Version Description
Dec 30 2020 = * Fix: Prevent skip checking UltimateMember register. * Upd: SFW die pages updated - networks count added. * Fix: AF auto cleaning table fixed. * Fix: Removing spam flag on gravity forms checking. * Fix: Remote call's request checking moved to separated func. * Fix: Prevent CRON action from remote call request.
Download this release
Release Info
Developer | glomberg |
Plugin | Spam protection, AntiSpam, FireWall by CleanTalk |
Version | 5.151.2 |
Comparing to | |
See all releases |
Code changes from version 5.151.1 to 5.151.2
- cleantalk.php +17 -7
- inc/cleantalk-common.php +2 -1
- inc/cleantalk-public.php +0 -1
- lib/Cleantalk/ApbctWP/Cron.php +10 -0
- lib/Cleantalk/ApbctWP/FindSpam/Checker.php +143 -143
- lib/Cleantalk/ApbctWP/Firewall/AntiCrawler.php +5 -3
- lib/Cleantalk/ApbctWP/Firewall/AntiFlood.php +8 -3
- lib/Cleantalk/ApbctWP/Firewall/SFW.php +4 -2
- readme.txt +9 -1
cleantalk.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Anti-Spam by CleanTalk
|
4 |
Plugin URI: https://cleantalk.org
|
5 |
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.
|
6 |
-
Version: 5.151.
|
7 |
Author: СleanTalk <welcome@cleantalk.org>
|
8 |
Author URI: https://cleantalk.org
|
9 |
Text Domain: cleantalk-spam-protect
|
@@ -129,7 +129,10 @@ if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
|
|
129 |
apbct_update_actions();
|
130 |
|
131 |
// Self cron
|
132 |
-
|
|
|
|
|
|
|
133 |
|
134 |
$ct_cron = new Cron();
|
135 |
$ct_cron->checkTasks();
|
@@ -249,7 +252,7 @@ if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
|
|
249 |
add_action( 'wp_head', 'apbct_search_add_noindex', 1 );
|
250 |
|
251 |
// Remote calls
|
252 |
-
if(
|
253 |
apbct_remote_call__perform();
|
254 |
}
|
255 |
// SpamFireWall check
|
@@ -487,6 +490,16 @@ function apbct_sfw_actions( $option, $value ) {
|
|
487 |
|
488 |
}
|
489 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
490 |
/**
|
491 |
* Function preforms remote call
|
492 |
*/
|
@@ -1072,11 +1085,8 @@ function ct_sfw_update( $api_key = '', $immediate = false ){
|
|
1072 |
|
1073 |
if( $apbct->settings['spam_firewall'] == 1 && ( ! empty($api_key) || $apbct->data['moderate_ip'] ) ) {
|
1074 |
|
1075 |
-
if(
|
1076 |
// Remote call is in process, do updating
|
1077 |
-
isset($_GET['spbc_remote_call_token'], $_GET['spbc_remote_call_action'], $_GET['plugin_name']) &&
|
1078 |
-
in_array($_GET['plugin_name'], array('antispam','anti-spam', 'apbct'))
|
1079 |
-
) {
|
1080 |
|
1081 |
$file_urls = isset($_GET['file_urls']) ? urldecode( $_GET['file_urls'] ) : null;
|
1082 |
$url_count = isset($_GET['url_count']) ? urldecode( $_GET['url_count'] ) : null;
|
3 |
Plugin Name: Anti-Spam by CleanTalk
|
4 |
Plugin URI: https://cleantalk.org
|
5 |
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.
|
6 |
+
Version: 5.151.2
|
7 |
Author: СleanTalk <welcome@cleantalk.org>
|
8 |
Author URI: https://cleantalk.org
|
9 |
Text Domain: cleantalk-spam-protect
|
129 |
apbct_update_actions();
|
130 |
|
131 |
// Self cron
|
132 |
+
if( ! apbct_is_remote_call() && // Do not doing CRON in remote call action
|
133 |
+
! defined('DOING_CRON') ||
|
134 |
+
(defined('DOING_CRON') && DOING_CRON !== true)
|
135 |
+
){
|
136 |
|
137 |
$ct_cron = new Cron();
|
138 |
$ct_cron->checkTasks();
|
252 |
add_action( 'wp_head', 'apbct_search_add_noindex', 1 );
|
253 |
|
254 |
// Remote calls
|
255 |
+
if( apbct_is_remote_call() ){
|
256 |
apbct_remote_call__perform();
|
257 |
}
|
258 |
// SpamFireWall check
|
490 |
|
491 |
}
|
492 |
|
493 |
+
/**
|
494 |
+
* Checking if the current request is the Remote Call
|
495 |
+
*
|
496 |
+
* @return bool
|
497 |
+
*/
|
498 |
+
function apbct_is_remote_call() {
|
499 |
+
return isset($_GET['spbc_remote_call_token'], $_GET['spbc_remote_call_action'], $_GET['plugin_name']) &&
|
500 |
+
in_array($_GET['plugin_name'], array('antispam','anti-spam', 'apbct'));
|
501 |
+
}
|
502 |
+
|
503 |
/**
|
504 |
* Function preforms remote call
|
505 |
*/
|
1085 |
|
1086 |
if( $apbct->settings['spam_firewall'] == 1 && ( ! empty($api_key) || $apbct->data['moderate_ip'] ) ) {
|
1087 |
|
1088 |
+
if( apbct_is_remote_call() ) {
|
1089 |
// Remote call is in process, do updating
|
|
|
|
|
|
|
1090 |
|
1091 |
$file_urls = isset($_GET['file_urls']) ? urldecode( $_GET['file_urls'] ) : null;
|
1092 |
$url_count = isset($_GET['url_count']) ? urldecode( $_GET['url_count'] ) : null;
|
inc/cleantalk-common.php
CHANGED
@@ -106,7 +106,8 @@ function apbct_base_call($params = array(), $reg_flag = false){
|
|
106 |
|
107 |
// Skip duplicate requests
|
108 |
if( key_exists( $apbct->plugin_request_id, $apbct->plugin_request_ids ) &&
|
109 |
-
current_filter() !== 'woocommerce_registration_errors'
|
|
|
110 |
{
|
111 |
do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
|
112 |
return array( 'ct_result' => new CleantalkResponse() );
|
106 |
|
107 |
// Skip duplicate requests
|
108 |
if( key_exists( $apbct->plugin_request_id, $apbct->plugin_request_ids ) &&
|
109 |
+
current_filter() !== 'woocommerce_registration_errors' && // Prevent skip checking woocommerce registration during checkout
|
110 |
+
current_filter() !== 'um_submit_form_register' ) // Prevent skip checking UltimateMember register
|
111 |
{
|
112 |
do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
|
113 |
return array( 'ct_result' => new CleantalkResponse() );
|
inc/cleantalk-public.php
CHANGED
@@ -3019,7 +3019,6 @@ function apbct_form__gravityForms__testSpam($is_spam, $form, $entry) {
|
|
3019 |
|
3020 |
if (
|
3021 |
$apbct->settings['contact_forms_test'] == 0 ||
|
3022 |
-
$is_spam ||
|
3023 |
$cleantalk_executed // Return unchanged result if the submission was already tested.
|
3024 |
) {
|
3025 |
do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
|
3019 |
|
3020 |
if (
|
3021 |
$apbct->settings['contact_forms_test'] == 0 ||
|
|
|
3022 |
$cleantalk_executed // Return unchanged result if the submission was already tested.
|
3023 |
) {
|
3024 |
do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
|
lib/Cleantalk/ApbctWP/Cron.php
CHANGED
@@ -74,6 +74,16 @@ class Cron
|
|
74 |
static public function updateTask($task, $handler, $period, $first_call = null){
|
75 |
self::addTask($task, $handler, $period, $first_call, true);
|
76 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
|
78 |
// Getting tasks which should be run. Putting tasks that should be run to $this->tasks_to_run
|
79 |
public function checkTasks()
|
74 |
static public function updateTask($task, $handler, $period, $first_call = null){
|
75 |
self::addTask($task, $handler, $period, $first_call, true);
|
76 |
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Getting list of tasks
|
80 |
+
*
|
81 |
+
* @return array
|
82 |
+
*/
|
83 |
+
public function getTasks()
|
84 |
+
{
|
85 |
+
return $this->tasks;
|
86 |
+
}
|
87 |
|
88 |
// Getting tasks which should be run. Putting tasks that should be run to $this->tasks_to_run
|
89 |
public function checkTasks()
|
lib/Cleantalk/ApbctWP/FindSpam/Checker.php
CHANGED
@@ -1,144 +1,144 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace Cleantalk\ApbctWP\FindSpam;
|
4 |
-
|
5 |
-
use Cleantalk\Variables\Cookie;
|
6 |
-
|
7 |
-
abstract class Checker
|
8 |
-
{
|
9 |
-
|
10 |
-
protected $page_title = '';
|
11 |
-
|
12 |
-
protected $apbct;
|
13 |
-
|
14 |
-
protected $page_script_name;
|
15 |
-
|
16 |
-
protected $page_slug;
|
17 |
-
|
18 |
-
protected $list_table;
|
19 |
-
|
20 |
-
public function __construct() {
|
21 |
-
|
22 |
-
global $apbct;
|
23 |
-
$this->apbct = $apbct;
|
24 |
-
|
25 |
-
// jQueryUI
|
26 |
-
wp_enqueue_script( 'jqueryui', plugins_url('/cleantalk-spam-protect/js/jquery-ui.min.js'), array('jquery'), '1.12.1' );
|
27 |
-
wp_enqueue_style( 'jqueryui_css', plugins_url('/cleantalk-spam-protect/css/jquery-ui.min.css'), array(), '1.21.1', 'all' );
|
28 |
-
wp_enqueue_style( 'jqueryui_theme_css', plugins_url('/cleantalk-spam-protect/css/jquery-ui.theme.min.css'), array(), '1.21.1', 'all' );
|
29 |
-
|
30 |
-
// Common CSS
|
31 |
-
wp_enqueue_style( 'cleantalk_admin_css_settings_page', plugins_url('/cleantalk-spam-protect/css/cleantalk-spam-check.min.css'), array( 'jqueryui_css' ), APBCT_VERSION, 'all' );
|
32 |
-
|
33 |
-
}
|
34 |
-
|
35 |
-
public function getPageTitle() {
|
36 |
-
|
37 |
-
return $this->page_title;
|
38 |
-
|
39 |
-
}
|
40 |
-
|
41 |
-
public function getPageScriptName() {
|
42 |
-
|
43 |
-
return $this->page_script_name;
|
44 |
-
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* @return mixed
|
49 |
-
*/
|
50 |
-
public function getPageSlug()
|
51 |
-
{
|
52 |
-
return $this->page_slug;
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* @return mixed
|
57 |
-
*/
|
58 |
-
public function getApbct()
|
59 |
-
{
|
60 |
-
return $this->apbct;
|
61 |
-
}
|
62 |
-
|
63 |
-
abstract function getCurrentScanPage();
|
64 |
-
|
65 |
-
abstract function getSpamLogsPage();
|
66 |
-
|
67 |
-
protected function getCurrentScanPanel( $spam_checker ) {
|
68 |
-
|
69 |
-
$dates_allowed = '';
|
70 |
-
$dates_disabled = 'disabled';
|
71 |
-
if( Cookie::get('ct_' . $this->page_slug . '_dates_allowed') ) {
|
72 |
-
$dates_allowed = 'checked';
|
73 |
-
$dates_disabled = '';
|
74 |
-
}
|
75 |
-
$dates_from = Cookie::get('ct_' . $this->page_slug . '_dates_from');
|
76 |
-
$dates_till = Cookie::get('ct_' . $this->page_slug . '_dates_till');
|
77 |
-
|
78 |
-
?>
|
79 |
-
|
80 |
-
<!-- Count -->
|
81 |
-
<h3 id="ct_checking_count"><?php echo $spam_checker::get_count_text() ; ?></h3>
|
82 |
-
|
83 |
-
<!-- Main info -->
|
84 |
-
<h3 id="ct_checking_status"><?php echo $spam_checker::ct_ajax_info(true) ; ?></h3>
|
85 |
-
|
86 |
-
<!-- Check options -->
|
87 |
-
<div class="ct_to_hide" id="ct_check_params_wrapper">
|
88 |
-
<button class="button ct_check_params_elem" id="ct_check_spam_button" <?php echo !$this->apbct->data['moderate'] ? 'disabled="disabled"' : ''; ?>><?php _e("Start check", 'cleantalk-spam-protect'); ?></button>
|
89 |
-
<?php if(!empty($_COOKIE['ct_paused_'.$this->page_slug.'_check'])) { ?><button class="button ct_check_params_elem" id="ct_proceed_check_button"><?php _e("Continue check", 'cleantalk-spam-protect'); ?></button><?php } ?>
|
90 |
-
<p class="ct_check_params_desc"><?php _e("The plugin will check all $this->page_slug against blacklists database and show you senders that have spam activity on other websites.", 'cleantalk-spam-protect'); ?></p>
|
91 |
-
<br />
|
92 |
-
<div class="ct_check_params_elem ct_check_params_elem_sub">
|
93 |
-
<input id="ct_accurate_check" type="checkbox" value="1" /><label for="ct_accurate_check"><strong><?php _e("Accurate check", 'cleantalk-spam-protect'); ?></strong></label>
|
94 |
-
</div>
|
95 |
-
<p class="ct_check_params_desc"><?php _e("Allows to use $this->page_slug's dates to perform more accurate check. Could seriously slow down the check.", 'cleantalk-spam-protect'); ?></p>
|
96 |
-
<br />
|
97 |
-
<div class="ct_check_params_elem ct_check_params_elem_sub">
|
98 |
-
<input id="ct_allow_date_range" type="checkbox" value="1" <?php echo $dates_allowed; ?> /><label for="ct_allow_date_range"><strong><?php _e("Specify date range", 'cleantalk-spam-protect'); ?></strong></label>
|
99 |
-
</div>
|
100 |
-
<div class="ct_check_params_desc">
|
101 |
-
<label for="ct_date_range_from"></label><input class="ct_date" type="text" id="ct_date_range_from" value="<?php echo $dates_from; ?>" <?php echo $dates_disabled; ?> readonly />
|
102 |
-
<label for="ct_date_range_till"></label><input class="ct_date" type="text" id="ct_date_range_till" value="<?php echo $dates_till; ?>" <?php echo $dates_disabled; ?> readonly />
|
103 |
-
</div>
|
104 |
-
<div class="ct_check_params_desc">
|
105 |
-
<p><?php esc_html_e( "Begin/end dates of creation $this->page_slug to check. If no date is specified, the plugin will check all entries.", 'cleantalk-spam-protect'); ?></p>
|
106 |
-
</div>
|
107 |
-
<br>
|
108 |
-
<?php apbct_admin__badge__get_premium(); ?>
|
109 |
-
</div>
|
110 |
-
|
111 |
-
<!-- Cooling notice -->
|
112 |
-
<h3 id="ct_cooling_notice"></h3>
|
113 |
-
|
114 |
-
<!-- Preloader and working message -->
|
115 |
-
<div id="ct_preloader">
|
116 |
-
<img src="<?php echo APBCT_URL_PATH . '/inc/images/preloader.gif'; ?>" alt="Cleantalk preloader" />
|
117 |
-
</div>
|
118 |
-
<div id="ct_working_message">
|
119 |
-
<?php _e("Please wait for a while. CleanTalk is checking all $this->page_slug via blacklist database at cleantalk.org. You will have option to delete found spam $this->page_slug after plugin finish.", 'cleantalk-spam-protect'); ?>
|
120 |
-
</div>
|
121 |
-
|
122 |
-
<!-- Pause button -->
|
123 |
-
<button class="button" id="ct_pause">Pause check</button>
|
124 |
-
<?php
|
125 |
-
}
|
126 |
-
|
127 |
-
public static function writeSpamLog( $scan_type, $scan_date, $cnt_checked, $cnt_spam, $cnt_bad ) {
|
128 |
-
|
129 |
-
global $wpdb;
|
130 |
-
$wpdb->insert(
|
131 |
-
APBCT_SPAMSCAN_LOGS,
|
132 |
-
array(
|
133 |
-
'scan_type' => $scan_type,
|
134 |
-
'start_time' => $scan_date, //@ToDo this is the END date. Need to place both: start and and of scanning
|
135 |
-
'count_to_scan' => $cnt_checked,
|
136 |
-
'found_spam' => $cnt_spam,
|
137 |
-
'found_bad' => $cnt_bad
|
138 |
-
),
|
139 |
-
array( '%s', '%s', '%d', '%d', '%d' )
|
140 |
-
);
|
141 |
-
|
142 |
-
}
|
143 |
-
|
144 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Cleantalk\ApbctWP\FindSpam;
|
4 |
+
|
5 |
+
use Cleantalk\Variables\Cookie;
|
6 |
+
|
7 |
+
abstract class Checker
|
8 |
+
{
|
9 |
+
|
10 |
+
protected $page_title = '';
|
11 |
+
|
12 |
+
protected $apbct;
|
13 |
+
|
14 |
+
protected $page_script_name;
|
15 |
+
|
16 |
+
protected $page_slug;
|
17 |
+
|
18 |
+
protected $list_table;
|
19 |
+
|
20 |
+
public function __construct() {
|
21 |
+
|
22 |
+
global $apbct;
|
23 |
+
$this->apbct = $apbct;
|
24 |
+
|
25 |
+
// jQueryUI
|
26 |
+
wp_enqueue_script( 'jqueryui', plugins_url('/cleantalk-spam-protect/js/jquery-ui.min.js'), array('jquery'), '1.12.1' );
|
27 |
+
wp_enqueue_style( 'jqueryui_css', plugins_url('/cleantalk-spam-protect/css/jquery-ui.min.css'), array(), '1.21.1', 'all' );
|
28 |
+
wp_enqueue_style( 'jqueryui_theme_css', plugins_url('/cleantalk-spam-protect/css/jquery-ui.theme.min.css'), array(), '1.21.1', 'all' );
|
29 |
+
|
30 |
+
// Common CSS
|
31 |
+
wp_enqueue_style( 'cleantalk_admin_css_settings_page', plugins_url('/cleantalk-spam-protect/css/cleantalk-spam-check.min.css'), array( 'jqueryui_css' ), APBCT_VERSION, 'all' );
|
32 |
+
|
33 |
+
}
|
34 |
+
|
35 |
+
public function getPageTitle() {
|
36 |
+
|
37 |
+
return $this->page_title;
|
38 |
+
|
39 |
+
}
|
40 |
+
|
41 |
+
public function getPageScriptName() {
|
42 |
+
|
43 |
+
return $this->page_script_name;
|
44 |
+
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* @return mixed
|
49 |
+
*/
|
50 |
+
public function getPageSlug()
|
51 |
+
{
|
52 |
+
return $this->page_slug;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* @return mixed
|
57 |
+
*/
|
58 |
+
public function getApbct()
|
59 |
+
{
|
60 |
+
return $this->apbct;
|
61 |
+
}
|
62 |
+
|
63 |
+
abstract function getCurrentScanPage();
|
64 |
+
|
65 |
+
abstract function getSpamLogsPage();
|
66 |
+
|
67 |
+
protected function getCurrentScanPanel( $spam_checker ) {
|
68 |
+
|
69 |
+
$dates_allowed = '';
|
70 |
+
$dates_disabled = 'disabled';
|
71 |
+
if( Cookie::get('ct_' . $this->page_slug . '_dates_allowed') ) {
|
72 |
+
$dates_allowed = 'checked';
|
73 |
+
$dates_disabled = '';
|
74 |
+
}
|
75 |
+
$dates_from = Cookie::get('ct_' . $this->page_slug . '_dates_from');
|
76 |
+
$dates_till = Cookie::get('ct_' . $this->page_slug . '_dates_till');
|
77 |
+
|
78 |
+
?>
|
79 |
+
|
80 |
+
<!-- Count -->
|
81 |
+
<h3 id="ct_checking_count"><?php echo $spam_checker::get_count_text() ; ?></h3>
|
82 |
+
|
83 |
+
<!-- Main info -->
|
84 |
+
<h3 id="ct_checking_status"><?php echo $spam_checker::ct_ajax_info(true) ; ?></h3>
|
85 |
+
|
86 |
+
<!-- Check options -->
|
87 |
+
<div class="ct_to_hide" id="ct_check_params_wrapper">
|
88 |
+
<button class="button ct_check_params_elem" id="ct_check_spam_button" <?php echo !$this->apbct->data['moderate'] ? 'disabled="disabled"' : ''; ?>><?php _e("Start check", 'cleantalk-spam-protect'); ?></button>
|
89 |
+
<?php if(!empty($_COOKIE['ct_paused_'.$this->page_slug.'_check'])) { ?><button class="button ct_check_params_elem" id="ct_proceed_check_button"><?php _e("Continue check", 'cleantalk-spam-protect'); ?></button><?php } ?>
|
90 |
+
<p class="ct_check_params_desc"><?php _e("The plugin will check all $this->page_slug against blacklists database and show you senders that have spam activity on other websites.", 'cleantalk-spam-protect'); ?></p>
|
91 |
+
<br />
|
92 |
+
<div class="ct_check_params_elem ct_check_params_elem_sub">
|
93 |
+
<input id="ct_accurate_check" type="checkbox" value="1" /><label for="ct_accurate_check"><strong><?php _e("Accurate check", 'cleantalk-spam-protect'); ?></strong></label>
|
94 |
+
</div>
|
95 |
+
<p class="ct_check_params_desc"><?php _e("Allows to use $this->page_slug's dates to perform more accurate check. Could seriously slow down the check.", 'cleantalk-spam-protect'); ?></p>
|
96 |
+
<br />
|
97 |
+
<div class="ct_check_params_elem ct_check_params_elem_sub">
|
98 |
+
<input id="ct_allow_date_range" type="checkbox" value="1" <?php echo $dates_allowed; ?> /><label for="ct_allow_date_range"><strong><?php _e("Specify date range", 'cleantalk-spam-protect'); ?></strong></label>
|
99 |
+
</div>
|
100 |
+
<div class="ct_check_params_desc">
|
101 |
+
<label for="ct_date_range_from"></label><input class="ct_date" type="text" id="ct_date_range_from" value="<?php echo $dates_from; ?>" <?php echo $dates_disabled; ?> readonly />
|
102 |
+
<label for="ct_date_range_till"></label><input class="ct_date" type="text" id="ct_date_range_till" value="<?php echo $dates_till; ?>" <?php echo $dates_disabled; ?> readonly />
|
103 |
+
</div>
|
104 |
+
<div class="ct_check_params_desc">
|
105 |
+
<p><?php esc_html_e( "Begin/end dates of creation $this->page_slug to check. If no date is specified, the plugin will check all entries.", 'cleantalk-spam-protect'); ?></p>
|
106 |
+
</div>
|
107 |
+
<br>
|
108 |
+
<?php apbct_admin__badge__get_premium(); ?>
|
109 |
+
</div>
|
110 |
+
|
111 |
+
<!-- Cooling notice -->
|
112 |
+
<h3 id="ct_cooling_notice"></h3>
|
113 |
+
|
114 |
+
<!-- Preloader and working message -->
|
115 |
+
<div id="ct_preloader">
|
116 |
+
<img src="<?php echo APBCT_URL_PATH . '/inc/images/preloader.gif'; ?>" alt="Cleantalk preloader" />
|
117 |
+
</div>
|
118 |
+
<div id="ct_working_message">
|
119 |
+
<?php _e("Please wait for a while. CleanTalk is checking all $this->page_slug via blacklist database at cleantalk.org. You will have option to delete found spam $this->page_slug after plugin finish.", 'cleantalk-spam-protect'); ?>
|
120 |
+
</div>
|
121 |
+
|
122 |
+
<!-- Pause button -->
|
123 |
+
<button class="button" id="ct_pause">Pause check</button>
|
124 |
+
<?php
|
125 |
+
}
|
126 |
+
|
127 |
+
public static function writeSpamLog( $scan_type, $scan_date, $cnt_checked, $cnt_spam, $cnt_bad ) {
|
128 |
+
|
129 |
+
global $wpdb;
|
130 |
+
$wpdb->insert(
|
131 |
+
APBCT_SPAMSCAN_LOGS,
|
132 |
+
array(
|
133 |
+
'scan_type' => $scan_type,
|
134 |
+
'start_time' => $scan_date, //@ToDo this is the END date. Need to place both: start and and of scanning
|
135 |
+
'count_to_scan' => $cnt_checked,
|
136 |
+
'found_spam' => $cnt_spam,
|
137 |
+
'found_bad' => $cnt_bad
|
138 |
+
),
|
139 |
+
array( '%s', '%s', '%d', '%d', '%d' )
|
140 |
+
);
|
141 |
+
|
142 |
+
}
|
143 |
+
|
144 |
}
|
lib/Cleantalk/ApbctWP/Firewall/AntiCrawler.php
CHANGED
@@ -331,13 +331,15 @@ class AntiCrawler extends \Cleantalk\Common\Firewall\FirewallModule{
|
|
331 |
|
332 |
public function _die( $result ){
|
333 |
|
334 |
-
global $apbct;
|
335 |
|
336 |
// File exists?
|
337 |
if(file_exists(CLEANTALK_PLUGIN_DIR . "lib/Cleantalk/ApbctWP/Firewall/die_page_anticrawler.html")){
|
338 |
|
339 |
$sfw_die_page = file_get_contents(CLEANTALK_PLUGIN_DIR . "lib/Cleantalk/ApbctWP/Firewall/die_page_anticrawler.html");
|
340 |
-
|
|
|
|
|
341 |
// Translation
|
342 |
$replaces = array(
|
343 |
'{SFW_DIE_NOTICE_IP}' => __('Anti-Crawler Protection is activated for your IP ', 'cleantalk-spam-protect'),
|
@@ -345,7 +347,7 @@ class AntiCrawler extends \Cleantalk\Common\Firewall\FirewallModule{
|
|
345 |
'{SFW_DIE_YOU_WILL_BE_REDIRECTED}' => sprintf( __( 'You will be automatically redirected to the requested page after %d seconds.', 'cleantalk-spam-protect' ), 3 ) . '<br>' . __( 'Don\'t close this page. Please, wait for 3 seconds to pass to the page.', 'cleantalk-spam-protect' ),
|
346 |
'{CLEANTALK_TITLE}' => __( 'Antispam by CleanTalk', 'cleantalk-spam-protect' ),
|
347 |
'{REMOTE_ADDRESS}' => $result['ip'],
|
348 |
-
'{SERVICE_ID}' => $this->apbct->data['service_id'],
|
349 |
'{HOST}' => Server::get( 'HTTP_HOST' ),
|
350 |
'{COOKIE_ANTICRAWLER}' => hash( 'sha256', $apbct->api_key . $apbct->data['salt'] ),
|
351 |
'{COOKIE_ANTICRAWLER_PASSED}' => '1',
|
331 |
|
332 |
public function _die( $result ){
|
333 |
|
334 |
+
global $apbct, $wpdb;
|
335 |
|
336 |
// File exists?
|
337 |
if(file_exists(CLEANTALK_PLUGIN_DIR . "lib/Cleantalk/ApbctWP/Firewall/die_page_anticrawler.html")){
|
338 |
|
339 |
$sfw_die_page = file_get_contents(CLEANTALK_PLUGIN_DIR . "lib/Cleantalk/ApbctWP/Firewall/die_page_anticrawler.html");
|
340 |
+
|
341 |
+
$net_count = $wpdb->get_var('SELECT COUNT(*) FROM ' . APBCT_TBL_FIREWALL_DATA );
|
342 |
+
|
343 |
// Translation
|
344 |
$replaces = array(
|
345 |
'{SFW_DIE_NOTICE_IP}' => __('Anti-Crawler Protection is activated for your IP ', 'cleantalk-spam-protect'),
|
347 |
'{SFW_DIE_YOU_WILL_BE_REDIRECTED}' => sprintf( __( 'You will be automatically redirected to the requested page after %d seconds.', 'cleantalk-spam-protect' ), 3 ) . '<br>' . __( 'Don\'t close this page. Please, wait for 3 seconds to pass to the page.', 'cleantalk-spam-protect' ),
|
348 |
'{CLEANTALK_TITLE}' => __( 'Antispam by CleanTalk', 'cleantalk-spam-protect' ),
|
349 |
'{REMOTE_ADDRESS}' => $result['ip'],
|
350 |
+
'{SERVICE_ID}' => $this->apbct->data['service_id'] . ', ' . $net_count,
|
351 |
'{HOST}' => Server::get( 'HTTP_HOST' ),
|
352 |
'{COOKIE_ANTICRAWLER}' => hash( 'sha256', $apbct->api_key . $apbct->data['salt'] ),
|
353 |
'{COOKIE_ANTICRAWLER_PASSED}' => '1',
|
lib/Cleantalk/ApbctWP/Firewall/AntiFlood.php
CHANGED
@@ -125,7 +125,8 @@ class AntiFlood extends \Cleantalk\Common\Firewall\FirewallModule{
|
|
125 |
$this->db->execute(
|
126 |
'DELETE
|
127 |
FROM ' . $this->db__table__ac_logs . '
|
128 |
-
WHERE interval_start < '. $interval_start .'
|
|
|
129 |
LIMIT 100000;'
|
130 |
);
|
131 |
}
|
@@ -166,11 +167,15 @@ class AntiFlood extends \Cleantalk\Common\Firewall\FirewallModule{
|
|
166 |
public function _die( $result ) {
|
167 |
|
168 |
parent::_die( $result );
|
169 |
-
|
|
|
|
|
170 |
// File exists?
|
171 |
if( file_exists( CLEANTALK_PLUGIN_DIR . 'lib/Cleantalk/ApbctWP/Firewall/die_page_antiflood.html' ) ){
|
172 |
|
173 |
$sfw_die_page = file_get_contents( CLEANTALK_PLUGIN_DIR . 'lib/Cleantalk/ApbctWP/Firewall/die_page_antiflood.html' );
|
|
|
|
|
174 |
|
175 |
// Translation
|
176 |
$replaces = array(
|
@@ -180,7 +185,7 @@ class AntiFlood extends \Cleantalk\Common\Firewall\FirewallModule{
|
|
180 |
'{CLEANTALK_TITLE}' => __( 'Antispam by CleanTalk', 'cleantalk-spam-protect' ),
|
181 |
'{REMOTE_ADDRESS}' => $result['ip'],
|
182 |
'{REQUEST_URI}' => Server::get( 'REQUEST_URI' ),
|
183 |
-
'{SERVICE_ID}' => $this->apbct->data['service_id'],
|
184 |
'{HOST}' => Server::get( 'HTTP_HOST' ),
|
185 |
'{GENERATED}' => '<p>The page was generated at ' . date( 'D, d M Y H:i:s' ) . "</p>",
|
186 |
'{COOKIE_ANTIFLOOD_PASSED}' => md5( $this->api_key . $result['ip'] ),
|
125 |
$this->db->execute(
|
126 |
'DELETE
|
127 |
FROM ' . $this->db__table__ac_logs . '
|
128 |
+
WHERE interval_start < '. $interval_start .'
|
129 |
+
AND ua = ""
|
130 |
LIMIT 100000;'
|
131 |
);
|
132 |
}
|
167 |
public function _die( $result ) {
|
168 |
|
169 |
parent::_die( $result );
|
170 |
+
|
171 |
+
global $wpdb;
|
172 |
+
|
173 |
// File exists?
|
174 |
if( file_exists( CLEANTALK_PLUGIN_DIR . 'lib/Cleantalk/ApbctWP/Firewall/die_page_antiflood.html' ) ){
|
175 |
|
176 |
$sfw_die_page = file_get_contents( CLEANTALK_PLUGIN_DIR . 'lib/Cleantalk/ApbctWP/Firewall/die_page_antiflood.html' );
|
177 |
+
|
178 |
+
$net_count = $wpdb->get_var('SELECT COUNT(*) FROM ' . APBCT_TBL_FIREWALL_DATA );
|
179 |
|
180 |
// Translation
|
181 |
$replaces = array(
|
185 |
'{CLEANTALK_TITLE}' => __( 'Antispam by CleanTalk', 'cleantalk-spam-protect' ),
|
186 |
'{REMOTE_ADDRESS}' => $result['ip'],
|
187 |
'{REQUEST_URI}' => Server::get( 'REQUEST_URI' ),
|
188 |
+
'{SERVICE_ID}' => $this->apbct->data['service_id'] . ', ' . $net_count,
|
189 |
'{HOST}' => Server::get( 'HTTP_HOST' ),
|
190 |
'{GENERATED}' => '<p>The page was generated at ' . date( 'D, d M Y H:i:s' ) . "</p>",
|
191 |
'{COOKIE_ANTIFLOOD_PASSED}' => md5( $this->api_key . $result['ip'] ),
|
lib/Cleantalk/ApbctWP/Firewall/SFW.php
CHANGED
@@ -206,7 +206,7 @@ class SFW extends \Cleantalk\Common\Firewall\FirewallModule {
|
|
206 |
*/
|
207 |
public function _die( $result ){
|
208 |
|
209 |
-
global $apbct;
|
210 |
|
211 |
parent::_die( $result );
|
212 |
|
@@ -223,6 +223,8 @@ class SFW extends \Cleantalk\Common\Firewall\FirewallModule {
|
|
223 |
|
224 |
$sfw_die_page = file_get_contents(CLEANTALK_PLUGIN_DIR . "lib/Cleantalk/ApbctWP/Firewall/die_page_sfw.html");
|
225 |
|
|
|
|
|
226 |
$status = $result['status'] == 'PASS_SFW__BY_WHITELIST' ? '1' : '0';
|
227 |
$cookie_val = md5( $result['ip'] . $this->api_key ) . $status;
|
228 |
|
@@ -234,7 +236,7 @@ class SFW extends \Cleantalk\Common\Firewall\FirewallModule {
|
|
234 |
'{SFW_DIE_YOU_WILL_BE_REDIRECTED}' => sprintf(__('Or you will be automatically redirected to the requested page after %d seconds.', 'cleantalk-spam-protect'), 3),
|
235 |
'{CLEANTALK_TITLE}' => ($this->test ? __('This is the testing page for SpamFireWall', 'cleantalk-spam-protect') : ''),
|
236 |
'{REMOTE_ADDRESS}' => $result['ip'],
|
237 |
-
'{SERVICE_ID}' => $this->apbct->data['service_id'],
|
238 |
'{HOST}' => Server::get( 'HTTP_HOST' ),
|
239 |
'{GENERATED}' => '<p>The page was generated at ' . date( 'D, d M Y H:i:s' ) . "</p>",
|
240 |
'{REQUEST_URI}' => Server::get( 'REQUEST_URI' ),
|
206 |
*/
|
207 |
public function _die( $result ){
|
208 |
|
209 |
+
global $apbct, $wpdb;
|
210 |
|
211 |
parent::_die( $result );
|
212 |
|
223 |
|
224 |
$sfw_die_page = file_get_contents(CLEANTALK_PLUGIN_DIR . "lib/Cleantalk/ApbctWP/Firewall/die_page_sfw.html");
|
225 |
|
226 |
+
$net_count = $wpdb->get_var('SELECT COUNT(*) FROM ' . APBCT_TBL_FIREWALL_DATA );
|
227 |
+
|
228 |
$status = $result['status'] == 'PASS_SFW__BY_WHITELIST' ? '1' : '0';
|
229 |
$cookie_val = md5( $result['ip'] . $this->api_key ) . $status;
|
230 |
|
236 |
'{SFW_DIE_YOU_WILL_BE_REDIRECTED}' => sprintf(__('Or you will be automatically redirected to the requested page after %d seconds.', 'cleantalk-spam-protect'), 3),
|
237 |
'{CLEANTALK_TITLE}' => ($this->test ? __('This is the testing page for SpamFireWall', 'cleantalk-spam-protect') : ''),
|
238 |
'{REMOTE_ADDRESS}' => $result['ip'],
|
239 |
+
'{SERVICE_ID}' => $this->apbct->data['service_id'] . ', ' . $net_count,
|
240 |
'{HOST}' => Server::get( 'HTTP_HOST' ),
|
241 |
'{GENERATED}' => '<p>The page was generated at ' . date( 'D, d M Y H:i:s' ) . "</p>",
|
242 |
'{REQUEST_URI}' => Server::get( 'REQUEST_URI' ),
|
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.6
|
6 |
Requires PHP: 5.4
|
7 |
-
Stable tag: 5.151.
|
8 |
License: GPLv2
|
9 |
|
10 |
Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
|
@@ -580,6 +580,14 @@ If your website has forms that send data to external sources, you can enable opt
|
|
580 |
|
581 |
== Changelog ==
|
582 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
583 |
= 5.151.1 Dec 22 2020 =
|
584 |
* Upd: Firewall now has it's own options, independent from the other.
|
585 |
* Upd: New API server added.
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 5.6
|
6 |
Requires PHP: 5.4
|
7 |
+
Stable tag: 5.151.2
|
8 |
License: GPLv2
|
9 |
|
10 |
Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
|
580 |
|
581 |
== Changelog ==
|
582 |
|
583 |
+
= 5.151.2 Dec 30 2020 =
|
584 |
+
* Fix: Prevent skip checking UltimateMember register.
|
585 |
+
* Upd: SFW die pages updated - networks count added.
|
586 |
+
* Fix: AF auto cleaning table fixed.
|
587 |
+
* Fix: Removing spam flag on gravity forms checking.
|
588 |
+
* Fix: Remote call's request checking moved to separated func.
|
589 |
+
* Fix: Prevent CRON action from remote call request.
|
590 |
+
|
591 |
= 5.151.1 Dec 22 2020 =
|
592 |
* Upd: Firewall now has it's own options, independent from the other.
|
593 |
* Upd: New API server added.
|