Version Description
- Enhancement - Compatibility version: WooCommerce 5.4
- Enhancement - Price slider with multiple taxonomy page
- Enhancement - Speed up Additional Tables generation
- Enhancement - Use WordPress cron for Additional Tables generation
- Enhancement - Generate more data with single request for Additional Tables generation
- Fix - Get templates when plugin settings open
- Fix - Hide selected filters area on page load
Download this release
Release Info
Developer | RazyRx |
Plugin | Advanced AJAX Product Filters |
Version | 1.5.4.6 |
Comparing to | |
See all releases |
Code changes from version 1.5.4.5 to 1.5.4.6
- addons/additional_tables/additional_tables.php +136 -159
- berocket/includes/updater.php +52 -9
- includes/display_filter/selected_area.php +7 -0
- includes/functions.php +1 -1
- includes/new_widget.php +2 -2
- main.php +1 -0
- readme.txt +10 -1
- woocommerce-filters.php +3 -3
addons/additional_tables/additional_tables.php
CHANGED
@@ -3,33 +3,24 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
3 |
public $addon_file = __FILE__;
|
4 |
public $plugin_name = 'ajax_filters';
|
5 |
public $php_file_name = 'add_table';
|
6 |
-
public $last_postion =
|
7 |
public $position_data = array(
|
8 |
1 => array(
|
9 |
-
'percentage' =>
|
10 |
),
|
11 |
2 => array(
|
12 |
-
'percentage' => 1
|
13 |
-
),
|
14 |
-
3 => array(
|
15 |
'percentage' => 13
|
16 |
),
|
17 |
-
|
18 |
-
'percentage' => 1
|
19 |
-
),
|
20 |
-
5 => array(
|
21 |
'percentage' => 80
|
22 |
),
|
23 |
-
|
24 |
-
'percentage' => 1
|
25 |
-
),
|
26 |
-
7 => array(
|
27 |
'percentage' => 2
|
28 |
),
|
29 |
-
|
30 |
'percentage' => 1
|
31 |
),
|
32 |
-
|
33 |
'percentage' => 0
|
34 |
),
|
35 |
);
|
@@ -39,7 +30,8 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
39 |
$create_position = $this->get_current_create_position();
|
40 |
if( in_array($this->addon_file, $active_addons) ) {
|
41 |
if( $create_position < $this->last_postion ) {
|
42 |
-
$this
|
|
|
43 |
$create_position = $this->get_current_create_position();
|
44 |
if( $create_position < $this->last_postion ) {
|
45 |
add_action('admin_init', array($this, 'activate_hooks'));
|
@@ -60,6 +52,23 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
60 |
}
|
61 |
}
|
62 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
function get_addon_data() {
|
64 |
$data = parent::get_addon_data();
|
65 |
return array_merge($data, array(
|
@@ -86,27 +95,21 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
86 |
update_option('BeRocket_aapf_additional_tables_addon_position_data', $data);
|
87 |
}
|
88 |
function activate($current_position = -1, $brajax = false) {
|
|
|
|
|
|
|
89 |
if( $current_position == -1 ) {
|
90 |
$current_position = $this->get_current_create_position();
|
91 |
}
|
92 |
if( empty($current_position) && $brajax ) {
|
93 |
-
$this->
|
94 |
} elseif( $current_position == 2 && $brajax ) {
|
95 |
-
$this->create_table_braapf_product_stock_status_parent();
|
96 |
-
} elseif( $current_position == 3 && $brajax ) {
|
97 |
$this->insert_table_braapf_product_stock_status_parent();
|
98 |
-
} elseif( $current_position ==
|
99 |
-
$this->create_table_braapf_product_variation_attributes();
|
100 |
-
} elseif( $current_position == 5 && $brajax ) {
|
101 |
$this->insert_table_braapf_product_variation_attributes();
|
102 |
-
} elseif( $current_position ==
|
103 |
-
$this->create_table_braapf_variation_attributes();
|
104 |
-
} elseif( $current_position == 7 && $brajax ) {
|
105 |
$this->insert_table_braapf_variation_attributes();
|
106 |
-
} elseif( $current_position ==
|
107 |
-
wp_unschedule_hook('berocket_create_table_braapf_product_stock_status_parent');
|
108 |
-
wp_unschedule_hook('berocket_create_table_braapf_product_variation_attributes');
|
109 |
-
wp_unschedule_hook('berocket_create_table_braapf_variation_attributes');
|
110 |
if( class_exists('berocket_information_notices') ) {
|
111 |
new berocket_information_notices(array(
|
112 |
'name' => $this->plugin_name.'_additional_table_status_end',
|
@@ -119,14 +122,15 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
119 |
'height' => 50,
|
120 |
));
|
121 |
}
|
122 |
-
$this->set_current_create_position(
|
|
|
|
|
|
|
|
|
123 |
}
|
124 |
}
|
125 |
function activate_hooks() {
|
126 |
if( function_exists('wc_update_product_lookup_tables_is_running') && ! wc_update_product_lookup_tables_is_running() ) {
|
127 |
-
add_action('berocket_create_table_braapf_product_stock_status_parent', array($this, 'insert_table_braapf_product_stock_status_parent'), 10, 3);
|
128 |
-
add_action('berocket_create_table_braapf_product_variation_attributes', array($this, 'insert_table_braapf_product_variation_attributes'), 10, 3);
|
129 |
-
add_action('berocket_create_table_braapf_variation_attributes', array($this, 'insert_table_braapf_variation_attributes'), 10);
|
130 |
//Notices
|
131 |
add_action( "wp_ajax_braapf_additional_table_status", array( $this, 'get_global_status_ajax' ) );
|
132 |
add_action( "wp_footer", array( $this, 'script_update' ) );
|
@@ -143,7 +147,7 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
143 |
$current_status = $this->get_current_global_status();
|
144 |
$text = sprintf(__('Additional tables are generating. They will be used after generation is completed. Current status is <strong><span class="braapf_additional_table_status">%d</span>%s</strong>', 'BeRocket_AJAX_domain'), $current_status, '%');
|
145 |
$current_position = $this->get_current_create_position();
|
146 |
-
if( $current_position ==
|
147 |
$run_data = $this->get_current_create_position_data();
|
148 |
if ( ! empty($run_data) && is_array($run_data) && isset($run_data['min_id']) && isset($run_data['max_id'])
|
149 |
&& ( intval($run_data['max_id']) - intval($run_data['min_id']) ) > 1000000 ) {
|
@@ -242,16 +246,55 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
242 |
'cron' => (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON ? 'DISABLED' : 'ENABLED')
|
243 |
));
|
244 |
}
|
245 |
-
function
|
246 |
$run_data = $this->get_current_create_position_data();
|
247 |
if( ! empty($run_data) && ! empty($run_data['run']) ) {
|
248 |
return false;
|
249 |
}
|
|
|
250 |
$this->set_current_create_position_data(array(
|
251 |
'status' => 0,
|
252 |
'run' => true,
|
253 |
));
|
254 |
-
$this->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
global $wpdb;
|
256 |
$charset_collate = $wpdb->get_charset_collate();
|
257 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
@@ -271,21 +314,8 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
271 |
) $charset_collate;";
|
272 |
$query_status = dbDelta( $sql );
|
273 |
$this->save_query_error($sql, $query_status);
|
274 |
-
$this->set_current_create_position(2);
|
275 |
-
$this->set_current_create_position_data(array(
|
276 |
-
'status' => 0,
|
277 |
-
'run' => false,
|
278 |
-
));
|
279 |
}
|
280 |
function create_table_braapf_product_stock_status_parent() {
|
281 |
-
$run_data = $this->get_current_create_position_data();
|
282 |
-
if( ! empty($run_data) && ! empty($run_data['run']) ) {
|
283 |
-
return false;
|
284 |
-
}
|
285 |
-
$this->set_current_create_position_data(array(
|
286 |
-
'status' => 0,
|
287 |
-
'run' => true,
|
288 |
-
));
|
289 |
global $wpdb;
|
290 |
$charset_collate = $wpdb->get_charset_collate();
|
291 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
@@ -301,26 +331,43 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
301 |
) $charset_collate;";
|
302 |
$query_status = dbDelta( $sql );
|
303 |
$this->save_query_error($sql, $query_status);
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
}
|
325 |
function insert_table_braapf_product_stock_status_parent() {
|
326 |
$run_data = $this->get_current_create_position_data();
|
@@ -368,60 +415,25 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
368 |
'min_id' => $min_id,
|
369 |
'max_id' => $max_id
|
370 |
));
|
371 |
-
wp_schedule_single_event( (time()+1), 'berocket_create_table_braapf_product_stock_status_parent' );
|
372 |
} else {
|
373 |
-
$
|
374 |
-
$
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
392 |
-
$table_name = $wpdb->prefix . 'braapf_product_variation_attributes';
|
393 |
-
$sql = "DROP TABLE IF EXISTS {$table_name};";
|
394 |
-
$wpdb->query($sql);
|
395 |
-
$sql = "CREATE TABLE $table_name (
|
396 |
-
post_id bigint(20) NOT NULL,
|
397 |
-
parent_id bigint(20) NOT NULL,
|
398 |
-
meta_key varchar(32) NOT NULL,
|
399 |
-
meta_value_id bigint(20) NOT NULL,
|
400 |
-
INDEX post_id (post_id),
|
401 |
-
INDEX meta_key (meta_key),
|
402 |
-
INDEX meta_value_id (meta_value_id),
|
403 |
-
UNIQUE uniqueid (post_id, meta_key, meta_value_id)
|
404 |
-
) $charset_collate;";
|
405 |
-
$query_status = dbDelta( $sql );
|
406 |
-
$this->save_query_error($sql, $query_status);
|
407 |
-
$sql = "SELECT MIN({$wpdb->postmeta}.meta_id) as min, MAX({$wpdb->postmeta}.meta_id) as max FROM {$wpdb->postmeta}";
|
408 |
-
$postmeta_data = $wpdb->get_row($sql);
|
409 |
-
if( ! empty($postmeta_data) && ! empty($postmeta_data->min) && ! empty($postmeta_data->max) ) {
|
410 |
-
$this->set_current_create_position(5);
|
411 |
-
$this->set_current_create_position_data(array(
|
412 |
-
'status' => 0,
|
413 |
-
'run' => false,
|
414 |
-
'start_id' => $postmeta_data->min,
|
415 |
-
'min_id' => $postmeta_data->min,
|
416 |
-
'max_id' => $postmeta_data->max
|
417 |
-
));
|
418 |
-
wp_schedule_single_event( (time()+1), 'berocket_create_table_braapf_product_variation_attributes' );
|
419 |
-
} else {
|
420 |
-
$this->set_current_create_position(6);
|
421 |
-
$this->set_current_create_position_data(array(
|
422 |
-
'status' => 0,
|
423 |
-
'run' => false,
|
424 |
-
));
|
425 |
}
|
426 |
}
|
427 |
function insert_table_braapf_product_variation_attributes() {
|
@@ -478,46 +490,14 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
478 |
'min_id' => $min_id,
|
479 |
'max_id' => $max_id
|
480 |
));
|
481 |
-
wp_schedule_single_event( (time()+1), 'berocket_create_table_braapf_product_variation_attributes' );
|
482 |
} else {
|
483 |
-
$this->set_current_create_position(
|
484 |
$this->set_current_create_position_data(array(
|
485 |
'status' => 0,
|
486 |
'run' => false
|
487 |
));
|
488 |
}
|
489 |
}
|
490 |
-
function create_table_braapf_variation_attributes() {
|
491 |
-
$run_data = $this->get_current_create_position_data();
|
492 |
-
if( ! empty($run_data) && ! empty($run_data['run']) ) {
|
493 |
-
return false;
|
494 |
-
}
|
495 |
-
$this->set_current_create_position_data(array(
|
496 |
-
'status' => 0,
|
497 |
-
'run' => true,
|
498 |
-
));
|
499 |
-
global $wpdb;
|
500 |
-
$charset_collate = $wpdb->get_charset_collate();
|
501 |
-
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
502 |
-
$table_name = $wpdb->prefix . 'braapf_variation_attributes';
|
503 |
-
$sql = "DROP TABLE IF EXISTS {$table_name};";
|
504 |
-
$wpdb->query($sql);
|
505 |
-
$sql = "CREATE TABLE $table_name (
|
506 |
-
post_id bigint(20) NOT NULL,
|
507 |
-
taxonomy varchar(32) NOT NULL,
|
508 |
-
INDEX post_id (post_id),
|
509 |
-
INDEX taxonomy (taxonomy),
|
510 |
-
UNIQUE uniqueid (post_id, taxonomy)
|
511 |
-
) $charset_collate;";
|
512 |
-
$query_status = dbDelta( $sql );
|
513 |
-
$this->save_query_error($sql, $query_status);
|
514 |
-
$this->set_current_create_position(7);
|
515 |
-
$this->set_current_create_position_data(array(
|
516 |
-
'status' => 0,
|
517 |
-
'run' => false,
|
518 |
-
));
|
519 |
-
wp_schedule_single_event( (time()+1), 'berocket_create_table_braapf_variation_attributes' );
|
520 |
-
}
|
521 |
function insert_table_braapf_variation_attributes() {
|
522 |
$run_data = $this->get_current_create_position_data();
|
523 |
if( ! empty($run_data) && ! empty($run_data['run']) ) {
|
@@ -542,7 +522,7 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
542 |
$this->save_query_error($sql);
|
543 |
}
|
544 |
}
|
545 |
-
$this->set_current_create_position(
|
546 |
$this->set_current_create_position_data(array(
|
547 |
'status' => 100,
|
548 |
'run' => false,
|
@@ -550,9 +530,6 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
550 |
}
|
551 |
function deactivate() {
|
552 |
global $wpdb;
|
553 |
-
wp_unschedule_hook('berocket_create_table_braapf_product_stock_status_parent');
|
554 |
-
wp_unschedule_hook('berocket_create_table_braapf_product_variation_attributes');
|
555 |
-
wp_unschedule_hook('berocket_create_table_braapf_variation_attributes');
|
556 |
$tables_drop = array(
|
557 |
'braapf_product_stock_status_parent',
|
558 |
'braapf_product_variation_attributes',
|
3 |
public $addon_file = __FILE__;
|
4 |
public $plugin_name = 'ajax_filters';
|
5 |
public $php_file_name = 'add_table';
|
6 |
+
public $last_postion = 6;
|
7 |
public $position_data = array(
|
8 |
1 => array(
|
9 |
+
'percentage' => 4
|
10 |
),
|
11 |
2 => array(
|
|
|
|
|
|
|
12 |
'percentage' => 13
|
13 |
),
|
14 |
+
3 => array(
|
|
|
|
|
|
|
15 |
'percentage' => 80
|
16 |
),
|
17 |
+
4 => array(
|
|
|
|
|
|
|
18 |
'percentage' => 2
|
19 |
),
|
20 |
+
5 => array(
|
21 |
'percentage' => 1
|
22 |
),
|
23 |
+
6 => array(
|
24 |
'percentage' => 0
|
25 |
),
|
26 |
);
|
30 |
$create_position = $this->get_current_create_position();
|
31 |
if( in_array($this->addon_file, $active_addons) ) {
|
32 |
if( $create_position < $this->last_postion ) {
|
33 |
+
add_action( "braapf_additional_table_cron", array( $this, 'cron' ), 10 );
|
34 |
+
add_action('init', array($this, 'init_activate'), 3);
|
35 |
$create_position = $this->get_current_create_position();
|
36 |
if( $create_position < $this->last_postion ) {
|
37 |
add_action('admin_init', array($this, 'activate_hooks'));
|
52 |
}
|
53 |
}
|
54 |
}
|
55 |
+
function cron() {
|
56 |
+
$start_time = time();
|
57 |
+
$time_limit = ( (function_exists('ini_get') && (int)ini_get('max_execution_time')) ? (int)ini_get('max_execution_time') : 30 );
|
58 |
+
if( $time_limit > 10 ) {
|
59 |
+
$time_limit = $time_limit/2;
|
60 |
+
} else {
|
61 |
+
$time_limit = 0;
|
62 |
+
}
|
63 |
+
do {
|
64 |
+
$this->activate(-1, true);
|
65 |
+
$end_time = time();
|
66 |
+
$create_position = $this->get_current_create_position();
|
67 |
+
} while( $time_limit > ($end_time - $start_time) && $create_position < $this->last_postion );
|
68 |
+
}
|
69 |
+
function init_activate() {
|
70 |
+
$this->activate();
|
71 |
+
}
|
72 |
function get_addon_data() {
|
73 |
$data = parent::get_addon_data();
|
74 |
return array_merge($data, array(
|
95 |
update_option('BeRocket_aapf_additional_tables_addon_position_data', $data);
|
96 |
}
|
97 |
function activate($current_position = -1, $brajax = false) {
|
98 |
+
if( function_exists('wc_update_product_lookup_tables_is_running') && wc_update_product_lookup_tables_is_running() ) {
|
99 |
+
return;
|
100 |
+
}
|
101 |
if( $current_position == -1 ) {
|
102 |
$current_position = $this->get_current_create_position();
|
103 |
}
|
104 |
if( empty($current_position) && $brajax ) {
|
105 |
+
$this->create_all_tables();
|
106 |
} elseif( $current_position == 2 && $brajax ) {
|
|
|
|
|
107 |
$this->insert_table_braapf_product_stock_status_parent();
|
108 |
+
} elseif( $current_position == 3 && $brajax ) {
|
|
|
|
|
109 |
$this->insert_table_braapf_product_variation_attributes();
|
110 |
+
} elseif( $current_position == 4 && $brajax ) {
|
|
|
|
|
111 |
$this->insert_table_braapf_variation_attributes();
|
112 |
+
} elseif( $current_position == 5 ) {
|
|
|
|
|
|
|
113 |
if( class_exists('berocket_information_notices') ) {
|
114 |
new berocket_information_notices(array(
|
115 |
'name' => $this->plugin_name.'_additional_table_status_end',
|
122 |
'height' => 50,
|
123 |
));
|
124 |
}
|
125 |
+
$this->set_current_create_position(6);
|
126 |
+
wp_clear_scheduled_hook('braapf_additional_table_cron');
|
127 |
+
}
|
128 |
+
if( empty($current_position) || $current_position < 5 ) {
|
129 |
+
wp_schedule_single_event(time(), 'braapf_additional_table_cron');
|
130 |
}
|
131 |
}
|
132 |
function activate_hooks() {
|
133 |
if( function_exists('wc_update_product_lookup_tables_is_running') && ! wc_update_product_lookup_tables_is_running() ) {
|
|
|
|
|
|
|
134 |
//Notices
|
135 |
add_action( "wp_ajax_braapf_additional_table_status", array( $this, 'get_global_status_ajax' ) );
|
136 |
add_action( "wp_footer", array( $this, 'script_update' ) );
|
147 |
$current_status = $this->get_current_global_status();
|
148 |
$text = sprintf(__('Additional tables are generating. They will be used after generation is completed. Current status is <strong><span class="braapf_additional_table_status">%d</span>%s</strong>', 'BeRocket_AJAX_domain'), $current_status, '%');
|
149 |
$current_position = $this->get_current_create_position();
|
150 |
+
if( $current_position == 2 ) {
|
151 |
$run_data = $this->get_current_create_position_data();
|
152 |
if ( ! empty($run_data) && is_array($run_data) && isset($run_data['min_id']) && isset($run_data['max_id'])
|
153 |
&& ( intval($run_data['max_id']) - intval($run_data['min_id']) ) > 1000000 ) {
|
246 |
'cron' => (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON ? 'DISABLED' : 'ENABLED')
|
247 |
));
|
248 |
}
|
249 |
+
function create_all_tables() {
|
250 |
$run_data = $this->get_current_create_position_data();
|
251 |
if( ! empty($run_data) && ! empty($run_data['run']) ) {
|
252 |
return false;
|
253 |
}
|
254 |
+
global $wpdb;
|
255 |
$this->set_current_create_position_data(array(
|
256 |
'status' => 0,
|
257 |
'run' => true,
|
258 |
));
|
259 |
+
$this->create_table_braapf_term_taxonomy_hierarchical();
|
260 |
+
$this->create_table_braapf_product_stock_status_parent();
|
261 |
+
$this->create_table_braapf_product_variation_attributes();
|
262 |
+
$this->create_table_braapf_variation_attributes();
|
263 |
+
|
264 |
+
$sql = "SELECT MIN({$wpdb->prefix}wc_product_meta_lookup.product_id) as min, MAX({$wpdb->prefix}wc_product_meta_lookup.product_id) as max FROM {$wpdb->prefix}wc_product_meta_lookup";
|
265 |
+
$product_data = $wpdb->get_row($sql);
|
266 |
+
$this->save_query_error($sql, $product_data);
|
267 |
+
if( ! empty($product_data) && ! empty($product_data->min) && ! empty($product_data->max) ) {
|
268 |
+
$this->set_current_create_position(2);
|
269 |
+
$this->set_current_create_position_data(array(
|
270 |
+
'status' => 0,
|
271 |
+
'run' => false,
|
272 |
+
'start_id' => $product_data->min,
|
273 |
+
'min_id' => $product_data->min,
|
274 |
+
'max_id' => $product_data->max
|
275 |
+
));
|
276 |
+
} else {
|
277 |
+
$sql = "SELECT MIN({$wpdb->postmeta}.meta_id) as min, MAX({$wpdb->postmeta}.meta_id) as max FROM {$wpdb->postmeta}";
|
278 |
+
$postmeta_data = $wpdb->get_row($sql);
|
279 |
+
if( ! empty($postmeta_data) && ! empty($postmeta_data->min) && ! empty($postmeta_data->max) ) {
|
280 |
+
$this->set_current_create_position(3);
|
281 |
+
$this->set_current_create_position_data(array(
|
282 |
+
'status' => 0,
|
283 |
+
'run' => false,
|
284 |
+
'start_id' => $postmeta_data->min,
|
285 |
+
'min_id' => $postmeta_data->min,
|
286 |
+
'max_id' => $postmeta_data->max
|
287 |
+
));
|
288 |
+
} else {
|
289 |
+
$this->set_current_create_position(4);
|
290 |
+
$this->set_current_create_position_data(array(
|
291 |
+
'status' => 0,
|
292 |
+
'run' => false,
|
293 |
+
));
|
294 |
+
}
|
295 |
+
}
|
296 |
+
}
|
297 |
+
function create_table_braapf_term_taxonomy_hierarchical() {
|
298 |
global $wpdb;
|
299 |
$charset_collate = $wpdb->get_charset_collate();
|
300 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
314 |
) $charset_collate;";
|
315 |
$query_status = dbDelta( $sql );
|
316 |
$this->save_query_error($sql, $query_status);
|
|
|
|
|
|
|
|
|
|
|
317 |
}
|
318 |
function create_table_braapf_product_stock_status_parent() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
319 |
global $wpdb;
|
320 |
$charset_collate = $wpdb->get_charset_collate();
|
321 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
331 |
) $charset_collate;";
|
332 |
$query_status = dbDelta( $sql );
|
333 |
$this->save_query_error($sql, $query_status);
|
334 |
+
}
|
335 |
+
function create_table_braapf_product_variation_attributes() {
|
336 |
+
global $wpdb;
|
337 |
+
$charset_collate = $wpdb->get_charset_collate();
|
338 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
339 |
+
$table_name = $wpdb->prefix . 'braapf_product_variation_attributes';
|
340 |
+
$sql = "DROP TABLE IF EXISTS {$table_name};";
|
341 |
+
$wpdb->query($sql);
|
342 |
+
$sql = "CREATE TABLE $table_name (
|
343 |
+
post_id bigint(20) NOT NULL,
|
344 |
+
parent_id bigint(20) NOT NULL,
|
345 |
+
meta_key varchar(32) NOT NULL,
|
346 |
+
meta_value_id bigint(20) NOT NULL,
|
347 |
+
INDEX post_id (post_id),
|
348 |
+
INDEX meta_key (meta_key),
|
349 |
+
INDEX meta_value_id (meta_value_id),
|
350 |
+
UNIQUE uniqueid (post_id, meta_key, meta_value_id)
|
351 |
+
) $charset_collate;";
|
352 |
+
$query_status = dbDelta( $sql );
|
353 |
+
$this->save_query_error($sql, $query_status);
|
354 |
+
}
|
355 |
+
function create_table_braapf_variation_attributes() {
|
356 |
+
global $wpdb;
|
357 |
+
$charset_collate = $wpdb->get_charset_collate();
|
358 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
359 |
+
$table_name = $wpdb->prefix . 'braapf_variation_attributes';
|
360 |
+
$sql = "DROP TABLE IF EXISTS {$table_name};";
|
361 |
+
$wpdb->query($sql);
|
362 |
+
$sql = "CREATE TABLE $table_name (
|
363 |
+
post_id bigint(20) NOT NULL,
|
364 |
+
taxonomy varchar(32) NOT NULL,
|
365 |
+
INDEX post_id (post_id),
|
366 |
+
INDEX taxonomy (taxonomy),
|
367 |
+
UNIQUE uniqueid (post_id, taxonomy)
|
368 |
+
) $charset_collate;";
|
369 |
+
$query_status = dbDelta( $sql );
|
370 |
+
$this->save_query_error($sql, $query_status);
|
371 |
}
|
372 |
function insert_table_braapf_product_stock_status_parent() {
|
373 |
$run_data = $this->get_current_create_position_data();
|
415 |
'min_id' => $min_id,
|
416 |
'max_id' => $max_id
|
417 |
));
|
|
|
418 |
} else {
|
419 |
+
$sql = "SELECT MIN({$wpdb->postmeta}.meta_id) as min, MAX({$wpdb->postmeta}.meta_id) as max FROM {$wpdb->postmeta}";
|
420 |
+
$postmeta_data = $wpdb->get_row($sql);
|
421 |
+
if( ! empty($postmeta_data) && isset($postmeta_data->min) && isset($postmeta_data->max) ) {
|
422 |
+
$this->set_current_create_position(3);
|
423 |
+
$this->set_current_create_position_data(array(
|
424 |
+
'status' => 0,
|
425 |
+
'run' => false,
|
426 |
+
'start_id' => $postmeta_data->min,
|
427 |
+
'min_id' => $postmeta_data->min,
|
428 |
+
'max_id' => $postmeta_data->max
|
429 |
+
));
|
430 |
+
} else {
|
431 |
+
$this->set_current_create_position(4);
|
432 |
+
$this->set_current_create_position_data(array(
|
433 |
+
'status' => 0,
|
434 |
+
'run' => false,
|
435 |
+
));
|
436 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
437 |
}
|
438 |
}
|
439 |
function insert_table_braapf_product_variation_attributes() {
|
490 |
'min_id' => $min_id,
|
491 |
'max_id' => $max_id
|
492 |
));
|
|
|
493 |
} else {
|
494 |
+
$this->set_current_create_position(4);
|
495 |
$this->set_current_create_position_data(array(
|
496 |
'status' => 0,
|
497 |
'run' => false
|
498 |
));
|
499 |
}
|
500 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
501 |
function insert_table_braapf_variation_attributes() {
|
502 |
$run_data = $this->get_current_create_position_data();
|
503 |
if( ! empty($run_data) && ! empty($run_data['run']) ) {
|
522 |
$this->save_query_error($sql);
|
523 |
}
|
524 |
}
|
525 |
+
$this->set_current_create_position(5);
|
526 |
$this->set_current_create_position_data(array(
|
527 |
'status' => 100,
|
528 |
'run' => false,
|
530 |
}
|
531 |
function deactivate() {
|
532 |
global $wpdb;
|
|
|
|
|
|
|
533 |
$tables_drop = array(
|
534 |
'braapf_product_stock_status_parent',
|
535 |
'braapf_product_variation_attributes',
|
berocket/includes/updater.php
CHANGED
@@ -85,10 +85,18 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
|
|
85 |
|
86 |
public static function error_log() {
|
87 |
if ( self::$debug_mode ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
self::$error_log = apply_filters( 'BeRocket_updater_error_log', self::$error_log );
|
89 |
self::$error_log[ 'real_memory_usage' ] = memory_get_peak_usage( true );
|
90 |
self::$error_log[ 'script_memory_usage' ] = memory_get_peak_usage( false );
|
91 |
-
self::$error_log[ 'plugins' ] =
|
92 |
self::$error_log[ 'memory_limit' ] = ini_get( 'memory_limit' );
|
93 |
self::$error_log[ 'WP_DEBUG' ] = 'WP_DEBUG:' . ( defined( 'WP_DEBUG' ) ? ( WP_DEBUG ? 'true' : 'false' ) : 'false' ) . '; WP_DEBUG_DISPLAY:' . ( defined( 'WP_DEBUG_DISPLAY' ) ? ( WP_DEBUG_DISPLAY ? 'true' : 'false' ) : 'false' );
|
94 |
$error_log = unserialize(preg_replace('/R:\d+/', 's:18:"RECURSION DETECTED"', serialize(self::$error_log)));
|
@@ -291,6 +299,18 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
|
|
291 |
$fast = ! empty($_POST[ 'fast' ]);
|
292 |
$site_url = get_site_url();
|
293 |
$plugins = self::$plugin_info;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
|
295 |
if ( is_array( $plugins ) ) {
|
296 |
$plugins = array_keys( $plugins );
|
@@ -340,7 +360,6 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
|
|
340 |
|
341 |
if ( isset( $out[ 'versions' ][ $id ] ) && version_compare( $current_plugin[ 'version' ], $out[ 'versions' ][ $id ], '<' ) ) {
|
342 |
$upgrade_button = '<a href="' . wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $current_plugin[ 'plugin' ], 'upgrade-plugin_' . $current_plugin[ 'plugin' ] ) . '" class="button tiny-button">Upgrade plugin</a>';
|
343 |
-
$out[ 'plugin_table' ] = '<p>' . $upgrade_button . '</p>' . $out[ 'plugin_table' ];
|
344 |
$out[ 'upgrade' ][] = array( 'id' => $id, 'upgrade' => $upgrade_button );
|
345 |
}
|
346 |
}
|
@@ -404,9 +423,6 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
|
|
404 |
if (data.key_exist == 1) {
|
405 |
if (show_correct) {
|
406 |
html = '<h3>' + data.status + '</h3>';
|
407 |
-
html += '<p><b>UserName: </b>' + data.username + '</p>';
|
408 |
-
html += '<p><b>E-Mail: </b>' + data.email + '</p>';
|
409 |
-
html += data.plugin_table;
|
410 |
jQuery('.berocket_test_result').html(html);
|
411 |
data.upgrade.forEach(function (el, i, arr) {
|
412 |
jQuery('.berocket_product_key_' + el.id + '_status').html(el.upgrade);
|
@@ -473,10 +489,11 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
|
|
473 |
register_setting( 'BeRocket_account_option_settings', 'BeRocket_account_option', array('sanitize_callback' => array(__CLASS__, 'reset_update_plugin_data')) );
|
474 |
}
|
475 |
|
476 |
-
public static function reset_update_plugin_data($
|
|
|
477 |
self::update_check_set('');
|
478 |
delete_site_transient( 'update_plugins' );
|
479 |
-
return $
|
480 |
}
|
481 |
|
482 |
public static function account_form() {
|
@@ -535,7 +552,7 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
|
|
535 |
<td><h3><?php _e('Account key', 'BeRocket_domain'); ?></h3></td>
|
536 |
<td><input type="text" id="berocket_account_key" name="BeRocket_account_option[account_key]"
|
537 |
size="50"
|
538 |
-
value="<?php echo( empty( $options[ 'account_key' ] ) ? '' : $options[ 'account_key' ] ) ?>">
|
539 |
</td>
|
540 |
<td><input class="berocket_test_account button tiny-button" type="button" value="Test"></td>
|
541 |
<td class="berocket_product_key_0_status"></td>
|
@@ -550,7 +567,7 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
|
|
550 |
echo $plugin[ 'slug' ];
|
551 |
}
|
552 |
echo '</h4></td>';
|
553 |
-
echo '<td><input class="berocket_test_account_product_key" id="berocket_product_key_', $plugin[ 'id' ], '" size="50" name="BeRocket_account_option[plugin_key][', $plugin[ 'id' ], ']" type="text" value="', ( empty( $options[ 'plugin_key' ][ $plugin[ 'id' ] ] ) ? '' : $options[ 'plugin_key' ][ $plugin[ 'id' ] ] ), '"></td>';
|
554 |
echo '<td><input class="berocket_test_account_product save_checked button tiny-button" data-id="', $plugin[ 'id' ], '" data-product="#berocket_product_key_', $plugin[ 'id' ], '" type="button" value="Test"></td>';
|
555 |
echo '<td class="berocket_product_key_status berocket_product_key_', $plugin[ 'id' ], '_status"></td>';
|
556 |
echo '</tr>';
|
@@ -814,6 +831,7 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
|
|
814 |
require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
|
815 |
}
|
816 |
|
|
|
817 |
if ( is_multisite() && is_plugin_active_for_network( plugin_basename( __FILE__ ) ) ) {
|
818 |
update_site_option( 'BeRocket_account_option', $options );
|
819 |
} else {
|
@@ -901,6 +919,31 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
|
|
901 |
</script>
|
902 |
<?php
|
903 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
904 |
}
|
905 |
|
906 |
BeRocket_updater::init();
|
85 |
|
86 |
public static function error_log() {
|
87 |
if ( self::$debug_mode ) {
|
88 |
+
$plugins_list = self::$plugin_info;
|
89 |
+
if( is_array($plugins_list) && count($plugins_list) > 0 ) {
|
90 |
+
foreach($plugins_list as &$plugin) {
|
91 |
+
if( ! empty($plugin['key']) ) {
|
92 |
+
$plugin['key'] = self::hide_key($plugin['key']);
|
93 |
+
}
|
94 |
+
}
|
95 |
+
}
|
96 |
self::$error_log = apply_filters( 'BeRocket_updater_error_log', self::$error_log );
|
97 |
self::$error_log[ 'real_memory_usage' ] = memory_get_peak_usage( true );
|
98 |
self::$error_log[ 'script_memory_usage' ] = memory_get_peak_usage( false );
|
99 |
+
self::$error_log[ 'plugins' ] = $plugins_list;
|
100 |
self::$error_log[ 'memory_limit' ] = ini_get( 'memory_limit' );
|
101 |
self::$error_log[ 'WP_DEBUG' ] = 'WP_DEBUG:' . ( defined( 'WP_DEBUG' ) ? ( WP_DEBUG ? 'true' : 'false' ) : 'false' ) . '; WP_DEBUG_DISPLAY:' . ( defined( 'WP_DEBUG_DISPLAY' ) ? ( WP_DEBUG_DISPLAY ? 'true' : 'false' ) : 'false' );
|
102 |
$error_log = unserialize(preg_replace('/R:\d+/', 's:18:"RECURSION DETECTED"', serialize(self::$error_log)));
|
299 |
$fast = ! empty($_POST[ 'fast' ]);
|
300 |
$site_url = get_site_url();
|
301 |
$plugins = self::$plugin_info;
|
302 |
+
if( strpos($key, '**') !== false ) {
|
303 |
+
if ($id == 0 ) {
|
304 |
+
$key = self::$key;
|
305 |
+
} elseif( is_array($plugins) && count($plugins) > 0 ) {
|
306 |
+
foreach($plugins as $plugin_info) {
|
307 |
+
if($plugin_info['id'] == $id) {
|
308 |
+
$key = $plugin_info['key'];
|
309 |
+
}
|
310 |
+
}
|
311 |
+
}
|
312 |
+
}
|
313 |
+
|
314 |
|
315 |
if ( is_array( $plugins ) ) {
|
316 |
$plugins = array_keys( $plugins );
|
360 |
|
361 |
if ( isset( $out[ 'versions' ][ $id ] ) && version_compare( $current_plugin[ 'version' ], $out[ 'versions' ][ $id ], '<' ) ) {
|
362 |
$upgrade_button = '<a href="' . wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $current_plugin[ 'plugin' ], 'upgrade-plugin_' . $current_plugin[ 'plugin' ] ) . '" class="button tiny-button">Upgrade plugin</a>';
|
|
|
363 |
$out[ 'upgrade' ][] = array( 'id' => $id, 'upgrade' => $upgrade_button );
|
364 |
}
|
365 |
}
|
423 |
if (data.key_exist == 1) {
|
424 |
if (show_correct) {
|
425 |
html = '<h3>' + data.status + '</h3>';
|
|
|
|
|
|
|
426 |
jQuery('.berocket_test_result').html(html);
|
427 |
data.upgrade.forEach(function (el, i, arr) {
|
428 |
jQuery('.berocket_product_key_' + el.id + '_status').html(el.upgrade);
|
489 |
register_setting( 'BeRocket_account_option_settings', 'BeRocket_account_option', array('sanitize_callback' => array(__CLASS__, 'reset_update_plugin_data')) );
|
490 |
}
|
491 |
|
492 |
+
public static function reset_update_plugin_data($options) {
|
493 |
+
$options = self::restore_keys($options);
|
494 |
self::update_check_set('');
|
495 |
delete_site_transient( 'update_plugins' );
|
496 |
+
return $options;
|
497 |
}
|
498 |
|
499 |
public static function account_form() {
|
552 |
<td><h3><?php _e('Account key', 'BeRocket_domain'); ?></h3></td>
|
553 |
<td><input type="text" id="berocket_account_key" name="BeRocket_account_option[account_key]"
|
554 |
size="50"
|
555 |
+
value="<?php echo( empty( $options[ 'account_key' ] ) ? '' : self::hide_key($options[ 'account_key' ]) ) ?>">
|
556 |
</td>
|
557 |
<td><input class="berocket_test_account button tiny-button" type="button" value="Test"></td>
|
558 |
<td class="berocket_product_key_0_status"></td>
|
567 |
echo $plugin[ 'slug' ];
|
568 |
}
|
569 |
echo '</h4></td>';
|
570 |
+
echo '<td><input class="berocket_test_account_product_key" id="berocket_product_key_', $plugin[ 'id' ], '" size="50" name="BeRocket_account_option[plugin_key][', $plugin[ 'id' ], ']" type="text" value="', ( empty( $options[ 'plugin_key' ][ $plugin[ 'id' ] ] ) ? '' : self::hide_key($options[ 'plugin_key' ][ $plugin[ 'id' ] ]) ), '"></td>';
|
571 |
echo '<td><input class="berocket_test_account_product save_checked button tiny-button" data-id="', $plugin[ 'id' ], '" data-product="#berocket_product_key_', $plugin[ 'id' ], '" type="button" value="Test"></td>';
|
572 |
echo '<td class="berocket_product_key_status berocket_product_key_', $plugin[ 'id' ], '_status"></td>';
|
573 |
echo '</tr>';
|
831 |
require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
|
832 |
}
|
833 |
|
834 |
+
$options = self::restore_keys($options);
|
835 |
if ( is_multisite() && is_plugin_active_for_network( plugin_basename( __FILE__ ) ) ) {
|
836 |
update_site_option( 'BeRocket_account_option', $options );
|
837 |
} else {
|
919 |
</script>
|
920 |
<?php
|
921 |
}
|
922 |
+
public static function hide_key($key) {
|
923 |
+
if( ! empty($key) ) {
|
924 |
+
$part = (int)(strlen($key) / 3);
|
925 |
+
$replace = strlen($key) - $part;
|
926 |
+
$key = substr($key, $replace);
|
927 |
+
for($i = 0; $i < $replace; $i++) {
|
928 |
+
$key = '*'.$key;
|
929 |
+
}
|
930 |
+
}
|
931 |
+
return $key;
|
932 |
+
}
|
933 |
+
public static function restore_keys($options) {
|
934 |
+
$options_old = self::get_options();
|
935 |
+
if( ! empty($options['account_key']) && strpos($options['account_key'], '**') !== false && ! empty($options_old['account_key']) ) {
|
936 |
+
$options['account_key'] = $options_old['account_key'];
|
937 |
+
}
|
938 |
+
if( ! empty($options['plugin_key']) && is_array($options['plugin_key']) ) {
|
939 |
+
foreach($options['plugin_key'] as $plugin_id => $plugin_key) {
|
940 |
+
if( ! empty($plugin_key) && strpos($plugin_key, '**') !== false && ! empty($options_old['plugin_key']) && ! empty($options_old['plugin_key'][$plugin_id]) ) {
|
941 |
+
$options['plugin_key'][$plugin_id] = $options_old['plugin_key'][$plugin_id];
|
942 |
+
}
|
943 |
+
}
|
944 |
+
}
|
945 |
+
return $options;
|
946 |
+
}
|
947 |
}
|
948 |
|
949 |
BeRocket_updater::init();
|
includes/display_filter/selected_area.php
CHANGED
@@ -13,6 +13,7 @@ class BeRocket_AAPF_display_filters_selected_area_type extends BeRocket_AAPF_dis
|
|
13 |
function init() {
|
14 |
static::$type_name = __('Selected Filters area', 'BeRocket_AJAX_domain');
|
15 |
parent::init();
|
|
|
16 |
}
|
17 |
public static function return_html($html, $additional) {
|
18 |
$set_query_var_title = $additional['set_query_var_title'];
|
@@ -24,5 +25,11 @@ class BeRocket_AAPF_display_filters_selected_area_type extends BeRocket_AAPF_dis
|
|
24 |
}
|
25 |
return ob_get_clean();
|
26 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
}
|
28 |
new BeRocket_AAPF_display_filters_selected_area_type();
|
13 |
function init() {
|
14 |
static::$type_name = __('Selected Filters area', 'BeRocket_AJAX_domain');
|
15 |
parent::init();
|
16 |
+
add_filter('BeRocket_AAPF_widget_additional_classes', array(__CLASS__, 'additional_class'), 10, 3);
|
17 |
}
|
18 |
public static function return_html($html, $additional) {
|
19 |
$set_query_var_title = $additional['set_query_var_title'];
|
25 |
}
|
26 |
return ob_get_clean();
|
27 |
}
|
28 |
+
public static function additional_class($additional_class, $filter_id, $filter_data) {
|
29 |
+
if(! empty($filter_data['widget_type']) && $filter_data['widget_type'] == 'selected_area') {
|
30 |
+
$additional_class[] = 'bapf_mt_none';
|
31 |
+
}
|
32 |
+
return $additional_class;
|
33 |
+
}
|
34 |
}
|
35 |
new BeRocket_AAPF_display_filters_selected_area_type();
|
includes/functions.php
CHANGED
@@ -2178,7 +2178,7 @@ if ( ! function_exists( 'br_filters_query' ) ) {
|
|
2178 |
}
|
2179 |
|
2180 |
$queried_object = $wp_query->get_queried_object_id();
|
2181 |
-
if ( ! empty( $queried_object ) ) {
|
2182 |
$query_object = $wp_query->get_queried_object();
|
2183 |
if ( ! empty( $query_object->taxonomy ) && ! empty( $query_object->slug ) ) {
|
2184 |
$tax_query[ $query_object->taxonomy ] = array(
|
2178 |
}
|
2179 |
|
2180 |
$queried_object = $wp_query->get_queried_object_id();
|
2181 |
+
if ( ! empty( $queried_object ) && $for != 'price' ) {
|
2182 |
$query_object = $wp_query->get_queried_object();
|
2183 |
if ( ! empty( $query_object->taxonomy ) && ! empty( $query_object->slug ) ) {
|
2184 |
$tax_query[ $query_object->taxonomy ] = array(
|
includes/new_widget.php
CHANGED
@@ -93,7 +93,7 @@ class BeRocket_new_AAPF_Widget extends WP_Widget
|
|
93 |
braapf_is_filters_displayed_debug($instance['group_id'], 'group', 'without_filters', 'Do not have any filters');
|
94 |
return false;
|
95 |
}
|
96 |
-
if( apply_filters('braapf_check_widget_by_instance_group', (! empty($filters['data']) && ! BeRocket_conditions::check($filters['data'], $BeRocket_AAPF_group_filters->hook_name) ) ) ) {
|
97 |
braapf_is_filters_displayed_debug($instance['group_id'], 'group', 'condition_restriction', 'Disabled for this page by conditions');
|
98 |
return false;
|
99 |
}
|
@@ -278,7 +278,7 @@ class BeRocket_new_AAPF_Widget_single extends WP_Widget
|
|
278 |
if( empty($filter_data) || empty($filter_post) ) {
|
279 |
return false;
|
280 |
}
|
281 |
-
if( apply_filters('braapf_check_widget_by_instance_single', (! empty($filter_data['data']) && ! BeRocket_conditions::check($filter_data['data'], $BeRocket_AAPF_single_filter->hook_name) ) ) ) {
|
282 |
braapf_is_filters_displayed_debug($instance['filter_id'], 'filter', 'condition_restriction', 'Disabled for this page by conditions');
|
283 |
return false;
|
284 |
}
|
93 |
braapf_is_filters_displayed_debug($instance['group_id'], 'group', 'without_filters', 'Do not have any filters');
|
94 |
return false;
|
95 |
}
|
96 |
+
if( apply_filters('braapf_check_widget_by_instance_group', (! empty($filters['data']) && ! BeRocket_conditions::check($filters['data'], $BeRocket_AAPF_group_filters->hook_name) ), $instance, $filters ) ) {
|
97 |
braapf_is_filters_displayed_debug($instance['group_id'], 'group', 'condition_restriction', 'Disabled for this page by conditions');
|
98 |
return false;
|
99 |
}
|
278 |
if( empty($filter_data) || empty($filter_post) ) {
|
279 |
return false;
|
280 |
}
|
281 |
+
if( apply_filters('braapf_check_widget_by_instance_single', (! empty($filter_data['data']) && ! BeRocket_conditions::check($filter_data['data'], $BeRocket_AAPF_single_filter->hook_name) ), $instance, $filter_data ) ) {
|
282 |
braapf_is_filters_displayed_debug($instance['filter_id'], 'filter', 'condition_restriction', 'Disabled for this page by conditions');
|
283 |
return false;
|
284 |
}
|
main.php
CHANGED
@@ -598,6 +598,7 @@ class BeRocket_AAPF extends BeRocket_Framework {
|
|
598 |
wp_enqueue_style( 'font-awesome' );
|
599 |
}
|
600 |
public function admin_settings( $tabs_info = array(), $data = array() ) {
|
|
|
601 |
wp_enqueue_script( 'berocket_aapf_widget-admin' );
|
602 |
parent::admin_settings(
|
603 |
array(
|
598 |
wp_enqueue_style( 'font-awesome' );
|
599 |
}
|
600 |
public function admin_settings( $tabs_info = array(), $data = array() ) {
|
601 |
+
do_action('bapf_include_all_tempate_styles');
|
602 |
wp_enqueue_script( 'berocket_aapf_widget-admin' );
|
603 |
parent::admin_settings(
|
604 |
array(
|
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.2
|
8 |
-
Stable tag: 1.5.4.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -185,6 +185,15 @@ You can try this plugin's admin side [here](https://berocket.com/product/woocomm
|
|
185 |
|
186 |
== Changelog ==
|
187 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
= 1.5.4.5 =
|
189 |
* Enhancement - Remove not needed property from terms cache
|
190 |
* Fix - Filters can be hidden on custom page with WooCommerce shortcodes
|
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.2
|
8 |
+
Stable tag: 1.5.4.6
|
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.4.6 =
|
189 |
+
* Enhancement - Compatibility version: WooCommerce 5.4
|
190 |
+
* Enhancement - Price slider with multiple taxonomy page
|
191 |
+
* Enhancement - Speed up Additional Tables generation
|
192 |
+
* Enhancement - Use WordPress cron for Additional Tables generation
|
193 |
+
* Enhancement - Generate more data with single request for Additional Tables generation
|
194 |
+
* Fix - Get templates when plugin settings open
|
195 |
+
* Fix - Hide selected filters area on page load
|
196 |
+
|
197 |
= 1.5.4.5 =
|
198 |
* Enhancement - Remove not needed property from terms cache
|
199 |
* Fix - Filters can be hidden on custom page with WooCommerce shortcodes
|
woocommerce-filters.php
CHANGED
@@ -3,14 +3,14 @@
|
|
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.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
|
10 |
* Text Domain: BeRocket_AJAX_domain
|
11 |
* Domain Path: /languages/
|
12 |
-
* WC tested up to: 5.
|
13 |
*/
|
14 |
-
define( "BeRocket_AJAX_filters_version", '1.5.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.4.6
|
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
|
10 |
* Text Domain: BeRocket_AJAX_domain
|
11 |
* Domain Path: /languages/
|
12 |
+
* WC tested up to: 5.4
|
13 |
*/
|
14 |
+
define( "BeRocket_AJAX_filters_version", '1.5.4.6' );
|
15 |
define( "BeRocket_AJAX_filters_file", __FILE__ );
|
16 |
include_once('main.php');
|