Advanced AJAX Product Filters - Version 1.5.3

Version Description

  • Fix - SECURITY ISSUE! Sanitize HTML tags for all settings. Custom JavaScript can be changed only by admin(Super admin for multisite).
  • Enhancement - New hook to change additional table generation products per call
  • Enhancement - Copy filter/group from other do not required
  • Fix - Price filter query issue with some plugins/themes
  • Fix - Remove "Limit filter values by products from the selected category" option from filter edit page
Download this release

Release Info

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

Code changes from version 1.5.2.11 to 1.5.3

addons/add_classes/classes.php CHANGED
@@ -13,6 +13,7 @@ class BeRocket_aapf_add_classes_filters {
13
  $element['attributes']['class']['term_tax'] = 'bapf_tax_'.$term->taxonomy;
14
  $element['attributes']['class']['term_slug'] = 'bapf_term_'.$term->slug;
15
  $element['attributes']['class']['term_id'] = 'bapf_term_'.$term->term_id;
 
16
  $element['attributes']['class']['term_parent'] = 'bapf_parent_'.(property_exists($term, 'parent') ? $term->parent : '0');
17
  return $element;
18
  }
13
  $element['attributes']['class']['term_tax'] = 'bapf_tax_'.$term->taxonomy;
14
  $element['attributes']['class']['term_slug'] = 'bapf_term_'.$term->slug;
15
  $element['attributes']['class']['term_id'] = 'bapf_term_'.$term->term_id;
16
+ $element['attributes']['class']['term_count'] = 'bapf_count_'.$term->count;
17
  $element['attributes']['class']['term_parent'] = 'bapf_parent_'.(property_exists($term, 'parent') ? $term->parent : '0');
18
  return $element;
19
  }
addons/additional_tables/additional_tables.php CHANGED
@@ -330,7 +330,7 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
330
  $start_id = intval($run_data['start_id']);
331
  $min_id = intval($run_data['min_id']);
332
  $max_id = intval($run_data['max_id']);
333
- $end_id = $start_id + 5000;
334
  BeRocket_error_notices::add_plugin_error(1, 'insert_table_braapf_product_stock_status_parent', array(
335
  'start_id' => $start_id,
336
  'end_id' => $end_id,
@@ -432,7 +432,7 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
432
  $start_id = intval($run_data['start_id']);
433
  $min_id = intval($run_data['min_id']);
434
  $max_id = intval($run_data['max_id']);
435
- $end_id = $start_id + 10000;
436
  global $wpdb;
437
  $table_name = $wpdb->prefix . 'braapf_product_variation_attributes';
438
  $charset_collate = $wpdb->get_charset_collate();
330
  $start_id = intval($run_data['start_id']);
331
  $min_id = intval($run_data['min_id']);
332
  $max_id = intval($run_data['max_id']);
333
+ $end_id = $start_id + apply_filters('berocket_insert_table_braapf_product_stock_status_parent_end', 5000);
334
  BeRocket_error_notices::add_plugin_error(1, 'insert_table_braapf_product_stock_status_parent', array(
335
  'start_id' => $start_id,
336
  'end_id' => $end_id,
432
  $start_id = intval($run_data['start_id']);
433
  $min_id = intval($run_data['min_id']);
434
  $max_id = intval($run_data['max_id']);
435
+ $end_id = $start_id + apply_filters('berocket_insert_table_braapf_product_variation_attributes_end', 10000);
436
  global $wpdb;
437
  $table_name = $wpdb->prefix . 'braapf_product_variation_attributes';
438
  $charset_collate = $wpdb->get_charset_collate();
assets/admin/css/admin.css CHANGED
@@ -607,6 +607,9 @@ td.br_colorpicker_field.colorpicker_removed:after {
607
  padding: 5px 12px 1px;
608
  margin-top: 8px;
609
  }
 
 
 
610
  #poststuff #conditions .inside {
611
  padding-bottom: 6px;
612
  }
607
  padding: 5px 12px 1px;
608
  margin-top: 8px;
609
  }
610
+ #conditions .section_conditions_hide_this_on label {
611
+ display: inline-block;
612
+ }
613
  #poststuff #conditions .inside {
614
  padding-bottom: 6px;
615
  }
assets/admin/js/admin.js CHANGED
@@ -932,7 +932,8 @@ function berocket_semple_creation_group_return($this, data) {
932
  jQuery(this).parents('li').first().remove();
933
  });
934
  jQuery('#post').on('submit', function(e) {
935
- if( jQuery('.berocket_add_filter_to_group').length && jQuery('.berocket_filter_added_list input[name="br_filters_group[filters][]"]').length == 0 ) {
 
936
  e.preventDefault();
937
  jQuery(document).trigger('braapf_group_required_filters');
938
  }
932
  jQuery(this).parents('li').first().remove();
933
  });
934
  jQuery('#post').on('submit', function(e) {
935
+ var copy_val = $('[name="berocket_copy_from_custom_post"]').val();
936
+ if( ! copy_val && jQuery('.berocket_add_filter_to_group').length && jQuery('.berocket_filter_added_list input[name="br_filters_group[filters][]"]').length == 0 ) {
937
  e.preventDefault();
938
  jQuery(document).trigger('braapf_group_required_filters');
939
  }
assets/admin/js/single_filter_edit.js CHANGED
@@ -345,12 +345,15 @@ braapf_checked_style_parent;
345
  $('#braapf_single_selection').data('was_select', braapf_current_template() == 'select');
346
 
347
  $('#post').on('submit', function(event) {
348
- if($('.braapf_widget_type input[type=radio]:enabled:checked').length == 0) {
349
- $(document).trigger('braapf_error_select_widget_type');
350
- event.preventDefault();
351
- } else if($('.braapf_style input[name="br_product_filter[style]"]:enabled:checked').length == 0) {
352
- $(document).trigger('braapf_error_select_style');
353
- event.preventDefault();
 
 
 
354
  }
355
  });
356
  $(window).on('scroll', function() {
345
  $('#braapf_single_selection').data('was_select', braapf_current_template() == 'select');
346
 
347
  $('#post').on('submit', function(event) {
348
+ var copy_val = $('[name="berocket_copy_from_custom_post"]').val();
349
+ if( ! copy_val ) {
350
+ if($('.braapf_widget_type input[type=radio]:enabled:checked').length == 0) {
351
+ $(document).trigger('braapf_error_select_widget_type');
352
+ event.preventDefault();
353
+ } else if($('.braapf_style input[name="br_product_filter[style]"]:enabled:checked').length == 0) {
354
+ $(document).trigger('braapf_error_select_style');
355
+ event.preventDefault();
356
+ }
357
  }
358
  });
359
  $(window).on('scroll', function() {
berocket/framework.php CHANGED
@@ -35,10 +35,12 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
35
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
36
  load_plugin_textdomain('BeRocket_domain', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/');
37
  class BeRocket_Framework {
38
- public static $framework_version = '2.6.0.6';
 
39
  public static $settings_name = '';
40
  public $addons;
41
  public $libraries;
 
42
  private $post;
43
  private $cc;
44
  protected static $instance;
@@ -122,6 +124,15 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
122
  }
123
  $this->libraries = new BeRocket_framework_libraries($this->active_libraries, $this->info, $this->values, $this->get_option());
124
  add_filter('BeRocket_admin_init_user_capabilities', array($this, 'init_user_capabilities'));
 
 
 
 
 
 
 
 
 
125
  }
126
  do_action($this->info[ 'plugin_name' ].'_framework_construct', $this->cc);
127
  add_filter('brfr_get_plugin_version_capability_'.$this->cc->info['plugin_name'], array($this, 'get_plugin_version_capability'));
@@ -155,7 +166,8 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
155
 
156
  public function plugins_loaded() {
157
  if( ! empty($_POST[ $this->cc->values[ 'settings_name' ] ]) ) {
158
- $this->post = berocket_sanitize_array($_POST[ $this->cc->values[ 'settings_name' ] ]);
 
159
  }
160
  }
161
 
@@ -386,7 +398,8 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
386
  */
387
  public function set_styles() {
388
  $options = $this->get_option();
389
- $custom_css = berocket_sanitize_array($options[ 'custom_css' ]);
 
390
  echo '<style>' . $custom_css . '</style>';
391
  }
392
  public function set_scripts() {
@@ -655,6 +668,8 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
655
 
656
  if ( isset($tab_content) and is_array($tab_content) and count( $tab_content ) ) {
657
  foreach ( $tab_content as $item ) {
 
 
658
  $class = $extra = '';
659
 
660
  if ( isset($item['class']) && trim( $item['class'] ) ) {
@@ -973,8 +988,9 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
973
  * @return mixed
974
  */
975
  public function sanitize_option( $input ) {
 
976
  $new_input = $this->recursive_array_set( $this->cc->defaults, $input );
977
- $new_input = berocket_sanitize_array($new_input);
978
  wp_cache_delete( $this->cc->values[ 'settings_name' ], 'berocket_framework_option' );
979
  return apply_filters('brfr_sanitize_option_' . $this->cc->info[ 'plugin_name' ], $new_input, $input, $this->cc->defaults);
980
  }
@@ -1112,6 +1128,86 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
1112
  $user_caps[] = $this->option_page_capability();
1113
  return $user_caps;
1114
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1115
  }
1116
  add_action('admin_init', 'BeRocket_admin_init_user_capabilities');
1117
  function BeRocket_admin_init_user_capabilities() {
35
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
36
  load_plugin_textdomain('BeRocket_domain', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/');
37
  class BeRocket_Framework {
38
+ public static $framework_version = '2.7';
39
+ public $plugin_framework_version = '2.7';
40
  public static $settings_name = '';
41
  public $addons;
42
  public $libraries;
43
+ protected $disable_settings_for_admin = array();
44
  private $post;
45
  private $cc;
46
  protected static $instance;
124
  }
125
  $this->libraries = new BeRocket_framework_libraries($this->active_libraries, $this->info, $this->values, $this->get_option());
126
  add_filter('BeRocket_admin_init_user_capabilities', array($this, 'init_user_capabilities'));
127
+ add_filter('berocket_sanitize_array_predefine', array($this, 'sanitize_array_predefine'), 10, 4);
128
+ add_filter('berocket_sanitize_array_kses', array($this, 'sanitize_array_kses'), 10, 4);
129
+ add_filter('brfr_menu_item_remove_'.$this->info['plugin_name'], array($this, 'menu_item_remove'), 10, 3);
130
+ //CHECK OLD FRAMEWORK
131
+ add_filter('berocket_sanitize_array_kses', array($this, 'disable_for_old_plugins'), 10, 4);
132
+ $framework_version_current = self::$framework_version;
133
+ $framework_version = $framework_version_current;
134
+ include($this->info['plugin_dir']."/berocket/framework_version.php");
135
+ $this->plugin_framework_version = $framework_version_current;
136
  }
137
  do_action($this->info[ 'plugin_name' ].'_framework_construct', $this->cc);
138
  add_filter('brfr_get_plugin_version_capability_'.$this->cc->info['plugin_name'], array($this, 'get_plugin_version_capability'));
166
 
167
  public function plugins_loaded() {
168
  if( ! empty($_POST[ $this->cc->values[ 'settings_name' ] ]) ) {
169
+ $previous_options = $this->get_option();
170
+ $this->post = berocket_sanitize_array($_POST[ $this->cc->values[ 'settings_name' ] ], array($this->cc->values[ 'settings_name' ]), $previous_options);
171
  }
172
  }
173
 
398
  */
399
  public function set_styles() {
400
  $options = $this->get_option();
401
+ $previous_options = $this->get_option();
402
+ $custom_css = berocket_sanitize_array($options[ 'custom_css' ], array($this->cc->values[ 'settings_name' ]), $previous_options);
403
  echo '<style>' . $custom_css . '</style>';
404
  }
405
  public function set_scripts() {
668
 
669
  if ( isset($tab_content) and is_array($tab_content) and count( $tab_content ) ) {
670
  foreach ( $tab_content as $item ) {
671
+ $item = apply_filters('brfr_menu_item_remove_'.$this->info['plugin_name'], $item, $tab_name, $tab_content);
672
+ if( empty($item) ) continue;
673
  $class = $extra = '';
674
 
675
  if ( isset($item['class']) && trim( $item['class'] ) ) {
988
  * @return mixed
989
  */
990
  public function sanitize_option( $input ) {
991
+ $previous_options = $this->get_option();
992
  $new_input = $this->recursive_array_set( $this->cc->defaults, $input );
993
+ $new_input = berocket_sanitize_array($new_input, array($this->cc->values[ 'settings_name' ]), $previous_options);
994
  wp_cache_delete( $this->cc->values[ 'settings_name' ], 'berocket_framework_option' );
995
  return apply_filters('brfr_sanitize_option_' . $this->cc->info[ 'plugin_name' ], $new_input, $input, $this->cc->defaults);
996
  }
1128
  $user_caps[] = $this->option_page_capability();
1129
  return $user_caps;
1130
  }
1131
+ //disable fields for not admin
1132
+ function sanitize_array_predefine($value, $array, $option_name, $previous_settings) {
1133
+ if( ! is_super_admin() && $this->search_disabled_settings($option_name) ) {
1134
+ array_shift($option_name);
1135
+ $value = br_get_value_from_array($previous_settings, $option_name);
1136
+ }
1137
+ return $value;
1138
+ }
1139
+ function sanitize_array_kses($apply, $array, $option_name, $previous_settings) {
1140
+ if( is_super_admin() && $this->search_disabled_settings($option_name) ) {
1141
+ $apply = false;
1142
+ }
1143
+ return $apply;
1144
+ }
1145
+ function menu_item_remove($item, $tab_name, $tab_content) {
1146
+ if ( is_array($item) && ( empty($item['section']) or $item['section'] == 'field' ) ) {
1147
+ $field_items = array();
1148
+ $single = false;
1149
+ if( isset($item['items']) && is_array($item['items']) ) {
1150
+ $field_items = $item['items'];
1151
+ } else {
1152
+ $field_items[] = $item;
1153
+ $single = true;
1154
+ }
1155
+ $new_field_name = array();
1156
+ foreach($field_items as $field_name => $field_item) {
1157
+ $option_name = $field_item['name'];
1158
+ if( ! is_array($option_name) ) {
1159
+ $option_name = array($option_name);
1160
+ }
1161
+ array_unshift($option_name, $this->values[ 'settings_name' ]);
1162
+ if( ! is_super_admin() && $this->search_disabled_settings($option_name) ) {
1163
+ $field_item['disabled'] = true;
1164
+ $field_item['admin_disabled'] = true;
1165
+ }
1166
+ $new_field_name[$field_name] = $field_item;
1167
+
1168
+ }
1169
+ if( count($new_field_name) > 0 ) {
1170
+ if( $single ) {
1171
+ $item = array_pop($new_field_name);
1172
+ } else {
1173
+ $item['items'] = $new_field_name;
1174
+ }
1175
+ } else {
1176
+ $item = false;
1177
+ }
1178
+ } elseif( ! empty($item['name']) ) {
1179
+ $option_name = $item['name'];
1180
+ if( ! is_array($option_name) ) {
1181
+ $option_name = array($option_name);
1182
+ }
1183
+ array_unshift($option_name, $this->values[ 'settings_name' ]);
1184
+ if( ! is_super_admin() &&$this->search_disabled_settings($option_name) ) {
1185
+ $item = false;
1186
+ }
1187
+ }
1188
+ return $item;
1189
+ }
1190
+ function search_disabled_settings($option_name) {
1191
+ $disable = false;
1192
+ if( is_array($this->disable_settings_for_admin) && count($this->disable_settings_for_admin) > 0 ) {
1193
+ foreach($this->disable_settings_for_admin as $search_option_name) {
1194
+ array_unshift($search_option_name, $this->values[ 'settings_name' ]);
1195
+ if(berocket_check_array_same($option_name, $search_option_name) ) {
1196
+ $disable = true;
1197
+ }
1198
+ }
1199
+ }
1200
+ return $disable;
1201
+ }
1202
+ function disable_for_old_plugins($apply, $array, $option_name, $previous_settings) {
1203
+ if( is_array($option_name) && count($option_name) > 0 ) {
1204
+ $base_name = array_shift($option_name);
1205
+ if( $base_name === $this->values[ 'settings_name' ] && version_compare($this->plugin_framework_version, '2.7', '<') ) {
1206
+ $apply = false;
1207
+ }
1208
+ }
1209
+ return $apply;
1210
+ }
1211
  }
1212
  add_action('admin_init', 'BeRocket_admin_init_user_capabilities');
1213
  function BeRocket_admin_init_user_capabilities() {
berocket/framework_version.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $framework_version_current = '2.6.0.6';
3
  if( version_compare($framework_version_current, $framework_version, '>') ) {
4
  $framework_version = $framework_version_current;
5
  $framework_dir = __DIR__;
1
  <?php
2
+ $framework_version_current = '2.7';
3
  if( version_compare($framework_version_current, $framework_version, '>') ) {
4
  $framework_version = $framework_version_current;
5
  $framework_dir = __DIR__;
berocket/includes/admin_notices.php CHANGED
@@ -1100,7 +1100,7 @@ if( ! class_exists( 'berocket_admin_notices_rate_stars' ) ) {
1100
  'title' => 'WooCommerce Advanced Product Labels',
1101
  'desc' => "Capture client's attention on needed products. Create labels easily and quickly",
1102
  'desc_top' => 'Capture client\'s attention on needed products. Create labels easily and quickly for only ${price}!',
1103
- 'url' => 'https://berocket.com/product/woocommerce-advanced-product-labels',
1104
  'bg' => '#f2f2f2'
1105
  ),
1106
  array(
1100
  'title' => 'WooCommerce Advanced Product Labels',
1101
  'desc' => "Capture client's attention on needed products. Create labels easily and quickly",
1102
  'desc_top' => 'Capture client\'s attention on needed products. Create labels easily and quickly for only ${price}!',
1103
+ 'url' => 'https://berocket.com/l/labels-upgrade',
1104
  'bg' => '#f2f2f2'
1105
  ),
1106
  array(
berocket/includes/custom_post.php CHANGED
@@ -327,7 +327,8 @@ if ( ! class_exists('BeRocket_custom_post_class') ) {
327
  public function wc_save_product_without_check( $post_id, $post ) {
328
  do_action( 'berocket_custom_post_'.$this->post_name.'_wc_save_product_without_check_before', $post_id, $post, $this->post_type_parameters);
329
  if ( isset( $_POST[$this->post_name] ) ) {
330
- $post_data = berocket_sanitize_array($_POST[$this->post_name]);
 
331
 
332
  if( is_array($post_data) ) {
333
  $settings = BeRocket_Framework::recursive_array_set($this->default_settings, $post_data);
327
  public function wc_save_product_without_check( $post_id, $post ) {
328
  do_action( 'berocket_custom_post_'.$this->post_name.'_wc_save_product_without_check_before', $post_id, $post, $this->post_type_parameters);
329
  if ( isset( $_POST[$this->post_name] ) ) {
330
+ $previous_options = $this->get_option($post_id);
331
+ $post_data = berocket_sanitize_array($_POST[$this->post_name], array($this->post_name), $previous_options);
332
 
333
  if( is_array($post_data) ) {
334
  $settings = BeRocket_Framework::recursive_array_set($this->default_settings, $post_data);
berocket/includes/functions.php CHANGED
@@ -474,50 +474,85 @@ if( ! function_exists( 'berocket_isset' ) ){
474
  }
475
  }
476
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
477
  if( ! function_exists( 'berocket_sanitize_array' ) ){
478
- function berocket_sanitize_array( $array ) {
479
  if ( is_object( $array ) ) $array = (array) $array; // wp_check_invalid_utf8 is not working with objects
480
 
481
  if ( is_array( $array ) ) {
482
- $array = array_map('berocket_sanitize_array', $array);
 
 
 
 
 
 
 
483
  } else {
484
- $filtered = wp_check_invalid_utf8( $array );
485
-
486
- // Remove any attribute starting with "on" or xmlns
487
- $filtered = preg_replace('#(<[^>]+?[\x00-\x20"\'])(?:on|xmlns)[^>]*+>#iu', '$1>', $filtered);
 
 
 
 
 
 
 
 
 
 
 
 
 
488
 
489
- // Remove javascript: and vbscript: protocols
490
- $filtered = preg_replace('#([a-z]*)[\x00-\x20]*=[\x00-\x20]*([`\'"]*)[\x00-\x20]*j[\x00-\x20]*a[\x00-\x20]*v[\x00-\x20]*a[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iu', '$1=$2nojavascript...', $filtered);
491
- $filtered = preg_replace('#([a-z]*)[\x00-\x20]*=([\'"]*)[\x00-\x20]*v[\x00-\x20]*b[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iu', '$1=$2novbscript...', $filtered);
492
- $filtered = preg_replace('#([a-z]*)[\x00-\x20]*=([\'"]*)[\x00-\x20]*-moz-binding[\x00-\x20]*:#u', '$1=$2nomozbinding...', $filtered);
493
 
494
- // Only works in IE: <span style="width: expression(alert('Ping!'));"></span>
495
- $filtered = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?expression[\x00-\x20]*\([^>]*+>#i', '$1>', $filtered);
496
- $filtered = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?behaviour[\x00-\x20]*\([^>]*+>#i', '$1>', $filtered);
497
- $filtered = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:*[^>]*+>#iu', '$1>', $filtered);
498
 
499
- // Remove namespaced elements (we do not need them)
500
- $data = preg_replace('#</*\w+:\w[^>]*+>#i', '', $filtered);
 
 
501
 
502
- do
503
- {
504
- // Remove really unwanted tags
505
- $old_data = $filtered;
506
- $filtered = preg_replace('#</*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|i(?:frame|layer)|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|title|xml)[^>]*+>#i', '', $filtered);
507
- }
508
- while ($old_data !== $filtered);
509
 
510
- $filtered = str_replace('fromCharCode', '', $filtered);
511
 
512
- $found = false;
513
- while ( preg_match('/%[a-f0-9]{2}/i', $filtered, $match) ) {
514
- $filtered = str_replace($match[0], '', $filtered);
515
- $found = true;
516
- }
517
 
518
- if ( $found ) {
519
- // Strip out the whitespace that may now exist after removing the octets.
520
- $filtered = preg_replace('/ +/', ' ', $filtered);
 
521
  }
522
  $array = $filtered;
523
  }
474
  }
475
  }
476
  }
477
+ if( ! function_exists( 'berocket_check_array_same' ) ) {
478
+ function berocket_check_array_same($array1, $array2) {
479
+ $same = false;
480
+ if( is_array($array1) && is_array($array2) && count($array1) == count($array2) ) {
481
+ $same = true;
482
+ $array1_keys = array_keys($array1);
483
+ $array2_keys = array_keys($array2);
484
+ $array1_vals = array_values($array1);
485
+ $array2_vals = array_values($array2);
486
+ for($i = 0; $i < count($array1_keys); $i++) {
487
+ if( $array1_keys[$i] !== $array2_keys[$i] || $array1_vals[$i] !== $array2_vals[$i] ) {
488
+ $same = false;
489
+ break;
490
+ }
491
+ }
492
+ }
493
+ return $same;
494
+ }
495
+ }
496
  if( ! function_exists( 'berocket_sanitize_array' ) ){
497
+ function berocket_sanitize_array( $array, $option_name = array(), $previous_settings = array() ) {
498
  if ( is_object( $array ) ) $array = (array) $array; // wp_check_invalid_utf8 is not working with objects
499
 
500
  if ( is_array( $array ) ) {
501
+ foreach($array as $arr_key => &$arr_val) {
502
+ $new_option_name = array();
503
+ if( count($option_name) > 0 ) {
504
+ $new_option_name = $option_name;
505
+ $new_option_name[] = $arr_key;
506
+ }
507
+ $arr_val = berocket_sanitize_array($arr_val, $new_option_name, $previous_settings);
508
+ }
509
  } else {
510
+ $filtered = apply_filters('berocket_sanitize_array_predefine', null, $array, $option_name, $previous_settings);
511
+ if( $filtered === null ) {
512
+ $filtered = wp_check_invalid_utf8( $array );
513
+
514
+ if( apply_filters('berocket_sanitize_array_kses', true, $array, $option_name, $previous_settings) ) {
515
+ $allowed_html = wp_kses_allowed_html();
516
+ $allowed_html['br'] = array();
517
+ $filtered = wp_kses( $filtered, $allowed_html );
518
+ } else {
519
+ do
520
+ {
521
+ // Remove really unwanted tags
522
+ $old_data = $filtered;
523
+ $filtered = preg_replace('#</*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|i(?:frame|layer)|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|title|xml)[^>]*+>#i', '', $filtered);
524
+ }
525
+ while ($old_data !== $filtered);
526
+ }
527
 
528
+ // Remove any attribute starting with "on" or xmlns
529
+ $filtered = preg_replace('#(<[^>]+?[\x00-\x20"\'])(?:on|xmlns)[^>]*+>#iu', '$1>', $filtered);
 
 
530
 
531
+ // Remove javascript: and vbscript: protocols
532
+ $filtered = preg_replace('#([a-z]*)[\x00-\x20]*=[\x00-\x20]*([`\'"]*)[\x00-\x20]*j[\x00-\x20]*a[\x00-\x20]*v[\x00-\x20]*a[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iu', '$1=$2nojavascript...', $filtered);
533
+ $filtered = preg_replace('#([a-z]*)[\x00-\x20]*=([\'"]*)[\x00-\x20]*v[\x00-\x20]*b[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iu', '$1=$2novbscript...', $filtered);
534
+ $filtered = preg_replace('#([a-z]*)[\x00-\x20]*=([\'"]*)[\x00-\x20]*-moz-binding[\x00-\x20]*:#u', '$1=$2nomozbinding...', $filtered);
535
 
536
+ // Only works in IE: <span style="width: expression(alert('Ping!'));"></span>
537
+ $filtered = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?expression[\x00-\x20]*\([^>]*+>#i', '$1>', $filtered);
538
+ $filtered = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?behaviour[\x00-\x20]*\([^>]*+>#i', '$1>', $filtered);
539
+ $filtered = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:*[^>]*+>#iu', '$1>', $filtered);
540
 
541
+ // Remove namespaced elements (we do not need them)
542
+ $data = preg_replace('#</*\w+:\w[^>]*+>#i', '', $filtered);
 
 
 
 
 
543
 
544
+ $filtered = str_replace('fromCharCode', '', $filtered);
545
 
546
+ $found = false;
547
+ while ( preg_match('/%[a-f0-9]{2}/i', $filtered, $match) ) {
548
+ $filtered = str_replace($match[0], '', $filtered);
549
+ $found = true;
550
+ }
551
 
552
+ if ( $found ) {
553
+ // Strip out the whitespace that may now exist after removing the octets.
554
+ $filtered = preg_replace('/ +/', ' ', $filtered);
555
+ }
556
  }
557
  $array = $filtered;
558
  }
berocket/includes/settings_fields.php CHANGED
@@ -3,18 +3,26 @@ if ( ! class_exists('BeRocket_framework_settings_fields') ) {
3
  class BeRocket_framework_settings_fields {
4
  function __construct() {
5
  do_action( 'BeRocket_framework_settings_fields_construct' );
6
- add_filter( 'berocket_framework_item_content_text', array( $this, 'text' ), 10, 6 );
7
- add_filter( 'berocket_framework_item_content_number', array( $this, 'number' ), 10, 6 );
8
- add_filter( 'berocket_framework_item_content_radio', array( $this, 'radio' ), 10, 8 );
9
- add_filter( 'berocket_framework_item_content_checkbox', array( $this, 'checkbox' ), 10, 8 );
10
- add_filter( 'berocket_framework_item_content_selectbox', array( $this, 'selectbox' ), 10, 6 );
11
- add_filter( 'berocket_framework_item_content_textarea', array( $this, 'textarea' ), 10, 6 );
12
- add_filter( 'berocket_framework_item_content_color', array( $this, 'color' ), 10, 6 );
13
- add_filter( 'berocket_framework_item_content_image', array( $this, 'image' ), 10, 6 );
14
- add_filter( 'berocket_framework_item_content_faimage', array( $this, 'faimage' ), 10, 6 );
15
- add_filter( 'berocket_framework_item_content_fontawesome', array( $this, 'fontawesome' ), 10, 6 );
16
- add_filter( 'berocket_framework_item_content_fa', array( $this, 'fontawesome' ), 10, 6 );
17
- add_filter( 'berocket_framework_item_content_products', array( $this, 'products' ), 10, 6 );
 
 
 
 
 
 
 
 
18
  }
19
 
20
  function text( $html, $field_item, $field_name, $value, $class, $extra ) {
@@ -22,7 +30,7 @@ if ( ! class_exists('BeRocket_framework_settings_fields') ) {
22
  if ( ! empty( $field_item[ 'label_be_for' ] ) ) {
23
  $html .= '<span class="br_label_be_for">' . $field_item[ 'label_be_for' ] . '</span>';
24
  }
25
- $html .= '<input type="text" name="' . $field_name . '" value="' . htmlentities( $value ) . '"' . $class . $extra . '/>';
26
  if ( ! empty( $field_item[ 'label_for' ] ) ) {
27
  $html .= '<span class="br_label_for">' . $field_item[ 'label_for' ] . '</span>';
28
  }
@@ -36,7 +44,7 @@ if ( ! class_exists('BeRocket_framework_settings_fields') ) {
36
  if ( ! empty( $field_item[ 'label_be_for' ] ) ) {
37
  $html .= '<span class="br_label_be_for">' . $field_item[ 'label_be_for' ] . '</span>';
38
  }
39
- $html .= '<input type="number" name="' . $field_name . '" value="' . $value . '"' . $class . $extra . ( empty( $field_item[ 'min' ] ) ? '' : ' min="' . $field_item[ 'min' ] . '"' ) . ( empty( $field_item[ 'max' ] ) ? '' : ' max="' . $field_item[ 'max' ] . '"' ) . '/>';
40
  if ( ! empty( $field_item[ 'label_for' ] ) ) {
41
  $html .= '<span class="br_label_for">' . $field_item[ 'label_for' ] . '</span>';
42
  }
@@ -51,7 +59,7 @@ if ( ! class_exists('BeRocket_framework_settings_fields') ) {
51
  if ( ! empty( $field_item[ 'label_be_for' ] ) ) {
52
  $html .= '<span class="br_label_be_for">' . $field_item[ 'label_be_for' ] . '</span>';
53
  }
54
- $html .= '<input type="radio" name="' . $field_name . '" value="' . $field_item[ 'value' ] . '"' . ( $field_item[ 'value' ] == $radio_default ? ' checked="checked" ' : '' ) . $class . $extra . '/>';
55
  if ( ! empty( $field_item[ 'label_for' ] ) ) {
56
  $html .= '<span class="br_label_for">' . $field_item[ 'label_for' ] . '</span>';
57
  }
@@ -65,7 +73,7 @@ if ( ! class_exists('BeRocket_framework_settings_fields') ) {
65
  if ( ! empty( $field_item[ 'label_be_for' ] ) ) {
66
  $html .= '<span class="br_label_be_for">' . $field_item[ 'label_be_for' ] . '</span>';
67
  }
68
- $html .= '<input type="checkbox" name="' . $field_name . '" value="' . $field_item[ 'value' ] . '"' . ( ( ! empty( $option_values ) ) ? ' checked="checked" ' : '' ) . $class . $extra . '/>';
69
  if ( ! empty( $field_item[ 'label_for' ] ) ) {
70
  $html .= '<span class="br_label_for">' . $field_item[ 'label_for' ] . '</span>';
71
  }
@@ -79,7 +87,7 @@ if ( ! class_exists('BeRocket_framework_settings_fields') ) {
79
  if ( ! empty( $field_item[ 'label_be_for' ] ) ) {
80
  $html .= '<span class="br_label_be_for">' . $field_item[ 'label_be_for' ] . '</span>';
81
  }
82
- $html .= '<select name="' . $field_name . '"' . $class . $extra . '>';
83
  if ( isset( $field_item[ 'options' ] ) and is_array( $field_item[ 'options' ] ) and count( $field_item[ 'options' ] ) ) {
84
  foreach ( $field_item[ 'options' ] as $option ) {
85
  $html .= '<option value="' . $option[ 'value' ] . '"' . ( ( $value == $option[ 'value' ] ) ? ' selected="selected" ' : '' ) . '>' . $option[ 'text' ] . '</option>';
@@ -100,7 +108,7 @@ if ( ! class_exists('BeRocket_framework_settings_fields') ) {
100
  if ( ! empty( $field_item[ 'label_be_for' ] ) ) {
101
  $html .= '<span class="br_label_be_for">' . $field_item[ 'label_be_for' ] . '</span>';
102
  }
103
- $html .= '<textarea name="' . $field_name . '"' . $class . $extra . '>' . htmlentities( $value ) . '</textarea>';
104
  if ( ! empty( $field_item[ 'label_for' ] ) ) {
105
  $html .= '<span class="br_label_for">' . $field_item[ 'label_for' ] . '</span>';
106
  }
@@ -170,6 +178,13 @@ if ( ! class_exists('BeRocket_framework_settings_fields') ) {
170
 
171
  return $html;
172
  }
 
 
 
 
 
 
 
173
  }
174
 
175
  new BeRocket_framework_settings_fields();
3
  class BeRocket_framework_settings_fields {
4
  function __construct() {
5
  do_action( 'BeRocket_framework_settings_fields_construct' );
6
+ $fields = array(
7
+ 'text' => 'text',
8
+ 'number' => 'number',
9
+ 'radio' => 'radio',
10
+ 'checkbox' => 'checkbox',
11
+ 'selectbox' => 'selectbox',
12
+ 'textarea' => 'textarea',
13
+ 'color' => 'color',
14
+ 'image' => 'image',
15
+ 'faimage' => 'faimage',
16
+ 'fontawesome' => 'fontawesome',
17
+ 'fa' => 'fontawesome',
18
+ 'products' => 'products',
19
+ );
20
+ foreach($fields as $field_hook => $field) {
21
+ add_filter( 'berocket_framework_item_content_'.$field_hook, array( $this, $field ), 10, 8 );
22
+ }
23
+ foreach($fields as $field_hook => $field) {
24
+ add_filter( 'berocket_framework_item_content_'.$field_hook, array( $this, 'admin_disable' ), 100, 8 );
25
+ }
26
  }
27
 
28
  function text( $html, $field_item, $field_name, $value, $class, $extra ) {
30
  if ( ! empty( $field_item[ 'label_be_for' ] ) ) {
31
  $html .= '<span class="br_label_be_for">' . $field_item[ 'label_be_for' ] . '</span>';
32
  }
33
+ $html .= '<input'.( empty($field_item['disabled']) ? '' : ' disabled=disabled').' type="text" name="' . $field_name . '" value="' . htmlentities( $value ) . '"' . $class . $extra . '/>';
34
  if ( ! empty( $field_item[ 'label_for' ] ) ) {
35
  $html .= '<span class="br_label_for">' . $field_item[ 'label_for' ] . '</span>';
36
  }
44
  if ( ! empty( $field_item[ 'label_be_for' ] ) ) {
45
  $html .= '<span class="br_label_be_for">' . $field_item[ 'label_be_for' ] . '</span>';
46
  }
47
+ $html .= '<input'.( empty($field_item['disabled']) ? '' : ' disabled=disabled').' type="number" name="' . $field_name . '" value="' . $value . '"' . $class . $extra . ( empty( $field_item[ 'min' ] ) ? '' : ' min="' . $field_item[ 'min' ] . '"' ) . ( empty( $field_item[ 'max' ] ) ? '' : ' max="' . $field_item[ 'max' ] . '"' ) . '/>';
48
  if ( ! empty( $field_item[ 'label_for' ] ) ) {
49
  $html .= '<span class="br_label_for">' . $field_item[ 'label_for' ] . '</span>';
50
  }
59
  if ( ! empty( $field_item[ 'label_be_for' ] ) ) {
60
  $html .= '<span class="br_label_be_for">' . $field_item[ 'label_be_for' ] . '</span>';
61
  }
62
+ $html .= '<input'.( empty($field_item['disabled']) ? '' : ' disabled=disabled').' type="radio" name="' . $field_name . '" value="' . $field_item[ 'value' ] . '"' . ( $field_item[ 'value' ] == $radio_default ? ' checked="checked" ' : '' ) . $class . $extra . '/>';
63
  if ( ! empty( $field_item[ 'label_for' ] ) ) {
64
  $html .= '<span class="br_label_for">' . $field_item[ 'label_for' ] . '</span>';
65
  }
73
  if ( ! empty( $field_item[ 'label_be_for' ] ) ) {
74
  $html .= '<span class="br_label_be_for">' . $field_item[ 'label_be_for' ] . '</span>';
75
  }
76
+ $html .= '<input'.( empty($field_item['disabled']) ? '' : ' disabled=disabled').' type="checkbox" name="' . $field_name . '" value="' . $field_item[ 'value' ] . '"' . ( ( ! empty( $option_values ) ) ? ' checked="checked" ' : '' ) . $class . $extra . '/>';
77
  if ( ! empty( $field_item[ 'label_for' ] ) ) {
78
  $html .= '<span class="br_label_for">' . $field_item[ 'label_for' ] . '</span>';
79
  }
87
  if ( ! empty( $field_item[ 'label_be_for' ] ) ) {
88
  $html .= '<span class="br_label_be_for">' . $field_item[ 'label_be_for' ] . '</span>';
89
  }
90
+ $html .= '<select'.( empty($field_item['disabled']) ? '' : ' disabled=disabled').' name="' . $field_name . '"' . $class . $extra . '>';
91
  if ( isset( $field_item[ 'options' ] ) and is_array( $field_item[ 'options' ] ) and count( $field_item[ 'options' ] ) ) {
92
  foreach ( $field_item[ 'options' ] as $option ) {
93
  $html .= '<option value="' . $option[ 'value' ] . '"' . ( ( $value == $option[ 'value' ] ) ? ' selected="selected" ' : '' ) . '>' . $option[ 'text' ] . '</option>';
108
  if ( ! empty( $field_item[ 'label_be_for' ] ) ) {
109
  $html .= '<span class="br_label_be_for">' . $field_item[ 'label_be_for' ] . '</span>';
110
  }
111
+ $html .= '<textarea'.( empty($field_item['disabled']) ? '' : ' disabled=disabled').' name="' . $field_name . '"' . $class . $extra . '>' . htmlentities( $value ) . '</textarea>';
112
  if ( ! empty( $field_item[ 'label_for' ] ) ) {
113
  $html .= '<span class="br_label_for">' . $field_item[ 'label_for' ] . '</span>';
114
  }
178
 
179
  return $html;
180
  }
181
+ function admin_disable( $html, $field_item, $field_name ) {
182
+ if( ! empty($field_item['admin_disabled']) ) {
183
+ $admin = ( is_multisite() ? __('MULTISITE ADMIN', 'BeRocket_domain') : __('ADMIN', 'BeRocket_domain') );
184
+ $html .= '<p style="font-weight:900;">'.sprintf(__('Field can be changed only by %s', 'BeRocket_domain'), $admin).'</p>';
185
+ }
186
+ return $html;
187
+ }
188
  }
189
 
190
  new BeRocket_framework_settings_fields();
berocket/includes/updater.php CHANGED
@@ -499,7 +499,8 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
499
  <form method="post" action="edit.php?page=berocket_account" class="account_key_send br_framework_settings">
500
  <?php
501
  if ( isset( $_POST[ 'BeRocket_account_option' ] ) ) {
502
- $option = berocket_sanitize_array( $_POST[ 'BeRocket_account_option' ] );
 
503
  update_site_option( 'BeRocket_account_option', $option );
504
  self::update_check_set('');
505
  delete_site_transient( 'update_plugins' );
499
  <form method="post" action="edit.php?page=berocket_account" class="account_key_send br_framework_settings">
500
  <?php
501
  if ( isset( $_POST[ 'BeRocket_account_option' ] ) ) {
502
+ $previous_options = get_site_option( 'BeRocket_account_option' );
503
+ $option = berocket_sanitize_array( $_POST[ 'BeRocket_account_option' ], array('BeRocket_account_option'), $previous_options );
504
  update_site_option( 'BeRocket_account_option', $option );
505
  self::update_check_set('');
506
  delete_site_transient( 'update_plugins' );
main.php CHANGED
@@ -22,6 +22,11 @@ class BeRocket_AAPF extends BeRocket_Framework {
22
  public static $settings_name = 'br_filters_options';
23
  public $info, $defaults, $values, $notice_array, $conditions;
24
  protected static $instance;
 
 
 
 
 
25
  public static $debug_mode = false;
26
  public static $error_log = array();
27
  public static $the_ajax_script_initialized = false;
@@ -282,7 +287,7 @@ class BeRocket_AAPF extends BeRocket_Framework {
282
  add_filter ( 'BeRocket_updater_menu_order_custom_post', array($this, 'menu_order_custom_post') );
283
  if( br_woocommerce_version_check('3.6') ) {
284
  //TEST FUNCTIONS
285
- add_filter( 'posts_clauses', array( $this, 'price_filter_post_clauses' ), 10, 2 );
286
  add_filter( 'berocket_posts_clauses_recount', array( $this, 'add_price_to_post_clauses' ), 10, 3 );
287
  }
288
  add_action('woocommerce_before_template_part', array($this, 'no_products_block_before'), 1, 1);
@@ -1228,6 +1233,7 @@ class BeRocket_AAPF extends BeRocket_Framework {
1228
  ),
1229
  'custom_css' => array(
1230
  'section' => 'custom_css',
 
1231
  "value" => "",
1232
  ),
1233
  ),
@@ -1378,6 +1384,7 @@ class BeRocket_AAPF extends BeRocket_Framework {
1378
  return $html;
1379
  }
1380
  public function section_custom_css ( $item, $options ) {
 
1381
  $html = '</table>
1382
  <table class="form-table bapf_custom_css_admin">
1383
  <tr>
22
  public static $settings_name = 'br_filters_options';
23
  public $info, $defaults, $values, $notice_array, $conditions;
24
  protected static $instance;
25
+ protected $disable_settings_for_admin = array(
26
+ array('javascript', 'berocket_ajax_filtering_start'),
27
+ array('javascript', 'berocket_ajax_filtering_on_update'),
28
+ array('javascript', 'berocket_ajax_products_loaded'),
29
+ );
30
  public static $debug_mode = false;
31
  public static $error_log = array();
32
  public static $the_ajax_script_initialized = false;
287
  add_filter ( 'BeRocket_updater_menu_order_custom_post', array($this, 'menu_order_custom_post') );
288
  if( br_woocommerce_version_check('3.6') ) {
289
  //TEST FUNCTIONS
290
+ add_filter( 'posts_clauses', array( $this, 'price_filter_post_clauses' ), 99999999999, 2 );
291
  add_filter( 'berocket_posts_clauses_recount', array( $this, 'add_price_to_post_clauses' ), 10, 3 );
292
  }
293
  add_action('woocommerce_before_template_part', array($this, 'no_products_block_before'), 1, 1);
1233
  ),
1234
  'custom_css' => array(
1235
  'section' => 'custom_css',
1236
+ 'name' => 'user_custom_css',
1237
  "value" => "",
1238
  ),
1239
  ),
1384
  return $html;
1385
  }
1386
  public function section_custom_css ( $item, $options ) {
1387
+ if( empty($item) ) return '';
1388
  $html = '</table>
1389
  <table class="form-table bapf_custom_css_admin">
1390
  <tr>
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.7
8
- Stable tag: 1.5.2.11
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -185,6 +185,13 @@ You can try this plugin's admin side [here](https://berocket.com/product/woocomm
185
 
186
  == Changelog ==
187
 
 
 
 
 
 
 
 
188
  = 1.5.2.11 =
189
  * Enhancement - Compatibility version: Wordpress 5.7 and WooCommerce 5.1
190
  * Fix - RTL filters align
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.7
8
+ Stable tag: 1.5.3
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.3 =
189
+ * Fix - SECURITY ISSUE! Sanitize HTML tags for all settings. Custom JavaScript can be changed only by admin(Super admin for multisite).
190
+ * Enhancement - New hook to change additional table generation products per call
191
+ * Enhancement - Copy filter/group from other do not required
192
+ * Fix - Price filter query issue with some plugins/themes
193
+ * Fix - Remove "Limit filter values by products from the selected category" option from filter edit page
194
+
195
  = 1.5.2.11 =
196
  * Enhancement - Compatibility version: Wordpress 5.7 and WooCommerce 5.1
197
  * Fix - RTL filters align
templates/single_filter/single_settings_elements.php CHANGED
@@ -151,9 +151,11 @@ if( ! class_exists('braapf_single_filter_edit_elements') ) {
151
  echo '</div>';
152
  }
153
  static function cat_value_limit($settings_name, $braapf_filter_settings) {
154
- echo '<div class="braapf_attribute_setup_flex">';
 
 
 
155
  echo '<div class="braapf_cat_value_limit braapf_full_select_full">';
156
- $cat_value_limit = br_get_value_from_array($braapf_filter_settings, 'cat_value_limit', '0');
157
  $hrterms = berocket_aapf_get_terms(array(
158
  'taxonomy' => 'product_cat',
159
  'hide_empty' => false
151
  echo '</div>';
152
  }
153
  static function cat_value_limit($settings_name, $braapf_filter_settings) {
154
+ $cat_value_limit = br_get_value_from_array($braapf_filter_settings, 'cat_value_limit', '0');
155
+ echo '<div class="braapf_attribute_setup_flex"'
156
+ . ( apply_filters('braapf_single_filter_hide_cat_value_limit', empty($cat_value_limit), $cat_value_limit) ? ' style="display:none;"' : '' )
157
+ . '>';
158
  echo '<div class="braapf_cat_value_limit braapf_full_select_full">';
 
159
  $hrterms = berocket_aapf_get_terms(array(
160
  'taxonomy' => 'product_cat',
161
  'hide_empty' => false
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.2.11
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: 5.1
13
  */
14
- define( "BeRocket_AJAX_filters_version", '1.5.2.11' );
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.3
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: 5.1
13
  */
14
+ define( "BeRocket_AJAX_filters_version", '1.5.3' );
15
  define( "BeRocket_AJAX_filters_file", __FILE__ );
16
  include_once('main.php');