Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.152.5

Version Description

Feb 04 2020 = * Fix: SFW. Auto-updating interval decreased to 5 mins. * Fix: Divi. Skip saving epanel. * New: Find users/comments table. Add footer description. * Fix: SFW. UA option removed. * Fix: SFW. AC checking by UA enabled by default. * Fix: SFW. AF disabled by default for the new installations.

Download this release

Release Info

Developer glomberg
Plugin Icon 128x128 Spam protection, AntiSpam, FireWall by CleanTalk
Version 5.152.5
Comparing to
See all releases

Code changes from version 5.152.4 to 5.152.5

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.152.4
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: https://cleantalk.org
9
  Text Domain: cleantalk-spam-protect
@@ -1030,7 +1030,7 @@ function ct_sfw_update( $api_key = '', $immediate = false ){
1030
  // Running sfw update once again in 15 min if entries is < 4000
1031
  if( $is_first_updating !== false ) {
1032
  if( $apbct->stats['sfw']['entries'] < 4000 ) {
1033
- wp_schedule_single_event( time() + 900, 'ct_sfw_update' );
1034
  }
1035
  delete_option( 'sfw_sync_first' );
1036
  }
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.152.5
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: https://cleantalk.org
9
  Text Domain: cleantalk-spam-protect
1030
  // Running sfw update once again in 15 min if entries is < 4000
1031
  if( $is_first_updating !== false ) {
1032
  if( $apbct->stats['sfw']['entries'] < 4000 ) {
1033
+ wp_schedule_single_event( time() + 300, 'ct_sfw_update' );
1034
  }
1035
  delete_option( 'sfw_sync_first' );
1036
  }
inc/cleantalk-pluggable.php CHANGED
@@ -188,6 +188,17 @@ function apbct_is_plugin_active( $plugin ) {
188
  return in_array( $plugin, (array) get_option( 'active_plugins', array() ) ) || apbct_is_plugin_active_for_network( $plugin );
189
  }
190
 
 
 
 
 
 
 
 
 
 
 
 
191
  /**
192
  * Checks if the plugin is active for network
193
  *
@@ -366,7 +377,13 @@ function apbct_is_skip_request( $ajax = false ) {
366
  {
367
  return 'injob_theme_plugin';
368
  }
369
-
 
 
 
 
 
 
370
  break;
371
 
372
  case false :
188
  return in_array( $plugin, (array) get_option( 'active_plugins', array() ) ) || apbct_is_plugin_active_for_network( $plugin );
189
  }
190
 
191
+ /**
192
+ * Checks if the theme is active
193
+ *
194
+ * @param string $theme_name template name
195
+ *
196
+ * @return bool
197
+ */
198
+ function apbct_is_theme_active ( $theme_name) {
199
+ return get_option( 'template' ) == $theme_name ? true : false;
200
+ }
201
+
202
  /**
203
  * Checks if the plugin is active for network
204
  *
377
  {
378
  return 'injob_theme_plugin';
379
  }
380
+ // Divi builder save epanel
381
+ if ( apbct_is_theme_active( 'Divi' ) &&
382
+ isset( $_POST['action'] ) &&
383
+ $_POST['action'] == 'save_epanel' )
384
+ {
385
+ return 'divi_builder_save_epanel';
386
+ }
387
  break;
388
 
389
  case false :
inc/cleantalk-settings.php CHANGED
@@ -117,7 +117,6 @@ function apbct_settings__set_fileds( $fields ){
117
  'title' => __('Anti-Crawler', 'cleantalk-spam-protect') . $additional_ac_title,
118
  'class' => 'apbct_settings-field_wrapper--sub',
119
  'parent' => 'spam_firewall',
120
- 'childrens' => array('sfw__anti_crawler_ua'),
121
  'description' => __('Plugin shows SpamFireWall stop page for any bot, except allowed bots (Google, Yahoo and etc).', 'cleantalk-spam-protect')
122
  . '<br>'
123
  . __( 'Anti-Crawler includes blocking bots by the User-Agent. To enable/disable, open the Advanced settings, and turn on/off "Block by User-Agent".', 'cleantalk-spam-protect' ),
@@ -444,14 +443,6 @@ function apbct_settings__set_fileds( $fields ){
444
  'options_callback_params' => array(true),
445
  'class' => 'apbct_settings-field_wrapper--sub',
446
  ),
447
- 'sfw__anti_crawler_ua' => array(
448
- 'type' => 'checkbox',
449
- 'title' => __('Block bots by User-Agents', 'cleantalk-spam-protect'),
450
- 'parent' => 'sfw__anti_crawler',
451
- 'description' => __('The option allows you to block or allow bots by their User-Agents. Supports black and white lists.', 'cleantalk-spam-protect')
452
- . '<br>'
453
- . __( 'This option improves the accuracy of Anti-Crawler and allows you to manage rules for specific bots.', 'cleantalk-spam-protect' ),
454
- ),
455
  'sfw__anti_flood__view_limit' => array(
456
  'type' => 'text',
457
  'title' => __('Anti-Flood Page Views Limit', 'cleantalk-spam-protect'),
@@ -702,7 +693,7 @@ function apbct_settings__display() {
702
 
703
  // Output spam count
704
  if($apbct->key_is_ok && apbct_api_key__is_correct()){
705
- if(!$apbct->white_label){
706
 
707
  // CP button
708
  echo '<a class="cleantalk_link cleantalk_link-manual" target="__blank" href="https://cleantalk.org/my?user_token='.$apbct->user_token.'&cp_mode=antispam">'
@@ -713,7 +704,7 @@ function apbct_settings__display() {
713
  }
714
  }
715
 
716
- if( apbct_api_key__is_correct() && ! $apbct->white_label ){
717
  // Sync button
718
  echo '<button type="button" class="cleantalk_link cleantalk_link-auto" id="apbct_button__sync" title="Synchronizing account status, SpamFireWall database, all kind of journals.">'
719
  . '<i class="icon-upload-cloud"></i>&nbsp;&nbsp;'
@@ -726,7 +717,7 @@ function apbct_settings__display() {
726
 
727
  // Output spam count
728
  if($apbct->key_is_ok && apbct_api_key__is_correct()){
729
- if(!$apbct->white_label){
730
 
731
  // Support button
732
  echo '<a class="cleantalk_link cleantalk_link-auto" target="__blank" href="https://wordpress.org/support/plugin/cleantalk-spam-protect">'.__('Support', 'cleantalk-spam-protect').'</a>';
117
  'title' => __('Anti-Crawler', 'cleantalk-spam-protect') . $additional_ac_title,
118
  'class' => 'apbct_settings-field_wrapper--sub',
119
  'parent' => 'spam_firewall',
 
120
  'description' => __('Plugin shows SpamFireWall stop page for any bot, except allowed bots (Google, Yahoo and etc).', 'cleantalk-spam-protect')
121
  . '<br>'
122
  . __( 'Anti-Crawler includes blocking bots by the User-Agent. To enable/disable, open the Advanced settings, and turn on/off "Block by User-Agent".', 'cleantalk-spam-protect' ),
443
  'options_callback_params' => array(true),
444
  'class' => 'apbct_settings-field_wrapper--sub',
445
  ),
 
 
 
 
 
 
 
 
446
  'sfw__anti_flood__view_limit' => array(
447
  'type' => 'text',
448
  'title' => __('Anti-Flood Page Views Limit', 'cleantalk-spam-protect'),
693
 
694
  // Output spam count
695
  if($apbct->key_is_ok && apbct_api_key__is_correct()){
696
+ if( ! $apbct->white_label || is_main_site() ){
697
 
698
  // CP button
699
  echo '<a class="cleantalk_link cleantalk_link-manual" target="__blank" href="https://cleantalk.org/my?user_token='.$apbct->user_token.'&cp_mode=antispam">'
704
  }
705
  }
706
 
707
+ if( apbct_api_key__is_correct() && ( ! $apbct->white_label || is_main_site() ) ){
708
  // Sync button
709
  echo '<button type="button" class="cleantalk_link cleantalk_link-auto" id="apbct_button__sync" title="Synchronizing account status, SpamFireWall database, all kind of journals.">'
710
  . '<i class="icon-upload-cloud"></i>&nbsp;&nbsp;'
717
 
718
  // Output spam count
719
  if($apbct->key_is_ok && apbct_api_key__is_correct()){
720
+ if( ! $apbct->white_label || is_main_site() ){
721
 
722
  // Support button
723
  echo '<a class="cleantalk_link cleantalk_link-auto" target="__blank" href="https://wordpress.org/support/plugin/cleantalk-spam-protect">'.__('Support', 'cleantalk-spam-protect').'</a>';
inc/cleantalk-updater.php CHANGED
@@ -662,9 +662,6 @@ function apbct_update_to_5_149_2() {
662
 
663
  apbct_activation__create_tables( $sqls, $apbct->db_prefix );
664
 
665
- $apbct->settings['sfw__anti_crawler_ua'] = 1;
666
- $apbct->saveSettings();
667
-
668
  }
669
 
670
  function apbct_update_to_5_150_0() {
662
 
663
  apbct_activation__create_tables( $sqls, $apbct->db_prefix );
664
 
 
 
 
665
  }
666
 
667
  function apbct_update_to_5_150_0() {
lib/Cleantalk/ApbctWP/FindSpam/Checker.php CHANGED
@@ -124,6 +124,23 @@ abstract class Checker
124
  <?php
125
  }
126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  public static function writeSpamLog( $scan_type, $scan_date, $cnt_checked, $cnt_spam, $cnt_bad ) {
128
 
129
  global $wpdb;
124
  <?php
125
  }
126
 
127
+ protected function getFooter() {
128
+ ?>
129
+ <div id = "ct_checktable_footer">
130
+ <p>
131
+ <strong>Purpose of use:</strong><br/>
132
+ Public VPN - not spam<br/>
133
+ TOR - potential spam<br/>
134
+ Hosting - potential spam<br/>
135
+ <br/>
136
+ <strong>Attacks count:</strong><br/>
137
+ IP - >=3 spam<br/>
138
+ E-mail - >=5 spam</br>
139
+ </p>
140
+ </div>
141
+ <?php
142
+ }
143
+
144
  public static function writeSpamLog( $scan_type, $scan_date, $cnt_checked, $cnt_spam, $cnt_bad ) {
145
 
146
  global $wpdb;
lib/Cleantalk/ApbctWP/FindSpam/CommentsChecker.php CHANGED
@@ -42,6 +42,7 @@ class CommentsChecker extends Checker
42
  echo '<form action="" method="POST">';
43
  $this->list_table->display();
44
  echo '</form>';
 
45
 
46
  }
47
 
@@ -369,10 +370,12 @@ class CommentsChecker extends Checker
369
  }
370
 
371
  $backup_notice = '&nbsp;';
372
- if ($cnt_spam > 0){
373
- $backup_notice = __("Please do backup of WordPress database before delete any comments!", 'cleantalk-spam-protect');
 
 
374
  }
375
- $return['message'] .= "<p>$backup_notice</p>";
376
 
377
  if($direct_call){
378
  return $return['message'];
42
  echo '<form action="" method="POST">';
43
  $this->list_table->display();
44
  echo '</form>';
45
+ $this->getFooter();
46
 
47
  }
48
 
370
  }
371
 
372
  $backup_notice = '&nbsp;';
373
+ $spam_system_notice = '&nbsp;';
374
+ if ($cnt_spam > 0) {
375
+ $backup_notice = __("Please do backup of WordPress database before delete any accounts!", 'cleantalk-spam-protect');
376
+ $spam_system_notice = __("Results are based on the decision of our spam checking system and do not give a complete guarantee that these comments are spam.", 'cleantalk-spam-protect');
377
  }
378
+ $return['message'] .= "<p>$backup_notice</p><p>$spam_system_notice</p>";
379
 
380
  if($direct_call){
381
  return $return['message'];
lib/Cleantalk/ApbctWP/FindSpam/UsersChecker.php CHANGED
@@ -45,6 +45,7 @@ class UsersChecker extends Checker
45
  echo '<form action="" method="POST">';
46
  $this->list_table->display();
47
  echo '</form>';
 
48
 
49
  }
50
 
@@ -406,10 +407,12 @@ class UsersChecker extends Checker
406
  }
407
 
408
  $backup_notice = '&nbsp;';
 
409
  if ($cnt_spam > 0) {
410
  $backup_notice = __("Please do backup of WordPress database before delete any accounts!", 'cleantalk-spam-protect');
 
411
  }
412
- $return['message'] .= "<p>$backup_notice</p>";
413
 
414
  if($direct_call){
415
  return $return['message'];
45
  echo '<form action="" method="POST">';
46
  $this->list_table->display();
47
  echo '</form>';
48
+ $this->getFooter();
49
 
50
  }
51
 
407
  }
408
 
409
  $backup_notice = '&nbsp;';
410
+ $spam_system_notice = '&nbsp;';
411
  if ($cnt_spam > 0) {
412
  $backup_notice = __("Please do backup of WordPress database before delete any accounts!", 'cleantalk-spam-protect');
413
+ $spam_system_notice = __("Results are based on the decision of our spam checking system and do not give a complete guarantee that these users are spammers.", 'cleantalk-spam-protect');
414
  }
415
+ $return['message'] .= "<p>$backup_notice</p><p>$spam_system_notice</p>";
416
 
417
  if($direct_call){
418
  return $return['message'];
lib/Cleantalk/ApbctWP/Firewall/AntiCrawler.php CHANGED
@@ -156,42 +156,38 @@ class AntiCrawler extends \Cleantalk\Common\Firewall\FirewallModule{
156
  }
157
 
158
  // UA check
159
- if( $this->apbct->settings['sfw__anti_crawler_ua'] ) {
 
 
160
 
161
- $ua_bl_results = $this->db->fetch_all(
162
- "SELECT * FROM " . $this->db__table__ac_ua_bl . " ORDER BY `ua_status` DESC;"
163
- );
164
 
165
- if( ! empty( $ua_bl_results ) ){
166
 
167
- $is_blocked = false;
168
 
169
- foreach( $ua_bl_results as $ua_bl_result ){
170
 
171
- if( ! empty( $ua_bl_result['ua_template'] ) && preg_match( "%". str_replace( '"', '', $ua_bl_result['ua_template'] ) ."%i", Server::get('HTTP_USER_AGENT') ) ) {
172
-
173
- $this->ua_id = $ua_bl_result['id'];
174
-
175
- if( $ua_bl_result['ua_status'] == 1 ) {
176
- // Whitelisted
177
- $results[] = array('ip' => $current_ip, 'is_personal' => false, 'status' => 'PASS_ANTICRAWLER_UA',);
178
- return $results;
179
- break;
180
- } else {
181
- // Blacklisted
182
- $results[] = array('ip' => $current_ip, 'is_personal' => false, 'status' => 'DENY_ANTICRAWLER_UA',);
183
- $is_blocked = true;
184
- break;
185
- }
186
 
 
 
 
 
 
 
 
 
 
 
187
  }
188
 
189
  }
190
 
191
- if( ! $is_blocked ) {
192
- $results[] = array('ip' => $current_ip, 'is_personal' => false, 'status' => 'PASS_ANTICRAWLER_UA',);
193
- }
194
 
 
 
195
  }
196
 
197
  }
156
  }
157
 
158
  // UA check
159
+ $ua_bl_results = $this->db->fetch_all(
160
+ "SELECT * FROM " . $this->db__table__ac_ua_bl . " ORDER BY `ua_status` DESC;"
161
+ );
162
 
163
+ if( ! empty( $ua_bl_results ) ){
 
 
164
 
165
+ $is_blocked = false;
166
 
167
+ foreach( $ua_bl_results as $ua_bl_result ){
168
 
169
+ if( ! empty( $ua_bl_result['ua_template'] ) && preg_match( "%". str_replace( '"', '', $ua_bl_result['ua_template'] ) ."%i", Server::get('HTTP_USER_AGENT') ) ) {
170
 
171
+ $this->ua_id = $ua_bl_result['id'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
 
173
+ if( $ua_bl_result['ua_status'] == 1 ) {
174
+ // Whitelisted
175
+ $results[] = array('ip' => $current_ip, 'is_personal' => false, 'status' => 'PASS_ANTICRAWLER_UA',);
176
+ return $results;
177
+ break;
178
+ } else {
179
+ // Blacklisted
180
+ $results[] = array('ip' => $current_ip, 'is_personal' => false, 'status' => 'DENY_ANTICRAWLER_UA',);
181
+ $is_blocked = true;
182
+ break;
183
  }
184
 
185
  }
186
 
187
+ }
 
 
188
 
189
+ if( ! $is_blocked ) {
190
+ $results[] = array('ip' => $current_ip, 'is_personal' => false, 'status' => 'PASS_ANTICRAWLER_UA',);
191
  }
192
 
193
  }
lib/Cleantalk/ApbctWP/State.php CHANGED
@@ -58,10 +58,9 @@ class State
58
  public $def_settings = array(
59
 
60
  'spam_firewall' => 1,
61
- 'sfw__anti_flood' => 1,
62
  'sfw__anti_flood__view_limit' => 20,
63
  'sfw__anti_crawler' => 1,
64
- 'sfw__anti_crawler_ua' => 1,
65
  'apikey' => '',
66
  'autoPubRevelantMess' => 0,
67
 
58
  public $def_settings = array(
59
 
60
  'spam_firewall' => 1,
61
+ 'sfw__anti_flood' => 0,
62
  'sfw__anti_flood__view_limit' => 20,
63
  'sfw__anti_crawler' => 1,
 
64
  'apikey' => '',
65
  'autoPubRevelantMess' => 0,
66
 
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.152.4
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.152.4 Feb 01 2020 =
584
  * Fix: Cron tasks compare fixed.
585
 
4
  Requires at least: 3.0
5
  Tested up to: 5.6
6
  Requires PHP: 5.4
7
+ Stable tag: 5.152.5
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.152.5 Feb 04 2020 =
584
+ * Fix: SFW. Auto-updating interval decreased to 5 mins.
585
+ * Fix: Divi. Skip saving epanel.
586
+ * New: Find users/comments table. Add footer description.
587
+ * Fix: SFW. UA option removed.
588
+ * Fix: SFW. AC checking by UA enabled by default.
589
+ * Fix: SFW. AF disabled by default for the new installations.
590
+
591
  = 5.152.4 Feb 01 2020 =
592
  * Fix: Cron tasks compare fixed.
593