Plugin Directory

Changeset 3089626


Ignore:
Timestamp:
05/20/2024 08:15:45 PM (11 months ago)
Author:
businessdirectoryplugin
Message:

Update to version 6.4.3 from GitHub

Location:
business-directory-plugin
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • business-directory-plugin/tags/6.4.3/README.TXT

    r3080046 r3089626  
    44Requires at least: 5.9
    55Requires PHP: 7.0
    6 Tested up to: 6.5.2
    7 Stable tag: 6.4.2
     6Tested up to: 6.5.3
     7Stable tag: 6.4.3
    88License: GPLv2 or later
    99
     
    159159
    160160== Changelog ==
     161= 6.4.3 =
     162* Fix: Security fix for searching.
     163* Fix: After a quick search with two words, don't include a "+" in the advanced search.
     164
    161165= 6.4.2 =
    162166* Fix: Reduce the number of API calls to speed up admin area and reduce throttling.
     
    222226* Fix: Show the correct number of allowed images to upload after changing the plan in admin meta boxes.
    223227
    224 = 6.3.6 =
    225 * Fix: Listing titles in taxonomy pages were showing in the sidebar
    226 * Fix: The admin listing tables had misaligned pagination
    227 * Fix: The fields on the contact form were not using consistent sizing
    228 * Fix: German translation for "Your message has been sent".
    229 
    230228<a href="https://businessdirectoryplugin.com/plugins/business-directory/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion">See changelog for all versions</a>
  • business-directory-plugin/tags/6.4.3/business-directory-plugin.php

    r3080046 r3089626  
    44 * Plugin URI: https://businessdirectoryplugin.com
    55 * Description: Provides the ability to maintain a free or paid business directory on your WordPress powered site.
    6  * Version: 6.4.2
     6 * Version: 6.4.3
    77 * Author: Business Directory Team
    88 * Author URI: https://businessdirectoryplugin.com
  • business-directory-plugin/tags/6.4.3/includes/class-wpbdp.php

    r3080046 r3089626  
    5656
    5757    private function setup_constants() {
    58         define( 'WPBDP_VERSION', '6.4.2' );
     58        define( 'WPBDP_VERSION', '6.4.3' );
    5959
    6060        define( 'WPBDP_PATH', wp_normalize_path( plugin_dir_path( WPBDP_PLUGIN_FILE ) ) );
  • business-directory-plugin/tags/6.4.3/includes/helpers/class-listing-search.php

    r3080046 r3089626  
    6767
    6868        if ( in_array( $field->get_id(), $quick_search_fields_ids, true ) && isset( $this->original_request['kw'] ) ) {
    69             return array( $this->original_request['kw'] );
     69            return array( urldecode( $this->original_request['kw'] ) );
    7070        }
    7171
     
    158158
    159159    private function _traverse_tree( $tree ) {
    160         if ( is_array( $tree ) && 2 == count( $tree ) && is_numeric( $tree[0] ) ) {
     160        if ( ! is_array( $tree ) ) {
     161            return '';
     162        }
     163
     164        if ( 2 == count( $tree ) && is_numeric( $tree[0] ) ) {
    161165            $key = md5( serialize( $tree ) );
    162166
     
    206210    }
    207211
     212    /**
     213     * @param array $request Unsanitized request data.
     214     */
    208215    public static function from_request( $request = array() ) {
    209216        return new self( self::parse_request( $request ), $request );
    210217    }
    211218
     219    /**
     220     * @param array $request Unsanitized request data.
     221     *
     222     * @return array
     223     */
    212224    public static function parse_request( $request = array() ) {
    213225        $res = array();
    214226
    215         // Quick search.
    216227        if ( ! empty( $request['kw'] ) ) {
    217             if ( wpbdp_get_option( 'quick-search-enable-performance-tricks' ) ) {
    218                 $request['kw'] = array( trim( $request['kw'] ) );
    219             } else {
    220                 $request['kw'] = explode( ' ', trim( $request['kw'] ) );
    221             }
    222 
    223             $fields = array();
    224 
    225             foreach ( self::get_quick_search_fields_ids() as $field_id ) {
    226                 $field = wpbdp_get_form_field( $field_id );
    227 
    228                 if ( $field ) {
    229                     $fields[] = $field;
    230                 }
    231             }
    232 
    233             $res[] = 'and';
    234 
    235             foreach ( $request['kw'] as $k ) {
    236                 $subq = array( 'or' );
    237 
    238                 foreach ( $fields as $field ) {
    239                     $subq[] = array( $field->get_id(), $k );
    240                 }
    241 
    242                 $res[] = $subq;
    243             }
     228            self::parse_quick_search( $request, $res );
    244229        } elseif ( ! empty( $request['listingfields'] ) ) {
    245             // Regular search.
    246             $res[] = 'and';
    247 
    248             foreach ( $request['listingfields'] as $field_id => $term ) {
    249                 if ( ! $term ) {
    250                     continue;
    251                 }
    252 
    253                 $search_terms = array();
    254 
    255                 if ( is_string( $term ) ) {
    256                     $search_terms = array_filter(
    257                         explode( ' ', trim( $term ) ),
    258                         function ( $t ) {
    259                             return strlen( $t ) >= 2;
    260                         }
    261                     );
    262                 }
    263 
    264                 if ( count( $search_terms ) < 2 ) {
    265                     $res[] = array( $field_id, $term );
    266                     continue;
    267                 }
    268 
    269                 $subq   = array( 'or' );
    270                 $termsq = array( 'and' );
    271 
    272                 foreach ( $search_terms as $k ) {
    273                     $termsq[] = array( $field_id, $k );
    274                 }
    275 
    276                 $subq[] = $termsq;
    277                 $subq[] = array( $field_id, $term );
    278 
    279                 $res[] = $subq;
    280             }
     230            self::parse_advanced_search( $request, $res );
    281231        }
    282232
    283233        $res = apply_filters( 'wpbdp_listing_search_parse_request', $res, $request );
    284234        return $res;
     235    }
     236
     237    /**
     238     * @since 6.4.3
     239     *
     240     * @param array $request Unsanitized request data.
     241     * @param array $res     The array to which the search query will be added.
     242     *
     243     * @return void
     244     */
     245    private static function parse_quick_search( $request, &$res ) {
     246        $kw = $request['kw'];
     247        wpbdp_sanitize_value( 'sanitize_text_field', $kw );
     248        $kw = trim( urldecode( $kw ) );
     249        $kw = wpbdp_get_option( 'quick-search-enable-performance-tricks' ) ? array( $kw ) : explode( ' ', $kw );
     250
     251        $fields = array();
     252
     253        foreach ( self::get_quick_search_fields_ids() as $field_id ) {
     254            $field = wpbdp_get_form_field( $field_id );
     255
     256            if ( $field ) {
     257                $fields[] = $field;
     258            }
     259        }
     260
     261        $res[] = 'and';
     262
     263        foreach ( $kw as $k ) {
     264            $subq = array( 'or' );
     265
     266            foreach ( $fields as $field ) {
     267                $subq[] = array( $field->get_id(), $k );
     268            }
     269
     270            $res[] = $subq;
     271        }
     272    }
     273
     274    /**
     275     * @since 6.4.3
     276     *
     277     * @param array $request Unsanitized request data.
     278     * @param array $res     The array to which the search query will be added.
     279     *
     280     * @return void
     281     */
     282    private static function parse_advanced_search( $request, &$res ) {
     283        $res[] = 'and';
     284
     285        foreach ( $request['listingfields'] as $field_id => $term ) {
     286            if ( ! $term ) {
     287                continue;
     288            }
     289            $field_id = intval( $field_id );
     290            wpbdp_sanitize_value( 'sanitize_text_field', $term );
     291            wpbdp_sanitize_value( 'urldecode', $term );
     292
     293            $search_terms = array();
     294
     295            if ( is_string( $term ) ) {
     296                $search_terms = array_filter(
     297                    explode( ' ', trim( $term ) ),
     298                    function ( $t ) {
     299                        return strlen( $t ) >= 2;
     300                    }
     301                );
     302            }
     303
     304            if ( count( $search_terms ) < 2 ) {
     305                $res[] = array( $field_id, $term );
     306                continue;
     307            }
     308
     309            $subq   = array( 'or' );
     310            $termsq = array( 'and' );
     311
     312            foreach ( $search_terms as $k ) {
     313                $termsq[] = array( $field_id, $k );
     314            }
     315
     316            $subq[] = $termsq;
     317            $subq[] = array( $field_id, $term );
     318
     319            $res[] = $subq;
     320        }
    285321    }
    286322
  • business-directory-plugin/tags/6.4.3/languages/business-directory-plugin.pot

    r3080046 r3089626  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Business Directory Plugin 6.4.2\n"
     5"Project-Id-Version: Business Directory Plugin 6.4.3\n"
    66"Report-Msgid-Bugs-To: "
    77"https://wordpress.org/support/plugin/business-directory-plugin\n"
    8 "POT-Creation-Date: 2024-05-01 20:47:08+00:00\n"
     8"POT-Creation-Date: 2024-05-20 20:04:10+00:00\n"
    99"MIME-Version: 1.0\n"
    1010"Content-Type: text/plain; charset=utf-8\n"
  • business-directory-plugin/tags/6.4.3/themes/default/theme.json

    r3080046 r3089626  
    22    "name": "Default Theme",
    33    "description": "A clean, basic look. This theme is always installed and cannot be removed.",
    4     "version": "6.4.2",
     4    "version": "6.4.3",
    55    "author": "Business Directory Team",
    66    "author_email": "support@businessdirectoryplugin.com",
  • business-directory-plugin/tags/6.4.3/themes/no_theme/theme.json

    r3080046 r3089626  
    22    "name": "No Theme",
    33    "description": "If you customized your directory templates and don’t want to use our themes, use this option.",
    4     "version": "6.4.2",
     4    "version": "6.4.3",
    55    "author": "Business Directory Team",
    66    "author_email": "support@businessdirectoryplugin.com",
  • business-directory-plugin/trunk/README.TXT

    r3080046 r3089626  
    44Requires at least: 5.9
    55Requires PHP: 7.0
    6 Tested up to: 6.5.2
    7 Stable tag: 6.4.2
     6Tested up to: 6.5.3
     7Stable tag: 6.4.3
    88License: GPLv2 or later
    99
     
    159159
    160160== Changelog ==
     161= 6.4.3 =
     162* Fix: Security fix for searching.
     163* Fix: After a quick search with two words, don't include a "+" in the advanced search.
     164
    161165= 6.4.2 =
    162166* Fix: Reduce the number of API calls to speed up admin area and reduce throttling.
     
    222226* Fix: Show the correct number of allowed images to upload after changing the plan in admin meta boxes.
    223227
    224 = 6.3.6 =
    225 * Fix: Listing titles in taxonomy pages were showing in the sidebar
    226 * Fix: The admin listing tables had misaligned pagination
    227 * Fix: The fields on the contact form were not using consistent sizing
    228 * Fix: German translation for "Your message has been sent".
    229 
    230228<a href="https://businessdirectoryplugin.com/plugins/business-directory/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion">See changelog for all versions</a>
  • business-directory-plugin/trunk/business-directory-plugin.php

    r3080046 r3089626  
    44 * Plugin URI: https://businessdirectoryplugin.com
    55 * Description: Provides the ability to maintain a free or paid business directory on your WordPress powered site.
    6  * Version: 6.4.2
     6 * Version: 6.4.3
    77 * Author: Business Directory Team
    88 * Author URI: https://businessdirectoryplugin.com
  • business-directory-plugin/trunk/includes/class-wpbdp.php

    r3080046 r3089626  
    5656
    5757    private function setup_constants() {
    58         define( 'WPBDP_VERSION', '6.4.2' );
     58        define( 'WPBDP_VERSION', '6.4.3' );
    5959
    6060        define( 'WPBDP_PATH', wp_normalize_path( plugin_dir_path( WPBDP_PLUGIN_FILE ) ) );
  • business-directory-plugin/trunk/includes/helpers/class-listing-search.php

    r3080046 r3089626  
    6767
    6868        if ( in_array( $field->get_id(), $quick_search_fields_ids, true ) && isset( $this->original_request['kw'] ) ) {
    69             return array( $this->original_request['kw'] );
     69            return array( urldecode( $this->original_request['kw'] ) );
    7070        }
    7171
     
    158158
    159159    private function _traverse_tree( $tree ) {
    160         if ( is_array( $tree ) && 2 == count( $tree ) && is_numeric( $tree[0] ) ) {
     160        if ( ! is_array( $tree ) ) {
     161            return '';
     162        }
     163
     164        if ( 2 == count( $tree ) && is_numeric( $tree[0] ) ) {
    161165            $key = md5( serialize( $tree ) );
    162166
     
    206210    }
    207211
     212    /**
     213     * @param array $request Unsanitized request data.
     214     */
    208215    public static function from_request( $request = array() ) {
    209216        return new self( self::parse_request( $request ), $request );
    210217    }
    211218
     219    /**
     220     * @param array $request Unsanitized request data.
     221     *
     222     * @return array
     223     */
    212224    public static function parse_request( $request = array() ) {
    213225        $res = array();
    214226
    215         // Quick search.
    216227        if ( ! empty( $request['kw'] ) ) {
    217             if ( wpbdp_get_option( 'quick-search-enable-performance-tricks' ) ) {
    218                 $request['kw'] = array( trim( $request['kw'] ) );
    219             } else {
    220                 $request['kw'] = explode( ' ', trim( $request['kw'] ) );
    221             }
    222 
    223             $fields = array();
    224 
    225             foreach ( self::get_quick_search_fields_ids() as $field_id ) {
    226                 $field = wpbdp_get_form_field( $field_id );
    227 
    228                 if ( $field ) {
    229                     $fields[] = $field;
    230                 }
    231             }
    232 
    233             $res[] = 'and';
    234 
    235             foreach ( $request['kw'] as $k ) {
    236                 $subq = array( 'or' );
    237 
    238                 foreach ( $fields as $field ) {
    239                     $subq[] = array( $field->get_id(), $k );
    240                 }
    241 
    242                 $res[] = $subq;
    243             }
     228            self::parse_quick_search( $request, $res );
    244229        } elseif ( ! empty( $request['listingfields'] ) ) {
    245             // Regular search.
    246             $res[] = 'and';
    247 
    248             foreach ( $request['listingfields'] as $field_id => $term ) {
    249                 if ( ! $term ) {
    250                     continue;
    251                 }
    252 
    253                 $search_terms = array();
    254 
    255                 if ( is_string( $term ) ) {
    256                     $search_terms = array_filter(
    257                         explode( ' ', trim( $term ) ),
    258                         function ( $t ) {
    259                             return strlen( $t ) >= 2;
    260                         }
    261                     );
    262                 }
    263 
    264                 if ( count( $search_terms ) < 2 ) {
    265                     $res[] = array( $field_id, $term );
    266                     continue;
    267                 }
    268 
    269                 $subq   = array( 'or' );
    270                 $termsq = array( 'and' );
    271 
    272                 foreach ( $search_terms as $k ) {
    273                     $termsq[] = array( $field_id, $k );
    274                 }
    275 
    276                 $subq[] = $termsq;
    277                 $subq[] = array( $field_id, $term );
    278 
    279                 $res[] = $subq;
    280             }
     230            self::parse_advanced_search( $request, $res );
    281231        }
    282232
    283233        $res = apply_filters( 'wpbdp_listing_search_parse_request', $res, $request );
    284234        return $res;
     235    }
     236
     237    /**
     238     * @since 6.4.3
     239     *
     240     * @param array $request Unsanitized request data.
     241     * @param array $res     The array to which the search query will be added.
     242     *
     243     * @return void
     244     */
     245    private static function parse_quick_search( $request, &$res ) {
     246        $kw = $request['kw'];
     247        wpbdp_sanitize_value( 'sanitize_text_field', $kw );
     248        $kw = trim( urldecode( $kw ) );
     249        $kw = wpbdp_get_option( 'quick-search-enable-performance-tricks' ) ? array( $kw ) : explode( ' ', $kw );
     250
     251        $fields = array();
     252
     253        foreach ( self::get_quick_search_fields_ids() as $field_id ) {
     254            $field = wpbdp_get_form_field( $field_id );
     255
     256            if ( $field ) {
     257                $fields[] = $field;
     258            }
     259        }
     260
     261        $res[] = 'and';
     262
     263        foreach ( $kw as $k ) {
     264            $subq = array( 'or' );
     265
     266            foreach ( $fields as $field ) {
     267                $subq[] = array( $field->get_id(), $k );
     268            }
     269
     270            $res[] = $subq;
     271        }
     272    }
     273
     274    /**
     275     * @since 6.4.3
     276     *
     277     * @param array $request Unsanitized request data.
     278     * @param array $res     The array to which the search query will be added.
     279     *
     280     * @return void
     281     */
     282    private static function parse_advanced_search( $request, &$res ) {
     283        $res[] = 'and';
     284
     285        foreach ( $request['listingfields'] as $field_id => $term ) {
     286            if ( ! $term ) {
     287                continue;
     288            }
     289            $field_id = intval( $field_id );
     290            wpbdp_sanitize_value( 'sanitize_text_field', $term );
     291            wpbdp_sanitize_value( 'urldecode', $term );
     292
     293            $search_terms = array();
     294
     295            if ( is_string( $term ) ) {
     296                $search_terms = array_filter(
     297                    explode( ' ', trim( $term ) ),
     298                    function ( $t ) {
     299                        return strlen( $t ) >= 2;
     300                    }
     301                );
     302            }
     303
     304            if ( count( $search_terms ) < 2 ) {
     305                $res[] = array( $field_id, $term );
     306                continue;
     307            }
     308
     309            $subq   = array( 'or' );
     310            $termsq = array( 'and' );
     311
     312            foreach ( $search_terms as $k ) {
     313                $termsq[] = array( $field_id, $k );
     314            }
     315
     316            $subq[] = $termsq;
     317            $subq[] = array( $field_id, $term );
     318
     319            $res[] = $subq;
     320        }
    285321    }
    286322
  • business-directory-plugin/trunk/languages/business-directory-plugin.pot

    r3080046 r3089626  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Business Directory Plugin 6.4.2\n"
     5"Project-Id-Version: Business Directory Plugin 6.4.3\n"
    66"Report-Msgid-Bugs-To: "
    77"https://wordpress.org/support/plugin/business-directory-plugin\n"
    8 "POT-Creation-Date: 2024-05-01 20:47:08+00:00\n"
     8"POT-Creation-Date: 2024-05-20 20:04:10+00:00\n"
    99"MIME-Version: 1.0\n"
    1010"Content-Type: text/plain; charset=utf-8\n"
  • business-directory-plugin/trunk/themes/default/theme.json

    r3080046 r3089626  
    22    "name": "Default Theme",
    33    "description": "A clean, basic look. This theme is always installed and cannot be removed.",
    4     "version": "6.4.2",
     4    "version": "6.4.3",
    55    "author": "Business Directory Team",
    66    "author_email": "support@businessdirectoryplugin.com",
  • business-directory-plugin/trunk/themes/no_theme/theme.json

    r3080046 r3089626  
    22    "name": "No Theme",
    33    "description": "If you customized your directory templates and don’t want to use our themes, use this option.",
    4     "version": "6.4.2",
     4    "version": "6.4.3",
    55    "author": "Business Directory Team",
    66    "author_email": "support@businessdirectoryplugin.com",
Note: See TracChangeset for help on using the changeset viewer.