Advanced AJAX Product Filters - Version 1.5.1.5

Version Description

  • Fix - Issue with some query
  • Fix - Some categories can be remove from conditions or displaying
  • Fix - Other small issues
Download this release

Release Info

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

Code changes from version 1.5.1.4 to 1.5.1.5

addons/additional_tables/add_table.php CHANGED
@@ -14,7 +14,7 @@ class BeRocket_aapf_variations_tables {
14
  $current_terms = array(0);
15
  if( is_array($terms) && count($terms) ) {
16
  foreach($terms as $term) {
17
- if( substr( $term[0], 0, 3 ) == 'pa_' ) {
18
  $current_terms[] = $term[1];
19
  }
20
  }
@@ -25,7 +25,7 @@ class BeRocket_aapf_variations_tables {
25
  $current_attributes[] = sanitize_title('attribute_' . $attr);
26
  foreach($term_ids as $term_id) {
27
  $term = get_term($term_id);
28
- if( ! empty($term) && ! is_wp_error($term) ) {
29
  $current_terms[] = $term->term_id;
30
  }
31
  }
14
  $current_terms = array(0);
15
  if( is_array($terms) && count($terms) ) {
16
  foreach($terms as $term) {
17
+ if( substr( $term[0], 0, 3 ) == 'pa_' && ! empty($term[1]) ) {
18
  $current_terms[] = $term[1];
19
  }
20
  }
25
  $current_attributes[] = sanitize_title('attribute_' . $attr);
26
  foreach($term_ids as $term_id) {
27
  $term = get_term($term_id);
28
+ if( ! empty($term) && ! is_wp_error($term) && ! empty($term->term_id) ) {
29
  $current_terms[] = $term->term_id;
30
  }
31
  }
berocket/includes/conditions.php CHANGED
@@ -334,6 +334,9 @@ if( ! class_exists('BeRocket_conditions') ) {
334
  $max_depth = $term->depth;
335
  }
336
  }
 
 
 
337
  if( is_array($array_sort) && is_array($terms) && count($array_sort) == count($terms) ) {
338
  array_multisort($array_sort, SORT_ASC, SORT_NUMERIC, $terms);
339
  }
334
  $max_depth = $term->depth;
335
  }
336
  }
337
+ if( isset($term) ) {
338
+ unset($term);
339
+ }
340
  if( is_array($array_sort) && is_array($terms) && count($array_sort) == count($terms) ) {
341
  array_multisort($array_sort, SORT_ASC, SORT_NUMERIC, $terms);
342
  }
fixes/replace_widgets.php CHANGED
@@ -106,8 +106,14 @@ if( ! empty($old_filter_widgets) && is_array($old_filter_widgets) && count($old_
106
  $sidebar_widget = $new_filter_to_old[$sidebar_widget];
107
  }
108
  }
 
 
 
109
  }
110
  }
 
 
 
111
  }
112
  update_option('sidebars_widgets', $sidebars_widgets);
113
  }
106
  $sidebar_widget = $new_filter_to_old[$sidebar_widget];
107
  }
108
  }
109
+ if( isset($sidebar_widget) ) {
110
+ unset($sidebar_widget);
111
+ }
112
  }
113
  }
114
+ if( isset($sidebar_widgets) ) {
115
+ unset($sidebar_widgets);
116
+ }
117
  }
118
  update_option('sidebars_widgets', $sidebars_widgets);
119
  }
includes/addons/price_include_tax.php CHANGED
@@ -47,6 +47,9 @@ class BeRocket_AAPF_price_use_tax {
47
  foreach($price as &$prices) {
48
  $prices = $this->$type($prices);
49
  }
 
 
 
50
  } else {
51
  $price = $this->$type($price);
52
  }
47
  foreach($price as &$prices) {
48
  $prices = $this->$type($prices);
49
  }
50
+ if( isset($prices) ) {
51
+ unset($prices);
52
+ }
53
  } else {
54
  $price = $this->$type($price);
55
  }
includes/custom_post.php CHANGED
@@ -249,6 +249,9 @@ class BeRocket_AAPF_single_filter extends BeRocket_custom_post_class {
249
  }
250
  }
251
  }
 
 
 
252
  }
253
  return array($berocket_admin_filter_types, $berocket_admin_filter_types_by_attr);
254
  }
249
  }
250
  }
251
  }
252
+ if( isset($type) ) {
253
+ unset($type);
254
+ }
255
  }
256
  return array($berocket_admin_filter_types, $berocket_admin_filter_types_by_attr);
257
  }
includes/faster_recount.php CHANGED
@@ -155,6 +155,9 @@ class BeRocket_AAPF_faster_attribute_recount {
155
  foreach($terms as &$term) {
156
  $term->count = (isset($result[$term->term_taxonomy_id]) ? $result[$term->term_taxonomy_id] : 0);
157
  }
 
 
 
158
  $terms = apply_filters('berocket_terms_after_recount', $terms, $query, $result);
159
  if( apply_filters('berocket_recount_cache_use', (! $use_filters), $taxonomy_data) ) {
160
  br_set_cache(md5(json_encode($query_imploded)), $terms, 'berocket_recount', DAY_IN_SECONDS);
155
  foreach($terms as &$term) {
156
  $term->count = (isset($result[$term->term_taxonomy_id]) ? $result[$term->term_taxonomy_id] : 0);
157
  }
158
+ if( isset($term) ) {
159
+ unset($term);
160
+ }
161
  $terms = apply_filters('berocket_terms_after_recount', $terms, $query, $result);
162
  if( apply_filters('berocket_recount_cache_use', (! $use_filters), $taxonomy_data) ) {
163
  br_set_cache(md5(json_encode($query_imploded)), $terms, 'berocket_recount', DAY_IN_SECONDS);
includes/filters/display_widget.php CHANGED
@@ -495,6 +495,9 @@ class BeRocket_AAPF_Widget {
495
  $term->name = $rating_names[$term->slug];
496
  }
497
  }
 
 
 
498
  }
499
  }
500
  $terms = apply_filters('berocket_aapf_widget_include_exclude_items', $terms, $instance, $get_terms_args, $get_terms_advanced, $set_query_var_title);
495
  $term->name = $rating_names[$term->slug];
496
  }
497
  }
498
+ if( isset($term) ) {
499
+ unset($term);
500
+ }
501
  }
502
  }
503
  $terms = apply_filters('berocket_aapf_widget_include_exclude_items', $terms, $instance, $get_terms_args, $get_terms_advanced, $set_query_var_title);
includes/filters/dynamic_data_template.php CHANGED
@@ -402,6 +402,9 @@ class BeRocket_AAPF_dynamic_data_template {
402
  $element['content']['child']['content'] = $this->hierarhical_add_open_close_button($element['content']['child']['content']);
403
  }
404
  }
 
 
 
405
  return $elements;
406
  }
407
  function values_per_row($template_content, $terms, $berocket_query_var_title) {
402
  $element['content']['child']['content'] = $this->hierarhical_add_open_close_button($element['content']['child']['content']);
403
  }
404
  }
405
+ if( isset($element) ) {
406
+ unset($element);
407
+ }
408
  return $elements;
409
  }
410
  function values_per_row($template_content, $terms, $berocket_query_var_title) {
includes/filters/get_terms.php CHANGED
@@ -144,9 +144,15 @@ class BeRocket_AAPF_get_terms {
144
  foreach($array_sort as $term_id => &$sort_number) {
145
  $sort_number = (isset($array_new_sort[$term_id]) ? $array_new_sort[$term_id] : 999999999);
146
  }
 
 
 
147
  foreach($terms as &$term) {
148
  $term->depth = (isset($terms_sorted[$term->term_id]) ? $terms_sorted[$term->term_id] : 0);
149
  }
 
 
 
150
  if( is_array($array_sort) && is_array($terms) && count($array_sort) == count($terms) ) {
151
  array_multisort($array_sort, SORT_ASC, SORT_NUMERIC, $terms);
152
  } else {
144
  foreach($array_sort as $term_id => &$sort_number) {
145
  $sort_number = (isset($array_new_sort[$term_id]) ? $array_new_sort[$term_id] : 999999999);
146
  }
147
+ if( isset($sort_number) ) {
148
+ unset($sort_number);
149
+ }
150
  foreach($terms as &$term) {
151
  $term->depth = (isset($terms_sorted[$term->term_id]) ? $terms_sorted[$term->term_id] : 0);
152
  }
153
+ if( isset($term) ) {
154
+ unset($term);
155
+ }
156
  if( is_array($array_sort) && is_array($terms) && count($array_sort) == count($terms) ) {
157
  array_multisort($array_sort, SORT_ASC, SORT_NUMERIC, $terms);
158
  } else {
includes/filters/get_terms_additional.php CHANGED
@@ -12,6 +12,9 @@ class BeRocket_AAPF_get_terms_additionals {
12
  foreach($terms as &$term) {
13
  $term->value = ( empty($options['slug_urls']) ? $term->term_id : $term->slug );
14
  }
 
 
 
15
  }
16
  return $terms;
17
  }
12
  foreach($terms as &$term) {
13
  $term->value = ( empty($options['slug_urls']) ? $term->term_id : $term->slug );
14
  }
15
+ if( isset($term) ) {
16
+ unset($term);
17
+ }
18
  }
19
  return $terms;
20
  }
includes/functions.php CHANGED
@@ -2480,6 +2480,9 @@ if( ! function_exists('br_get_taxonomy_hierarchy') ) {
2480
  }
2481
  }
2482
  }
 
 
 
2483
  }
2484
  return $terms;
2485
  }
2480
  }
2481
  }
2482
  }
2483
+ if( isset($term) ) {
2484
+ unset($term);
2485
+ }
2486
  }
2487
  return $terms;
2488
  }
includes/widget_functions.php CHANGED
@@ -152,10 +152,16 @@ class BeRocket_AAPF_Widget_functions {
152
  $subterm->PID = '';
153
  }
154
  }
 
 
 
155
  }
156
 
157
  }
158
  }
 
 
 
159
  return $terms;
160
  }
161
 
@@ -435,11 +441,17 @@ class BeRocket_AAPF_Widget_functions {
435
  $attributesname = array();
436
  }
437
  }
 
 
 
438
  foreach($_RESPONSE['attributes'] as &$attributes) {
439
  if( ! is_array($attributes) ) {
440
  $attributes = array();
441
  }
442
  }
 
 
 
443
  echo json_encode( $_RESPONSE );
444
  if ( $br_options['alternative_load_type'] == 'js' ) echo '||JSON||';
445
 
152
  $subterm->PID = '';
153
  }
154
  }
155
+ if( isset($subterm) ) {
156
+ unset($subterm);
157
+ }
158
  }
159
 
160
  }
161
  }
162
+ if( isset($term) ) {
163
+ unset($term);
164
+ }
165
  return $terms;
166
  }
167
 
441
  $attributesname = array();
442
  }
443
  }
444
+ if( isset($attributesname) ) {
445
+ unset($attributesname);
446
+ }
447
  foreach($_RESPONSE['attributes'] as &$attributes) {
448
  if( ! is_array($attributes) ) {
449
  $attributes = array();
450
  }
451
  }
452
+ if( isset($attributes) ) {
453
+ unset($attributes);
454
+ }
455
  echo json_encode( $_RESPONSE );
456
  if ( $br_options['alternative_load_type'] == 'js' ) echo '||JSON||';
457
 
main.php CHANGED
@@ -1474,6 +1474,9 @@ jQuery(document).on('change', '.berocket_disable_ajax_loading', berocket_disable
1474
  }
1475
  }
1476
  }
 
 
 
1477
  }
1478
  return $terms;
1479
  }
@@ -1727,6 +1730,9 @@ jQuery(document).on('change', '.berocket_disable_ajax_loading', berocket_disable
1727
  $new_filter_widget['title'] = '';
1728
  }
1729
  }
 
 
 
1730
  update_option('widget_berocket_aapf_group', $new_filter_widgets);
1731
  }
1732
  }
@@ -1934,6 +1940,9 @@ jQuery(document).on('change', '.berocket_disable_ajax_loading', berocket_disable
1934
  foreach($terms as &$term) {
1935
  $term = get_term_by( 'slug', $term, 'pa_'.$atts['attribute']);
1936
  }
 
 
 
1937
  } else {
1938
  $terms = get_terms( array(
1939
  'taxonomy' => 'pa_'.$atts['attribute'],
@@ -3008,6 +3017,9 @@ jQuery(document).on('change', '.berocket_disable_ajax_loading', berocket_disable
3008
  unset($style['this']);
3009
  }
3010
  }
 
 
 
3011
  }
3012
  update_option('BeRocket_AAPF_getall_Template_Styles', $styles);
3013
  }
1474
  }
1475
  }
1476
  }
1477
+ if( isset($term) ) {
1478
+ unset($term);
1479
+ }
1480
  }
1481
  return $terms;
1482
  }
1730
  $new_filter_widget['title'] = '';
1731
  }
1732
  }
1733
+ if( isset($new_filter_widget) ) {
1734
+ unset($new_filter_widget);
1735
+ }
1736
  update_option('widget_berocket_aapf_group', $new_filter_widgets);
1737
  }
1738
  }
1940
  foreach($terms as &$term) {
1941
  $term = get_term_by( 'slug', $term, 'pa_'.$atts['attribute']);
1942
  }
1943
+ if( isset($term) ) {
1944
+ unset($term);
1945
+ }
1946
  } else {
1947
  $terms = get_terms( array(
1948
  'taxonomy' => 'pa_'.$atts['attribute'],
3017
  unset($style['this']);
3018
  }
3019
  }
3020
+ if( isset($style) ) {
3021
+ unset($style);
3022
+ }
3023
  }
3024
  update_option('BeRocket_AAPF_getall_Template_Styles', $styles);
3025
  }
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: 5.0
7
  Tested up to: 5.5
8
- Stable tag: 1.5.1.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -185,6 +185,11 @@ You can try this plugin's admin side [here](https://berocket.com/product/woocomm
185
 
186
  == Changelog ==
187
 
 
 
 
 
 
188
  = 1.5.1.4 =
189
  * Fix - Image upload issue
190
  * Fix - Multiple filters with "Select" style for same taxonomy
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: 5.0
7
  Tested up to: 5.5
8
+ Stable tag: 1.5.1.5
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
185
 
186
  == Changelog ==
187
 
188
+ = 1.5.1.5 =
189
+ * Fix - Issue with some query
190
+ * Fix - Some categories can be remove from conditions or displaying
191
+ * Fix - Other small issues
192
+
193
  = 1.5.1.4 =
194
  * Fix - Image upload issue
195
  * Fix - Multiple filters with "Select" style for same taxonomy
templates/disabled/slider.php CHANGED
@@ -53,6 +53,9 @@ if( !$is_child_parent || count( $all_terms_name ) > 0 ) {
53
  foreach($all_terms_slug as &$all_term_slug) {
54
  $all_term_slug = str_replace("'", ''', $all_term_slug);
55
  }
 
 
 
56
  }
57
  ?>
58
  <li class='<?php echo berocket_isset($main_class) ?>'>
53
  foreach($all_terms_slug as &$all_term_slug) {
54
  $all_term_slug = str_replace("'", '&#39;', $all_term_slug);
55
  }
56
+ if( isset($all_term_slug) ) {
57
+ unset($all_term_slug);
58
+ }
59
  }
60
  ?>
61
  <li class='<?php echo berocket_isset($main_class) ?>'>
templates/old_templates/slider.php CHANGED
@@ -52,6 +52,9 @@ if( !$is_child_parent || count( $all_terms_name ) > 0 ) {
52
  foreach($all_terms_slug as &$all_term_slug) {
53
  $all_term_slug = str_replace("'", '&#39;', $all_term_slug);
54
  }
 
 
 
55
  }
56
  ?>
57
  <li class='<?php echo berocket_isset($main_class) ?>'>
52
  foreach($all_terms_slug as &$all_term_slug) {
53
  $all_term_slug = str_replace("'", '&#39;', $all_term_slug);
54
  }
55
+ if( isset($all_term_slug) ) {
56
+ unset($all_term_slug);
57
+ }
58
  }
59
  ?>
60
  <li class='<?php echo berocket_isset($main_class) ?>'>
templates/single_filter/single_settings_elements.php CHANGED
@@ -65,6 +65,9 @@ if( ! class_exists('braapf_single_filter_edit_elements') ) {
65
  'hierarchical' => empty($attr_taxonomy->hierarchical) ? 0 : 1
66
  );
67
  }
 
 
 
68
  $attribute = br_get_value_from_array($braapf_filter_settings, 'attribute', '');
69
  echo '<div class="braapf_attribute braapf_half_select_full">';
70
  echo '<label for="braapf_attribute">' . __('Attribute', 'BeRocket_AJAX_domain') . '</label>';
@@ -692,6 +695,9 @@ if( ! class_exists('braapf_single_filter_edit_elements') ) {
692
  }
693
  }
694
  }
 
 
 
695
  return $filter_type_array;
696
  }
697
  static function get_all_style_template_data() {
65
  'hierarchical' => empty($attr_taxonomy->hierarchical) ? 0 : 1
66
  );
67
  }
68
+ if( isset($attribute_list) ) {
69
+ unset($attribute_list);
70
+ }
71
  $attribute = br_get_value_from_array($braapf_filter_settings, 'attribute', '');
72
  echo '<div class="braapf_attribute braapf_half_select_full">';
73
  echo '<label for="braapf_attribute">' . __('Attribute', 'BeRocket_AJAX_domain') . '</label>';
695
  }
696
  }
697
  }
698
+ if( isset($filter_type) ) {
699
+ unset($filter_type);
700
+ }
701
  return $filter_type_array;
702
  }
703
  static function get_all_style_template_data() {
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.5.1.4
7
  * Author: BeRocket
8
  * Requires at least: 5.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: 4.5.1
13
  */
14
- define( "BeRocket_AJAX_filters_version", '1.5.1.4' );
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.5.1.5
7
  * Author: BeRocket
8
  * Requires at least: 5.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: 4.5.1
13
  */
14
+ define( "BeRocket_AJAX_filters_version", '1.5.1.5' );
15
  define( "BeRocket_AJAX_filters_file", __FILE__ );
16
  include_once('main.php');