Changeset 3375276
- Timestamp:
- 10/08/2025 06:05:34 PM (5 months ago)
- Location:
- flexmls-idx/trunk
- Files:
-
- 13 edited
-
README.txt (modified) (2 diffs)
-
components/search.php (modified) (2 diffs)
-
components/v2/search-results.php (modified) (2 diffs)
-
flexmls_connect.php (modified) (2 diffs)
-
lib/base.php (modified) (1 diff)
-
lib/flexmlsAPI/Core.php (modified) (1 diff)
-
lib/gutenberg.php (modified) (1 diff)
-
lib/oauth-api.php (modified) (2 diffs)
-
lib/search-util.php (modified) (1 diff)
-
pages/core.php (modified) (1 diff)
-
pages/full-page.php (modified) (2 diffs)
-
pages/listing-details.php (modified) (8 diffs)
-
pages/search-results.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
flexmls-idx/trunk/README.txt
r3372018 r3375276 5 5 Tested up to: 6.8.3 6 6 Requires PHP: 7.4 7 Stable tag: 3.15. 57 Stable tag: 3.15.6 8 8 9 9 Add Flexmls® IDX listings, market statistics, IDX searches, and a contact form on your web site. … … 85 85 86 86 == Changelog == 87 = 3.15.6 = 88 Efficiency Update 89 * Improving canonical link priorirty for listing detail pages 90 * More PHP warnings resolved 91 92 87 93 = 3.15.5 = 88 94 Efficiency Update -
flexmls-idx/trunk/components/search.php
r3169439 r3375276 346 346 // mainly to catch location search values and the selected property types 347 347 foreach ($query_parts as $part_key => $part_value) { 348 if ( array_key_exists($part_key, $api_standard_fields) and !empty($part_value) ) {348 if ( is_array($api_standard_fields) && array_key_exists($part_key, $api_standard_fields) and !empty($part_value) ) { 349 349 $search_conditions[$part_key] = stripslashes($part_value); 350 350 } … … 383 383 $standard_fields = $standard_fields[0]; 384 384 385 if ( array_key_exists('BathsTotal', $standard_fields)) {385 if (is_array($standard_fields) && array_key_exists('BathsTotal', $standard_fields)) { 386 386 if (array_key_exists('MlsVisible', $standard_fields['BathsTotal']) and empty($standard_fields['BathsTotal']['MlsVisible'])) { 387 387 $fields_to_catch['Baths'] = "BathsFull"; -
flexmls-idx/trunk/components/v2/search-results.php
r3363339 r3375276 104 104 $this->search_data = $search_results; 105 105 } 106 foreach ( $this->search_data as $record ) { 106 if (is_array($this->search_data)) { 107 foreach ( $this->search_data as $record ) { 107 108 $result_count ++; 108 109 $fields = $record['StandardFields']; … … 157 158 'bathrooms' => esc_html( $fields['BathsTotal'] ), 158 159 ); 160 } 159 161 } 160 162 -
flexmls-idx/trunk/flexmls_connect.php
r3372018 r3375276 6 6 Description: Provides Flexmls® Customers with Flexmls® IDX features on their WordPress websites. <strong>Tips:</strong> <a href="admin.php?page=fmc_admin_settings">Activate your Flexmls® IDX plugin</a> on the settings page; <a href="widgets.php">add widgets to your sidebar</a> using the Widgets Admin under Appearance; and include widgets on your posts or pages using the Flexmls® IDX Widget Short-Code Generator on the Visual page editor. 7 7 Author: FBS 8 Version: 3.15. 58 Version: 3.15.6 9 9 Author URI: https://www.flexmls.com 10 10 Requires at least: 5.0 … … 17 17 const FMC_API_BASE = 'sparkapi.com'; 18 18 const FMC_API_VERSION = 'v1'; 19 const FMC_PLUGIN_VERSION = '3.15. 5';19 const FMC_PLUGIN_VERSION = '3.15.6'; 20 20 21 21 define( 'FMC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); -
flexmls-idx/trunk/lib/base.php
r3367368 r3375276 672 672 673 673 $full_requested_url = (preg_match('/^HTTP\//', $_SERVER['SERVER_PROTOCOL'])) ? "http" : "https"; 674 $full_requested_url .= "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];674 $full_requested_url .= "://" . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '') . (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''); 675 675 676 676 $query_string = parse_url($full_requested_url, PHP_URL_QUERY); -
flexmls-idx/trunk/lib/flexmlsAPI/Core.php
r3372018 r3375276 44 44 'Accept-Encoding' => "gzip,deflate", 45 45 'Content-Type' => "application/json", 46 'User-Agent' => "Flexmls WordPress Plugin/3.15. 5",47 'X-SparkApi-User-Agent' => "flexmls-WordPress-Plugin/3.15. 5"46 'User-Agent' => "Flexmls WordPress Plugin/3.15.6", 47 'X-SparkApi-User-Agent' => "flexmls-WordPress-Plugin/3.15.6" 48 48 ); 49 49 -
flexmls-idx/trunk/lib/gutenberg.php
r3367368 r3375276 310 310 curl_close ($ch); 311 311 $output = flexmlsJSON::json_decode($server_output); 312 echo $output['body']; 312 if (is_array($output) && isset($output['body'])) { 313 echo $output['body']; 314 } else { 315 echo "<div>Error loading content</div>"; 316 } 313 317 314 318 } -
flexmls-idx/trunk/lib/oauth-api.php
r3179036 r3375276 188 188 //$raw_state = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; 189 189 $protocol = (is_ssl()) ? 'https' : 'http'; 190 $raw_state = parse_url("$protocol:// $_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");190 $raw_state = parse_url("$protocol://" . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '') . (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '')); 191 191 if ($page_override != null and count($additional_state_params)>0){ 192 192 $raw_state = parse_url($page_override); … … 205 205 } 206 206 else 207 $state = "$protocol:// $_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";207 $state = "$protocol://" . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '') . (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''); 208 208 209 209 $page_conditions = array( -
flexmls-idx/trunk/lib/search-util.php
r3135793 r3375276 296 296 if ( array_key_exists( 'type', $f ) ) { 297 297 $type = $f['type']; 298 } elseif ( array_key_exists( $f['field'], $standard_fields ) ) {298 } elseif ( is_array( $standard_fields ) && array_key_exists( $f['field'], $standard_fields ) ) { 299 299 $type = $standard_fields[ $f['field'] ]['Type']; 300 300 } else { -
flexmls-idx/trunk/pages/core.php
r3358668 r3375276 293 293 if ( array_key_exists( 'type', $f ) ) { 294 294 $type = $f['type']; 295 } elseif ( array_key_exists( $f['field'], $this->standard_fields ) ) {295 } elseif ( is_array( $this->standard_fields ) && array_key_exists( $f['field'], $this->standard_fields ) ) { 296 296 $type = $this->standard_fields[ $f['field'] ]['Type']; 297 297 } else { -
flexmls-idx/trunk/pages/full-page.php
r2810167 r3375276 60 60 61 61 if ( !empty($fmc_special_page_caught['page-url']) ) { 62 // Remove WordPress default canonical 62 63 remove_action('wp_head', 'rel_canonical'); 64 65 // Remove other SEO plugin canonical actions 66 remove_action('wp_head', 'wpseo_canonical'); 67 remove_action('wp_head', 'rank_math_canonical'); 68 remove_action('wp_head', 'aioseo_canonical'); 69 remove_action('wp_head', 'the_seo_framework_canonical'); 70 remove_action('wp_head', 'seopress_canonical'); 71 72 // Add our custom canonical 63 73 add_action('wp_head', array('flexmlsConnectPage', 'rel_canonical') ); 64 74 } … … 78 88 79 89 if ( !empty($fmc_special_page_caught['page-url']) ) { 90 // Remove WordPress default canonical 80 91 remove_action('wp_head', 'rel_canonical'); 92 93 // Remove other SEO plugin canonical actions 94 remove_action('wp_head', 'wpseo_canonical'); 95 remove_action('wp_head', 'rank_math_canonical'); 96 remove_action('wp_head', 'aioseo_canonical'); 97 remove_action('wp_head', 'the_seo_framework_canonical'); 98 remove_action('wp_head', 'seopress_canonical'); 99 100 // Add our custom canonical 81 101 add_action('wp_head', array('flexmlsConnectPage', 'rel_canonical') ); 82 102 } -
flexmls-idx/trunk/pages/listing-details.php
r3358668 r3375276 17 17 add_filter( 'wpseo_canonical', array( $this, 'wpseo_canonical' ), 0 ); 18 18 add_filter( 'wp_robots', array($this, 'wp_robots_noindex_listing'), 0 ); 19 20 // Handle other SEO plugins 21 add_filter( 'rank_math/frontend/canonical', array( $this, 'rankmath_canonical' ), 0 ); 22 add_filter( 'aioseo_canonical_url', array( $this, 'aioseo_canonical' ), 0 ); 23 add_filter( 'the_seo_framework_meta_canonical', array( $this, 'seo_framework_canonical' ), 0 ); 24 add_filter( 'seopress_canonical', array( $this, 'seopress_canonical' ), 0 ); 19 25 20 26 add_action('wp_head', array($this, 'wp_meta_description_tag'), 0 ); … … 104 110 105 111 $standard_fields_plus = $this->api->GetStandardFields(); 106 $standard_fields_plus = $standard_fields_plus[0];112 $standard_fields_plus = (is_array($standard_fields_plus) && isset($standard_fields_plus[0])) ? $standard_fields_plus[0] : array(); 107 113 // $custom_fields = $fmc_api->GetCustomFields(); 108 114 … … 124 130 125 131 $custom_fields = array(); 126 if (is _array($record["CustomFields"][0]["Main"])) {132 if (isset($record["CustomFields"]) && is_array($record["CustomFields"]) && isset($record["CustomFields"][0]) && is_array($record["CustomFields"][0]["Main"])) { 127 133 foreach ($record["CustomFields"][0]["Main"] as $data) { 128 134 foreach ($data as $group_name => $fields) { … … 153 159 } 154 160 155 if (isset($record["CustomFields"] [0]["Details"]) andis_array($record["CustomFields"][0]["Details"])) {161 if (isset($record["CustomFields"]) && is_array($record["CustomFields"]) && isset($record["CustomFields"][0]) && isset($record["CustomFields"][0]["Details"]) && is_array($record["CustomFields"][0]["Details"])) { 156 162 foreach ($record["CustomFields"][0]["Details"] as $data) { 157 163 foreach ($data as $group_name => $fields) … … 337 343 338 344 339 if ($sf['StateOrProvince'] == 'NY' ) {345 if ($sf['StateOrProvince'] == 'NY' && isset($compList[0]) && is_array($compList[0])) { 340 346 echo "<p>{$compList[0][0]} {$compList[0][1]}</p>"; 341 347 } … … 440 446 441 447 // Photos 442 if ( count($sf['Photos']) >= 1) {448 if (isset($sf['Photos']) && is_array($sf['Photos']) && count($sf['Photos']) >= 1) { 443 449 $main_photo_url = $sf['Photos'][0]['Uri640']; 444 450 $main_photo_caption = htmlspecialchars($sf['Photos'][0]['Caption'], ENT_QUOTES); … … 522 528 523 529 // Open Houses 524 if ($count_openhouses > 0 ) {530 if ($count_openhouses > 0 && isset($sf['OpenHouses']) && is_array($sf['OpenHouses']) && isset($sf['OpenHouses'][0])) { 525 531 $this_o = $sf['OpenHouses'][0]; 526 532 echo "<div class='flexmls_connect__sr_openhouse'><em>Open House</em> (". $this_o['Date'] ." - ". $this_o['StartTime'] ." - ". $this_o['EndTime'] .")</div>"; … … 897 903 } 898 904 905 function wpseo_canonical() { 906 // Disable the Yoast canonical tag. We add our own in flexmlsConnectPage::rel_canonical() 907 return false; 908 } 909 910 function rankmath_canonical() { 911 // Disable RankMath canonical tag. We add our own in flexmlsConnectPage::rel_canonical() 912 return false; 913 } 914 915 function aioseo_canonical() { 916 // Disable All in One SEO canonical tag. We add our own in flexmlsConnectPage::rel_canonical() 917 return false; 918 } 919 920 function seo_framework_canonical() { 921 // Disable The SEO Framework canonical tag. We add our own in flexmlsConnectPage::rel_canonical() 922 return false; 923 } 924 925 function seopress_canonical() { 926 // Disable SEOPress canonical tag. We add our own in flexmlsConnectPage::rel_canonical() 927 return false; 928 } 929 899 930 function open_graph_tags() { 900 931 $site_name = get_bloginfo('name'); 901 932 $title = flexmlsConnect::make_nice_address_title($this->listing_data); 902 $thumbnail = ( isset($this->listing_data['StandardFields']['Photos']) ) ? $this->listing_data['StandardFields']['Photos'][0]['Uri1280'] : '';933 $thumbnail = ( isset($this->listing_data['StandardFields']['Photos']) && is_array($this->listing_data['StandardFields']['Photos']) && isset($this->listing_data['StandardFields']['Photos'][0]) ) ? $this->listing_data['StandardFields']['Photos'][0]['Uri1280'] : ''; 903 934 $description = ( isset($this->listing_data['StandardFields']['PublicRemarks']) ) ? substr($this->listing_data['StandardFields']['PublicRemarks'], 0, 140) : ''; 904 935 $url = flexmlsConnect::make_nice_address_url($this->listing_data); -
flexmls-idx/trunk/pages/search-results.php
r3363339 r3375276 15 15 protected $order_by; 16 16 public $title; 17 public $default_page_size;17 public $default_page_size; 18 18 19 19 function __construct( $api, $type = 'fmc_tag' ){ … … 22 22 23 23 add_filter( 'wpseo_canonical', array( $this, 'wpseo_canonical' ) ); 24 25 // Handle other SEO plugins 26 add_filter( 'rank_math/frontend/canonical', array( $this, 'rankmath_canonical' ), 0 ); 27 add_filter( 'aioseo_canonical_url', array( $this, 'aioseo_canonical' ), 0 ); 28 add_filter( 'the_seo_framework_meta_canonical', array( $this, 'seo_framework_canonical' ), 0 ); 29 add_filter( 'seopress_canonical', array( $this, 'seopress_canonical' ), 0 ); 24 30 25 31 } … … 720 726 } 721 727 728 function wpseo_canonical() { 729 // Disable the Yoast canonical tag. We add our own in flexmlsConnectPage::rel_canonical() 730 return false; 731 } 732 733 function rankmath_canonical() { 734 // Disable RankMath canonical tag. We add our own in flexmlsConnectPage::rel_canonical() 735 return false; 736 } 737 738 function aioseo_canonical() { 739 // Disable All in One SEO canonical tag. We add our own in flexmlsConnectPage::rel_canonical() 740 return false; 741 } 742 743 function seo_framework_canonical() { 744 // Disable The SEO Framework canonical tag. We add our own in flexmlsConnectPage::rel_canonical() 745 return false; 746 } 747 748 function seopress_canonical() { 749 // Disable SEOPress canonical tag. We add our own in flexmlsConnectPage::rel_canonical() 750 return false; 751 } 752 722 753 }
Note: See TracChangeset
for help on using the changeset viewer.