Version Description
Nov 18 2021 = * Fix: skip ult-forgot-password action. * Fix: Uncanny toolkit skip. * Fix: SFW. Clearing FW stats fixed. * Fix: SFW. Updating fallback fixed. * Fix: SFW. Updating FW stats fixed. * Mod: Changed the type of verification on check_message during registration in BuddyPress * Fix: register_settings for wp < 4.7. * Fix: Comment scanners. Getting cookie fixed. * Fix: check if errors exists in state. * Fix: update sfw after enabled. * Fix: WPMS. Settings validating fixed. * Fix: wpforms skip remove token validation. * Fix. Text. Feedback description fixed. * Fix: WPMS. Delete api key from settings template used. * Fix. Updater. Notice fixed. * Fix: WPMS. Setting transferring to the sub sites fixed.
Download this release
Release Info
Developer | glomberg |
Plugin | Spam protection, AntiSpam, FireWall by CleanTalk |
Version | 5.166 |
Comparing to | |
See all releases |
Code changes from version 5.165.1 to 5.166
- cleantalk.php +10 -8
- inc/cleantalk-admin.php +1 -1
- inc/cleantalk-ajax.php +1 -1
- inc/cleantalk-pluggable.php +8 -2
- inc/cleantalk-public-integrations.php +9 -2
- inc/cleantalk-public.php +1 -1
- inc/cleantalk-settings.php +19 -5
- inc/cleantalk-updater.php +3 -1
- js/cleantalk-comments-checkspam.min.js +1 -1
- js/cleantalk-comments-checkspam.min.js.map +1 -1
- lib/Cleantalk/ApbctWP/State.php +2 -2
- readme.txt +19 -1
cleantalk.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: Anti-Spam by CleanTalk
|
5 |
Plugin URI: https://cleantalk.org
|
6 |
Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
|
7 |
-
Version: 5.
|
8 |
Author: СleanTalk <welcome@cleantalk.org>
|
9 |
Author URI: https://cleantalk.org
|
10 |
Text Domain: cleantalk-spam-protect
|
@@ -791,7 +791,7 @@ function apbct_sfw__clear()
|
|
791 |
$apbct->save('stats');
|
792 |
}
|
793 |
|
794 |
-
// This action triggered by wp_schedule_single_event( time() +
|
795 |
add_action('apbct_sfw_update__init', 'apbct_sfw_update__init');
|
796 |
|
797 |
/**
|
@@ -1322,12 +1322,6 @@ function apbct_sfw_update__end_of_update__updating_stats($is_direct_update = fal
|
|
1322 |
{
|
1323 |
global $apbct;
|
1324 |
|
1325 |
-
// Increment firewall entries
|
1326 |
-
$apbct->fw_stats['firewall_update_percent'] = 0;
|
1327 |
-
$apbct->fw_stats['firewall_updating_id'] = null;
|
1328 |
-
$apbct->fw_stats['expected_networks_count'] = false;
|
1329 |
-
$apbct->save('fw_stats');
|
1330 |
-
|
1331 |
$is_first_updating = ! $apbct->stats['sfw']['last_update_time'];
|
1332 |
$apbct->stats['sfw']['last_update_time'] = time();
|
1333 |
$apbct->stats['sfw']['last_update_way'] = $is_direct_update ? 'Direct update' : 'Queue update';
|
@@ -1362,6 +1356,13 @@ function apbct_sfw_update__end_of_update($is_first_updating = false)
|
|
1362 |
|
1363 |
apbct_remove_upd_folder($apbct->fw_stats['updating_folder']);
|
1364 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1365 |
return true;
|
1366 |
}
|
1367 |
|
@@ -1577,6 +1578,7 @@ function apbct_sfw_update__fallback()
|
|
1577 |
*/
|
1578 |
$cron = new Cron();
|
1579 |
$cron->removeTask('sfw_update_checker');
|
|
|
1580 |
|
1581 |
/**
|
1582 |
* Remove _temp table
|
4 |
Plugin Name: Anti-Spam by CleanTalk
|
5 |
Plugin URI: https://cleantalk.org
|
6 |
Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
|
7 |
+
Version: 5.166
|
8 |
Author: СleanTalk <welcome@cleantalk.org>
|
9 |
Author URI: https://cleantalk.org
|
10 |
Text Domain: cleantalk-spam-protect
|
791 |
$apbct->save('stats');
|
792 |
}
|
793 |
|
794 |
+
// This action triggered by wp_schedule_single_event( time() + 720, 'apbct_sfw_update__init' );
|
795 |
add_action('apbct_sfw_update__init', 'apbct_sfw_update__init');
|
796 |
|
797 |
/**
|
1322 |
{
|
1323 |
global $apbct;
|
1324 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1325 |
$is_first_updating = ! $apbct->stats['sfw']['last_update_time'];
|
1326 |
$apbct->stats['sfw']['last_update_time'] = time();
|
1327 |
$apbct->stats['sfw']['last_update_way'] = $is_direct_update ? 'Direct update' : 'Queue update';
|
1356 |
|
1357 |
apbct_remove_upd_folder($apbct->fw_stats['updating_folder']);
|
1358 |
|
1359 |
+
// Reset all FW stats
|
1360 |
+
$apbct->fw_stats['firewall_update_percent'] = 0;
|
1361 |
+
$apbct->fw_stats['firewall_updating_id'] = null;
|
1362 |
+
$apbct->fw_stats['expected_networks_count'] = false;
|
1363 |
+
$apbct->fw_stats['expected_ua_count'] = false;
|
1364 |
+
$apbct->save('fw_stats');
|
1365 |
+
|
1366 |
return true;
|
1367 |
}
|
1368 |
|
1578 |
*/
|
1579 |
$cron = new Cron();
|
1580 |
$cron->removeTask('sfw_update_checker');
|
1581 |
+
$cron->updateTask('sfw_update', 'apbct_sfw_update__init', $apbct->stats['sfw']['update_period']);
|
1582 |
|
1583 |
/**
|
1584 |
* Remove _temp table
|
inc/cleantalk-admin.php
CHANGED
@@ -552,7 +552,7 @@ function apbct_admin__enqueue_scripts($hook)
|
|
552 |
$apbct->user_token ? "<a target='_blank' href=https://cleantalk.org/my?user_token={$apbct->user_token}&cp_mode=antispam>" : '',
|
553 |
$apbct->user_token ? "</a>" : ''
|
554 |
) . ' ' . esc_html__('The service accepts feedback only for requests made no more than 7 or 45 days
|
555 |
-
(if the
|
556 |
'ct_show_check_links' => (bool)$apbct->settings['comments__show_check_links'],
|
557 |
'ct_img_src_new_tab' => plugin_dir_url(__FILE__) . "images/new_window.gif",
|
558 |
));
|
552 |
$apbct->user_token ? "<a target='_blank' href=https://cleantalk.org/my?user_token={$apbct->user_token}&cp_mode=antispam>" : '',
|
553 |
$apbct->user_token ? "</a>" : ''
|
554 |
) . ' ' . esc_html__('The service accepts feedback only for requests made no more than 7 or 45 days
|
555 |
+
(if the Extra package is activated) ago.', 'cleantalk-spam-protect'),
|
556 |
'ct_show_check_links' => (bool)$apbct->settings['comments__show_check_links'],
|
557 |
'ct_img_src_new_tab' => plugin_dir_url(__FILE__) . "images/new_window.gif",
|
558 |
));
|
inc/cleantalk-ajax.php
CHANGED
@@ -386,7 +386,7 @@ function ct_ajax_hook($message_obj = null)
|
|
386 |
// Easy Digital Downloads ajax skip
|
387 |
/* !! Do not add actions here. Use apbct_is_skip_request() function below !! */
|
388 |
//Unknown plugin Ticket #25047
|
389 |
-
'alhbrmeu'
|
390 |
);
|
391 |
|
392 |
global $apbct;
|
386 |
// Easy Digital Downloads ajax skip
|
387 |
/* !! Do not add actions here. Use apbct_is_skip_request() function below !! */
|
388 |
//Unknown plugin Ticket #25047
|
389 |
+
'alhbrmeu'
|
390 |
);
|
391 |
|
392 |
global $apbct;
|
inc/cleantalk-pluggable.php
CHANGED
@@ -601,8 +601,8 @@ function apbct_is_skip_request($ajax = false)
|
|
601 |
}
|
602 |
// WPForms check restricted email skipped
|
603 |
if (
|
604 |
-
|
605 |
-
|
606 |
) {
|
607 |
return 'wpforms_check_restricted_email';
|
608 |
}
|
@@ -646,6 +646,12 @@ function apbct_is_skip_request($ajax = false)
|
|
646 |
) {
|
647 |
return 'Classified checkemail';
|
648 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
649 |
} else {
|
650 |
/*****************************************/
|
651 |
/* Here is non-ajax requests skipping */
|
601 |
}
|
602 |
// WPForms check restricted email skipped
|
603 |
if (
|
604 |
+
apbct_is_plugin_active('wpforms/wpforms.php') &&
|
605 |
+
Post::get('action') === 'wpforms_restricted_email'
|
606 |
) {
|
607 |
return 'wpforms_check_restricted_email';
|
608 |
}
|
646 |
) {
|
647 |
return 'Classified checkemail';
|
648 |
}
|
649 |
+
if (
|
650 |
+
(apbct_is_plugin_active('uncanny-toolkit-pro/uncanny-toolkit-pro.php') || apbct_is_plugin_active('uncanny-learndash-toolkit'))
|
651 |
+
&& Post::get('action') === 'ult-forgot-password'
|
652 |
+
) {
|
653 |
+
return 'Uncanny Toolkit';
|
654 |
+
}
|
655 |
} else {
|
656 |
/*****************************************/
|
657 |
/* Here is non-ajax requests skipping */
|
inc/cleantalk-public-integrations.php
CHANGED
@@ -1360,6 +1360,7 @@ function ct_test_registration($nickname, $email, $ip = null)
|
|
1360 |
function ct_registration_errors($errors, $sanitized_user_login = null, $user_email = null)
|
1361 |
{
|
1362 |
global $ct_checkjs_register_form, $apbct_cookie_request_id_label, $apbct_cookie_register_ok_label, $apbct_cookie_request_id, $bp, $ct_signup_done, $ct_negative_comment, $apbct, $ct_registration_error_comment, $cleantalk_executed;
|
|
|
1363 |
|
1364 |
// Go out if a registered user action
|
1365 |
if ( apbct_is_user_enable() === false ) {
|
@@ -1414,7 +1415,6 @@ function ct_registration_errors($errors, $sanitized_user_login = null, $user_ema
|
|
1414 |
return $errors;
|
1415 |
}
|
1416 |
|
1417 |
-
|
1418 |
if ( current_filter() === 'woocommerce_registration_errors' ) {
|
1419 |
$checkjs = apbct_js_test('ct_checkjs', $_COOKIE, true);
|
1420 |
$checkjs_post = null;
|
@@ -1439,6 +1439,13 @@ function ct_registration_errors($errors, $sanitized_user_login = null, $user_ema
|
|
1439 |
: null,
|
1440 |
);
|
1441 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1442 |
$base_call_result = apbct_base_call(
|
1443 |
array(
|
1444 |
'sender_email' => $user_email,
|
@@ -1446,7 +1453,7 @@ function ct_registration_errors($errors, $sanitized_user_login = null, $user_ema
|
|
1446 |
'sender_info' => $sender_info,
|
1447 |
'js_on' => $checkjs,
|
1448 |
),
|
1449 |
-
|
1450 |
);
|
1451 |
$ct_result = $base_call_result['ct_result'];
|
1452 |
ct_hash($ct_result->id);
|
1360 |
function ct_registration_errors($errors, $sanitized_user_login = null, $user_email = null)
|
1361 |
{
|
1362 |
global $ct_checkjs_register_form, $apbct_cookie_request_id_label, $apbct_cookie_register_ok_label, $apbct_cookie_request_id, $bp, $ct_signup_done, $ct_negative_comment, $apbct, $ct_registration_error_comment, $cleantalk_executed;
|
1363 |
+
$reg_flag = true;
|
1364 |
|
1365 |
// Go out if a registered user action
|
1366 |
if ( apbct_is_user_enable() === false ) {
|
1415 |
return $errors;
|
1416 |
}
|
1417 |
|
|
|
1418 |
if ( current_filter() === 'woocommerce_registration_errors' ) {
|
1419 |
$checkjs = apbct_js_test('ct_checkjs', $_COOKIE, true);
|
1420 |
$checkjs_post = null;
|
1439 |
: null,
|
1440 |
);
|
1441 |
|
1442 |
+
/**
|
1443 |
+
* Changing the type of check for BuddyPress
|
1444 |
+
*/
|
1445 |
+
if (Post::get('signup_username') && Post::get('signup_email')) {
|
1446 |
+
$reg_flag = false;
|
1447 |
+
}
|
1448 |
+
|
1449 |
$base_call_result = apbct_base_call(
|
1450 |
array(
|
1451 |
'sender_email' => $user_email,
|
1453 |
'sender_info' => $sender_info,
|
1454 |
'js_on' => $checkjs,
|
1455 |
),
|
1456 |
+
$reg_flag
|
1457 |
);
|
1458 |
$ct_result = $base_call_result['ct_result'];
|
1459 |
ct_hash($ct_result->id);
|
inc/cleantalk-public.php
CHANGED
@@ -1230,7 +1230,7 @@ function ct_enqueue_scripts_public($_hook)
|
|
1230 |
$apbct->user_token ? "<a target='_blank' href=https://cleantalk.org/my/show_requests?user_token={$apbct->user_token}&cp_mode=antispam>" : '',
|
1231 |
$apbct->user_token ? "</a>" : ''
|
1232 |
) . ' ' . esc_html__('The service accepts feedback only for requests made no more than 7 or 45 days
|
1233 |
-
(if the
|
1234 |
));
|
1235 |
}
|
1236 |
}
|
1230 |
$apbct->user_token ? "<a target='_blank' href=https://cleantalk.org/my/show_requests?user_token={$apbct->user_token}&cp_mode=antispam>" : '',
|
1231 |
$apbct->user_token ? "</a>" : ''
|
1232 |
) . ' ' . esc_html__('The service accepts feedback only for requests made no more than 7 or 45 days
|
1233 |
+
(if the Extra package is activated) ago.', 'cleantalk-spam-protect'),
|
1234 |
));
|
1235 |
}
|
1236 |
}
|
inc/cleantalk-settings.php
CHANGED
@@ -2,13 +2,14 @@
|
|
2 |
|
3 |
use Cleantalk\ApbctWP\Helper;
|
4 |
use Cleantalk\Variables\Post;
|
|
|
5 |
|
6 |
/**
|
7 |
* Admin action 'admin_menu' - Add the admin options page
|
8 |
*/
|
9 |
function apbct_settings_add_page()
|
10 |
{
|
11 |
-
global $apbct, $pagenow;
|
12 |
|
13 |
$parent_slug = is_network_admin() ? 'settings.php' : 'options-general.php';
|
14 |
$callback = is_network_admin() ? 'apbct_settings__display__network' : 'apbct_settings__display';
|
@@ -27,10 +28,12 @@ function apbct_settings_add_page()
|
|
27 |
return;
|
28 |
}
|
29 |
|
|
|
|
|
30 |
register_setting(
|
31 |
'cleantalk_settings',
|
32 |
'cleantalk_settings',
|
33 |
-
|
34 |
);
|
35 |
|
36 |
$fields = apbct_settings__set_fileds();
|
@@ -2024,8 +2027,10 @@ function apbct_settings__validate($settings)
|
|
2024 |
// Set missing network settings.
|
2025 |
$stored_network_options = get_site_option($apbct->option_prefix . '_network_settings', array());
|
2026 |
foreach ( $apbct->def_network_settings as $setting => $value ) {
|
2027 |
-
if ( ! isset($settings[$setting])
|
2028 |
-
$
|
|
|
|
|
2029 |
settype($settings[$setting], gettype($value));
|
2030 |
}
|
2031 |
}
|
@@ -2034,7 +2039,8 @@ function apbct_settings__validate($settings)
|
|
2034 |
// Actions with toggle SFW settings
|
2035 |
// SFW was enabled
|
2036 |
if ( ! $apbct->settings['sfw__enabled'] && $settings['sfw__enabled'] ) {
|
2037 |
-
|
|
|
2038 |
// SFW was disabled
|
2039 |
} elseif ( $apbct->settings['sfw__enabled'] && ! $settings['sfw__enabled'] ) {
|
2040 |
apbct_sfw__clear();
|
@@ -2461,11 +2467,19 @@ function apbct_update_blogs_options($settings)
|
|
2461 |
{
|
2462 |
global $wpdb;
|
2463 |
|
|
|
|
|
|
|
|
|
2464 |
$blog_ids = $settings['multisite__use_settings_template_apply_for_current_list_sites'] ?: array();
|
2465 |
|
2466 |
$wp_blogs = $wpdb->get_results('SELECT blog_id FROM ' . $wpdb->blogs, OBJECT_K);
|
2467 |
foreach ( $wp_blogs as $blog ) {
|
2468 |
if ( in_array($blog->blog_id, $blog_ids) ) {
|
|
|
|
|
|
|
|
|
2469 |
update_blog_option($blog->blog_id, 'cleantalk_settings', $settings);
|
2470 |
}
|
2471 |
}
|
2 |
|
3 |
use Cleantalk\ApbctWP\Helper;
|
4 |
use Cleantalk\Variables\Post;
|
5 |
+
use Cleantalk\ApbctWP\Cron;
|
6 |
|
7 |
/**
|
8 |
* Admin action 'admin_menu' - Add the admin options page
|
9 |
*/
|
10 |
function apbct_settings_add_page()
|
11 |
{
|
12 |
+
global $apbct, $pagenow, $wp_version;
|
13 |
|
14 |
$parent_slug = is_network_admin() ? 'settings.php' : 'options-general.php';
|
15 |
$callback = is_network_admin() ? 'apbct_settings__display__network' : 'apbct_settings__display';
|
28 |
return;
|
29 |
}
|
30 |
|
31 |
+
$callback_format = version_compare($wp_version, '4.7') >= 0 ? array('type' => 'string', 'sanitize_callback' => 'apbct_settings__validate', 'default' => null) : 'apbct_settings__validate';
|
32 |
+
|
33 |
register_setting(
|
34 |
'cleantalk_settings',
|
35 |
'cleantalk_settings',
|
36 |
+
$callback_format
|
37 |
);
|
38 |
|
39 |
$fields = apbct_settings__set_fileds();
|
2027 |
// Set missing network settings.
|
2028 |
$stored_network_options = get_site_option($apbct->option_prefix . '_network_settings', array());
|
2029 |
foreach ( $apbct->def_network_settings as $setting => $value ) {
|
2030 |
+
if ( ! isset($settings[$setting]) ) {
|
2031 |
+
if ( ! array_key_exists($setting, $stored_network_options) ) {
|
2032 |
+
$settings[$setting] = $value;
|
2033 |
+
}
|
2034 |
settype($settings[$setting], gettype($value));
|
2035 |
}
|
2036 |
}
|
2039 |
// Actions with toggle SFW settings
|
2040 |
// SFW was enabled
|
2041 |
if ( ! $apbct->settings['sfw__enabled'] && $settings['sfw__enabled'] ) {
|
2042 |
+
$cron = new Cron();
|
2043 |
+
$cron->updateTask('sfw_update', 'apbct_sfw_update__init', 180);
|
2044 |
// SFW was disabled
|
2045 |
} elseif ( $apbct->settings['sfw__enabled'] && ! $settings['sfw__enabled'] ) {
|
2046 |
apbct_sfw__clear();
|
2467 |
{
|
2468 |
global $wpdb;
|
2469 |
|
2470 |
+
if ( isset($settings['apikey']) ) {
|
2471 |
+
unset($settings['apikey']);
|
2472 |
+
}
|
2473 |
+
|
2474 |
$blog_ids = $settings['multisite__use_settings_template_apply_for_current_list_sites'] ?: array();
|
2475 |
|
2476 |
$wp_blogs = $wpdb->get_results('SELECT blog_id FROM ' . $wpdb->blogs, OBJECT_K);
|
2477 |
foreach ( $wp_blogs as $blog ) {
|
2478 |
if ( in_array($blog->blog_id, $blog_ids) ) {
|
2479 |
+
$current_blog_settings = get_blog_option($blog->blog_id, 'cleantalk_settings');
|
2480 |
+
if ( isset($current_blog_settings['apikey']) ) {
|
2481 |
+
$settings['apikey'] = $current_blog_settings['apikey'];
|
2482 |
+
}
|
2483 |
update_blog_option($blog->blog_id, 'cleantalk_settings', $settings);
|
2484 |
}
|
2485 |
}
|
inc/cleantalk-updater.php
CHANGED
@@ -21,7 +21,9 @@ function apbct_run_update_actions($current_version, $new_version)
|
|
21 |
$need_start_update_sfw = false;
|
22 |
|
23 |
// Excludes the repeated call of the plugin update if the process is already running.
|
24 |
-
if ((
|
|
|
|
|
25 |
return false;
|
26 |
}
|
27 |
|
21 |
$need_start_update_sfw = false;
|
22 |
|
23 |
// Excludes the repeated call of the plugin update if the process is already running.
|
24 |
+
if ( isset($apbct->stats['plugin']['plugin_is_being_updated']) &&
|
25 |
+
(int)$apbct->stats['plugin']['plugin_is_being_updated'] === 1
|
26 |
+
) {
|
27 |
return false;
|
28 |
}
|
29 |
|
js/cleantalk-comments-checkspam.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
var ct_working=!(String.prototype.printf=function(){var e
|
2 |
//# sourceMappingURL=cleantalk-comments-checkspam.min.js.map
|
1 |
+
var ct_working=!(String.prototype.printf=function(){var e=this;for(var t in arguments)var c=e.substring(0,e.indexOf("%s",0)),a=e.substring(e.indexOf("%s",0)+2,e.length),e=c+arguments[t]+a;return e}),ct_new_check=!0,ct_cooling_down_flag=!1,ct_close_animate=!0,ct_accurate_check=!1,ct_pause=!1,ct_prev_accurate=ctCommentsCheck.ct_prev_accurate,ct_prev_from=ctCommentsCheck.ct_prev_from,ct_prev_till=ctCommentsCheck.ct_prev_till,ct_cool_down_time=9e4,ct_requests_counter=0,ct_max_requests=60,ct_ajax_nonce=ctCommentsCheck.ct_ajax_nonce,ct_comments_total=0,ct_comments_checked=0,ct_comments_spam=0,ct_comments_bad=0,ct_unchecked="unset",ct_date_from=0,ct_date_till=0;function animate_comment(e,t){ct_close_animate?.3==e?jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(1,t)}):jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(.3,t)}):ct_close_animate=!0}function ct_clear_comments(){var e=0,t=0;jQuery("#ct_allow_date_range").is(":checked")&&(e=jQuery("#ct_date_range_from").val(),t=jQuery("#ct_date_range_till").val());var c="https:"===location.protocol?"; secure":"";document.cookie="apbct_check_comments_offset=0; path=/; samesite=lax"+c;var a={action:"ajax_clear_comments",security:ct_ajax_nonce,from:e,till:t};jQuery.ajax({type:"POST",url:ajaxurl,data:a,success:function(e){ct_show_info(),ct_send_comments()}})}function ct_cooling_down_toggle(){ct_cooling_down_flag=!1,ct_send_comments(),ct_show_info()}function ct_send_comments(){if(!0!==ct_cooling_down_flag){if(ct_max_requests<=ct_requests_counter)return setTimeout(ct_cooling_down_toggle,ct_cool_down_time),void(ct_cooling_down_flag=!(ct_requests_counter=0));ct_requests_counter++;var e={action:"ajax_check_comments",security:ct_ajax_nonce,new_check:ct_new_check,unchecked:ct_unchecked,offset:Number(ctGetCookie("apbct_check_comments_offset"))};ct_accurate_check&&(e.accurate_check=!0),ct_date_from&&ct_date_till&&(e.from=ct_date_from,e.till=ct_date_till),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){var t,c,a;e=jQuery.parseJSON(e),parseInt(e.error)?(ct_working=!1,confirm(e.error_message+". Do you want to proceed?")?ct_send_comments():(t="edit-comments.php?page=ct_check_spam",0!=ct_date_from&&0!=ct_date_till&&(t+="&from="+ct_date_from+"&till="+ct_date_till),location.href=t)):(ct_new_check=!1,1==parseInt(e.end)||!0===ct_pause?(1==parseInt(e.end)&&(document.cookie="ct_paused_spam_check=0; path=/; samesite=lax"),ct_working=!1,jQuery("#ct_working_message").hide(),t="edit-comments.php?page=ct_check_spam",0!=ct_date_from&&0!=ct_date_till&&(t+="&from="+ct_date_from+"&till="+ct_date_till),location.href=t):0==parseInt(e.end)&&(ct_comments_checked+=e.checked,ct_comments_spam+=e.spam,ct_comments_bad+=e.bad,ct_unchecked=ct_comments_total-ct_comments_checked-ct_comments_bad,c=(c=String(ctCommentsCheck.ct_status_string)).printf(ct_comments_checked,ct_comments_spam,ct_comments_bad),0<parseInt(ct_comments_spam)&&(c+=ctCommentsCheck.ct_status_string_warning),jQuery("#ct_checking_status").html(c),jQuery("#ct_error_message").hide(),+ct_comments_total<ct_comments_checked+ct_comments_bad&&(document.cookie="ct_comments_start_check=1; path=/; samesite=lax",location.href="edit-comments.php?page=ct_check_spam"),a=Number(ctGetCookie("apbct_check_comments_offset"))+100,document.cookie="apbct_check_comments_offset="+a+"; path=/",ct_send_comments()))},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ct_send_comments(),3e3)},timeout:25e3})}}function ct_show_info(){if(ct_working){if(1==ct_cooling_down_flag)return jQuery("#ct_cooling_notice").html("Waiting for API to cool down. (About a minute)"),void jQuery("#ct_cooling_notice").show();var e;jQuery("#ct_cooling_notice").hide(),ct_comments_total||(e={action:"ajax_info_comments",security:ct_ajax_nonce},ct_date_from&&ct_date_till&&(e.from=ct_date_from,e.till=ct_date_till),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){e=jQuery.parseJSON(e),jQuery("#ct_checking_status").html(e.message),ct_comments_total=e.total,ct_comments_spam=e.spam,ct_comments_checked=e.checked,ct_comments_bad=e.bad},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ct_show_info(),3e3)},timeout:15e3}))}}function ct_toggle_depended(e,t){t=t||null;var c=jQuery(e.data("depended"));e.data("state")||t?(e.data("state",!1),c.prop("disabled",!0),c.removeProp("checked"),c.data("depended")&&ct_toggle_depended(c,!0)):(e.data("state",!0),c.removeProp("disabled"))}function ct_trash_all(a){var e={action:"ajax_trash_all",security:ct_ajax_nonce};jQuery("."+a.target.id).addClass("disabled"),jQuery(".spinner").css("visibility","visible"),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){0<e?(jQuery("#cleantalk_comments_left").html(e),ct_trash_all(a)):(jQuery("."+a.target.id).removeClass("disabled"),jQuery(".spinner").css("visibility","hidden"),location.href="edit-comments.php?page=ct_check_spam")},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ct_trash_all(a),3e3)},timeout:25e3})}function ct_spam_all(a){var e={action:"ajax_spam_all",security:ct_ajax_nonce};jQuery("."+a.target.id).addClass("disabled"),jQuery(".spinner").css("visibility","visible"),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){0<e?(jQuery("#cleantalk_comments_left").html(e),ct_spam_all(a)):(jQuery("."+a.target.id).removeClass("disabled"),jQuery(".spinner").css("visibility","hidden"),location.href="edit-comments.php?page=ct_check_spam")},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ct_spam_all(a),3e3)},timeout:25e3})}function ctGetCookie(e){var t=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return t?decodeURIComponent(t[1]):void 0}jQuery(document).ready(function(){ct_prev_accurate&&jQuery("#ct_accurate_check").prop("checked",!0),ct_prev_from&&(jQuery("#ct_allow_date_range").prop("checked",!0).data("state",!0),jQuery("#ct_date_range_from").removeProp("disabled").val(ct_prev_from),jQuery("#ct_date_range_till").removeProp("disabled").val(ct_prev_till)),jQuery("#ct_allow_date_range").on("change",function(){document.cookie="ct_spam_dates_from="+jQuery("#ct_date_range_from").val()+"; path=/; samesite=lax",document.cookie="ct_spam_dates_till="+jQuery("#ct_date_range_till").val()+"; path=/; samesite=lax",this.checked?(document.cookie="ct_spam_dates_allowed=1; path=/; samesite=lax",jQuery(".ct_date").prop("checked",!0).attr("disabled",!1)):(document.cookie="ct_spam_dates_allowed=0; path=/; samesite=lax",jQuery(".ct_date").prop("disabled",!0).attr("disabled",!0))}),jQuery.datepicker.setDefaults(jQuery.datepicker.regional.en);var _=jQuery("#ct_date_range_from, #ct_date_range_till").datepicker({dateFormat:"M d yy",maxDate:"+0D",changeMonth:!0,changeYear:!0,showAnim:"slideDown",onSelect:function(e){var t="ct_date_range_from"==this.id?"minDate":"maxDate",c=jQuery(this).data("datepicker"),a=jQuery.datepicker.parseDate(c.settings.dateFormat||jQuery.datepicker._defaults.dateFormat,e,c.settings);_.not(this).datepicker("option",t,a),document.cookie="ct_spam_dates_from="+jQuery("#ct_date_range_from").val()+"; path=/; samesite=lax",document.cookie="ct_spam_dates_till="+jQuery("#ct_date_range_till").val()+"; path=/; samesite=lax"}});function e(e){e=e||null,jQuery("#ct_allow_date_range").is(":checked")&&(ct_date_from=jQuery("#ct_date_range_from").val(),ct_date_till=jQuery("#ct_date_range_till").val(),""==ct_date_from||""==ct_date_till)?alert("Please, specify a date range."):(jQuery("#ct_accurate_check").is(":checked")&&(ct_accurate_check=!0),jQuery(".ct_to_hide").hide(),jQuery("#ct_working_message").show(),jQuery("#ct_preloader").show(),jQuery("#ct_pause").show(),ct_working=!0,e?(ct_show_info(),ct_send_comments()):ct_clear_comments())}jQuery("#ct_check_spam_button").click(function(){e(!(document.cookie="ct_paused_spam_check=0; path=/; samesite=lax"))}),jQuery("#ct_proceed_check_button").click(function(){e(!0)}),jQuery("#ct_pause").on("click",function(){ct_pause=!0;var e={accurate:ct_accurate_check,from:ct_date_from,till:ct_date_till};document.cookie="ct_paused_spam_check="+JSON.stringify(e)+"; path=/; samesite=lax"}),"1"===ctCommentsCheck.start&&(document.cookie="ct_comments_start_check=0; expires="+new Date(0).toUTCString()+"; path=/; samesite=lax",jQuery("#ct_check_spam_button").click()),jQuery(".ct_trash_all").click(function(e){return!!confirm(ctCommentsCheck.ct_confirm_trash_all)&&void ct_trash_all(e)}),jQuery(".ct_spam_all").click(function(e){return!!confirm(ctCommentsCheck.ct_confirm_spam_all)&&void ct_spam_all(e)})});
|
2 |
//# sourceMappingURL=cleantalk-comments-checkspam.min.js.map
|
js/cleantalk-comments-checkspam.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk-comments-checkspam.min.js","sources":["cleantalk-comments-checkspam.js"],"sourcesContent":["// Printf for JS\nString.prototype.printf = function(){\n var formatted = this;\n for( var arg in arguments ) {\n\t\tvar before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\n\t\tvar after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\n\t\tformatted = before_formatted + arguments[arg] + after_formatted;\n }\n return formatted;\n};\n\n// Flags\nvar ct_working = false,\n\tct_new_check = true,\n\tct_cooling_down_flag = false,\n\tct_close_animate = true,\n\tct_accurate_check = false,\n\tct_pause = false,\n\tct_prev_accurate = ctCommentsCheck.ct_prev_accurate,\n\tct_prev_from = ctCommentsCheck.ct_prev_from,\t\n\tct_prev_till = ctCommentsCheck.ct_prev_till;\n// Settings\nvar ct_cool_down_time = 90000,\n\tct_requests_counter = 0,\n\tct_max_requests = 60;\n// Variables\nvar ct_ajax_nonce = ctCommentsCheck.ct_ajax_nonce,\n\tct_comments_total = 0,\n\tct_comments_checked = 0,\n\tct_comments_spam = 0,\n\tct_comments_bad = 0,\n\tct_unchecked = 'unset',\n\tct_date_from = 0,\n\tct_date_till = 0;\n\nfunction animate_comment(to,id){\n\tif(ct_close_animate){\n\t\tif(to==0.3){\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(1,id)\n\t\t\t});\n\t\t}else{\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(0.3,id)\n\t\t\t});\n\t\t}\n\t}else{\n\t\tct_close_animate=true;\n\t}\n}\n\nfunction ct_clear_comments(){\n\n\tvar from = 0, till = 0;\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\n\t\tfrom = jQuery('#ct_date_range_from').val();\n\t\ttill = jQuery('#ct_date_range_till').val();\n\t}\n\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\tdocument.cookie = 'apbct_check_comments_offset' + \"=\" + 0 + \"; path=/; samesite=lax\" + ctSecure;\n\t\n\tvar data = {\n\t\t'action' : 'ajax_clear_comments',\n\t\t'security' : ct_ajax_nonce,\n\t\t'from' : from,\n\t\t'till' : till\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_show_info();\n\t\t\tct_send_comments();\n\t\t}\n\t});\n}\n\n//Continues the check after cooldown time\n//Called by ct_send_users();\nfunction ct_cooling_down_toggle(){\n\tct_cooling_down_flag = false;\n\tct_send_comments();\n\tct_show_info();\n}\n\nfunction ct_send_comments(){\n\t\n\tif(ct_cooling_down_flag === true)\n\t\treturn;\n\t\n\tif(ct_requests_counter >= ct_max_requests){\n\t\tsetTimeout(ct_cooling_down_toggle, ct_cool_down_time);\n\t\tct_requests_counter = 0;\n\t\tct_cooling_down_flag = true;\n\t\treturn;\n\t}else{\n\t\tct_requests_counter++;\n\t}\n\t\n\tvar data = {\n\t\t'action': 'ajax_check_comments',\n\t\t'security': ct_ajax_nonce,\n\t\t'new_check': ct_new_check,\n\t\t'unchecked': ct_unchecked,\n\t\t'offset' : Number(ctGetCookie('apbct_check_comments_offset'))\n\t};\n\t\n\tif(ct_accurate_check)\n\t\tdata['accurate_check'] = true;\n\t\n\tif(ct_date_from && ct_date_till){\n\t\tdata['from'] = ct_date_from;\n\t\tdata['till'] = ct_date_till;\n\t}\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\t\n\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\n\t\t\tif(parseInt(msg.error)){\n\t\t\t\tct_working=false;\n\t\t\t\tif(!confirm(msg.error_message+\". Do you want to proceed?\")){\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else\n\t\t\t\t\tct_send_comments();\n\t\t\t}else{\n\t\t\t\tct_new_check = false;\n\t\t\t\tif(parseInt(msg.end) == 1 || ct_pause === true){\n\t\t\t\t\tif(parseInt(msg.end) == 1)\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';\n\t\t\t\t\tct_working=false;\n\t\t\t\t\tjQuery('#ct_working_message').hide();\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else if(parseInt(msg.end) == 0){\n\t\t\t\t\tct_comments_checked += msg.checked;\n\t\t\t\t\tct_comments_spam += msg.spam;\n\t\t\t\t\tct_comments_bad += msg.bad;\n\t\t\t\t\tct_unchecked = ct_comments_total - ct_comments_checked - ct_comments_bad;\n\t\t\t\t\tvar status_string = String(ctCommentsCheck.ct_status_string);\n\t\t\t\t\tvar status_string = status_string.printf(ct_comments_checked, ct_comments_spam, ct_comments_bad);\n\t\t\t\t\tif(parseInt(ct_comments_spam) > 0)\n\t\t\t\t\t\tstatus_string += ctCommentsCheck.ct_status_string_warning;\n\t\t\t\t\tjQuery('#ct_checking_status').html(status_string);\n\t\t\t\t\tjQuery('#ct_error_message').hide();\n\t\t\t\t\t// If DB woks not properly\n\t\t\t\t\tif(+ct_comments_total < ct_comments_checked + ct_comments_bad){\n\t\t\t\t\t\tdocument.cookie = 'ct_comments_start_check=1; path=/; samesite=lax';\n\t\t\t\t\t\tlocation.href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\t}\n\n\t\t\t\t\tvar offset = Number(ctGetCookie('apbct_check_comments_offset')) + 100;\n\t\t\t\t\tdocument.cookie = 'apbct_check_comments_offset' + \"=\" + offset + \"; path=/\";\n\t\t\t\t\t\n\t\t\t\t\tct_send_comments();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_send_comments(), 3000); \n },\n timeout: 25000\n\t});\n}\nfunction ct_show_info(){\n\t\n\tif(ct_working){\n\t\t\n\t\tif(ct_cooling_down_flag == true){\n\t\t\tjQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)');\n\t\t\tjQuery('#ct_cooling_notice').show();\n\t\t\treturn;\t\t\t\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\n\t\t\n\t\tif(!ct_comments_total){\n\t\t\t\n\t\t\tvar data = {\n\t\t\t\t'action': 'ajax_info_comments',\n\t\t\t\t'security': ct_ajax_nonce\n\t\t\t};\n\t\t\t\n\t\t\tif(ct_date_from && ct_date_till){\n\t\t\t\tdata['from'] = ct_date_from;\n\t\t\t\tdata['till'] = ct_date_till;\n\t\t\t}\n\t\t\t\n\t\t\tjQuery.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: ajaxurl,\n\t\t\t\tdata: data,\n\t\t\t\tsuccess: function(msg){\n\t\t\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\t\tjQuery('#ct_checking_status').html(msg.message);\n\t\t\t\t\tct_comments_total = msg.total;\n\t\t\t\t\tct_comments_spam = msg.spam;\n\t\t\t\t\tct_comments_checked = msg.checked;\n\t\t\t\t\tct_comments_bad = msg.bad;\n\t\t\t\t},\n\t\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\tjQuery('#ct_error_message').show();\n\t\t\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\t\t\tsetTimeout(ct_show_info(), 3000); \n\t\t\t\t},\n\t\t\t\ttimeout: 15000\n\t\t\t});\n\t\t}\n\t}\n}\n\n// Function to toggle dependences\nfunction ct_toggle_depended(obj, secondary){\n\n secondary = secondary || null;\n\n\tvar depended = jQuery(obj.data('depended')),\n\t\tstate = obj.data('state');\n\t\t\n\tif(!state && !secondary){\n\t\tobj.data('state', true);\n\t\tdepended.removeProp('disabled');\n\t}else{\n\t\tobj.data('state', false);\n\t\tdepended.prop('disabled', true);\n\t\tdepended.removeProp('checked');\n\t\tif(depended.data('depended'))\n\t\t\tct_toggle_depended(depended, true);\n\t}\n}\n\nfunction ct_trash_all( e ) {\n\n\tvar data = {\n\t\t'action': 'ajax_trash_all',\n\t\t'security': ct_ajax_nonce\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_comments_left').html(msg);\n\t\t\t\tct_trash_all( e );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='edit-comments.php?page=ct_check_spam';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_trash_all( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n\n}\n\nfunction ct_spam_all( e ) {\n\n\tvar data = {\n\t\t'action': 'ajax_spam_all',\n\t\t'security': ct_ajax_nonce\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_comments_left').html(msg);\n\t\t\t\tct_spam_all( e );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='edit-comments.php?page=ct_check_spam';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_spam_all( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n\n}\n\njQuery(document).ready(function(){\n\t\n\t// Prev check parameters\n\tif(ct_prev_accurate){\n\t\tjQuery(\"#ct_accurate_check\").prop('checked', true);\n\t}\n\tif(ct_prev_from){\n\t\tjQuery(\"#ct_allow_date_range\").prop('checked', true).data('state', true);\n\t\tjQuery(\"#ct_date_range_from\").removeProp('disabled').val(ct_prev_from);\n\t\tjQuery(\"#ct_date_range_till\").removeProp('disabled').val(ct_prev_till);\n\t}\n\t\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range\").on('change', function(){\n\t\tdocument.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\tdocument.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\tif( this.checked ) {\n\t\t\tdocument.cookie = 'ct_spam_dates_allowed=1; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t} else {\n\t\t\tdocument.cookie = 'ct_spam_dates_allowed=0; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('disabled', true).attr('disabled',true);\n\t\t}\n\t});\n\n jQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'M d yy',\n\t\t\tmaxDate:\"+0D\",\n\t\t\tchangeMonth:true,\n\t\t\tchangeYear:true,\n\t\t\tshowAnim: 'slideDown',\n\t\t\tonSelect: function(selectedDate){\n\t\t\tvar option = this.id == \"ct_date_range_from\" ? \"minDate\" : \"maxDate\",\n\t\t\t\tinstance = jQuery( this ).data( \"datepicker\" ),\n\t\t\t\tdate = jQuery.datepicker.parseDate(\n\t\t\t\t\tinstance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\n\t\t\t\t\tselectedDate, instance.settings);\n\t\t\t\tdates.not(this).datepicker(\"option\", option, date);\n\t\t\t\tdocument.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\t\t\tdocument.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\t\t}\n\t\t}\n\t);\n\t\n\tfunction ct_start_check(continue_check){\n\n continue_check = continue_check || null;\n\n\t\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\t\t\t\n\t\t\tct_date_from = jQuery('#ct_date_range_from').val();\n\t\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\t\t\t\t\t\t\n\t\t\tif(!(ct_date_from != '' && ct_date_till != '')){\n\t\t\t\talert('Please, specify a date range.');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\t\tct_accurate_check = true;\n\t\t}\n\t\t\n\t\tjQuery('.ct_to_hide').hide();\n\t\tjQuery('#ct_working_message').show();\n\t\tjQuery('#ct_preloader').show();\n\t\tjQuery('#ct_pause').show();\n\n\t\tct_working=true;\n\t\t\n\t\tif(continue_check){\n\t\t\tct_show_info();\n\t\t\tct_send_comments();\n\t\t}else\n\t\t\tct_clear_comments();\n\t\t\n\t}\n\t\n\t// Check comments\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_start_check(true);\n\t});\n\n\t// Pause the check\n\tjQuery('#ct_pause').on('click', function(){\n\t\tct_pause = true;\n\t\tvar ct_check = {\n\t\t\t'accurate': ct_accurate_check,\n\t\t\t'from' : ct_date_from,\n\t\t\t'till' : ct_date_till\n\t\t};\n\t\tdocument.cookie = 'ct_paused_spam_check=' + JSON.stringify(ct_check) + '; path=/; samesite=lax';\n\t});\n\n\n\tif(ctCommentsCheck.start === '1'){\n\t\tdocument.cookie = 'ct_comments_start_check=0; expires=' + new Date(0).toUTCString() + '; path=/; samesite=lax';\n\t\tjQuery('#ct_check_spam_button').click();\t\n\t}\n\n\t// Delete all spam comments\n\tjQuery(\".ct_trash_all\").click(function( e ){\n\n\t\tif (!confirm(ctCommentsCheck.ct_confirm_trash_all))\n\t\t\treturn false;\n\n\t\tct_trash_all( e );\n\n\t});\n\n\t// Mark as spam all spam comments\n\tjQuery(\".ct_spam_all\").click(function( e ){\n\n\t\tif (!confirm(ctCommentsCheck.ct_confirm_spam_all))\n\t\t\treturn false;\n\n\t\tct_spam_all( e );\n\n\t});\n\n});\n\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction ctGetCookie(name) {\n\tlet matches = document.cookie.match(new RegExp(\n\t\t\"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n\t));\n\treturn matches ? decodeURIComponent(matches[1]) : undefined;\n}"],"names":["ct_working","String","prototype","printf","arg","formatted","this","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_new_check","ct_cooling_down_flag","ct_close_animate","ct_accurate_check","ct_pause","ct_prev_accurate","ctCommentsCheck","ct_prev_from","ct_prev_till","ct_cool_down_time","ct_requests_counter","ct_max_requests","ct_ajax_nonce","ct_comments_total","ct_comments_checked","ct_comments_spam","ct_comments_bad","ct_unchecked","ct_date_from","ct_date_till","animate_comment","to","id","jQuery","fadeTo","ct_clear_comments","from","till","is","val","ctSecure","location","protocol","document","cookie","ajax","type","url","ajaxurl","data","action","security","success","msg","ct_show_info","ct_send_comments","ct_cooling_down_toggle","setTimeout","new_check","unchecked","offset","Number","ctGetCookie","new_href","parseJSON","parseInt","error","confirm","error_message","href","end","hide","checked","spam","bad","status_string","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","total","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_trash_all","e","target","addClass","css","removeClass","ct_spam_all","name","matches","match","RegExp","replace","decodeURIComponent","undefined","ready","on","attr","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","ct_start_check","continue_check","alert","click","ct_check","accurate","JSON","stringify","start","Date","toUTCString","ct_confirm_trash_all","ct_confirm_spam_all"],"mappings":"AAYA,IAAIA,aAXJC,OAAOC,UAAUC,OAAS,WACtB,IACSC,EADLC,EAAYC,KAChB,IAASF,KAAOG,UAClB,IAAIC,EAAmBH,EAAUI,UAAU,EAAGJ,EAAUK,QAAQ,KAAM,IAClEC,EAAmBN,EAAUI,UAAUJ,EAAUK,QAAQ,KAAM,GAAG,EAAGL,EAAUO,QACnFP,EAAYG,EAAmBD,UAAUH,GAAOO,EAE9C,OAAON,IAKVQ,cAAe,EACfC,sBAAuB,EACvBC,kBAAmB,EACnBC,mBAAoB,EACpBC,UAAW,EACXC,iBAAmBC,gBAAgBD,iBACnCE,aAAeD,gBAAgBC,aAC/BC,aAAeF,gBAAgBE,aAE5BC,kBAAoB,IACvBC,oBAAsB,EACtBC,gBAAkB,GAEfC,cAAgBN,gBAAgBM,cACnCC,kBAAoB,EACpBC,oBAAsB,EACtBC,iBAAmB,EACnBC,gBAAkB,EAClBC,aAAe,QACfC,aAAe,EACfC,aAAe,EAEhB,SAASC,gBAAgBC,EAAGC,GACxBpB,iBACK,IAAJmB,EACFE,OAAO,YAAYD,GAAIE,OAAO,IAAIH,EAAG,WACpCD,gBAAgB,EAAEE,KAGnBC,OAAO,YAAYD,GAAIE,OAAO,IAAIH,EAAG,WACpCD,gBAAgB,GAAIE,KAItBpB,kBAAiB,EAInB,SAASuB,oBAER,IAAIC,EAAO,EAAGC,EAAO,EAClBJ,OAAO,wBAAwBK,GAAG,cACpCF,EAAOH,OAAO,uBAAuBM,MACrCF,EAAOJ,OAAO,uBAAuBM,OAEtC,IAAIC,EAAiC,WAAtBC,SAASC,SAAwB,WAAa,GAC7DC,SAASC,OAAS,sDAAqEJ,EASvFP,OAAOY,KAAK,CACXC,KAAM,OACNC,IAAKC,QACLC,KAVU,CACVC,OAAa,sBAC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,SAAUW,EAAQE,GAC7C/E,SAASC,OAAS,sBAAuBX,OAAO,uBAAuBM,MAAO,yBAC9EI,SAASC,OAAS,sBAAuBX,OAAO,uBAAuBM,MAAO,4BAKjF,SAASwF,EAAeC,GAEjBA,EAAiBA,GAAkB,KAEtC/F,OAAO,wBAAwBK,GAAG,cAEpCV,aAAeK,OAAO,uBAAuBM,MAC7CV,aAAeI,OAAO,uBAAuBM,MAExB,IAAhBX,cAAsC,IAAhBC,cAC1BoG,MAAM,kCAKLhG,OAAO,sBAAsBK,GAAG,cAClCzB,mBAAoB,GAGrBoB,OAAO,eAAesC,OACtBtC,OAAO,uBAAuBiD,OAC9BjD,OAAO,iBAAiBiD,OACxBjD,OAAO,aAAaiD,OAEpBrF,YAAW,EAERmI,GACF1E,eACAC,oBAEApB,qBAKFF,OAAO,yBAAyBiG,MAAM,WAErCH,IADApF,SAASC,OAAS,mDAGnBX,OAAO,4BAA4BiG,MAAM,WACxCH,GAAe,KAIhB9F,OAAO,aAAa0E,GAAG,QAAS,WAC/B7F,UAAW,EACX,IAAIqH,EAAW,CACdC,SAAYvH,kBACZuB,KAAYR,aACZS,KAAYR,cAEbc,SAASC,OAAS,wBAA0ByF,KAAKC,UAAUH,GAAY,2BAI3C,MAA1BnH,gBAAgBuH,QAClB5F,SAASC,OAAS,sCAAwC,IAAI4F,KAAK,GAAGC,cAAgB,yBACtFxG,OAAO,yBAAyBiG,SAIjCjG,OAAO,iBAAiBiG,MAAM,SAAUrC,GAEvC,QAAK1B,QAAQnD,gBAAgB0H,4BAG7B9C,aAAcC,KAKf5D,OAAO,gBAAgBiG,MAAM,SAAUrC,GAEtC,QAAK1B,QAAQnD,gBAAgB2H,2BAG7BzC,YAAaL"}
|
1 |
+
{"version":3,"file":"cleantalk-comments-checkspam.min.js","sources":["cleantalk-comments-checkspam.js"],"sourcesContent":["// Printf for JS\nString.prototype.printf = function(){\n var formatted = this;\n for( var arg in arguments ) {\n\t\tvar before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\n\t\tvar after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\n\t\tformatted = before_formatted + arguments[arg] + after_formatted;\n }\n return formatted;\n};\n\n// Flags\nvar ct_working = false,\n\tct_new_check = true,\n\tct_cooling_down_flag = false,\n\tct_close_animate = true,\n\tct_accurate_check = false,\n\tct_pause = false,\n\tct_prev_accurate = ctCommentsCheck.ct_prev_accurate,\n\tct_prev_from = ctCommentsCheck.ct_prev_from,\t\n\tct_prev_till = ctCommentsCheck.ct_prev_till;\n// Settings\nvar ct_cool_down_time = 90000,\n\tct_requests_counter = 0,\n\tct_max_requests = 60;\n// Variables\nvar ct_ajax_nonce = ctCommentsCheck.ct_ajax_nonce,\n\tct_comments_total = 0,\n\tct_comments_checked = 0,\n\tct_comments_spam = 0,\n\tct_comments_bad = 0,\n\tct_unchecked = 'unset',\n\tct_date_from = 0,\n\tct_date_till = 0;\n\nfunction animate_comment(to,id){\n\tif(ct_close_animate){\n\t\tif(to==0.3){\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(1,id)\n\t\t\t});\n\t\t}else{\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(0.3,id)\n\t\t\t});\n\t\t}\n\t}else{\n\t\tct_close_animate=true;\n\t}\n}\n\nfunction ct_clear_comments(){\n\n\tvar from = 0, till = 0;\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\n\t\tfrom = jQuery('#ct_date_range_from').val();\n\t\ttill = jQuery('#ct_date_range_till').val();\n\t}\n\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\tdocument.cookie = 'apbct_check_comments_offset' + \"=\" + 0 + \"; path=/; samesite=lax\" + ctSecure;\n\t\n\tvar data = {\n\t\t'action' : 'ajax_clear_comments',\n\t\t'security' : ct_ajax_nonce,\n\t\t'from' : from,\n\t\t'till' : till\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_show_info();\n\t\t\tct_send_comments();\n\t\t}\n\t});\n}\n\n//Continues the check after cooldown time\n//Called by ct_send_users();\nfunction ct_cooling_down_toggle(){\n\tct_cooling_down_flag = false;\n\tct_send_comments();\n\tct_show_info();\n}\n\nfunction ct_send_comments(){\n\t\n\tif(ct_cooling_down_flag === true)\n\t\treturn;\n\t\n\tif(ct_requests_counter >= ct_max_requests){\n\t\tsetTimeout(ct_cooling_down_toggle, ct_cool_down_time);\n\t\tct_requests_counter = 0;\n\t\tct_cooling_down_flag = true;\n\t\treturn;\n\t}else{\n\t\tct_requests_counter++;\n\t}\n\t\n\tvar data = {\n\t\t'action': 'ajax_check_comments',\n\t\t'security': ct_ajax_nonce,\n\t\t'new_check': ct_new_check,\n\t\t'unchecked': ct_unchecked,\n\t\t'offset' : Number(ctGetCookie('apbct_check_comments_offset'))\n\t};\n\t\n\tif(ct_accurate_check)\n\t\tdata['accurate_check'] = true;\n\t\n\tif(ct_date_from && ct_date_till){\n\t\tdata['from'] = ct_date_from;\n\t\tdata['till'] = ct_date_till;\n\t}\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\t\n\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\n\t\t\tif(parseInt(msg.error)){\n\t\t\t\tct_working=false;\n\t\t\t\tif(!confirm(msg.error_message+\". Do you want to proceed?\")){\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else\n\t\t\t\t\tct_send_comments();\n\t\t\t}else{\n\t\t\t\tct_new_check = false;\n\t\t\t\tif(parseInt(msg.end) == 1 || ct_pause === true){\n\t\t\t\t\tif(parseInt(msg.end) == 1)\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';\n\t\t\t\t\tct_working=false;\n\t\t\t\t\tjQuery('#ct_working_message').hide();\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else if(parseInt(msg.end) == 0){\n\t\t\t\t\tct_comments_checked += msg.checked;\n\t\t\t\t\tct_comments_spam += msg.spam;\n\t\t\t\t\tct_comments_bad += msg.bad;\n\t\t\t\t\tct_unchecked = ct_comments_total - ct_comments_checked - ct_comments_bad;\n\t\t\t\t\tvar status_string = String(ctCommentsCheck.ct_status_string);\n\t\t\t\t\tvar status_string = status_string.printf(ct_comments_checked, ct_comments_spam, ct_comments_bad);\n\t\t\t\t\tif(parseInt(ct_comments_spam) > 0)\n\t\t\t\t\t\tstatus_string += ctCommentsCheck.ct_status_string_warning;\n\t\t\t\t\tjQuery('#ct_checking_status').html(status_string);\n\t\t\t\t\tjQuery('#ct_error_message').hide();\n\t\t\t\t\t// If DB woks not properly\n\t\t\t\t\tif(+ct_comments_total < ct_comments_checked + ct_comments_bad){\n\t\t\t\t\t\tdocument.cookie = 'ct_comments_start_check=1; path=/; samesite=lax';\n\t\t\t\t\t\tlocation.href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\t}\n\n\t\t\t\t\tvar offset = Number(ctGetCookie('apbct_check_comments_offset')) + 100;\n\t\t\t\t\tdocument.cookie = 'apbct_check_comments_offset' + \"=\" + offset + \"; path=/\";\n\t\t\t\t\t\n\t\t\t\t\tct_send_comments();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_send_comments(), 3000); \n },\n timeout: 25000\n\t});\n}\nfunction ct_show_info(){\n\t\n\tif(ct_working){\n\t\t\n\t\tif(ct_cooling_down_flag == true){\n\t\t\tjQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)');\n\t\t\tjQuery('#ct_cooling_notice').show();\n\t\t\treturn;\t\t\t\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\n\t\t\n\t\tif(!ct_comments_total){\n\t\t\t\n\t\t\tvar data = {\n\t\t\t\t'action': 'ajax_info_comments',\n\t\t\t\t'security': ct_ajax_nonce\n\t\t\t};\n\t\t\t\n\t\t\tif(ct_date_from && ct_date_till){\n\t\t\t\tdata['from'] = ct_date_from;\n\t\t\t\tdata['till'] = ct_date_till;\n\t\t\t}\n\t\t\t\n\t\t\tjQuery.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: ajaxurl,\n\t\t\t\tdata: data,\n\t\t\t\tsuccess: function(msg){\n\t\t\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\t\tjQuery('#ct_checking_status').html(msg.message);\n\t\t\t\t\tct_comments_total = msg.total;\n\t\t\t\t\tct_comments_spam = msg.spam;\n\t\t\t\t\tct_comments_checked = msg.checked;\n\t\t\t\t\tct_comments_bad = msg.bad;\n\t\t\t\t},\n\t\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\tjQuery('#ct_error_message').show();\n\t\t\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\t\t\tsetTimeout(ct_show_info(), 3000); \n\t\t\t\t},\n\t\t\t\ttimeout: 15000\n\t\t\t});\n\t\t}\n\t}\n}\n\n// Function to toggle dependences\nfunction ct_toggle_depended(obj, secondary){\n\n secondary = secondary || null;\n\n\tvar depended = jQuery(obj.data('depended')),\n\t\tstate = obj.data('state');\n\t\t\n\tif(!state && !secondary){\n\t\tobj.data('state', true);\n\t\tdepended.removeProp('disabled');\n\t}else{\n\t\tobj.data('state', false);\n\t\tdepended.prop('disabled', true);\n\t\tdepended.removeProp('checked');\n\t\tif(depended.data('depended'))\n\t\t\tct_toggle_depended(depended, true);\n\t}\n}\n\nfunction ct_trash_all( e ) {\n\n\tvar data = {\n\t\t'action': 'ajax_trash_all',\n\t\t'security': ct_ajax_nonce\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_comments_left').html(msg);\n\t\t\t\tct_trash_all( e );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='edit-comments.php?page=ct_check_spam';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_trash_all( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n\n}\n\nfunction ct_spam_all( e ) {\n\n\tvar data = {\n\t\t'action': 'ajax_spam_all',\n\t\t'security': ct_ajax_nonce\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_comments_left').html(msg);\n\t\t\t\tct_spam_all( e );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='edit-comments.php?page=ct_check_spam';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_spam_all( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n\n}\n\njQuery(document).ready(function(){\n\t\n\t// Prev check parameters\n\tif(ct_prev_accurate){\n\t\tjQuery(\"#ct_accurate_check\").prop('checked', true);\n\t}\n\tif(ct_prev_from){\n\t\tjQuery(\"#ct_allow_date_range\").prop('checked', true).data('state', true);\n\t\tjQuery(\"#ct_date_range_from\").removeProp('disabled').val(ct_prev_from);\n\t\tjQuery(\"#ct_date_range_till\").removeProp('disabled').val(ct_prev_till);\n\t}\n\t\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range\").on('change', function(){\n\t\tdocument.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\tdocument.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\tif( this.checked ) {\n\t\t\tdocument.cookie = 'ct_spam_dates_allowed=1; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t} else {\n\t\t\tdocument.cookie = 'ct_spam_dates_allowed=0; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('disabled', true).attr('disabled',true);\n\t\t}\n\t});\n\n jQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'M d yy',\n\t\t\tmaxDate:\"+0D\",\n\t\t\tchangeMonth:true,\n\t\t\tchangeYear:true,\n\t\t\tshowAnim: 'slideDown',\n\t\t\tonSelect: function(selectedDate){\n\t\t\tvar option = this.id == \"ct_date_range_from\" ? \"minDate\" : \"maxDate\",\n\t\t\t\tinstance = jQuery( this ).data( \"datepicker\" ),\n\t\t\t\tdate = jQuery.datepicker.parseDate(\n\t\t\t\t\tinstance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\n\t\t\t\t\tselectedDate, instance.settings);\n\t\t\t\tdates.not(this).datepicker(\"option\", option, date);\n\t\t\t\tdocument.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\t\t\tdocument.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\t\t}\n\t\t}\n\t);\n\t\n\tfunction ct_start_check(continue_check){\n\n continue_check = continue_check || null;\n\n\t\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\t\t\t\n\t\t\tct_date_from = jQuery('#ct_date_range_from').val();\n\t\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\t\t\t\t\t\t\n\t\t\tif(!(ct_date_from != '' && ct_date_till != '')){\n\t\t\t\talert('Please, specify a date range.');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\t\tct_accurate_check = true;\n\t\t}\n\t\t\n\t\tjQuery('.ct_to_hide').hide();\n\t\tjQuery('#ct_working_message').show();\n\t\tjQuery('#ct_preloader').show();\n\t\tjQuery('#ct_pause').show();\n\n\t\tct_working=true;\n\t\t\n\t\tif(continue_check){\n\t\t\tct_show_info();\n\t\t\tct_send_comments();\n\t\t}else\n\t\t\tct_clear_comments();\n\t\t\n\t}\n\t\n\t// Check comments\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_start_check(true);\n\t});\n\n\t// Pause the check\n\tjQuery('#ct_pause').on('click', function(){\n\t\tct_pause = true;\n\t\tvar ct_check = {\n\t\t\t'accurate': ct_accurate_check,\n\t\t\t'from' : ct_date_from,\n\t\t\t'till' : ct_date_till\n\t\t};\n\t\tdocument.cookie = 'ct_paused_spam_check=' + JSON.stringify(ct_check) + '; path=/; samesite=lax';\n\t});\n\n\n\tif(ctCommentsCheck.start === '1'){\n\t\tdocument.cookie = 'ct_comments_start_check=0; expires=' + new Date(0).toUTCString() + '; path=/; samesite=lax';\n\t\tjQuery('#ct_check_spam_button').click();\t\n\t}\n\n\t// Delete all spam comments\n\tjQuery(\".ct_trash_all\").click(function( e ){\n\n\t\tif (!confirm(ctCommentsCheck.ct_confirm_trash_all))\n\t\t\treturn false;\n\n\t\tct_trash_all( e );\n\n\t});\n\n\t// Mark as spam all spam comments\n\tjQuery(\".ct_spam_all\").click(function( e ){\n\n\t\tif (!confirm(ctCommentsCheck.ct_confirm_spam_all))\n\t\t\treturn false;\n\n\t\tct_spam_all( e );\n\n\t});\n\n});\n\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction ctGetCookie(name) {\n\tvar matches = document.cookie.match(new RegExp(\"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"));\n\treturn matches ? decodeURIComponent(matches[1]) : undefined;\n}"],"names":["ct_working","String","prototype","printf","formatted","this","arg","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_new_check","ct_cooling_down_flag","ct_close_animate","ct_accurate_check","ct_pause","ct_prev_accurate","ctCommentsCheck","ct_prev_from","ct_prev_till","ct_cool_down_time","ct_requests_counter","ct_max_requests","ct_ajax_nonce","ct_comments_total","ct_comments_checked","ct_comments_spam","ct_comments_bad","ct_unchecked","ct_date_from","ct_date_till","animate_comment","to","id","jQuery","fadeTo","ct_clear_comments","from","till","is","val","ctSecure","location","protocol","document","cookie","data","action","security","ajax","type","url","ajaxurl","success","msg","ct_show_info","ct_send_comments","ct_cooling_down_toggle","setTimeout","new_check","unchecked","offset","Number","ctGetCookie","new_href","status_string","parseJSON","parseInt","error","confirm","error_message","href","end","hide","checked","spam","bad","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","total","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_trash_all","e","target","addClass","css","removeClass","ct_spam_all","name","matches","match","RegExp","replace","decodeURIComponent","undefined","ready","on","attr","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","ct_start_check","continue_check","alert","click","ct_check","accurate","JSON","stringify","start","Date","toUTCString","ct_confirm_trash_all","ct_confirm_spam_all"],"mappings":"AAYA,IAAIA,aAXJC,OAAOC,UAAUC,OAAS,WACtB,IAAIC,EAAYC,KAChB,IAAK,IAAIC,KAAOC,UAClB,IAAIC,EAAmBJ,EAAUK,UAAU,EAAGL,EAAUM,QAAQ,KAAM,IAClEC,EAAmBP,EAAUK,UAAUL,EAAUM,QAAQ,KAAM,GAAG,EAAGN,EAAUQ,QACnFR,EAAYI,EAAmBD,UAAUD,GAAOK,EAE9C,OAAOP,IAKVS,cAAe,EACfC,sBAAuB,EACvBC,kBAAmB,EACnBC,mBAAoB,EACpBC,UAAW,EACXC,iBAAmBC,gBAAgBD,iBACnCE,aAAeD,gBAAgBC,aAC/BC,aAAeF,gBAAgBE,aAE5BC,kBAAoB,IACvBC,oBAAsB,EACtBC,gBAAkB,GAEfC,cAAgBN,gBAAgBM,cACnCC,kBAAoB,EACpBC,oBAAsB,EACtBC,iBAAmB,EACnBC,gBAAkB,EAClBC,aAAe,QACfC,aAAe,EACfC,aAAe,EAEhB,SAASC,gBAAgBC,EAAGC,GACxBpB,iBACK,IAAJmB,EACFE,OAAO,YAAYD,GAAIE,OAAO,IAAIH,EAAG,WAC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H,gBAAgBuH,QAClB5F,SAASC,OAAS,sCAAwC,IAAI4F,KAAK,GAAGC,cAAgB,yBACtFxG,OAAO,yBAAyBiG,SAIjCjG,OAAO,iBAAiBiG,MAAM,SAAUrC,GAEvC,QAAKzB,QAAQpD,gBAAgB0H,4BAG7B9C,aAAcC,KAKf5D,OAAO,gBAAgBiG,MAAM,SAAUrC,GAEtC,QAAKzB,QAAQpD,gBAAgB2H,2BAG7BzC,YAAaL"}
|
lib/Cleantalk/ApbctWP/State.php
CHANGED
@@ -578,7 +578,7 @@ class State extends \Cleantalk\Common\State
|
|
578 |
// Remove subtype errors from processing.
|
579 |
// No need to array_shift for these
|
580 |
$sub_errors = array();
|
581 |
-
if ( is_array($this->errors[$type]) ) {
|
582 |
foreach ( $this->errors[$type] as $key => $sub_error ) {
|
583 |
if ( is_string($key) ) {
|
584 |
$sub_errors[$key] = $sub_error;
|
@@ -588,7 +588,7 @@ class State extends \Cleantalk\Common\State
|
|
588 |
}
|
589 |
|
590 |
// Drop first element if errors array length is more than 5
|
591 |
-
if ( is_array($this->errors[$type]) && count($this->errors[$type]) >= 5 ) {
|
592 |
array_shift($this->errors[$type]);
|
593 |
}
|
594 |
|
578 |
// Remove subtype errors from processing.
|
579 |
// No need to array_shift for these
|
580 |
$sub_errors = array();
|
581 |
+
if ( isset($this->errors[$type]) && is_array($this->errors[$type]) ) {
|
582 |
foreach ( $this->errors[$type] as $key => $sub_error ) {
|
583 |
if ( is_string($key) ) {
|
584 |
$sub_errors[$key] = $sub_error;
|
588 |
}
|
589 |
|
590 |
// Drop first element if errors array length is more than 5
|
591 |
+
if ( isset($this->errors[$type]) && is_array($this->errors[$type]) && count($this->errors[$type]) >= 5 ) {
|
592 |
array_shift($this->errors[$type]);
|
593 |
}
|
594 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: spam, antispam, anti-spam, comments, firewall
|
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 5.8
|
6 |
Requires PHP: 5.6
|
7 |
-
Stable tag: 5.
|
8 |
License: GPLv2
|
9 |
|
10 |
Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
|
@@ -595,6 +595,24 @@ If your website has forms that send data to external sources, you can enable opt
|
|
595 |
|
596 |
== Changelog ==
|
597 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
598 |
= 5.165.1 Nov 09 2021 =
|
599 |
* Fix. Settings. Saving settings fixed.
|
600 |
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 5.8
|
6 |
Requires PHP: 5.6
|
7 |
+
Stable tag: 5.166
|
8 |
License: GPLv2
|
9 |
|
10 |
Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
|
595 |
|
596 |
== Changelog ==
|
597 |
|
598 |
+
= 5.166 Nov 18 2021 =
|
599 |
+
* Fix: skip ult-forgot-password action.
|
600 |
+
* Fix: Uncanny toolkit skip.
|
601 |
+
* Fix: SFW. Clearing FW stats fixed.
|
602 |
+
* Fix: SFW. Updating fallback fixed.
|
603 |
+
* Fix: SFW. Updating FW stats fixed.
|
604 |
+
* Mod: Changed the type of verification on check_message during registration in BuddyPress
|
605 |
+
* Fix: register_settings for wp < 4.7.
|
606 |
+
* Fix: Comment scanners. Getting cookie fixed.
|
607 |
+
* Fix: check if errors exists in state.
|
608 |
+
* Fix: update sfw after enabled.
|
609 |
+
* Fix: WPMS. Settings validating fixed.
|
610 |
+
* Fix: wpforms skip remove token validation.
|
611 |
+
* Fix. Text. Feedback description fixed.
|
612 |
+
* Fix: WPMS. Delete api key from settings template used.
|
613 |
+
* Fix. Updater. Notice fixed.
|
614 |
+
* Fix: WPMS. Setting transferring to the sub sites fixed.
|
615 |
+
|
616 |
= 5.165.1 Nov 09 2021 =
|
617 |
* Fix. Settings. Saving settings fixed.
|
618 |
|