Advanced AJAX Product Filters - Version 1.3.4.2

Version Description

  • Fix - WPML incompatibility with new recount script
  • Fix - Purge cache after update
Download this release

Release Info

Developer RazyRx
Plugin Icon wp plugin Advanced AJAX Product Filters
Version 1.3.4.2
Comparing to
See all releases

Code changes from version 1.3.4.1 to 1.3.4.2

includes/faster_recount.php CHANGED
@@ -13,6 +13,11 @@ class BeRocket_AAPF_faster_attribute_recount {
13
  add_filter('berocket_aapf_recount_terms_query', array($this, 'onsale_query'), 20, 3);
14
  }
15
  function recount_terms($terms = FALSE, $taxonomy_data = array()) {
 
 
 
 
 
16
  $taxonomy_data = apply_filters('berocket_recount_taxonomy_data', array_merge(array(
17
  'taxonomy' => '',
18
  'operator' => 'OR',
@@ -29,6 +34,10 @@ class BeRocket_AAPF_faster_attribute_recount {
29
  $terms = $this->get_terms($taxonomy);
30
  }
31
  if( empty($terms) ) {
 
 
 
 
32
  return $terms;
33
  }
34
  if( $tax_query === FALSE ) {
@@ -47,6 +56,11 @@ class BeRocket_AAPF_faster_attribute_recount {
47
  $taxonomy_data['tax_query_sql'] = $tax_query_sql = $tax_query->get_sql( $wpdb->posts, 'ID' );
48
  $taxonomy_data['term_taxonomy_ids'] = $term_taxonomy_ids = wp_list_pluck($terms, 'term_taxonomy_id', 'term_id');
49
  if( $return_terms = apply_filters('berocket_recount_extension_enabled', false, $terms, $taxonomy_data) ) {
 
 
 
 
 
50
  return $return_terms;
51
  }
52
 
@@ -102,6 +116,12 @@ class BeRocket_AAPF_faster_attribute_recount {
102
  } else {
103
  $terms = $terms_cache;
104
  }
 
 
 
 
 
 
105
  return $terms;
106
  }
107
  function child_include($query, $taxonomy_data, $terms) {
@@ -140,6 +160,7 @@ class BeRocket_AAPF_faster_attribute_recount {
140
  return $query;
141
  }
142
  function date_query($query, $taxonomy_data, $terms) {
 
143
  extract($taxonomy_data);
144
  if( ! empty($use_filters) ) {
145
  if( ! empty($_POST['limits']) && is_array($_POST['limits']) && count($_POST['limits']) ) {
@@ -163,6 +184,7 @@ class BeRocket_AAPF_faster_attribute_recount {
163
  return $query;
164
  }
165
  function wpml_query($query, $taxonomy_data, $terms) {
 
166
  extract($taxonomy_data);
167
  if( defined( 'WCML_VERSION' ) && defined('ICL_LANGUAGE_CODE') ) {
168
  $query['join']['wpml'] = " INNER JOIN {$wpdb->prefix}icl_translations as wpml_lang ON ( {$wpdb->posts}.ID = wpml_lang.element_id )";
@@ -171,6 +193,7 @@ class BeRocket_AAPF_faster_attribute_recount {
171
  return $query;
172
  }
173
  function remove_all_berocket_tax_query($tax_query, $taxonomy = FALSE, $inside = FALSE ) {
 
174
  if( is_array($tax_query) ) {
175
  $md5_exist = array();
176
  foreach($tax_query as $key => $value) {
13
  add_filter('berocket_aapf_recount_terms_query', array($this, 'onsale_query'), 20, 3);
14
  }
15
  function recount_terms($terms = FALSE, $taxonomy_data = array()) {
16
+ if( BeRocket_AAPF::$debug_mode ) {
17
+ if( empty(BeRocket_AAPF::$error_log['faster_recount_sql']) || ! is_array(BeRocket_AAPF::$error_log['faster_recount_sql']) ) {
18
+ BeRocket_AAPF::$error_log['faster_recount_sql'] = array();
19
+ }
20
+ }
21
  $taxonomy_data = apply_filters('berocket_recount_taxonomy_data', array_merge(array(
22
  'taxonomy' => '',
23
  'operator' => 'OR',
34
  $terms = $this->get_terms($taxonomy);
35
  }
36
  if( empty($terms) ) {
37
+ if( BeRocket_AAPF::$debug_mode ) {
38
+ $taxonomy_data['error'] = 'Empty terms';
39
+ BeRocket_AAPF::$error_log['faster_recount_sql'][] = $taxonomy_data;
40
+ }
41
  return $terms;
42
  }
43
  if( $tax_query === FALSE ) {
56
  $taxonomy_data['tax_query_sql'] = $tax_query_sql = $tax_query->get_sql( $wpdb->posts, 'ID' );
57
  $taxonomy_data['term_taxonomy_ids'] = $term_taxonomy_ids = wp_list_pluck($terms, 'term_taxonomy_id', 'term_id');
58
  if( $return_terms = apply_filters('berocket_recount_extension_enabled', false, $terms, $taxonomy_data) ) {
59
+ if( BeRocket_AAPF::$debug_mode ) {
60
+ $taxonomy_data['error'] = 'extension_enabled';
61
+ $taxonomy_data['return_terms'] = $return_terms;
62
+ BeRocket_AAPF::$error_log['faster_recount_sql'][] = $taxonomy_data;
63
+ }
64
  return $return_terms;
65
  }
66
 
116
  } else {
117
  $terms = $terms_cache;
118
  }
119
+ if( BeRocket_AAPF::$debug_mode ) {
120
+ $taxonomy_data['query_imploded'] = $query_imploded;
121
+ $taxonomy_data['return_terms'] = $return_terms;
122
+ $taxonomy_data['result'] = $result;
123
+ BeRocket_AAPF::$error_log['faster_recount_sql'][] = $taxonomy_data;
124
+ }
125
  return $terms;
126
  }
127
  function child_include($query, $taxonomy_data, $terms) {
160
  return $query;
161
  }
162
  function date_query($query, $taxonomy_data, $terms) {
163
+ global $wpdb;
164
  extract($taxonomy_data);
165
  if( ! empty($use_filters) ) {
166
  if( ! empty($_POST['limits']) && is_array($_POST['limits']) && count($_POST['limits']) ) {
184
  return $query;
185
  }
186
  function wpml_query($query, $taxonomy_data, $terms) {
187
+ global $wpdb;
188
  extract($taxonomy_data);
189
  if( defined( 'WCML_VERSION' ) && defined('ICL_LANGUAGE_CODE') ) {
190
  $query['join']['wpml'] = " INNER JOIN {$wpdb->prefix}icl_translations as wpml_lang ON ( {$wpdb->posts}.ID = wpml_lang.element_id )";
193
  return $query;
194
  }
195
  function remove_all_berocket_tax_query($tax_query, $taxonomy = FALSE, $inside = FALSE ) {
196
+ global $wpdb;
197
  if( is_array($tax_query) ) {
198
  $md5_exist = array();
199
  foreach($tax_query as $key => $value) {
main.php CHANGED
@@ -1504,7 +1504,7 @@ jQuery(document).on('change', '.br_selected_area_show', br_selected_area_show);
1504
  }
1505
  public function update_from_older( $version ) {
1506
  $option = $this->get_option();
1507
- $version_index = 7;
1508
  if( version_compare($version, '2.0', '>') ) {
1509
  if ( version_compare($version, '2.0.4', '<') ) {
1510
  $version_index = 1;
@@ -1520,6 +1520,9 @@ jQuery(document).on('change', '.br_selected_area_show', br_selected_area_show);
1520
  $version_index = 6;
1521
  }
1522
  }
 
 
 
1523
 
1524
  if( $version_index <= 1 ) {
1525
  update_option('berocket_filter_open_wizard_on_settings', true);
@@ -1558,6 +1561,9 @@ jQuery(document).on('change', '.br_selected_area_show', br_selected_area_show);
1558
  if( $version_index <= 6 ) {
1559
  update_option( 'berocket_nn_permalink_option', $this->default_nn_permalink );
1560
  }
 
 
 
1561
 
1562
  update_option( 'br_filters_options', $option );
1563
  update_option( 'br_filters_version', BeRocket_AJAX_filters_version );
1504
  }
1505
  public function update_from_older( $version ) {
1506
  $option = $this->get_option();
1507
+ $version_index = 8;
1508
  if( version_compare($version, '2.0', '>') ) {
1509
  if ( version_compare($version, '2.0.4', '<') ) {
1510
  $version_index = 1;
1520
  $version_index = 6;
1521
  }
1522
  }
1523
+ if( version_compare($version, '1.3.4.2', '<') || (version_compare($version, '2.0', '>') && version_compare($version, '2.3.0.2', '<') ) ) {
1524
+ $version_index = 7;
1525
+ }
1526
 
1527
  if( $version_index <= 1 ) {
1528
  update_option('berocket_filter_open_wizard_on_settings', true);
1561
  if( $version_index <= 6 ) {
1562
  update_option( 'berocket_nn_permalink_option', $this->default_nn_permalink );
1563
  }
1564
+ if( $version_index <= 7 ) {
1565
+ $option['purge_cache_time'] = time();
1566
+ }
1567
 
1568
  update_option( 'br_filters_options', $option );
1569
  update_option( 'br_filters_version', BeRocket_AJAX_filters_version );
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://berocket.com/product/woocommerce-ajax-products-filter?utm_s
5
  Tags: filters, product filters, ajax product filters, ajax filter, ajax filter widget, color filter, size filter, product onsale filter, product preview, product category filter, product reset filter, product sort by filter, stock filter, product tag filter, price range filter, price box filter, advanced product filters, woocommerce filters, woocommerce product filters, woocommerce products filter, woocommerce ajax product filters, widget, plugin, woocommerce item filters, filters plugin, ajax filters plugin, filter woocommerce products, filter woocommerce products plugin, wc filters, wc filters products, wc products filters, wc ajax products filters, wc product filters, wc advanced product filters, woocommerce layered nav, woocommerce layered navigation, ajax filtered nav, ajax filtered navigation, price filter, ajax price filter, woocommerce product sorting, sidebar filter, sidebar ajax filter, taxonomy filter, category filter, attribute filter, attributes filter, woocommerce product sort, ajax products filter plugin for woocommerce, rocket, berocket, berocket woocommerce ajax products filter
6
  Requires at least: 4.0
7
  Tested up to: 5.2.3
8
- Stable tag: 1.3.4.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -184,6 +184,10 @@ You can try this plugin's admin side [here](https://berocket.com/product/woocomm
184
 
185
  == Changelog ==
186
 
 
 
 
 
187
  = 1.3.4.1 =
188
  * Fix - WordPress database prefix was incorrect for some tables
189
 
5
  Tags: filters, product filters, ajax product filters, ajax filter, ajax filter widget, color filter, size filter, product onsale filter, product preview, product category filter, product reset filter, product sort by filter, stock filter, product tag filter, price range filter, price box filter, advanced product filters, woocommerce filters, woocommerce product filters, woocommerce products filter, woocommerce ajax product filters, widget, plugin, woocommerce item filters, filters plugin, ajax filters plugin, filter woocommerce products, filter woocommerce products plugin, wc filters, wc filters products, wc products filters, wc ajax products filters, wc product filters, wc advanced product filters, woocommerce layered nav, woocommerce layered navigation, ajax filtered nav, ajax filtered navigation, price filter, ajax price filter, woocommerce product sorting, sidebar filter, sidebar ajax filter, taxonomy filter, category filter, attribute filter, attributes filter, woocommerce product sort, ajax products filter plugin for woocommerce, rocket, berocket, berocket woocommerce ajax products filter
6
  Requires at least: 4.0
7
  Tested up to: 5.2.3
8
+ Stable tag: 1.3.4.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
184
 
185
  == Changelog ==
186
 
187
+ = 1.3.4.2 =
188
+ * Fix - WPML incompatibility with new recount script
189
+ * Fix - Purge cache after update
190
+
191
  = 1.3.4.1 =
192
  * Fix - WordPress database prefix was incorrect for some tables
193
 
woocommerce-filters.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Advanced AJAX Product Filters for WooCommerce
4
  * Plugin URI: https://wordpress.org/plugins/woocommerce-ajax-filters/?utm_source=free_plugin&utm_medium=plugins&utm_campaign=ajax_filters
5
  * Description: Unlimited AJAX products filters to make your shop perfect
6
- * Version: 1.3.4.1
7
  * Author: BeRocket
8
  * Requires at least: 4.0
9
  * Author URI: https://berocket.com?utm_source=free_plugin&utm_medium=plugins&utm_campaign=ajax_filters
@@ -11,6 +11,6 @@
11
  * Domain Path: /languages/
12
  * WC tested up to: 3.7.0
13
  */
14
- define( "BeRocket_AJAX_filters_version", '1.3.4.1' );
15
  define( "BeRocket_AJAX_filters_file", __FILE__ );
16
  include_once('main.php');
3
  * Plugin Name: Advanced AJAX Product Filters for WooCommerce
4
  * Plugin URI: https://wordpress.org/plugins/woocommerce-ajax-filters/?utm_source=free_plugin&utm_medium=plugins&utm_campaign=ajax_filters
5
  * Description: Unlimited AJAX products filters to make your shop perfect
6
+ * Version: 1.3.4.2
7
  * Author: BeRocket
8
  * Requires at least: 4.0
9
  * Author URI: https://berocket.com?utm_source=free_plugin&utm_medium=plugins&utm_campaign=ajax_filters
11
  * Domain Path: /languages/
12
  * WC tested up to: 3.7.0
13
  */
14
+ define( "BeRocket_AJAX_filters_version", '1.3.4.2' );
15
  define( "BeRocket_AJAX_filters_file", __FILE__ );
16
  include_once('main.php');