Plugin Directory

Changeset 3358551


Ignore:
Timestamp:
09/09/2025 11:48:48 AM (7 months ago)
Author:
PropertyHive
Message:

Update to version 2.5.28

Location:
houzez-property-feed/trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • houzez-property-feed/trunk/README.txt

    r3351871 r3358551  
    44Requires at least: 3.8
    55Tested up to: 6.8
    6 Stable tag: 2.5.27
    7 Version: 2.5.27
     6Stable tag: 2.5.28
     7Version: 2.5.28
    88Homepage: https://houzezpropertyfeed.com
    99License: GPLv3
     
    2727* Apimo
    2828* BDP
     29* Behomes
    2930* BLM
    3031* Bridge - RESO MLS API Provider (beta)
     
    143144== Changelog ==
    144145
     146= 2.5.28 - 2025-09-09 =
     147* Added support for importing properties from Behomes
     148* Added support for land property to ReaXML imports
     149* Added a 'Referer' header to OSM geocoding requests to prevent getting blocked
     150* Added filter 'houzez_property_feed_clean_price_on_import' to disable price cleansing when importing price using custom field mappings
     151
    145152= 2.5.27 - 2025-08-28 =
    146153* Send price qualifier in RTDF exports
  • houzez-property-feed/trunk/houzez-property-feed.php

    r3351871 r3358551  
    44 * Plugin Uri: https://houzezpropertyfeed.com
    55 * Description: Automatically import properties to Houzez from estate agency CRMs and export to portals
    6  * Version: 2.5.27
     6 * Version: 2.5.28
    77 * Author: PropertyHive
    88 * Author URI: https://wp-property-hive.com
     
    2020     * @var string
    2121     */
    22     public $version = '2.5.27';
     22    public $version = '2.5.28';
    2323
    2424    /**
  • houzez-property-feed/trunk/includes/class-houzez-property-feed-import.php

    r3351871 r3358551  
    12931293                    elseif ( $and_rules['houzez_field'] == 'fave_property_price' && $result != '' )
    12941294                    {
    1295                         $explode_result = explode(" ", $result);
    1296                         $new_result = array();
    1297                         foreach ( $explode_result as $word )
    1298                         {
    1299                             $price_separators = hpf_determine_number_separators($word);
    1300                             $word = str_replace($price_separators['thousand'], '', $word);
    1301                             $word = str_replace($price_separators['decimal'], '.', $word);
    1302 
    1303                             $new_result[] = $word;
    1304                         }
    1305                         $result = implode(" ", $new_result);
     1295                        if ( apply_filters( 'houzez_property_feed_clean_price_on_import', true ) === true )
     1296                        {
     1297                            $explode_result = explode(" ", $result);
     1298                            $new_result = array();
     1299                            foreach ( $explode_result as $word )
     1300                            {
     1301                                $price_separators = hpf_determine_number_separators($word);
     1302                                $word = str_replace($price_separators['thousand'], '', $word);
     1303                                $word = str_replace($price_separators['decimal'], '.', $word);
     1304
     1305                                $new_result[] = $word;
     1306                            }
     1307
     1308                            $result = implode(" ", $new_result);
     1309                        }
    13061310                    }
    13071311
  • houzez-property-feed/trunk/includes/class-houzez-property-feed-process.php

    r3294397 r3358551  
    566566        $request_url = "https://nominatim.openstreetmap.org/search?format=json&limit=1&countrycodes=" . strtolower($country) . "&addressdetails=1&q=" . urlencode(implode(", ", $address));
    567567
    568         $response = wp_remote_get($request_url);
    569 
    570         if ( !is_wp_error( $response ))
    571         {
    572             if ( is_array( $response ) )
    573             {
    574                 $body = wp_remote_retrieve_body( $response );
    575                 $json = json_decode($body, true);
    576 
    577                 if ( !empty($json) && isset($json[0]['lat']) && isset($json[0]['lon']) )
    578                 {
    579                     $lat = $json[0]['lat'];
    580                     $lng = $json[0]['lon'];
    581 
    582                     if ($lat != '' && $lng != '')
    583                     {
    584                         update_post_meta( $post_id, 'houzez_geolocation_lat', $lat );
    585                         update_post_meta( $post_id, 'houzez_geolocation_long', $lng );
    586 
    587                         return array( $lat, $lng );
    588                     }
    589                 }
    590                 else
    591                 {
    592                     $this->log_error( 'No co-ordinates returned for the address provided: ' . implode( ", ", $address ), $agent_ref, $post_id );
     568        $response = wp_remote_get(
     569            $request_url,
     570            array(
     571                'headers' => array(
     572                    'Referer' => home_url(),
     573                ),
     574            )
     575        );
     576
     577        if ( is_wp_error( $response ))
     578        {
     579            $this->log_error( 'Error returned from geocoding service: ' . $response->get_error_message(), $agent_ref, $post_id );
     580            sleep(2); // Sleep due to throttling limits
     581            return false;
     582        }
     583
     584        if ( wp_remote_retrieve_response_code($response) !== 200 )
     585        {
     586            $this->log_error( wp_remote_retrieve_response_code($response) . ' response received when geocoding address ' . implode(", ", $address) . '. Error message: ' . wp_remote_retrieve_response_message($response) );
     587            sleep(2); // Sleep due to throttling limits
     588            return false;
     589        }
     590
     591        if ( is_array( $response ) )
     592        {
     593            $body = wp_remote_retrieve_body( $response );
     594            $json = json_decode($body, true);
     595
     596            if ( !empty($json) && isset($json[0]['lat']) && isset($json[0]['lon']) )
     597            {
     598                $lat = $json[0]['lat'];
     599                $lng = $json[0]['lon'];
     600
     601                if ($lat != '' && $lng != '')
     602                {
     603                    update_post_meta( $post_id, 'houzez_geolocation_lat', $lat );
     604                    update_post_meta( $post_id, 'houzez_geolocation_long', $lng );
     605
     606                    return array( $lat, $lng );
    593607                }
    594608            }
    595609            else
    596610            {
    597                 $this->log_error( 'Failed to parse JSON response from OSM Geocoding service.', $agent_ref, $post_id );
     611                $this->log_error( 'No co-ordinates returned for the address provided: ' . implode( ", ", $address ), $agent_ref, $post_id );
    598612            }
    599613        }
    600614        else
    601615        {
    602             $this->log_error( 'Error returned from geocoding service: ' . $response->get_error_message(), $agent_ref, $post_id );
    603         }
    604 
    605         sleep(1); // Sleep due to throttling limits
     616            $this->log_error( 'Failed to parse JSON response from OSM Geocoding service.', $agent_ref, $post_id );
     617        }
     618
     619        sleep(2); // Sleep due to throttling limits
    606620
    607621        return false;
     
    664678                    $this->log_error( 'Invalid response when trying to obtain co-ordinates', $agent_ref, $post_id );
    665679                }
     680
     681                sleep(2); // Sleep due to throttling limits
    666682            }
    667683            else
     
    674690            $this->log( 'Not performing Google Geocoding request as no API key present in settings', $agent_ref, $post_id  );
    675691        }
    676 
    677         sleep(1); // Sleep due to throttling limits
    678692
    679693        return false;
     
    791805            // check lat and lng set, and use that instead of doing geocoding
    792806            $lat = get_post_meta($post_id, 'houzez_geolocation_lat', true);
    793             $lng = get_post_meta($post_id, 'houzez_geolocation_lng', true);
     807            $lng = get_post_meta($post_id, 'houzez_geolocation_long', true);
    794808            if ( !empty($lat) && !empty($lng) )
    795809            {
  • houzez-property-feed/trunk/includes/format-functions.php

    r3325700 r3358551  
    481481            'help_url' => 'https://houzezpropertyfeed.com/documentation/managing-imports/formats/bdp/',
    482482            'warnings' => array_filter( array( $curl_warning ) ),
     483        ),
     484        'behomes' => array(
     485            'name' => __( 'Behomes', 'houzezpropertyfeed' ),
     486            'fields' => array(
     487                array(
     488                    'id' => 'api_key',
     489                    'label' => __( 'API Key', 'houzezpropertyfeed' ),
     490                    'type' => 'text',
     491                    'tooltip' => __( 'Your API key can be found in your Behomes account under "My Integrations"', 'houzezpropertyfeed' )
     492                ),
     493                array(
     494                    'id' => 'property_type',
     495                    'label' => __( 'Properties To Import', 'houzezpropertyfeed' ),
     496                    'type' => 'select',
     497                    'options' => array(
     498                        '' => __( 'All Properties', 'houzezpropertyfeed' ),
     499                        'Off-plan' => __( 'Off-Plan Properties', 'houzezpropertyfeed' ),
     500                        'Secondary' => __( 'Secondary Properties', 'houzezpropertyfeed' )
     501                    ),
     502                    'default' => 'offplan'
     503                ),
     504               /* array(
     505                    'id' => 'language',
     506                    'label' => __( 'Language', 'houzezpropertyfeed' ),
     507                    'type' => 'select',
     508                    'options' => array(
     509                        'en' => __( 'English', 'houzezpropertyfeed' ),
     510                        'ru' => __( 'Russian', 'houzezpropertyfeed' ),
     511                        'de' => __( 'German', 'houzezpropertyfeed' ),
     512                        'fr' => __( 'French', 'houzezpropertyfeed' ),
     513                        'hi' => __( 'Hindi', 'houzezpropertyfeed' ),
     514                        'ar' => __( 'Arabic', 'houzezpropertyfeed' ),
     515                        'tr' => __( 'Turkish', 'houzezpropertyfeed' ),
     516                        'ch' => __( 'Chinese', 'houzezpropertyfeed' ),
     517                        'it' => __( 'Italian', 'houzezpropertyfeed' ),
     518                        'pl' => __( 'Polish', 'houzezpropertyfeed' )
     519                    ),
     520                    'default' => 'en'
     521                ),*/
     522                array(
     523                    'id' => 'unit',
     524                    'label' => __( 'Unit System', 'houzezpropertyfeed' ),
     525                    'type' => 'select',
     526                    'options' => array(
     527                        'meter' => __( 'Meters', 'houzezpropertyfeed' ),
     528                        'foot' => __( 'Feet', 'houzezpropertyfeed' )
     529                    ),
     530                    'default' => 'meter'
     531                ),
     532                /*array(
     533                    'id' => 'launch_type',
     534                    'label' => __( 'Launch Type (Off-Plan Only)', 'houzezpropertyfeed' ),
     535                    'type' => 'radio',
     536                    'options' => array(
     537                        'all' => __( 'All Launch Types', 'houzezpropertyfeed' ),
     538                        'Launch_soon' => __( 'Launch Soon', 'houzezpropertyfeed' ),
     539                        'New_launch' => __( 'New Launch', 'houzezpropertyfeed' ),
     540                        'Popular' => __( 'Popular', 'houzezpropertyfeed' ),
     541                        'Assignment' => __( 'Assignment', 'houzezpropertyfeed' ),
     542                        'Sold_out' => __( 'Sold Out', 'houzezpropertyfeed' )
     543                    ),
     544                    'default' => 'all'
     545                ),*/
     546                array(
     547                    'id' => 'developer',
     548                    'label' => __( 'Developer(s)', 'houzezpropertyfeed' ),
     549                    'type' => 'text',
     550                    'placeholder' => 'e.g., Damac, Azizi, Sobha',
     551                    'tooltip' => __( 'Filter properties by developer name. Leave empty to import all developers', 'houzezpropertyfeed' )
     552                )
     553            ),
     554            'address_fields' => array( 'district' ),
     555            'taxonomy_values' => array(
     556                /*'sales_status' => array(
     557
     558                ),
     559                'lettings_status' => array(
     560
     561                ),*/
     562                'property_type' => array(
     563                    'Apartment' => 'Apartment',
     564                    'Villa' => 'Villa',
     565                    'Townhouse' => 'Townhouse',
     566                ),
     567            ),
     568            'contact_information_fields' => array(
     569                'organizationName',
     570            ),
     571            'help_url' => 'https://houzezpropertyfeed.com/documentation/managing-imports/formats/behomes/',
    483572        ),
    484573        'blm_local' => array(
     
    22482337                    'Retirement' => 'Retirement',
    22492338                    'ServicedApartment' => 'ServicedApartment',
     2339                    'Land' => 'Land',
    22502340                    'Other' => 'Other',
    22512341                )
     
    22932383                    'Retirement' => 'Retirement',
    22942384                    'ServicedApartment' => 'ServicedApartment',
     2385                    'Land' => 'Land',
    22952386                    'Other' => 'Other',
    22962387                )
  • houzez-property-feed/trunk/includes/import-formats/class-houzez-property-feed-format-reaxml.php

    r3351871 r3358551  
    7171                    {
    7272                        $property->addChild('department', 'residential-lettings');
     73                        $this->properties[] = $property;
     74                    }
     75                } // end foreach property
     76            }
     77
     78            if (isset($xml->land))
     79            {
     80                foreach ($xml->land as $property)
     81                {
     82                    $property_attributes = $property->attributes();
     83
     84                    if ( $property_attributes['status'] == 'current' )
     85                    {
     86                        $property->addChild('department', 'residential-sales');
     87                        $category = $property->addChild('category');
     88                        $category->addAttribute('name', 'Land');
    7389                        $this->properties[] = $property;
    7490                    }
  • houzez-property-feed/trunk/includes/import-functions.php

    r3325700 r3358551  
    455455            break;
    456456        }
     457        case "behomes":
     458        {
     459            // includes
     460            require_once dirname( __FILE__ ) . '/import-formats/class-houzez-property-feed-format-behomes.php';
     461
     462            $import_object = new Houzez_Property_Feed_Format_Behomes( $instance_id, $import_id );
     463
     464            break;
     465        }
    457466        case "blm_local":
    458467        {
Note: See TracChangeset for help on using the changeset viewer.