Plugin Directory

Changeset 3362767


Ignore:
Timestamp:
09/16/2025 08:15:35 PM (7 months ago)
Author:
realtyna
Message:

WPL 5.1.0 released

  • Added: Add cron to update openhouse tags
  • Fixed: Showing county/city list in search widget for MLS On The Fly™ listings
  • Fixed: Disable geocoding for MLS On The Fly™ listings
Location:
real-estate-listing-realtyna-wpl
Files:
2537 added
1 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • real-estate-listing-realtyna-wpl/trunk/WPL.php

    r3350009 r3362767  
    55 * Description: WPL is a professional WordPress real estate plugin created by Realtyna.
    66 * Author: Realtyna
    7  * Version: 5.0.13
     7 * Version: 5.1.0
    88 * Text Domain: real-estate-listing-realtyna-wpl
    99 * Domain Path: /languages
     
    2828 */
    2929define('WPL_TEXTDOMAIN', 'real-estate-listing-realtyna-wpl');
    30 define('WPL_VERSION', '5.0.13'); // WPL Version
     30define('WPL_VERSION', '5.1.0'); // WPL Version
    3131
    3232require WPL_ABSPATH.'config.php';
  • real-estate-listing-realtyna-wpl/trunk/assets/changelogs/wpl.php

    r3350009 r3362767  
    55<div>
    66    <div class="wpl_rev_container">
     7        <h4>WPL5.1.0 (<span class="wpl_log_date">09/16/2025</span>)</h4>
     8        - Added: Add cron to update openhouse tags<br>
     9        - Fixed: Showing county/city list in search widget for MLS On The Fly™ listings<br>
     10        - Fixed: Disable geocoding for MLS On The Fly™ listings<br>
     11
    712        <h4>WPL5.0.13 (<span class="wpl_log_date">08/25/2025</span>)</h4>
    813        - Added: cache some queries<br>
  • real-estate-listing-realtyna-wpl/trunk/libraries/dbst_wizard/js_validation/upload.php

    r3080599 r3362767  
    77    $js_string .=
    88    '
    9     if(!wplj("#preview_upload'.$field->id.'").length)
     9    if(!wplj("#preview_upload'.$field->id.'").length && !wplj("#wpl_listing_field_container'.$field->id.'").is(":hidden"))
    1010    {
    1111        wpl_alert("'.wpl_esc::return_js_t('Upload a valid').' '.wpl_esc::return_js_t($label).'!");
  • real-estate-listing-realtyna-wpl/trunk/libraries/locations.php

    r3350009 r3362767  
    523523        if(!$property_id) $property_id = $property_data['id'];
    524524
     525        // no need to get lat/long for RF properties
     526        $source = wpl_property::get_property_source($property_id);
     527        if($source == 'RF') {
     528            return [0, 0];
     529        }
    525530        $location_text = wpl_property::generate_location_text($property_data);
    526531        $location_text = apply_filters('wpl_locations/update_LatLng/location_text', $location_text, $property_data);
     
    537542        }
    538543
    539         $latitude = (double) ($LatLng[0] ? $LatLng[0] : $property_data['googlemap_lt']);
    540         $longitude = (double) ($LatLng[1] ? $LatLng[1] : $property_data['googlemap_ln']);
     544        $latitude = (double) ($LatLng[0] ?: $property_data['googlemap_lt']);
     545        $longitude = (double) ($LatLng[1] ?: $property_data['googlemap_ln']);
    541546
    542547        return array($latitude, $longitude);
     
    695700        $abbreviation = static::makeAbbreviation($text);
    696701        $abbreviationState = static::makeFullState($abbreviation);
     702        $fullState = static::makeFullState($full);
    697703        return array_unique([
    698704            $text,
     
    700706            $abbreviation,
    701707            $abbreviationState,
     708            $fullState,
    702709        ]);
    703710    }
  • real-estate-listing-realtyna-wpl/trunk/libraries/property.php

    r3350009 r3362767  
    28152815        return apply_filters('wpl_property_listing_controller/advanced_locationtextsearch_autocomplete/queries', $queries, $term, $kind);
    28162816    }
     2817
     2818    public function update_openhouse_tag()
     2819    {
     2820        $listings = wpl_db::select("SELECT distinct `parent_id` FROM `#__wpl_items` WHERE `item_type`='opendates' and parent_id in (select id from `#__wpl_properties` where sp_openhouse = 1)", 'loadAssocList');
     2821        if (empty($listings)){
     2822            return;
     2823        }
     2824
     2825        foreach($listings as $key => $listing)
     2826        {
     2827            $id = $listing['parent_id'];
     2828            $open_dates = wpl_db::select("SELECT * FROM `#__wpl_items` WHERE `parent_id`='{$id}' AND `item_type`='opendates'", 'loadObjectList');
     2829            if(!empty($open_dates))
     2830            {
     2831                $valid_date = wpl_items::render_opendates($open_dates, true);
     2832                if(empty($valid_date)) unset($listings[$key]);
     2833            }
     2834        }
     2835        $listing_ids = array_column($listings,'parent_id');
     2836
     2837        if(count($listing_ids) > 0){
     2838            wpl_db::q("UPDATE `#__wpl_properties` SET `sp_openhouse`='0' WHERE `sp_openhouse`='1' and `id` NOT IN (".implode(',', $listing_ids).")");
     2839        } else {
     2840            wpl_db::q("UPDATE `#__wpl_properties` SET `sp_openhouse`='0' WHERE `sp_openhouse`='1'");
     2841        }
     2842    }
    28172843}
  • real-estate-listing-realtyna-wpl/trunk/libraries/rf_shell/rf_property.php

    r3350009 r3362767  
    936936    private function merge_fields($property_id, $cloud_data) {
    937937        $local = $this->get_local_property($property_id);
    938         if(!empty($cloud_data['googlemap_lt'])) {
    939             unset($local['googlemap_lt']);
    940         }
    941         if(!empty($cloud_data['googlemap_ln'])) {
    942             unset($local['googlemap_ln']);
    943         }
    944938        $return = array_merge($cloud_data, $local);
    945939        return apply_filters('wpl_rf_property/merge_fields', $return, $property_id);
     
    947941
    948942    private function get_local_property($propertyId) {
    949         $result = wpl_db::select('select id, user_id, googlemap_ln, googlemap_lt from `#__wpl_properties` where id = ' . $propertyId, 'loadAssoc', true);
     943        $result = wpl_db::select('select id, user_id from `#__wpl_properties` where id = ' . $propertyId, 'loadAssoc', true);
    950944        if(empty($result)) {
    951945            return [];
    952         }
    953         if($result['googlemap_ln'] == 0 || $result['googlemap_lt'] == 0) {
    954             unset($result['googlemap_lt']);
    955             unset($result['googlemap_ln']);
    956946        }
    957947        // to remove columns that have no value
     
    10271017
    10281018    public static function get_location_names($level, $conditions = []) {
    1029         $args = array(
    1030             'taxonomy' => 'wpl_property_location' . $level . '_name',
    1031         );
     1019        $mapped = [
     1020            2 => 'StateOrProvince',
     1021            3 => 'CountyOrParish',
     1022            4 => 'City',
     1023        ];
     1024        $mapped = apply_filters('wpl_rf_property/get_location_names/mapped', $mapped);
     1025
     1026        $rf = \Realtyna\MlsOnTheFly\Boot\App::get(\Realtyna\MlsOnTheFly\Components\CloudPost\SubComponents\RFClient\SDK\RF\RF::class);
     1027        $RFQuery = new \Realtyna\MlsOnTheFly\Components\CloudPost\SubComponents\RFClient\SDK\RF\RFQuery();
     1028        $RFQuery->set_entity('Property');
     1029        $RFQuery->set_top(1000);
     1030        $RFQuery->set_groups([$mapped[$level], 'aggregate($count as ' . $mapped[$level] . 'Count)']);
    10321031        if(!empty($conditions)) {
    1033             $args['meta_query'] = [];
    10341032            foreach ($conditions as $table_column => $column_value) {
    1035                 if(!is_array($column_value)) {
     1033                if (!is_array($column_value)) {
    10361034                    $column_value = trim($column_value);
    1037                     if(empty($column_value)) {
     1035                    if (empty($column_value)) {
    10381036                        continue;
    10391037                    }
    10401038                    $column_value = explode(',', $column_value);
    10411039                }
    1042                 $orQuery = [
    1043                     'relation' => 'OR',
    1044                 ];
    1045                 foreach ($column_value as $column_value_item) {
    1046                     $column_value_item = trim($column_value_item);
    1047                     if(empty($column_value_item)) {
    1048                         continue;
    1049                     }
    1050                     $orQuery[] = [
    1051                         'key' => $table_column,
    1052                         'value' => $column_value_item,
    1053                         'compare' => '=',
    1054                     ];
    1055                 }
    1056                 if(count($orQuery) == 1) {
    1057                     continue;
    1058                 }
    1059                 $args['meta_query'][] = $orQuery;
    1060             }
    1061         }
    1062         $terms = get_terms($args);
     1040                $levelNumber = str_replace('location', '', $table_column);
     1041                $levelNumber = intval(str_replace('_name', '', $levelNumber));
     1042                $RFQuery->add_filter('where', $mapped[$levelNumber], 'eq', implode(', ', $column_value));
     1043            }
     1044        }
     1045
     1046        $RFResponse = $rf->get($RFQuery);
    10631047        $return = [];
    1064         foreach($terms as $term) {
    1065             $return[] = $term->name;
    1066         }
    1067         sort($return);
     1048        foreach ($RFResponse->items as $item) {
     1049            $return[] = $item[$mapped[$level]];
     1050        }
    10681051        return apply_filters('wpl_rf_property/get_location_names', $return, $level) ;
    10691052    }
  • real-estate-listing-realtyna-wpl/trunk/libraries/units.php

    r3191515 r3362767  
    9494       
    9595        $unit = wpl_units::get_units('', '', wpl_db::prepare(" AND `id` = %d", $id));
    96         return (isset($unit[0]) ? $unit[0] : NULL);
     96        return $unit[0] ?? null;
    9797    }
    9898   
  • real-estate-listing-realtyna-wpl/trunk/libraries/widget_search/frontend/types/number.php

    r3350009 r3362767  
    6363        /** current values **/
    6464        $current_min_value = max(
    65             stripslashes(wpl_request::getVar('sf_tmin_' . $field_data['table_column'], $min_value)),
     65            stripslashes(wpl_request::getVar('sf_tmin_' . $field_data['table_column'], '-1')),
    6666            $min_value
    6767        );
  • real-estate-listing-realtyna-wpl/trunk/libraries/widget_search/frontend/types/price.php

    r3191515 r3362767  
    276276                }
    277277
    278                 while ($i < $listing_field['max']) {
    279                     if ($i == '0' and $any) {
    280                         $i += $listing_field['division'];
    281                         continue;
    282                     }
    283 
     278                $select_options = [];
     279                while ($i < $listing_field['max']) {
     280                    if ($i == '0' and $any) {
     281                        $i += $listing_field['division'];
     282                        continue;
     283                    }
     284                    $select_options[] = $i;
     285                    $i += $listing_field['division'];
     286                }
     287                $select_options = apply_filters('widget_search/frontend/general/price/minmax_selectbox/options', $select_options, $listing_field);
     288
     289                foreach ($select_options as $i) {
    284290                    $html .= '<option value="' . $i . '" ' . (($listing_field['cur_min'] == $i and $i != $listing_field['min']) ? 'selected="selected"' : '') . '>' . $unit_name . ' ' . number_format(
    285291                            $i,
     
    288294                            $listing_field['separator']
    289295                        ) . '</option>';
    290                     $i += $listing_field['division'];
    291296                }
    292297
     
    309314                $i = $listing_field['min'];
    310315
    311                 while ($i < $listing_field['max']) {
    312                     if ($i == '0' and $any) {
    313                         $i += $listing_field['division'];
    314                         continue;
    315                     }
    316 
     316                $select_options = [];
     317                while ($i < $listing_field['max']) {
     318                    if ($i == '0' and $any) {
     319                        $i += $listing_field['division'];
     320                        continue;
     321                    }
     322                    $select_options[] = $i;
     323                    $i += $listing_field['division'];
     324                }
     325                $select_options = apply_filters('widget_search/frontend/general/price/minmax_selectbox/options', $select_options, $listing_field);
     326
     327                foreach ($select_options as $i) {
    317328                    $html .= '<option value="' . $i . '" ' . (($listing_field['cur_max'] == $i and $i != $listing_field['min']) ? 'selected="selected"' : '') . '>' . $unit_name . ' ' . number_format(
    318329                            $i,
     
    321332                            $listing_field['separator']
    322333                        ) . '</option>';
    323                     $i += $listing_field['division'];
    324334                }
    325335
  • real-estate-listing-realtyna-wpl/trunk/readme.txt

    r3350009 r3362767  
    55Requires at least: 4.7.0
    66Tested up to: 6.7.2
    7 Stable tag: 5.0.13
     7Stable tag: 5.1.0
    88Requires PHP: 7.4
    9 Version: 5.0.13
     9Version: 5.1.0
    1010License: GPL-2.0-or-later
    1111License URI: https://www.gnu.org/licenses/license-list.html#GPLv2
     
    4747
    4848== Changelog ==
     49= 5.1.0 =
     50- Added: Add cron to update openhouse tags
     51- Fixed: Showing county/city list in search widget for MLS On The Fly™ listings
     52- Fixed: Disable geocoding for MLS On The Fly™ listings
    4953
    5054= 5.0.13 =
  • real-estate-listing-realtyna-wpl/trunk/views/backend/listing/tmpl/scripts/css.php

    r1452586 r3362767  
    1919.prow-textarea textarea.wpl_c_field_308{width: 60%;}
    2020.pwizard-wp .after-finilize-wp .message-wp{width: 60%;}
     21.pwizard-wp .after-finilize-wp .message-wp .wpl-button{margin-bottom: 5px}
    2122.wpl-mass-actions{text-align: right;}
     23    @media (max-width: 480px) {
     24        .pwizard-wp .after-finilize-wp{text-align: center}
     25        .pwizard-wp .after-finilize-wp .message-wp{width:100%;padding-left: 0;}
     26        .pwizard-wp .after-finilize-wp .message-wp .wpl-button{margin-bottom: 5px;width: 100% !important;}
     27    }
    2228</style>
  • real-estate-listing-realtyna-wpl/trunk/views/frontend/property_listing/wpl_ajax.php

    r3350009 r3362767  
    131131    private function advanced_locationtextsearch_autocomplete($term, $kind = 0)
    132132    {
     133        $term = trim($term ?? '');
    133134        $settings = wpl_settings::get_settings(3);
    134135        $queries = wpl_property::get_suggestion_fields($kind, $term);
     
    153154            foreach($queries as $column => $title)
    154155            {
    155                 if(in_array($column, ['mls_id', 'location_text'])) {
    156                     $property_object = new wpl_property();
    157                     $property_object->start(0, $limit, '', '', ["sf_text_$column" => $term]);
    158                     $property_object->query();
    159                     $found = $property_object->search();
    160                     $counter = 0;
    161                     foreach ($found as $found_item) {
    162                         $counter++;
    163                         if($counter > $limit) {
    164                             break;
    165                         }
    166                         $value = $found_item->{$column};
    167                         if($column == 'location_text') {
    168                             $value = wpl_property::generate_location_text((array) $found_item);
    169                         }
    170                         $output[$column . $value] = array('title' => $title, 'label' => $value, 'column' => $column, 'value' => $value);
     156                if($column == 'mls_id' and strpos($term, ' ') !== false) {
     157                    continue;
     158                }
     159                $property_object = new wpl_property();
     160                $property_object->start(0, $limit, '', '', ["sf_text_$column" => $term]);
     161                $property_object->query();
     162                $found = $property_object->search();
     163                $counter = 0;
     164                foreach ($found as $found_item) {
     165                    $counter++;
     166                    if($counter > $limit) {
     167                        break;
    171168                    }
    172                     continue;
    173                 }
    174                 $found_terms = get_terms('wpl_property_' . $column);
    175                 $counter = 0;
    176                 foreach($found_terms as $found_term) {
    177                     if(strpos(strtolower($found_term->name), strtolower($term)) !== false) {
    178                         $counter++;
    179                         if($counter > $limit) {
    180                             break;
    181                         }
    182                         $output_row = array('title' => $title, 'label' => $found_term->name, 'column' => $column, 'value' => $found_term->name);
    183                         $output[$column . $found_term->name] = apply_filters('wpl_property_listing_controller/advanced_locationtextsearch_autocomplete/rf/output_row', $output_row, $found_term);
     169                    $value = $found_item->{$column};
     170                    if($column == 'location_text') {
     171                        $value = wpl_property::generate_location_text((array) $found_item);
    184172                    }
     173                    $output[$column . $value] = array('title' => $title, 'label' => $value, 'column' => $column, 'value' => $value);
    185174                }
    186175            }
     
    334323        $vars = array_merge(wpl_request::get('POST'), wpl_request::get('GET'));
    335324        $where = array_merge($vars, $default);
    336         if(wpl_settings::is_mls_on_the_fly() && $kind == 0) {
     325        if($kind == 0) {
    337326            $model = new wpl_property();
    338327            $model->start(1, 1, 'id', 'ASC', $where, $kind);
Note: See TracChangeset for help on using the changeset viewer.