Plugin Directory

Changeset 3375276


Ignore:
Timestamp:
10/08/2025 06:05:34 PM (5 months ago)
Author:
flexmls
Message:

Flexmls WordPress plugin 3.15.6

Location:
flexmls-idx/trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • flexmls-idx/trunk/README.txt

    r3372018 r3375276  
    55Tested up to: 6.8.3
    66Requires PHP: 7.4
    7 Stable tag: 3.15.5
     7Stable tag: 3.15.6
    88
    99Add Flexmls® IDX listings, market statistics, IDX searches, and a contact form on your web site.
     
    8585
    8686== Changelog ==
     87= 3.15.6 =
     88Efficiency Update
     89* Improving canonical link priorirty for listing detail pages
     90* More PHP warnings resolved
     91
     92
    8793= 3.15.5 =
    8894Efficiency Update
  • flexmls-idx/trunk/components/search.php

    r3169439 r3375276  
    346346    // mainly to catch location search values and the selected property types
    347347    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) ) {
    349349        $search_conditions[$part_key] = stripslashes($part_value);
    350350      }
     
    383383    $standard_fields = $standard_fields[0];
    384384
    385     if (array_key_exists('BathsTotal', $standard_fields)) {
     385    if (is_array($standard_fields) && array_key_exists('BathsTotal', $standard_fields)) {
    386386      if (array_key_exists('MlsVisible', $standard_fields['BathsTotal']) and empty($standard_fields['BathsTotal']['MlsVisible'])) {
    387387        $fields_to_catch['Baths'] = "BathsFull";
  • flexmls-idx/trunk/components/v2/search-results.php

    r3363339 r3375276  
    104104                    $this->search_data = $search_results;
    105105                }
    106                 foreach ( $this->search_data as $record ) {
     106                if (is_array($this->search_data)) {
     107                    foreach ( $this->search_data as $record ) {
    107108                    $result_count ++;
    108109                    $fields = $record['StandardFields'];
     
    157158                        'bathrooms' => esc_html( $fields['BathsTotal'] ),
    158159                    );
     160                }
    159161                }
    160162
  • flexmls-idx/trunk/flexmls_connect.php

    r3372018 r3375276  
    66Description: Provides Flexmls&reg; Customers with Flexmls&reg; IDX features on their WordPress websites. <strong>Tips:</strong> <a href="admin.php?page=fmc_admin_settings">Activate your Flexmls&reg; 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&reg; IDX Widget Short-Code Generator on the Visual page editor.
    77Author: FBS
    8 Version: 3.15.5
     8Version: 3.15.6
    99Author URI:  https://www.flexmls.com
    1010Requires at least: 5.0
     
    1717const FMC_API_BASE = 'sparkapi.com';
    1818const FMC_API_VERSION = 'v1';
    19 const FMC_PLUGIN_VERSION = '3.15.5';
     19const FMC_PLUGIN_VERSION = '3.15.6';
    2020
    2121define( 'FMC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
  • flexmls-idx/trunk/lib/base.php

    r3367368 r3375276  
    672672
    673673      $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'] : '');
    675675
    676676      $query_string = parse_url($full_requested_url, PHP_URL_QUERY);
  • flexmls-idx/trunk/lib/flexmlsAPI/Core.php

    r3372018 r3375276  
    4444        'Accept-Encoding' => "gzip,deflate",
    4545        '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"
    4848    );
    4949
  • flexmls-idx/trunk/lib/gutenberg.php

    r3367368 r3375276  
    310310        curl_close ($ch);
    311311        $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        }
    313317
    314318    }
  • flexmls-idx/trunk/lib/oauth-api.php

    r3179036 r3375276  
    188188    //$raw_state = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
    189189    $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'] : ''));
    191191    if ($page_override != null and count($additional_state_params)>0){
    192192      $raw_state = parse_url($page_override);
     
    205205    }
    206206    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'] : '');
    208208
    209209    $page_conditions = array(
  • flexmls-idx/trunk/lib/search-util.php

    r3135793 r3375276  
    296296                    if ( array_key_exists( 'type', $f ) ) {
    297297                            $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 ) ) {
    299299                            $type = $standard_fields[ $f['field'] ]['Type'];
    300300                    } else {
  • flexmls-idx/trunk/pages/core.php

    r3358668 r3375276  
    293293            if ( array_key_exists( 'type', $f ) ) {
    294294                $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 ) ) {
    296296                $type = $this->standard_fields[ $f['field'] ]['Type'];
    297297            } else {
  • flexmls-idx/trunk/pages/full-page.php

    r2810167 r3375276  
    6060
    6161      if ( !empty($fmc_special_page_caught['page-url']) ) {
     62        // Remove WordPress default canonical
    6263        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
    6373        add_action('wp_head', array('flexmlsConnectPage', 'rel_canonical') );
    6474      }
     
    7888
    7989      if ( !empty($fmc_special_page_caught['page-url']) ) {
     90        // Remove WordPress default canonical
    8091        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
    81101        add_action('wp_head', array('flexmlsConnectPage', 'rel_canonical') );
    82102      }
  • flexmls-idx/trunk/pages/listing-details.php

    r3358668 r3375276  
    1717    add_filter( 'wpseo_canonical', array( $this, 'wpseo_canonical' ), 0 );
    1818    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 );
    1925   
    2026    add_action('wp_head', array($this, 'wp_meta_description_tag'), 0 );
     
    104110
    105111    $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();
    107113    // $custom_fields = $fmc_api->GetCustomFields();
    108114
     
    124130
    125131    $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"])) {
    127133      foreach ($record["CustomFields"][0]["Main"] as $data) {
    128134        foreach ($data as $group_name => $fields) {
     
    153159    }
    154160
    155     if (isset($record["CustomFields"][0]["Details"]) and is_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"])) {
    156162      foreach ($record["CustomFields"][0]["Details"] as $data) {
    157163        foreach ($data as $group_name => $fields)
     
    337343
    338344
    339     if ($sf['StateOrProvince'] == 'NY') {
     345    if ($sf['StateOrProvince'] == 'NY' && isset($compList[0]) && is_array($compList[0])) {
    340346      echo "<p>{$compList[0][0]} {$compList[0][1]}</p>";
    341347    }
     
    440446
    441447    // Photos
    442     if (count($sf['Photos']) >= 1) {
     448    if (isset($sf['Photos']) && is_array($sf['Photos']) && count($sf['Photos']) >= 1) {
    443449    $main_photo_url = $sf['Photos'][0]['Uri640'];
    444450    $main_photo_caption = htmlspecialchars($sf['Photos'][0]['Caption'], ENT_QUOTES);
     
    522528
    523529    // Open Houses
    524     if ($count_openhouses > 0) {
     530    if ($count_openhouses > 0 && isset($sf['OpenHouses']) && is_array($sf['OpenHouses']) && isset($sf['OpenHouses'][0])) {
    525531      $this_o = $sf['OpenHouses'][0];
    526532      echo "<div class='flexmls_connect__sr_openhouse'><em>Open House</em> (". $this_o['Date'] ." - ". $this_o['StartTime'] ." - ". $this_o['EndTime'] .")</div>";
     
    897903  }
    898904
     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
    899930  function open_graph_tags() {
    900931    $site_name = get_bloginfo('name');
    901932    $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'] : '';
    903934    $description = ( isset($this->listing_data['StandardFields']['PublicRemarks']) ) ? substr($this->listing_data['StandardFields']['PublicRemarks'], 0, 140) : '';
    904935    $url = flexmlsConnect::make_nice_address_url($this->listing_data);
  • flexmls-idx/trunk/pages/search-results.php

    r3363339 r3375276  
    1515    protected $order_by;
    1616    public $title;
    17   public $default_page_size;
     17    public $default_page_size;
    1818
    1919    function __construct( $api, $type = 'fmc_tag' ){
     
    2222
    2323        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 );
    2430
    2531    }
     
    720726    }
    721727
     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
    722753}
Note: See TracChangeset for help on using the changeset viewer.