Advanced AJAX Product Filters - Version 1.3.1.3

Version Description

  • Enhancement - Code Security
  • Enhancement - Added Purge cache button
Download this release

Release Info

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

Code changes from version 1.3.1.2 to 1.3.1.3

berocket/README.md DELETED
@@ -1,30 +0,0 @@
1
- # README #
2
-
3
-
4
- ### Process of new plugin initialization ###
5
-
6
- * Create plugin folder name (locally)
7
- * In that folder create folder called `berocket`
8
- * Clone repository into `berocket`
9
- * Run this from the `berocket` folder `git update-index --assume-unchanged plugin.php` - We are telling git that we will not change this file and no sense to check it (but we will lol)
10
- * Move `plugin.php` to the parent folder (plugin root)
11
- * Rename and edit `plugin.php` as you need
12
- * Create new repo on the bitbucket and clone it to the plugin root
13
- * Create all needed folders(js, css, includes, etc) and files you need for the plugin.
14
- * On change don't forget to commit
15
-
16
- ##### Don't edit Plugin Framework files from the plugin. OR at least commit asap because always there is a chance that you will forget to commit changes and we will have problems of merging #####
17
-
18
- ###### Plugin Framework would be as a sub-repository. Sub-repositories updating manually. So it will not provide issues while you still can update it when needed. ######
19
-
20
-
21
-
22
- ### Process of cloning plugin in process ###
23
-
24
- * Create plugin folder name (locally)
25
- * Clone repository
26
- * In the plugin folder you will see folder `berocket`
27
- * Clone into it this repo
28
- * On change don't forget to commit
29
-
30
- ##### Don't edit Plugin Framework files from the plugin. OR at least commit asap because always there is a chance that you will forget to commit changes and we will have problems of merging #####
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
berocket/framework.php CHANGED
@@ -421,9 +421,8 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
421
  add_filter('option_page_capability_'.$this->cc->values[ 'option_page' ], array($this, 'option_page_capability'));
422
  }
423
 
424
- public function option_page_capability($capability) {
425
- $capability = 'manage_woocommerce';
426
- return $capability;
427
  }
428
 
429
  /**
@@ -441,7 +440,7 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
441
  'berocket_account',
442
  $this->cc->info[ 'norm_name' ] . ' ' . __( 'Settings', 'BeRocket_domain' ),
443
  $this->cc->info[ 'norm_name' ],
444
- 'manage_woocommerce',
445
  $this->cc->values[ 'option_page' ],
446
  array(
447
  $this->cc,
@@ -480,8 +479,10 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
480
  public function display_admin_settings( $tabs_info = array(), $data = array(), $setup_style = array() ) {
481
  $plugin_info = get_plugin_data( $this->cc->info[ 'plugin_file' ] );
482
  global $wp;
 
 
483
  $def_setup_style = array(
484
- 'settings_url' => add_query_arg( NULL, NULL ),
485
  'use_filters_hook' => true,
486
  'hide_header' => false,
487
  'hide_header_links' => false,
421
  add_filter('option_page_capability_'.$this->cc->values[ 'option_page' ], array($this, 'option_page_capability'));
422
  }
423
 
424
+ public function option_page_capability($capability = '') {
425
+ return 'manage_woocommerce';
 
426
  }
427
 
428
  /**
440
  'berocket_account',
441
  $this->cc->info[ 'norm_name' ] . ' ' . __( 'Settings', 'BeRocket_domain' ),
442
  $this->cc->info[ 'norm_name' ],
443
+ $this->option_page_capability(),
444
  $this->cc->values[ 'option_page' ],
445
  array(
446
  $this->cc,
479
  public function display_admin_settings( $tabs_info = array(), $data = array(), $setup_style = array() ) {
480
  $plugin_info = get_plugin_data( $this->cc->info[ 'plugin_file' ] );
481
  global $wp;
482
+ $settings_url = add_query_arg( NULL, NULL );
483
+ $settings_url = esc_url_raw($settings_url);
484
  $def_setup_style = array(
485
+ 'settings_url' => $settings_url,
486
  'use_filters_hook' => true,
487
  'hide_header' => false,
488
  'hide_header_links' => false,
berocket/includes/admin_notices.php CHANGED
@@ -743,22 +743,30 @@ if( ! class_exists( 'berocket_admin_notices' ) ) {
743
  }
744
  public static function subscribe() {
745
  if( ! empty($_POST['email']) ) {
746
- if( $ch = curl_init() ) {
747
- $plugins = array();
748
- if( ! empty($_POST['plugin']) ) {
749
- $plugins[] = sanitize_textarea_field($_POST['plugin']);
750
- }
751
- $plugins = apply_filters('berocket_admin_notices_subscribe_plugins', $plugins);
752
- $plugins = array_unique($plugins);
753
- $plugins = implode(',', $plugins);
754
- update_option('berocket_email_subscribed', true);
755
- curl_setopt($ch, CURLOPT_URL,"https://berocket.com/main/subscribe");
756
- curl_setopt($ch, CURLOPT_POST, 1);
757
- curl_setopt($ch, CURLOPT_POSTFIELDS, "subs_email=" . sanitize_email($_POST['email']) . "&plugins=" . $plugins);
758
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
759
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
760
- echo curl_exec ($ch);
761
- curl_close ($ch);
 
 
 
 
 
 
 
 
762
  }
763
  }
764
  wp_die();
743
  }
744
  public static function subscribe() {
745
  if( ! empty($_POST['email']) ) {
746
+ $plugins = array();
747
+ if( ! empty($_POST['plugin']) ) {
748
+ $plugins[] = sanitize_textarea_field($_POST['plugin']);
749
+ }
750
+ $plugins = apply_filters('berocket_admin_notices_subscribe_plugins', $plugins);
751
+ $plugins = array_unique($plugins);
752
+ $plugins = implode(',', $plugins);
753
+ $email = sanitize_email($_POST['email']);
754
+ update_option('berocket_email_subscribed', true);
755
+
756
+ $response = wp_remote_post('https://berocket.com/main/subscribe', array(
757
+ 'body' => array(
758
+ 'subs_email' => $email,
759
+ 'plugins' => $plugins
760
+ ),
761
+ 'method' => 'POST',
762
+ 'timeout' => 15,
763
+ 'redirection' => 5,
764
+ 'blocking' => true,
765
+ 'sslverify' => false
766
+ ));
767
+ if( ! is_wp_error($response) ) {
768
+ $out = wp_remote_retrieve_body($response);
769
+ echo $out;
770
  }
771
  }
772
  wp_die();
berocket/includes/custom_post.php CHANGED
@@ -172,6 +172,8 @@ if ( ! class_exists('BeRocket_custom_post_class') ) {
172
 
173
  echo 'ID:' . $post->ID . ' <strong>' . $title . '</strong>';
174
 
 
 
175
  break;
176
  }
177
  do_action( 'berocket_custom_post_'.$this->post_name.'_columns_replace', $column, $this->post_type_parameters);
@@ -358,8 +360,14 @@ if ( ! class_exists('BeRocket_custom_post_class') ) {
358
  }
359
  }
360
  public function sortable_change() {
361
- if( ! empty($_POST['BRsortable_id']) && isset($_POST['BRorder']) && current_user_can('edit_post', $_POST['BRsortable_id']) ) {
362
- update_post_meta($_POST['BRsortable_id'], 'berocket_post_order', $_POST['BRorder']);
 
 
 
 
 
 
363
  }
364
  }
365
  public function sortable_get_posts( $query ){
@@ -380,7 +388,7 @@ if ( ! class_exists('BeRocket_custom_post_class') ) {
380
  }
381
  public function sortable_wc_save_product_before( $post_id, $post ) {
382
  $order_position = get_post_meta( $post_id, 'berocket_post_order', true );
383
- $order_position = (int)$order_position;
384
  update_post_meta( $post_id, 'berocket_post_order', $order_position );
385
  }
386
  public function sortable_columns_replace($column) {
@@ -391,6 +399,8 @@ if ( ! class_exists('BeRocket_custom_post_class') ) {
391
  case "berocket_sortable":
392
  echo $this->sortable_html_position($post_id, $order_position);
393
  break;
 
 
394
  }
395
  }
396
  public function sortable_html_position($post_id, $order) {
172
 
173
  echo 'ID:' . $post->ID . ' <strong>' . $title . '</strong>';
174
 
175
+ break;
176
+ default:
177
  break;
178
  }
179
  do_action( 'berocket_custom_post_'.$this->post_name.'_columns_replace', $column, $this->post_type_parameters);
360
  }
361
  }
362
  public function sortable_change() {
363
+ if( ! empty($_POST['BRsortable_id']) && isset($_POST['BRorder']) ) {
364
+ $BRsortable_id = sanitize_key($_POST['BRsortable_id']);
365
+ $BRorder = sanitize_key($_POST['BRorder']);
366
+ $BRsortable_id = intval($BRsortable_id);
367
+ $BRorder = intval($BRorder);
368
+ if( current_user_can('edit_post', $BRsortable_id) ) {
369
+ update_post_meta($BRsortable_id, 'berocket_post_order', $BRorder);
370
+ }
371
  }
372
  }
373
  public function sortable_get_posts( $query ){
388
  }
389
  public function sortable_wc_save_product_before( $post_id, $post ) {
390
  $order_position = get_post_meta( $post_id, 'berocket_post_order', true );
391
+ $order_position = intval($order_position);
392
  update_post_meta( $post_id, 'berocket_post_order', $order_position );
393
  }
394
  public function sortable_columns_replace($column) {
399
  case "berocket_sortable":
400
  echo $this->sortable_html_position($post_id, $order_position);
401
  break;
402
+ default:
403
+ break;
404
  }
405
  }
406
  public function sortable_html_position($post_id, $order) {
berocket/includes/error_notices.php CHANGED
@@ -35,6 +35,8 @@ if( ! class_exists('BeRocket_error_notices') ) {
35
  if( empty($plugin_id) ) {
36
  $plugin_id = br_get_value_from_array($_GET, 'plugin_id');
37
  }
 
 
38
  if( ! empty($plugin_id) && ( ! empty($_POST['clear_errors']) || ! empty($_GET['clear_errors']) ) ) {
39
  self::clear_plugin_errors($plugin_id);
40
  }
35
  if( empty($plugin_id) ) {
36
  $plugin_id = br_get_value_from_array($_GET, 'plugin_id');
37
  }
38
+ $plugin_id = sanitize_key($plugin_id);
39
+ $plugin_id = intval($plugin_id);
40
  if( ! empty($plugin_id) && ( ! empty($_POST['clear_errors']) || ! empty($_GET['clear_errors']) ) ) {
41
  self::clear_plugin_errors($plugin_id);
42
  }
berocket/includes/functions.php CHANGED
@@ -134,8 +134,8 @@ if( ! function_exists( 'br_color_picker' ) ) {
134
  $default_button = ( isset($additional['default_button']) ? $additional['default_button'] : true );
135
  $class = ( ( isset($additional['class']) && trim( $additional['class'] ) ) ? ' ' . trim( $additional['class'] ) : '' );
136
  $extra = ( ( isset($additional['extra']) && trim( $additional['extra'] ) ) ? ' ' . trim( $additional['extra'] ) : '' );
137
- $value = ( empty($value) ? '#000000' : ( $value[0] == '#' ? $value : '#' . $value ) );
138
  $default = ( isset($default) && strlen($default) > 1 ? ( $default == -1 ? '' : ( $default[0] == '#' ? $default : '#' . $default ) ) : '#000000' );
 
139
  $return = '';
140
  $return .= '<div class="berocket_color"><div class="br_colorpicker" data-default="' . $default . '" data-color="' . $value . '" style="background-color:' . $value . ';"></div>
141
  <input class="br_colorpicker_value' . $class . '" type="hidden" value="' . $value . '" name="' . $name . '"' . $extra . '/>';
134
  $default_button = ( isset($additional['default_button']) ? $additional['default_button'] : true );
135
  $class = ( ( isset($additional['class']) && trim( $additional['class'] ) ) ? ' ' . trim( $additional['class'] ) : '' );
136
  $extra = ( ( isset($additional['extra']) && trim( $additional['extra'] ) ) ? ' ' . trim( $additional['extra'] ) : '' );
 
137
  $default = ( isset($default) && strlen($default) > 1 ? ( $default == -1 ? '' : ( $default[0] == '#' ? $default : '#' . $default ) ) : '#000000' );
138
+ $value = ( empty($value) ? $default : ( $value[0] == '#' ? $value : '#' . $value ) );
139
  $return = '';
140
  $return .= '<div class="berocket_color"><div class="br_colorpicker" data-default="' . $default . '" data-color="' . $value . '" style="background-color:' . $value . ';"></div>
141
  <input class="br_colorpicker_value' . $class . '" type="hidden" value="' . $value . '" name="' . $name . '"' . $extra . '/>';
berocket/includes/updater.php CHANGED
@@ -441,7 +441,7 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
441
  }
442
 
443
  public static function main_menu_item() {
444
- add_menu_page( 'BeRocket Account', 'BeRocket', 'manage_woocommerce', 'berocket_account', array(
445
  __CLASS__,
446
  'account_form'
447
  ), plugin_dir_url( __FILE__ ) . 'ico.png', '55.55' );
441
  }
442
 
443
  public static function main_menu_item() {
444
+ add_menu_page( 'BeRocket Account', 'BeRocket', 'manage_options', 'berocket_account', array(
445
  __CLASS__,
446
  'account_form'
447
  ), plugin_dir_url( __FILE__ ) . 'ico.png', '55.55' );
includes/free.php DELETED
@@ -1,37 +0,0 @@
1
- <?php
2
- class BeRocket_AAPF_Free extends BeRocket_plugin_variations {
3
- public $plugin_name = 'ajax_filters';
4
- public $version_number = 0;
5
- public function __construct() {
6
- parent::__construct();
7
- add_filter('brfr_ajax_filters_section_feature', array($this, 'section_feature'));
8
- }
9
- public function settings_page($data) {
10
- $data['Features'] = array(
11
- 'section_feature' => array(
12
- "section" => "section_feature",
13
- "value" => "",
14
- )
15
- );
16
- return $data;
17
- }
18
- public function settings_tabs($data) {
19
- $data = berocket_insert_to_array(
20
- $data,
21
- 'JavaScript/CSS',
22
- array(
23
- 'Features' => array(
24
- 'icon' => 'info',
25
- ),
26
- )
27
- );
28
- return $data;
29
- }
30
- public function section_feature ($html) {
31
- ob_start();
32
- include_once(AAPF_TEMPLATE_PATH.'free/feature.php');
33
- $html = ob_get_clean();
34
- return $html;
35
- }
36
- }
37
- new BeRocket_AAPF_Free();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/functions.php CHANGED
@@ -454,7 +454,15 @@ if( ! function_exists( 'br_aapf_args_parser_attributes_terms' ) ) {
454
  'taxonomy' => 'product_cat',
455
  'return' => 'terms'
456
  ), $args);
457
- $md5 = $wpdb->get_var("SELECT MD5(GROUP_CONCAT(CONCAT(t.slug, t.term_id, tt.parent, tt.count))) FROM {$wpdb->terms} AS t INNER JOIN {$wpdb->term_taxonomy} AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('{$args['taxonomy']}')");
 
 
 
 
 
 
 
 
458
  $attributes_terms = get_option( apply_filters('br_aapf_md5_cache_text', 'br_get_taxonomy_args_parser_'.$args['taxonomy']) );
459
  if( empty($attributes_terms) || $attributes_terms['md5'] != $md5 ) {
460
  $attributes_terms = array(
@@ -1608,9 +1616,16 @@ if ( ! function_exists( 'br_get_post_meta_price' ) ) {
1608
  function br_get_post_meta_price( $object_id ) {
1609
  global $wpdb;
1610
 
1611
- $meta_list = $wpdb->get_row("SELECT meta_value FROM {$wpdb->postmeta}
1612
- WHERE post_id = {$object_id} AND meta_key = '".apply_filters('berocket_price_filter_meta_key', '_price', 'functions_1553')."'
1613
- ORDER BY meta_id ASC LIMIT 1", ARRAY_A );
 
 
 
 
 
 
 
1614
 
1615
  return maybe_unserialize( $meta_list['meta_value'] );
1616
  }
@@ -1644,7 +1659,7 @@ if ( ! function_exists( 'br_get_taxonomy_id' ) ) {
1644
  }
1645
 
1646
  $term = $wpdb->get_row(
1647
- $wpdb->prepare( "SELECT t.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy
1648
  AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = '%s' AND $field = %s LIMIT 1", $taxonomy, $value )
1649
  );
1650
 
@@ -1746,7 +1761,7 @@ if ( ! function_exists( '_br_get_category_id' ) ) {
1746
  }
1747
 
1748
  $term = $wpdb->get_row(
1749
- $wpdb->prepare( "SELECT t.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy
1750
  AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = 'product_cat' AND $field = %s LIMIT 1", $value )
1751
  );
1752
 
@@ -1769,7 +1784,7 @@ if ( ! function_exists( 'br_get_category' ) ) {
1769
  function br_get_category( $id ) {
1770
  global $wpdb;
1771
 
1772
- if ( ! $id = (int) $id or ! $term = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->terms WHERE term_id = %s", $id ) ) ) {
1773
  return false;
1774
  }
1775
 
@@ -1851,11 +1866,15 @@ if ( ! function_exists( 'br_wp_get_object_terms' ) ) {
1851
  $select_this = 't.*, tt.*, tr.object_id';
1852
  }
1853
 
1854
- $query = "SELECT $select_this FROM $wpdb->terms AS t
1855
- INNER JOIN $wpdb->term_taxonomy AS tt ON tt.term_id = t.term_id
1856
- INNER JOIN $wpdb->term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id
1857
- WHERE tt.taxonomy = '$taxonomy' AND tr.object_id = $object_id
1858
- ORDER BY t.term_id ASC";
 
 
 
 
1859
 
1860
  if( BeRocket_AAPF::$debug_mode ) {
1861
  $wpdb->show_errors();
@@ -1889,7 +1908,11 @@ if ( ! function_exists( 'br_wp_get_object_terms' ) ) {
1889
  }
1890
  $terms = array_merge( $terms, $_terms );
1891
  } elseif ( 'tt_ids' == $fields ) {
1892
- $terms = $wpdb->get_col("SELECT tr.term_taxonomy_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tr.object_id IN ($object_ids) AND tt.taxonomy IN ($taxonomies) $orderby $order");
 
 
 
 
1893
  if( BeRocket_AAPF::$debug_mode ) {
1894
  ob_start();
1895
  if ( $wpdb->last_error ) {
@@ -2257,14 +2280,22 @@ if( ! function_exists('br_get_taxonomy_hierarchy') ) {
2257
  'parent' => 0,
2258
  'depth' => 0
2259
  ), $args);
2260
- $default_terms = $wpdb->get_var("SELECT MD5(GROUP_CONCAT(CONCAT(t.slug, t.term_id, tt.parent, tt.count))) FROM {$wpdb->terms} AS t INNER JOIN {$wpdb->term_taxonomy} AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('{$args['taxonomy']}')");
 
 
 
 
 
 
 
 
2261
  $hierarchy_data = get_option( apply_filters('br_aapf_md5_cache_text', 'br_get_taxonomy_hierarchy_'.$args['taxonomy']) );
2262
- if( empty($hierarchy_data) || $hierarchy_data['md5'] != $default_terms ) {
2263
  $hierarchy = br_generate_taxonomy_hierarchy($args['taxonomy']);
2264
  $hierarchy_data = array(
2265
  'terms' => $hierarchy,
2266
  'hierarchy' => array(),
2267
- 'md5' => $default_terms,
2268
  'time' => time()
2269
  );
2270
  foreach($hierarchy as $hierarchy_term) {
@@ -2343,7 +2374,15 @@ if( ! function_exists('br_generate_taxonomy_hierarchy') ) {
2343
  if( ! function_exists('br_generate_child_relation') ) {
2344
  function br_generate_child_relation($taxonomy) {
2345
  global $wpdb;
2346
- $newmd5 = $wpdb->get_var("SELECT MD5(GROUP_CONCAT(CONCAT(t.slug, t.term_id, tt.parent, tt.count))) FROM {$wpdb->terms} AS t INNER JOIN {$wpdb->term_taxonomy} AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('{$taxonomy}')");
 
 
 
 
 
 
 
 
2347
  $md5 = get_option(apply_filters('br_aapf_md5_cache_text', 'br_generate_child_relation_'.$taxonomy));
2348
  if($md5 != $newmd5) {
2349
  $terms = get_terms( array(
454
  'taxonomy' => 'product_cat',
455
  'return' => 'terms'
456
  ), $args);
457
+ $md5 = $wpdb->get_var(
458
+ $wpdb->prepare("SELECT MD5(GROUP_CONCAT(CONCAT(t.slug, t.term_id, tt.parent, tt.count)))
459
+ FROM {$wpdb->terms} AS t
460
+ INNER JOIN {$wpdb->term_taxonomy} AS tt ON t.term_id = tt.term_id
461
+ WHERE tt.taxonomy IN ('%s')",
462
+ $args['taxonomy']
463
+ )
464
+ );
465
+ $md5 = apply_filters('BRaapf_cache_check_md5', $md5, 'br_aapf_args_parser_attributes_terms', $args);
466
  $attributes_terms = get_option( apply_filters('br_aapf_md5_cache_text', 'br_get_taxonomy_args_parser_'.$args['taxonomy']) );
467
  if( empty($attributes_terms) || $attributes_terms['md5'] != $md5 ) {
468
  $attributes_terms = array(
1616
  function br_get_post_meta_price( $object_id ) {
1617
  global $wpdb;
1618
 
1619
+ $meta_list = $wpdb->get_row(
1620
+ $wpdb->prepare(
1621
+ "SELECT meta_value FROM {$wpdb->postmeta}
1622
+ WHERE post_id = %d AND meta_key = '%s'
1623
+ ORDER BY meta_id ASC LIMIT 1",
1624
+ $object_id,
1625
+ apply_filters('berocket_price_filter_meta_key', '_price', 'functions_1553')
1626
+ ),
1627
+ ARRAY_A
1628
+ );
1629
 
1630
  return maybe_unserialize( $meta_list['meta_value'] );
1631
  }
1659
  }
1660
 
1661
  $term = $wpdb->get_row(
1662
+ $wpdb->prepare( "SELECT t.term_id, tt.term_taxonomy_id FROM {$wpdb->terms} AS t INNER JOIN {$wpdb->term_taxonomy}
1663
  AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = '%s' AND $field = %s LIMIT 1", $taxonomy, $value )
1664
  );
1665
 
1761
  }
1762
 
1763
  $term = $wpdb->get_row(
1764
+ $wpdb->prepare( "SELECT t.term_id, tt.term_taxonomy_id FROM {$wpdb->terms} AS t INNER JOIN {$wpdb->term_taxonomy}
1765
  AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = 'product_cat' AND $field = %s LIMIT 1", $value )
1766
  );
1767
 
1784
  function br_get_category( $id ) {
1785
  global $wpdb;
1786
 
1787
+ if ( ! $id = (int) $id or ! $term = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->terms} WHERE term_id = %d", $id ) ) ) {
1788
  return false;
1789
  }
1790
 
1866
  $select_this = 't.*, tt.*, tr.object_id';
1867
  }
1868
 
1869
+ $query = $wpdb->prepare(
1870
+ "SELECT {$select_this} FROM {$wpdb->terms} AS t
1871
+ INNER JOIN {$wpdb->term_taxonomy} AS tt ON tt.term_id = t.term_id
1872
+ INNER JOIN {$wpdb->term_relationships} AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id
1873
+ WHERE tt.taxonomy = %s AND tr.object_id = %d
1874
+ ORDER BY t.term_id ASC",
1875
+ $taxonomy,
1876
+ $object_id
1877
+ );
1878
 
1879
  if( BeRocket_AAPF::$debug_mode ) {
1880
  $wpdb->show_errors();
1908
  }
1909
  $terms = array_merge( $terms, $_terms );
1910
  } elseif ( 'tt_ids' == $fields ) {
1911
+ $terms = $wpdb->get_col(
1912
+ "SELECT tr.term_taxonomy_id FROM {$wpdb->term_relationships} AS tr
1913
+ INNER JOIN {$wpdb->term_taxonomy} AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id
1914
+ WHERE tr.object_id IN ({$object_ids}) AND tt.taxonomy IN ({$taxonomies}) {$orderby} {$order}"
1915
+ );
1916
  if( BeRocket_AAPF::$debug_mode ) {
1917
  ob_start();
1918
  if ( $wpdb->last_error ) {
2280
  'parent' => 0,
2281
  'depth' => 0
2282
  ), $args);
2283
+ $md5 = $wpdb->get_var(
2284
+ $wpdb->prepare(
2285
+ "SELECT MD5(GROUP_CONCAT(CONCAT(t.slug, t.term_id, tt.parent, tt.count))) FROM {$wpdb->terms} AS t
2286
+ INNER JOIN {$wpdb->term_taxonomy} AS tt ON t.term_id = tt.term_id
2287
+ WHERE tt.taxonomy IN (%s)",
2288
+ $args['taxonomy']
2289
+ )
2290
+ );
2291
+ $md5 = apply_filters('BRaapf_cache_check_md5', $md5, 'br_get_taxonomy_hierarchy', $args);
2292
  $hierarchy_data = get_option( apply_filters('br_aapf_md5_cache_text', 'br_get_taxonomy_hierarchy_'.$args['taxonomy']) );
2293
+ if( empty($hierarchy_data) || $hierarchy_data['md5'] != $md5 ) {
2294
  $hierarchy = br_generate_taxonomy_hierarchy($args['taxonomy']);
2295
  $hierarchy_data = array(
2296
  'terms' => $hierarchy,
2297
  'hierarchy' => array(),
2298
+ 'md5' => $md5,
2299
  'time' => time()
2300
  );
2301
  foreach($hierarchy as $hierarchy_term) {
2374
  if( ! function_exists('br_generate_child_relation') ) {
2375
  function br_generate_child_relation($taxonomy) {
2376
  global $wpdb;
2377
+ $newmd5 = $wpdb->get_var(
2378
+ $wpdb->prepare(
2379
+ "SELECT MD5(GROUP_CONCAT(CONCAT(t.slug, t.term_id, tt.parent, tt.count))) FROM {$wpdb->terms} AS t
2380
+ INNER JOIN {$wpdb->term_taxonomy} AS tt ON t.term_id = tt.term_id
2381
+ WHERE tt.taxonomy IN (%s)",
2382
+ $taxonomy
2383
+ )
2384
+ );
2385
+ $newmd5 = apply_filters('BRaapf_cache_check_md5', $newmd5, 'br_generate_child_relation', $taxonomy);
2386
  $md5 = get_option(apply_filters('br_aapf_md5_cache_text', 'br_generate_child_relation_'.$taxonomy));
2387
  if($md5 != $newmd5) {
2388
  $terms = get_terms( array(
includes/new_widget.php CHANGED
@@ -222,8 +222,10 @@ class BeRocket_new_AAPF_Widget_single extends WP_Widget
222
  }
223
  public function update( $new_instance, $old_instance ) {
224
  $instance = $old_instance;
225
- $instance['filter_id'] = strip_tags( @ $new_instance['filter_id'] );
226
- $instance['custom_class'] = strip_tags( @ $new_instance['custom_class'] );
 
 
227
  return $instance;
228
  }
229
  public function form($instance) {
222
  }
223
  public function update( $new_instance, $old_instance ) {
224
  $instance = $old_instance;
225
+ $instance['filter_id'] = strip_tags( $new_instance['filter_id'] );
226
+ $instance['filter_id'] = intval($instance['filter_id']);
227
+ $instance['custom_class'] = strip_tags( $new_instance['custom_class'] );
228
+ $instance['custom_class'] = sanitize_text_field($instance['custom_class']);
229
  return $instance;
230
  }
231
  public function form($instance) {
main.php CHANGED
@@ -25,20 +25,21 @@ class BeRocket_AAPF extends BeRocket_Framework {
25
  );
26
  function __construct () {
27
  $this->info = array(
28
- 'id' => 1,
29
- 'version' => BeRocket_AJAX_filters_version,
30
- 'plugin' => '',
31
- 'slug' => '',
32
- 'key' => '',
33
- 'name' => '',
34
- 'plugin_name' => 'ajax_filters',
35
- 'full_name' => 'WooCommerce AJAX Products Filter',
36
- 'norm_name' => 'Product Filters',
37
- 'price' => '',
38
- 'domain' => 'BeRocket_AJAX_domain',
39
- 'templates' => AAPF_TEMPLATE_PATH,
40
- 'plugin_file' => BeRocket_AJAX_filters_file,
41
- 'plugin_dir' => __DIR__,
 
42
  );
43
  $this->defaults = array(
44
  'plugin_key' => '',
@@ -139,7 +140,7 @@ class BeRocket_AAPF extends BeRocket_Framework {
139
  );
140
  $this->feature_list = array();
141
  $this->framework_data['fontawesome_frontend'] = true;
142
- $this->active_libraries = array('addons');
143
 
144
  if( is_admin() ) {
145
  require_once dirname( __FILE__ ) . '/includes/wizard.php';
@@ -246,6 +247,7 @@ class BeRocket_AAPF extends BeRocket_Framework {
246
  add_action( 'admin_notices', array( $this, 'no_woocommerce' ) );
247
  }
248
  }
 
249
  }
250
  }
251
  function init_validation() {
@@ -733,6 +735,10 @@ class BeRocket_AAPF extends BeRocket_Framework {
733
  "value" => '1',
734
  'label_for' => __('Don\'t loading css file for Font Awesome on site front end. Use this only if you doesn\'t uses Font Awesome icons in widgets or you have Font Awesome in your theme.', 'BeRocket_AJAX_domain'),
735
  ),*/
 
 
 
 
736
  'replace_old_widget' => array(
737
  "section" => "replace_old_widget",
738
  "value" => "",
@@ -855,6 +861,40 @@ class BeRocket_AAPF extends BeRocket_Framework {
855
  </tr>';
856
  return $html;
857
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
858
  public function section_replace_old_widget ( $item, $options ) {
859
  $html = '<tr>
860
  <th scope="row">' . __('Replace old widgets', 'BeRocket_AJAX_domain') . '</th>
@@ -2352,6 +2392,11 @@ jQuery(document).on('change', '.br_selected_area_show', br_selected_area_show);
2352
  }
2353
  return $prefix;
2354
  }
 
 
 
 
 
2355
  }
2356
 
2357
  new BeRocket_AAPF;
25
  );
26
  function __construct () {
27
  $this->info = array(
28
+ 'id' => 1,
29
+ 'version' => BeRocket_AJAX_filters_version,
30
+ 'plugin' => '',
31
+ 'slug' => '',
32
+ 'key' => '',
33
+ 'name' => '',
34
+ 'plugin_name' => 'ajax_filters',
35
+ 'full_name' => 'WooCommerce AJAX Products Filter',
36
+ 'norm_name' => 'Product Filters',
37
+ 'price' => '',
38
+ 'domain' => 'BeRocket_AJAX_domain',
39
+ 'templates' => AAPF_TEMPLATE_PATH,
40
+ 'plugin_file' => BeRocket_AJAX_filters_file,
41
+ 'plugin_dir' => __DIR__,
42
+ 'feature_template' => __DIR__ . '/templates/free/features.php'
43
  );
44
  $this->defaults = array(
45
  'plugin_key' => '',
140
  );
141
  $this->feature_list = array();
142
  $this->framework_data['fontawesome_frontend'] = true;
143
+ $this->active_libraries = array('addons', 'feature');
144
 
145
  if( is_admin() ) {
146
  require_once dirname( __FILE__ ) . '/includes/wizard.php';
247
  add_action( 'admin_notices', array( $this, 'no_woocommerce' ) );
248
  }
249
  }
250
+ add_filter('BRaapf_cache_check_md5', array($this, 'BRaapf_cache_check_md5'));
251
  }
252
  }
253
  function init_validation() {
735
  "value" => '1',
736
  'label_for' => __('Don\'t loading css file for Font Awesome on site front end. Use this only if you doesn\'t uses Font Awesome icons in widgets or you have Font Awesome in your theme.', 'BeRocket_AJAX_domain'),
737
  ),*/
738
+ 'purge_cache' => array(
739
+ "section" => "purge_cache",
740
+ "value" => "",
741
+ ),
742
  'replace_old_widget' => array(
743
  "section" => "replace_old_widget",
744
  "value" => "",
861
  </tr>';
862
  return $html;
863
  }
864
+ public function section_purge_cache ( $item, $options ) {
865
+ $html = '<tr>
866
+ <th scope="row">' . __('Purge Cache', 'BeRocket_AJAX_domain') . '</th>
867
+ <td>';
868
+ $old_filter_widgets = get_option('widget_berocket_aapf_widget');
869
+ if( ! is_array($old_filter_widgets) ) {
870
+ $old_filter_widgets = array();
871
+ }
872
+ foreach ($old_filter_widgets as $key => $value) {
873
+ if (!is_numeric($key)) {
874
+ unset($old_filter_widgets[$key]);
875
+ }
876
+ }
877
+ $html .= '
878
+ <span class="button berocket_purge_cache" data-time="'.time().'">
879
+ <input class="berocket_purge_cache_input" type="hidden" name="br_filters_options[purge_cache_time]" value="'.br_get_value_from_array($options, 'purge_cache_time').'">
880
+ ' . __('Purge Cache', 'BeRocket_AJAX_domain') . '
881
+ </span>
882
+ <p>' . __('Clear attribute/custom taxonomy cache for plugin', 'BeRocket_AJAX_domain') . '</p>
883
+ <script>
884
+ jQuery(".berocket_purge_cache").click(function() {
885
+ var $this = jQuery(this);
886
+ if( ! $this.is(".berocket_ajax_sending") ) {
887
+ $this.attr("disabled", "disabled");
888
+ var time = $this.data("time");
889
+ $this.parents(".br_framework_submit_form").addClass("br_reload_form");
890
+ $this.find(".berocket_purge_cache_input").val(time).submit();
891
+ }
892
+ });
893
+ </script>
894
+ </td>
895
+ </tr>';
896
+ return $html;
897
+ }
898
  public function section_replace_old_widget ( $item, $options ) {
899
  $html = '<tr>
900
  <th scope="row">' . __('Replace old widgets', 'BeRocket_AJAX_domain') . '</th>
2392
  }
2393
  return $prefix;
2394
  }
2395
+ public function BRaapf_cache_check_md5($md5) {
2396
+ $options = $this->get_option();
2397
+ $md5 = $md5 . br_get_value_from_array($options, 'purge_cache_time');
2398
+ return $md5;
2399
+ }
2400
  }
2401
 
2402
  new BeRocket_AAPF;
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: http://berocket.com/product/woocommerce-ajax-products-filter
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.1.1
8
- Stable tag: 1.3.1.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -187,6 +187,10 @@ You can try this plugin's admin side [here](http://berocket.com/product/woocomme
187
 
188
  == Changelog ==
189
 
 
 
 
 
190
  = 1.3.1.2 =
191
  * Fix - Loading Icon
192
  * Fix - Creation filters/groups in customizer
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.1.1
8
+ Stable tag: 1.3.1.3
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
187
 
188
  == Changelog ==
189
 
190
+ = 1.3.1.3 =
191
+ * Enhancement - Code Security
192
+ * Enhancement - Added Purge cache button
193
+
194
  = 1.3.1.2 =
195
  * Fix - Loading Icon
196
  * Fix - Creation filters/groups in customizer
templates/free/{feature.php → features.php} RENAMED
@@ -19,7 +19,7 @@
19
  <div>&nbsp;</div>
20
 
21
  <div class="row berocket_aapf_features">
22
- <div class="col-md-6 col-xs-12">
23
  <h4>Show filters above products</h4>
24
 
25
  <h5>Need more space for the products? Say no to sidebars</h5>
@@ -124,6 +124,15 @@
124
  </div>
125
  </div>
126
  <style>
 
 
 
 
 
 
 
 
 
127
  .berocket_aapf_features img {
128
  max-width: 100%;
129
  margin:auto;
@@ -143,4 +152,10 @@
143
  font-weight: 700;
144
  text-transform: uppercase;
145
  }
 
 
 
 
 
 
146
  </style>
19
  <div>&nbsp;</div>
20
 
21
  <div class="row berocket_aapf_features">
22
+ <div>
23
  <h4>Show filters above products</h4>
24
 
25
  <h5>Need more space for the products? Say no to sidebars</h5>
124
  </div>
125
  </div>
126
  <style>
127
+ .berocket_aapf_features > div {
128
+ width: 50%;
129
+ float: left;
130
+ padding: 10px;
131
+ box-sizing: border-box;
132
+ }
133
+ .berocket_aapf_features > div:nth-child(2n+1) {
134
+ clear: left;
135
+ }
136
  .berocket_aapf_features img {
137
  max-width: 100%;
138
  margin:auto;
152
  font-weight: 700;
153
  text-transform: uppercase;
154
  }
155
+ @media screen and (max-width: 767px){
156
+ .berocket_aapf_features > div {
157
+ width: 100%;
158
+ float: none;
159
+ }
160
+ }
161
  </style>
templates/free/free/feature.php DELETED
@@ -1,146 +0,0 @@
1
- <div class="row berocket_aapf_features">
2
- <div class="col-md-6 col-xs-12">
3
- <h4>Choose best layout for your filter</h4>
4
-
5
- <h5>Our WooCommerce AJAX Products Filter offers several layouts including slider, image and color</h5>
6
-
7
- <div class="demo-site"><a href="http://woocommerce-products-filter.berocket.com/shop/" target="_blank">[ demo site ]</a></div>
8
- <img alt="Choose best layout for your filter" src="https://berocket.com/images/features/filters/filters-types.jpg" /></div>
9
-
10
- <div class="col-md-6 col-xs-12">
11
- <h4>Pagination and Order without page reloading</h4>
12
-
13
- <h5>Users will get next page loaded ordered by their preferences and without page reloading</h5>
14
-
15
- <div class="demo-site"><a href="http://woocommerce-products-filter.berocket.com/shop/" target="_blank">[ demo site ]</a></div>
16
- <img alt="Pagination and Order without page reloading" src="https://berocket.com/images/features/filters/ajax_order_nav.jpg" /></div>
17
- </div>
18
-
19
- <div>&nbsp;</div>
20
-
21
- <div class="row berocket_aapf_features">
22
- <div class="col-md-6 col-xs-12">
23
- <h4>Show filters above products</h4>
24
-
25
- <h5>Need more space for the products? Say no to sidebars</h5>
26
-
27
- <div class="demo-site">
28
- <a href="http://woocommerce-products-filter.berocket.com/product-category/tshirts/" target="_blank">[ demo site ]</a>
29
- </div>
30
- <img alt="Show filters above products" src="https://berocket.com/images/features/filters/above_products.jpg" />
31
- </div>
32
-
33
- <div>
34
- <h4>SEO friendly urls</h4>
35
-
36
- <h5>Use Nice URLs with canonicalization and slugs instead of IDs</h5>
37
-
38
- <div class="demo-site">
39
- <a href="" target="_blank">[ demo site ]</a>
40
- </div>
41
-
42
- <div>&nbsp;</div>
43
- <img alt="SEO friendly urls" src="https://berocket.com/images/features/filters/urls.jpg" />
44
- </div>
45
-
46
- <div>
47
- <h4>Show results before filtering</h4>
48
-
49
- <h5>Show users what they will get before filters applied. Fast and efficient</h5>
50
-
51
- <div class="demo-site">
52
- <a href="http://woocommerce-products-filter.berocket.com/woocommerce-products-filter-demo-4/" target="_blank">[ demo site ]</a>
53
- </div>
54
-
55
- <div>&nbsp;</div>
56
-
57
- <img alt="Show results before filtering" src="https://berocket.com/images/features/filters/before_filter.jpg" />
58
- </div>
59
-
60
- <div>
61
- <h4>Include/Exclude values</h4>
62
-
63
- <h5>Show only needed values from the attribute or hide few</h5>
64
-
65
- <div class="demo-site">
66
- <a href="http://woocommerce-products-filter.berocket.com/woocommerce-products-filter-demo-4/" target="_blank">[ demo site ]</a>
67
- </div>
68
- <img alt="Include/Exclude values" src="https://berocket.com/images/features/filters/include_exclude.jpg" />
69
- </div>
70
-
71
- <div>
72
- <h4>Search Box on any page</h4>
73
-
74
- <h5>Users can pre-fill filters before visiting shop page</h5>
75
-
76
- <div class="demo-site">
77
- <a href="http://woocommerce-products-filter.berocket.com/" target="_blank">[ demo site ]</a>
78
- </div>
79
- <img alt="Search Box on any page" src="https://berocket.com/images/features/filters/searchbox.jpg" />
80
- </div>
81
-
82
- <div>
83
- <h4>Update filters with user needs</h4>
84
-
85
- <h5>Hate &quot;No Products!&quot; message? Hide values without products on the go</h5>
86
-
87
- <div class="demo-site">
88
- <a href="http://woocommerce-products-filter.berocket.com/shop/" target="_blank">[ demo site ]</a>
89
- </div>
90
-
91
- <div>&nbsp;</div>
92
- <img alt="Update filters with user needs" src="https://berocket.com/images/features/filters/reload.jpg" />
93
- </div>
94
-
95
- <div>
96
- <h4>Brands<br />
97
- <small>(require our Brands plugin)</small></h4>
98
-
99
- <h5>Users love brands. Help them find favorite brands faster</h5>
100
-
101
- <div class="demo-site">
102
- <a href="http://woocommerce-products-filter.berocket.com/woocommerce-products-filter-demo-5/" target="_blank">[ demo site ]</a>
103
- </div>
104
- <img alt="Brands" src="https://berocket.com/images/features/filters/brands.jpg" />
105
- </div>
106
-
107
- <div>
108
- <h4>Price Ranges and Sliders for Attributes</h4>
109
-
110
- <h5>Love sliders? Use them now for the attributes too!</h5>
111
-
112
- <div class="demo-site">
113
- <a href="http://woocommerce-products-filter.berocket.com/woocommerce-products-filter-demo-2/" target="_blank">[ demo site ]</a>
114
- </div>
115
- <img alt="Price Ranges and Sliders for Attributes" src="https://berocket.com/images/features/filters/range_slider.jpg" />
116
- </div>
117
-
118
-
119
- <div>
120
- <h4>WPML and Polylang compatibility</h4>
121
-
122
- <h5>EASILY TRANSLATE THE PLUGIN TO OTHER LANGUAGES WITH THE POWERFUL WPML AND POLYLANG TOOLS</h5>
123
- <img alt="WPML and Polylang compatibility" src="https://berocket.com/img/docs/wpml_polylang.png" />
124
- </div>
125
- </div>
126
- <style>
127
- .berocket_aapf_features img {
128
- max-width: 100%;
129
- margin:auto;
130
- display: block;
131
- }
132
- .berocket_aapf_features h4,
133
- .berocket_aapf_features h5,
134
- .berocket_aapf_features .demo-site {
135
- text-align: center;
136
- }
137
- .berocket_aapf_features h5 {
138
- font-size: 17px;
139
- font-weight: 500;
140
- }
141
- .berocket_aapf_features h4 {
142
- font-size: 26px;
143
- font-weight: 700;
144
- text-transform: uppercase;
145
- }
146
- </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wizard/setup-wizard.php CHANGED
@@ -71,7 +71,7 @@ if( ! class_exists('BeRocket_Setup_Wizard') ) {
71
  if ( false === $step_index ) {
72
  return '';
73
  }
74
- return add_query_arg( 'step', $keys[ $step_index + 1 ], remove_query_arg( 'activate_error' ) );
75
  }
76
  public function redirect_to_next_step() {
77
  wp_redirect( esc_url_raw( $this->get_next_step_link() ) );
@@ -130,7 +130,7 @@ if( ! class_exists('BeRocket_Setup_Wizard') ) {
130
  }
131
  ?>" href="<?php
132
  if ( array_search( $this->step, array_keys( $this->steps ) ) > array_search( $step_key, array_keys( $this->steps ) ) ) {
133
- echo add_query_arg( 'step', $step_key, remove_query_arg( 'activate_error' ) );
134
  } else {
135
  echo '#'.$step_key;
136
  }
71
  if ( false === $step_index ) {
72
  return '';
73
  }
74
+ return esc_url_raw(add_query_arg( 'step', $keys[ $step_index + 1 ], remove_query_arg( 'activate_error' ) ));
75
  }
76
  public function redirect_to_next_step() {
77
  wp_redirect( esc_url_raw( $this->get_next_step_link() ) );
130
  }
131
  ?>" href="<?php
132
  if ( array_search( $this->step, array_keys( $this->steps ) ) > array_search( $step_key, array_keys( $this->steps ) ) ) {
133
+ echo esc_url_raw(add_query_arg( 'step', $step_key, remove_query_arg( 'activate_error' ) ));
134
  } else {
135
  echo '#'.$step_key;
136
  }
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/
5
  * Description: Unlimited AJAX products filters to make your shop perfect
6
- * Version: 1.3.1.2
7
  * Author: BeRocket
8
  * Requires at least: 4.0
9
  * Author URI: http://berocket.com
@@ -13,6 +13,6 @@
13
  * Domain Path: /languages/
14
  * WC tested up to: 3.5.7
15
  */
16
- define( "BeRocket_AJAX_filters_version", '1.3.1.2' );
17
  define( "BeRocket_AJAX_filters_file", __FILE__ );
18
  include_once('main.php');
3
  * Plugin Name: Advanced AJAX Product Filters for WooCommerce
4
  * Plugin URI: https://wordpress.org/plugins/woocommerce-ajax-filters/
5
  * Description: Unlimited AJAX products filters to make your shop perfect
6
+ * Version: 1.3.1.3
7
  * Author: BeRocket
8
  * Requires at least: 4.0
9
  * Author URI: http://berocket.com
13
  * Domain Path: /languages/
14
  * WC tested up to: 3.5.7
15
  */
16
+ define( "BeRocket_AJAX_filters_version", '1.3.1.3' );
17
  define( "BeRocket_AJAX_filters_file", __FILE__ );
18
  include_once('main.php');