Advanced Woo Search - Version 2.35

Version Description

( 2021-08-31 ) = * Add - Seamless integration for Modern Store theme * Update - WholeSale plugin support. Change products filter script to improve execution time * Update - FacetWP plugin integration. Fix problem with search results page * Update - Plugin settings page. Change performance options * Update - Tested with WC 5.6 * Fix - Admin area descriptions spelling

Download this release

Release Info

Developer Mihail Barinov
Plugin Icon 128x128 Advanced Woo Search
Version 2.35
Comparing to
See all releases

Code changes from version 2.34 to 2.35

advanced-woo-search.php CHANGED
@@ -3,12 +3,12 @@
3
  /*
4
  Plugin Name: Advanced Woo Search
5
  Description: Advance ajax WooCommerce product search.
6
- Version: 2.34
7
  Author: ILLID
8
  Author URI: https://advanced-woo-search.com/
9
  Text Domain: advanced-woo-search
10
  WC requires at least: 3.0.0
11
- WC tested up to: 5.5.0
12
  */
13
 
14
 
@@ -96,7 +96,7 @@ final class AWS_Main {
96
  */
97
  private function define_constants() {
98
 
99
- $this->define( 'AWS_VERSION', '2.34' );
100
 
101
  $this->define( 'AWS_DIR', plugin_dir_path( AWS_FILE ) );
102
  $this->define( 'AWS_URL', plugin_dir_url( AWS_FILE ) );
3
  /*
4
  Plugin Name: Advanced Woo Search
5
  Description: Advance ajax WooCommerce product search.
6
+ Version: 2.35
7
  Author: ILLID
8
  Author URI: https://advanced-woo-search.com/
9
  Text Domain: advanced-woo-search
10
  WC requires at least: 3.0.0
11
+ WC tested up to: 5.6.0
12
  */
13
 
14
 
96
  */
97
  private function define_constants() {
98
 
99
+ $this->define( 'AWS_VERSION', '2.35' );
100
 
101
  $this->define( 'AWS_DIR', plugin_dir_path( AWS_FILE ) );
102
  $this->define( 'AWS_URL', plugin_dir_url( AWS_FILE ) );
includes/admin/class-aws-admin-fields.php CHANGED
@@ -350,6 +350,22 @@ if ( ! class_exists( 'AWS_Admin_Fields' ) ) :
350
  </tr>
351
  <?php break;
352
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353
  }
354
 
355
  }
350
  </tr>
351
  <?php break;
352
 
353
+ case 'html':
354
+ $custom_html = isset( $value['html'] ) ? $value['html'] : '';
355
+ $description = isset( $value['desc'] ) ? $value['desc'] : '';
356
+ ?>
357
+ <tr valign="top">
358
+ <th scope="row"><?php echo esc_html( $value['name'] ); ?></th>
359
+ <td>
360
+ <?php echo $value['html']; ?>
361
+ <?php if ( $description ): ?>
362
+ <span class="description"><?php echo $description; ?></span>
363
+ <?php endif; ?>
364
+ </td>
365
+ </tr>
366
+
367
+ <?php break;
368
+
369
  }
370
 
371
  }
includes/admin/class-aws-admin-meta-boxes.php CHANGED
@@ -54,17 +54,6 @@ if ( ! class_exists( 'AWS_Admin_Meta_Boxes' ) ) :
54
 
55
  $html .= '</tr>';
56
 
57
-
58
- $html .= '<tr>';
59
-
60
- $html .= '<th>' . esc_html__( 'Clear cache', 'advanced-woo-search' ) . '</th>';
61
- $html .= '<td>';
62
- $html .= '<div id="aws-clear-cache"><input class="button" type="button" value="' . esc_attr__( 'Clear cache', 'advanced-woo-search' ) . '"><span class="loader"></span></div><br>';
63
- $html .= '<span class="description">' . esc_html__( 'Clear cache for all search results.', 'advanced-woo-search' ) . '</span>';
64
- $html .= '</td>';
65
-
66
- $html .= '</tr>';
67
-
68
  $html .= '</tbody>';
69
  $html .= '</table>';
70
 
54
 
55
  $html .= '</tr>';
56
 
 
 
 
 
 
 
 
 
 
 
 
57
  $html .= '</tbody>';
58
  $html .= '</table>';
59
 
includes/admin/class-aws-admin-options.php CHANGED
@@ -200,31 +200,6 @@ if ( ! class_exists( 'AWS_Admin_Options' ) ) :
200
  )
201
  );
202
 
203
- $options['general'][] = array(
204
- "name" => __( "Cache results", "advanced-woo-search" ),
205
- "desc" => __( "Turn off if you have old data in the search results after content of products was changed.<br><strong>CAUTION:</strong> can dramatically increase search speed", "advanced-woo-search" ),
206
- "id" => "cache",
207
- "value" => 'true',
208
- "type" => "radio",
209
- 'choices' => array(
210
- 'true' => __( 'On', 'advanced-woo-search' ),
211
- 'false' => __( 'Off', 'advanced-woo-search' ),
212
- )
213
- );
214
-
215
- $options['general'][] = array(
216
- "name" => __( "Sync index table", "advanced-woo-search" ),
217
- "desc" => __( "Automatically update plugin index table when product content was changed. This means that in search there will be always latest product data.", "advanced-woo-search" ) . '<br>' .
218
- __( "Turn this off if you have any problems with performance.", "advanced-woo-search" ),
219
- "id" => "autoupdates",
220
- "value" => 'true',
221
- "type" => "radio",
222
- 'choices' => array(
223
- 'true' => __( 'On', 'advanced-woo-search' ),
224
- 'false' => __( 'Off', 'advanced-woo-search' ),
225
- )
226
- );
227
-
228
  $options['general'][] = array(
229
  "name" => __( "Search in", "advanced-woo-search" ),
230
  "desc" => __( "Click on status icon to enable or disable search source.", "advanced-woo-search" ),
@@ -372,6 +347,31 @@ if ( ! class_exists( 'AWS_Admin_Options' ) ) :
372
  "type" => "number"
373
  );
374
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
375
  $options['performance'][] = array(
376
  "name" => __( "Index table options", "advanced-woo-search" ),
377
  "id" => "index_sources",
@@ -426,6 +426,19 @@ if ( ! class_exists( 'AWS_Admin_Options' ) ) :
426
  )
427
  );
428
 
 
 
 
 
 
 
 
 
 
 
 
 
 
429
  // Search Form Settings
430
  $options['form'][] = array(
431
  "name" => __( "Text for search field", "advanced-woo-search" ),
@@ -553,7 +566,7 @@ if ( ! class_exists( 'AWS_Admin_Options' ) ) :
553
  "value" => 'true',
554
  "type" => "radio",
555
  'choices' => array(
556
- 'true' => __( "Smart scrapping sentences with searching terms from product description.", "advanced-woo-search" ),
557
  'false' => __( "First N words of product description ( number of words that you choose below. )", "advanced-woo-search" ),
558
  )
559
  );
200
  )
201
  );
202
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  $options['general'][] = array(
204
  "name" => __( "Search in", "advanced-woo-search" ),
205
  "desc" => __( "Click on status icon to enable or disable search source.", "advanced-woo-search" ),
347
  "type" => "number"
348
  );
349
 
350
+ $options['performance'][] = array(
351
+ "name" => __( "Cache options", "advanced-woo-search" ),
352
+ "type" => "heading"
353
+ );
354
+
355
+ $options['performance'][] = array(
356
+ "name" => __( "Cache results", "advanced-woo-search" ),
357
+ "desc" => __( "Cache search results to increase search speed.", "advanced-woo-search" ) . '<br>' .
358
+ __( "Turn off if you have old data in the search results after the content of products was changed.", "advanced-woo-search" ),
359
+ "id" => "cache",
360
+ "value" => 'true',
361
+ "type" => "radio",
362
+ 'choices' => array(
363
+ 'true' => __( 'On', 'advanced-woo-search' ),
364
+ 'false' => __( 'Off', 'advanced-woo-search' ),
365
+ )
366
+ );
367
+
368
+ $options['performance'][] = array(
369
+ "name" => __( "Clear cache", "advanced-woo-search" ),
370
+ "type" => "html",
371
+ "desc" =>__( "Clear cache for all search results.", "advanced-woo-search" ),
372
+ "html" => '<div id="aws-clear-cache"><input class="button" type="button" value="' . esc_attr__( 'Clear cache', 'advanced-woo-search' ) . '"><span class="loader"></span></div><br>',
373
+ );
374
+
375
  $options['performance'][] = array(
376
  "name" => __( "Index table options", "advanced-woo-search" ),
377
  "id" => "index_sources",
426
  )
427
  );
428
 
429
+ $options['performance'][] = array(
430
+ "name" => __( "Sync index table", "advanced-woo-search" ),
431
+ "desc" => __( "Automatically update plugin index table when product content was changed. This means that in search there will be always latest product data.", "advanced-woo-search" ) . '<br>' .
432
+ __( "Turn this off if you have any problems with performance.", "advanced-woo-search" ),
433
+ "id" => "autoupdates",
434
+ "value" => 'true',
435
+ "type" => "radio",
436
+ 'choices' => array(
437
+ 'true' => __( 'On', 'advanced-woo-search' ),
438
+ 'false' => __( 'Off', 'advanced-woo-search' ),
439
+ )
440
+ );
441
+
442
  // Search Form Settings
443
  $options['form'][] = array(
444
  "name" => __( "Text for search field", "advanced-woo-search" ),
566
  "value" => 'true',
567
  "type" => "radio",
568
  'choices' => array(
569
+ 'true' => __( "Smart scraping sentences with searching terms from product description.", "advanced-woo-search" ),
570
  'false' => __( "First N words of product description ( number of words that you choose below. )", "advanced-woo-search" ),
571
  )
572
  );
includes/class-aws-integrations.php CHANGED
@@ -240,6 +240,7 @@ if ( ! class_exists( 'AWS_Integrations' ) ) :
240
  if ( class_exists( 'FacetWP' ) ) {
241
  add_filter( 'facetwp_filtered_post_ids', array( $this, 'facetwp_filtered_post_ids' ), 1 );
242
  add_filter( 'aws_searchpage_enabled', array( $this, 'facetwp_aws_searchpage_enabled' ), 1 );
 
243
  }
244
 
245
  // Product Visibility by User Role for WooCommerce plugin
@@ -1526,6 +1527,10 @@ if ( ! class_exists( 'AWS_Integrations' ) ) :
1526
  $selectors[] = '#searchModal form';
1527
  }
1528
 
 
 
 
 
1529
  // WCFM - WooCommerce Multivendor Marketplace
1530
  if ( class_exists( 'WCFMmp' ) ) {
1531
  $selectors[] = '#wcfmmp-store .woocommerce-product-search';
@@ -1822,6 +1827,16 @@ if ( ! class_exists( 'AWS_Integrations' ) ) :
1822
  return $enabled;
1823
  }
1824
 
 
 
 
 
 
 
 
 
 
 
1825
  /*
1826
  * Product Visibility by User Role for WooCommerce plugin hide products for certain users
1827
  */
240
  if ( class_exists( 'FacetWP' ) ) {
241
  add_filter( 'facetwp_filtered_post_ids', array( $this, 'facetwp_filtered_post_ids' ), 1 );
242
  add_filter( 'aws_searchpage_enabled', array( $this, 'facetwp_aws_searchpage_enabled' ), 1 );
243
+ add_filter( 'aws_search_page_custom_data', array( $this, 'facetwp_aws_search_page_custom_data' ), 1 );
244
  }
245
 
246
  // Product Visibility by User Role for WooCommerce plugin
1527
  $selectors[] = '#searchModal form';
1528
  }
1529
 
1530
+ if ( 'Modern Store' === $this->current_theme ) {
1531
+ $selectors[] = '#search-form-container form';
1532
+ }
1533
+
1534
  // WCFM - WooCommerce Multivendor Marketplace
1535
  if ( class_exists( 'WCFMmp' ) ) {
1536
  $selectors[] = '#wcfmmp-store .woocommerce-product-search';
1827
  return $enabled;
1828
  }
1829
 
1830
+ /*
1831
+ * FacetWP - Update search page query
1832
+ */
1833
+ public function facetwp_aws_search_page_custom_data( $data ) {
1834
+ if ( isset( $this->data['facetwp'] ) && $this->data['facetwp'] ) {
1835
+ $data['force_ids'] = true;
1836
+ }
1837
+ return $data;
1838
+ }
1839
+
1840
  /*
1841
  * Product Visibility by User Role for WooCommerce plugin hide products for certain users
1842
  */
includes/modules/class-aws-wholesale.php CHANGED
@@ -175,6 +175,50 @@ if ( ! class_exists( 'AWS_Wholesale' ) ) :
175
  }
176
 
177
  $products_ids = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  $restricted_products = get_posts( array(
179
  'posts_per_page' => -1,
180
  'fields' => 'ids',
@@ -187,32 +231,11 @@ if ( ! class_exists( 'AWS_Wholesale' ) ) :
187
  'orderby' => 'ID',
188
  'order' => 'DESC',
189
  'lang' => '',
190
- 'meta_query' => array(
191
- array(
192
- 'key' => 'wwpp_product_wholesale_visibility_filter',
193
- 'compare' => 'EXISTS',
194
- )
195
- )
196
  ) );
197
 
198
  if ( $restricted_products ) {
199
- foreach ($restricted_products as $restricted_product_id) {
200
-
201
- $custom_fields = get_post_meta( $restricted_product_id, 'wwpp_product_wholesale_visibility_filter' );
202
- $custom_price = get_post_meta( $restricted_product_id, 'wholesale_customer_wholesale_price' );
203
-
204
- if ( $custom_fields && ! empty( $custom_fields ) && $custom_fields[0] !== 'all' && $custom_fields[0] !== $user_role ) {
205
- $products_ids[] = $restricted_product_id;
206
- continue;
207
- }
208
-
209
- if ( is_user_logged_in() && !empty( $all_registered_wholesale_roles ) && isset( $all_registered_wholesale_roles[$user_role] )
210
- && get_option( 'wwpp_settings_only_show_wholesale_products_to_wholesale_users', false ) === 'yes' && ! $custom_price ) {
211
- $products_ids[] = $restricted_product_id;
212
- continue;
213
- }
214
-
215
- }
216
  }
217
 
218
  return $products_ids;
175
  }
176
 
177
  $products_ids = array();
178
+ $meta_query = array();
179
+
180
+ if ( is_user_logged_in() && !empty( $all_registered_wholesale_roles ) && isset( $all_registered_wholesale_roles[$user_role] )
181
+ && get_option( 'wwpp_settings_only_show_wholesale_products_to_wholesale_users', false ) === 'yes' ) {
182
+
183
+ $meta_query = array(
184
+ 'relation' => 'OR',
185
+ array(
186
+ 'relation' => 'AND',
187
+ array(
188
+ 'key' => 'wwpp_product_wholesale_visibility_filter',
189
+ 'value' => 'all',
190
+ 'compare' => '!=',
191
+ ),
192
+ array(
193
+ 'key' => 'wwpp_product_wholesale_visibility_filter',
194
+ 'value' => $user_role,
195
+ 'compare' => '!=',
196
+ )
197
+ ),
198
+ array(
199
+ 'key' => 'wholesale_customer_wholesale_price',
200
+ 'compare' => 'NOT EXISTS'
201
+ ),
202
+ );
203
+
204
+ } else {
205
+
206
+ $meta_query = array(
207
+ 'relation' => 'AND',
208
+ array(
209
+ 'key' => 'wwpp_product_wholesale_visibility_filter',
210
+ 'value' => 'all',
211
+ 'compare' => '!=',
212
+ ),
213
+ array(
214
+ 'key' => 'wwpp_product_wholesale_visibility_filter',
215
+ 'value' => $user_role,
216
+ 'compare' => '!=',
217
+ )
218
+ );
219
+
220
+ }
221
+
222
  $restricted_products = get_posts( array(
223
  'posts_per_page' => -1,
224
  'fields' => 'ids',
231
  'orderby' => 'ID',
232
  'order' => 'DESC',
233
  'lang' => '',
234
+ 'meta_query' => $meta_query
 
 
 
 
 
235
  ) );
236
 
237
  if ( $restricted_products ) {
238
+ $products_ids = $restricted_products;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  }
240
 
241
  return $products_ids;
languages/advanced-woo-search-de_DE.po CHANGED
@@ -66,7 +66,7 @@ msgstr "Cache löschen für alle Suchergebnisse"
66
 
67
  #: includes/options.php:111
68
  msgid ""
69
- "Smart scrapping sentences with searching terms from product description."
70
  msgstr ""
71
  "Intelligente Verkürzung von Sätzen mit Suchbegriffen aus der "
72
  "Produktbeschreibung."
66
 
67
  #: includes/options.php:111
68
  msgid ""
69
+ "Smart scraping sentences with searching terms from product description."
70
  msgstr ""
71
  "Intelligente Verkürzung von Sätzen mit Suchbegriffen aus der "
72
  "Produktbeschreibung."
languages/advanced-woo-search-hu_HU.po CHANGED
@@ -44,7 +44,7 @@ msgstr "Az összes keresési eredmény törlése a gyorsítótárból"
44
 
45
  #: includes/options.php:111
46
  msgid ""
47
- "Smart scrapping sentences with searching terms from product description."
48
  msgstr ""
49
  "A keresési kifejezést tartalmazó mondatot jelenítsük meg leírásként a "
50
  "találat alatt."
44
 
45
  #: includes/options.php:111
46
  msgid ""
47
+ "Smart scraping sentences with searching terms from product description."
48
  msgstr ""
49
  "A keresési kifejezést tartalmazó mondatot jelenítsük meg leírásként a "
50
  "találat alatt."
languages/advanced-woo-search-ru_RU.po CHANGED
@@ -65,7 +65,7 @@ msgstr "Очищает кеш от всех результатов поиска"
65
 
66
  #: includes/options.php:111
67
  msgid ""
68
- "Smart scrapping sentences with searching terms from product description."
69
  msgstr "Умные списки предложений с поисковыми терминами из описания продукта."
70
 
71
  #: includes/options.php:112
65
 
66
  #: includes/options.php:111
67
  msgid ""
68
+ "Smart scraping sentences with searching terms from product description."
69
  msgstr "Умные списки предложений с поисковыми терминами из описания продукта."
70
 
71
  #: includes/options.php:112
languages/advanced-woo-search.pot CHANGED
@@ -54,7 +54,7 @@ msgstr ""
54
 
55
  #: includes/options.php:111
56
  msgid ""
57
- "Smart scrapping sentences with searching terms from product description."
58
  msgstr ""
59
 
60
  #: includes/options.php:112
@@ -127,7 +127,9 @@ msgstr ""
127
  msgid "Excluded from search results"
128
  msgstr ""
129
 
130
- #: includes/options.php:9
 
 
131
  msgid "Cache results"
132
  msgstr ""
133
 
@@ -170,11 +172,10 @@ msgstr ""
170
  msgid "Add PHP code to the necessary files of your theme: %s"
171
  msgstr ""
172
 
173
- #: includes/options.php:10
174
- msgid ""
175
- "Turn off if you have old data in the search results after content of "
176
- "products was changed.<br><strong>CAUTION:</strong> can dramatically increase "
177
- "search speed"
178
  msgstr ""
179
 
180
  #: includes/options.php:15 includes/options.php:43 includes/options.php:55
54
 
55
  #: includes/options.php:111
56
  msgid ""
57
+ "Smart scraping sentences with searching terms from product description."
58
  msgstr ""
59
 
60
  #: includes/options.php:112
127
  msgid "Excluded from search results"
128
  msgstr ""
129
 
130
+ msgid "Cache options"
131
+ msgstr ""
132
+
133
  msgid "Cache results"
134
  msgstr ""
135
 
172
  msgid "Add PHP code to the necessary files of your theme: %s"
173
  msgstr ""
174
 
175
+ msgid "Cache search results to increase search speed."
176
+ msgstr ""
177
+
178
+ msgid "Turn off if you have old data in the search results after the content of products was changed."
 
179
  msgstr ""
180
 
181
  #: includes/options.php:15 includes/options.php:43 includes/options.php:55
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: widget, plugin, woocommerce, search, product search, woocommerce search, ajax search, live search, custom search, ajax, shortcode, better search, relevance search, relevant search, search by sku, search plugin, shop, store, wordpress search, wp ajax search, wp search, wp search plugin, sidebar, ecommerce, merketing, products, category search, instant-search, search highlight, woocommerce advanced search, woocommerce live search, WooCommerce Plugin, woocommerce product search
5
  Requires at least: 4.0
6
  Tested up to: 5.8
7
- Stable tag: 2.34
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -167,6 +167,14 @@ Yep. This plugin is always compatible with the latest version of Woocommerce?
167
 
168
  == Changelog ==
169
 
 
 
 
 
 
 
 
 
170
  = 2.34 ( 2021-08-16 ) =
171
  * Add - New options for products search results page
172
  * Update - Support for WPML plugin. Use default product language if no translation and fallback to default language option is enabled
4
  Tags: widget, plugin, woocommerce, search, product search, woocommerce search, ajax search, live search, custom search, ajax, shortcode, better search, relevance search, relevant search, search by sku, search plugin, shop, store, wordpress search, wp ajax search, wp search, wp search plugin, sidebar, ecommerce, merketing, products, category search, instant-search, search highlight, woocommerce advanced search, woocommerce live search, WooCommerce Plugin, woocommerce product search
5
  Requires at least: 4.0
6
  Tested up to: 5.8
7
+ Stable tag: 2.35
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
167
 
168
  == Changelog ==
169
 
170
+ = 2.35 ( 2021-08-31 ) =
171
+ * Add - Seamless integration for Modern Store theme
172
+ * Update - WholeSale plugin support. Change products filter script to improve execution time
173
+ * Update - FacetWP plugin integration. Fix problem with search results page
174
+ * Update - Plugin settings page. Change performance options
175
+ * Update - Tested with WC 5.6
176
+ * Fix - Admin area descriptions spelling
177
+
178
  = 2.34 ( 2021-08-16 ) =
179
  * Add - New options for products search results page
180
  * Update - Support for WPML plugin. Use default product language if no translation and fallback to default language option is enabled