Changeset 3089626
- Timestamp:
- 05/20/2024 08:15:45 PM (11 months ago)
- Location:
- business-directory-plugin
- Files:
-
- 14 edited
- 1 copied
-
tags/6.4.3 (copied) (copied from business-directory-plugin/trunk)
-
tags/6.4.3/README.TXT (modified) (3 diffs)
-
tags/6.4.3/business-directory-plugin.php (modified) (1 diff)
-
tags/6.4.3/includes/class-wpbdp.php (modified) (1 diff)
-
tags/6.4.3/includes/helpers/class-listing-search.php (modified) (3 diffs)
-
tags/6.4.3/languages/business-directory-plugin.pot (modified) (1 diff)
-
tags/6.4.3/themes/default/theme.json (modified) (1 diff)
-
tags/6.4.3/themes/no_theme/theme.json (modified) (1 diff)
-
trunk/README.TXT (modified) (3 diffs)
-
trunk/business-directory-plugin.php (modified) (1 diff)
-
trunk/includes/class-wpbdp.php (modified) (1 diff)
-
trunk/includes/helpers/class-listing-search.php (modified) (3 diffs)
-
trunk/languages/business-directory-plugin.pot (modified) (1 diff)
-
trunk/themes/default/theme.json (modified) (1 diff)
-
trunk/themes/no_theme/theme.json (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
business-directory-plugin/tags/6.4.3/README.TXT
r3080046 r3089626 4 4 Requires at least: 5.9 5 5 Requires PHP: 7.0 6 Tested up to: 6.5. 27 Stable tag: 6.4. 26 Tested up to: 6.5.3 7 Stable tag: 6.4.3 8 8 License: GPLv2 or later 9 9 … … 159 159 160 160 == 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 161 165 = 6.4.2 = 162 166 * Fix: Reduce the number of API calls to speed up admin area and reduce throttling. … … 222 226 * Fix: Show the correct number of allowed images to upload after changing the plan in admin meta boxes. 223 227 224 = 6.3.6 =225 * Fix: Listing titles in taxonomy pages were showing in the sidebar226 * Fix: The admin listing tables had misaligned pagination227 * Fix: The fields on the contact form were not using consistent sizing228 * Fix: German translation for "Your message has been sent".229 230 228 <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 4 4 * Plugin URI: https://businessdirectoryplugin.com 5 5 * Description: Provides the ability to maintain a free or paid business directory on your WordPress powered site. 6 * Version: 6.4. 26 * Version: 6.4.3 7 7 * Author: Business Directory Team 8 8 * Author URI: https://businessdirectoryplugin.com -
business-directory-plugin/tags/6.4.3/includes/class-wpbdp.php
r3080046 r3089626 56 56 57 57 private function setup_constants() { 58 define( 'WPBDP_VERSION', '6.4. 2' );58 define( 'WPBDP_VERSION', '6.4.3' ); 59 59 60 60 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 67 67 68 68 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'] ) ); 70 70 } 71 71 … … 158 158 159 159 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] ) ) { 161 165 $key = md5( serialize( $tree ) ); 162 166 … … 206 210 } 207 211 212 /** 213 * @param array $request Unsanitized request data. 214 */ 208 215 public static function from_request( $request = array() ) { 209 216 return new self( self::parse_request( $request ), $request ); 210 217 } 211 218 219 /** 220 * @param array $request Unsanitized request data. 221 * 222 * @return array 223 */ 212 224 public static function parse_request( $request = array() ) { 213 225 $res = array(); 214 226 215 // Quick search.216 227 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 ); 244 229 } 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 ); 281 231 } 282 232 283 233 $res = apply_filters( 'wpbdp_listing_search_parse_request', $res, $request ); 284 234 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 } 285 321 } 286 322 -
business-directory-plugin/tags/6.4.3/languages/business-directory-plugin.pot
r3080046 r3089626 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Business Directory Plugin 6.4. 2\n"5 "Project-Id-Version: Business Directory Plugin 6.4.3\n" 6 6 "Report-Msgid-Bugs-To: " 7 7 "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" 9 9 "MIME-Version: 1.0\n" 10 10 "Content-Type: text/plain; charset=utf-8\n" -
business-directory-plugin/tags/6.4.3/themes/default/theme.json
r3080046 r3089626 2 2 "name": "Default Theme", 3 3 "description": "A clean, basic look. This theme is always installed and cannot be removed.", 4 "version": "6.4. 2",4 "version": "6.4.3", 5 5 "author": "Business Directory Team", 6 6 "author_email": "support@businessdirectoryplugin.com", -
business-directory-plugin/tags/6.4.3/themes/no_theme/theme.json
r3080046 r3089626 2 2 "name": "No Theme", 3 3 "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", 5 5 "author": "Business Directory Team", 6 6 "author_email": "support@businessdirectoryplugin.com", -
business-directory-plugin/trunk/README.TXT
r3080046 r3089626 4 4 Requires at least: 5.9 5 5 Requires PHP: 7.0 6 Tested up to: 6.5. 27 Stable tag: 6.4. 26 Tested up to: 6.5.3 7 Stable tag: 6.4.3 8 8 License: GPLv2 or later 9 9 … … 159 159 160 160 == 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 161 165 = 6.4.2 = 162 166 * Fix: Reduce the number of API calls to speed up admin area and reduce throttling. … … 222 226 * Fix: Show the correct number of allowed images to upload after changing the plan in admin meta boxes. 223 227 224 = 6.3.6 =225 * Fix: Listing titles in taxonomy pages were showing in the sidebar226 * Fix: The admin listing tables had misaligned pagination227 * Fix: The fields on the contact form were not using consistent sizing228 * Fix: German translation for "Your message has been sent".229 230 228 <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 4 4 * Plugin URI: https://businessdirectoryplugin.com 5 5 * Description: Provides the ability to maintain a free or paid business directory on your WordPress powered site. 6 * Version: 6.4. 26 * Version: 6.4.3 7 7 * Author: Business Directory Team 8 8 * Author URI: https://businessdirectoryplugin.com -
business-directory-plugin/trunk/includes/class-wpbdp.php
r3080046 r3089626 56 56 57 57 private function setup_constants() { 58 define( 'WPBDP_VERSION', '6.4. 2' );58 define( 'WPBDP_VERSION', '6.4.3' ); 59 59 60 60 define( 'WPBDP_PATH', wp_normalize_path( plugin_dir_path( WPBDP_PLUGIN_FILE ) ) ); -
business-directory-plugin/trunk/includes/helpers/class-listing-search.php
r3080046 r3089626 67 67 68 68 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'] ) ); 70 70 } 71 71 … … 158 158 159 159 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] ) ) { 161 165 $key = md5( serialize( $tree ) ); 162 166 … … 206 210 } 207 211 212 /** 213 * @param array $request Unsanitized request data. 214 */ 208 215 public static function from_request( $request = array() ) { 209 216 return new self( self::parse_request( $request ), $request ); 210 217 } 211 218 219 /** 220 * @param array $request Unsanitized request data. 221 * 222 * @return array 223 */ 212 224 public static function parse_request( $request = array() ) { 213 225 $res = array(); 214 226 215 // Quick search.216 227 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 ); 244 229 } 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 ); 281 231 } 282 232 283 233 $res = apply_filters( 'wpbdp_listing_search_parse_request', $res, $request ); 284 234 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 } 285 321 } 286 322 -
business-directory-plugin/trunk/languages/business-directory-plugin.pot
r3080046 r3089626 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Business Directory Plugin 6.4. 2\n"5 "Project-Id-Version: Business Directory Plugin 6.4.3\n" 6 6 "Report-Msgid-Bugs-To: " 7 7 "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" 9 9 "MIME-Version: 1.0\n" 10 10 "Content-Type: text/plain; charset=utf-8\n" -
business-directory-plugin/trunk/themes/default/theme.json
r3080046 r3089626 2 2 "name": "Default Theme", 3 3 "description": "A clean, basic look. This theme is always installed and cannot be removed.", 4 "version": "6.4. 2",4 "version": "6.4.3", 5 5 "author": "Business Directory Team", 6 6 "author_email": "support@businessdirectoryplugin.com", -
business-directory-plugin/trunk/themes/no_theme/theme.json
r3080046 r3089626 2 2 "name": "No Theme", 3 3 "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", 5 5 "author": "Business Directory Team", 6 6 "author_email": "support@businessdirectoryplugin.com",
Note: See TracChangeset
for help on using the changeset viewer.