Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.40

Version Description

2016-04-19 = * Added JSON encoding for posts that were protected via Custom contact forms option. It allows show anti-spam logs in the Dashboard in more comfortable view. * Minor fix in plugin settings. * Fixed pagination for bulk users spam test. * Fixed issue with unknown _SESSION. * Fixed issue with double SpamFireWall database upload.

Download this release

Release Info

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

Code changes from version 5.39.1 to 5.40

cleantalk.php CHANGED
@@ -1,15 +1,16 @@
1
  <?php
2
  /*
3
- Plugin Name: Anti-Spam by CleanTalk
4
  Plugin URI: http://cleantalk.org
5
  Description: Max power, all-in-one, captcha less, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
6
- Version: 5.39.1
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
- $cleantalk_plugin_version='5.39.1';
11
- $ct_agent_version = 'wordpress-5391';
12
  $cleantalk_executed=false;
 
13
 
14
  if(defined('CLEANTALK_AJAX_USE_BUFFER'))
15
  {
@@ -453,7 +454,7 @@ add_action( 'right_now_content_table_end', 'my_add_counts_to_dashboard' );
453
 
454
  function cleantalk_update_sfw()
455
  {
456
- global $wpdb;
457
 
458
  if(!function_exists('sendRawRequest'))
459
  {
@@ -468,14 +469,14 @@ function cleantalk_update_sfw()
468
  {
469
  $value=0;
470
  }
471
-
472
- if($value==1)
473
  {
474
  $data = Array( 'auth_key' => $ct_options['apikey'],
475
  'method_name' => '2s_blacklists_db'
476
  );
477
 
478
- $result=sendRawRequest('https://api.cleantalk.org/2.1', $data);
479
  $result=json_decode($result, true);
480
  if(isset($result['data']))
481
  {
@@ -500,6 +501,7 @@ INDEX ( `network` , `mask` )
500
  }
501
  }
502
  $wpdb->query($query);
 
503
  }
504
  }
505
  }
1
  <?php
2
  /*
3
+ Plugin Name: Anti-Spam by CleanTalk
4
  Plugin URI: http://cleantalk.org
5
  Description: Max power, all-in-one, captcha less, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
6
+ Version: 5.40
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
+ $cleantalk_plugin_version='5.40';
11
+ $ct_agent_version = 'wordpress-540';
12
  $cleantalk_executed=false;
13
+ $ct_sfw_updated = false;
14
 
15
  if(defined('CLEANTALK_AJAX_USE_BUFFER'))
16
  {
454
 
455
  function cleantalk_update_sfw()
456
  {
457
+ global $wpdb, $ct_sfw_updated;
458
 
459
  if(!function_exists('sendRawRequest'))
460
  {
469
  {
470
  $value=0;
471
  }
472
+
473
+ if($value==1 && $ct_sfw_updated === false)
474
  {
475
  $data = Array( 'auth_key' => $ct_options['apikey'],
476
  'method_name' => '2s_blacklists_db'
477
  );
478
 
479
+ $result=sendRawRequest('https://api.cleantalk.org', $data);
480
  $result=json_decode($result, true);
481
  if(isset($result['data']))
482
  {
501
  }
502
  }
503
  $wpdb->query($query);
504
+ $ct_sfw_updated = true;
505
  }
506
  }
507
  }
inc/cleantalk-admin.php CHANGED
@@ -956,7 +956,10 @@ function ct_input_spam_firewall() {
956
 
957
  echo "<div id='cleantalk_anchor1' style='display:none'></div><input type=hidden name='cleantalk_settings[spam_firewall]' value='0' />";
958
  echo "<input type='checkbox' id='cleantalk_spam_firewall1' name='cleantalk_settings[spam_firewall]' value='1' " . ($value == '1' ? 'checked' : '') . " /><label for='cleantalk_spam_firewall1'> " . __('SpamFireWall') . "</label>";
959
- @admin_addDescriptionsFields(sprintf(__("This option allows to filter spam bots before they access website. Also reduces CPU usage on hosting server and accelerates pages load time.", 'cleantalk'), $ct_options['spam_firewall']));
 
 
 
960
  echo "<script>
961
  jQuery(document).ready(function(){
962
  jQuery('#cleantalk_anchor1').parent().parent().children().first().hide();
956
 
957
  echo "<div id='cleantalk_anchor1' style='display:none'></div><input type=hidden name='cleantalk_settings[spam_firewall]' value='0' />";
958
  echo "<input type='checkbox' id='cleantalk_spam_firewall1' name='cleantalk_settings[spam_firewall]' value='1' " . ($value == '1' ? 'checked' : '') . " /><label for='cleantalk_spam_firewall1'> " . __('SpamFireWall') . "</label>";
959
+ @admin_addDescriptionsFields(sprintf(__("This option allows to filter spam bots before they access website. Also reduces CPU usage on hosting server and accelerates pages load time.", 'cleantalk'), $ct_options['spam_firewall']) .
960
+ " " .
961
+ '<a href="https://cleantalk.org/cleantalk-spam-firewall" style="font-size: 10pt; color: #666 !important" target="_blank">' . __('Learn more') . '</a>.'
962
+ );
963
  echo "<script>
964
  jQuery(document).ready(function(){
965
  jQuery('#cleantalk_anchor1').parent().parent().children().first().hide();
inc/cleantalk-common.php CHANGED
@@ -651,7 +651,7 @@ function ct_get_fields_any(&$email,&$message,&$nickname,&$subject, &$contact,$ar
651
  }
652
  else
653
  {
654
- @$message.="$value\n";
655
  }
656
  }
657
  else if(!is_object($value)&&@get_class($value)!='WP_User')
651
  }
652
  else
653
  {
654
+ $message[$key] = $value;
655
  }
656
  }
657
  else if(!is_object($value)&&@get_class($value)!='WP_User')
inc/cleantalk-public.php CHANGED
@@ -200,13 +200,12 @@ function ct_init_after_all() {
200
  ct_init_session();
201
 
202
  if ($_SERVER['REQUEST_METHOD'] == 'POST') {
203
- if (is_array($_SESSION) && !array_key_exists($ct_formtime_label, $_SESSION) && session_id() != '') {
204
  $ct_direct_post = 1;
205
  }
206
  } else {
207
  $_SESSION[$ct_formtime_label] = time();
208
  }
209
-
210
  };
211
 
212
  function ct_ajaxurl() {
@@ -1862,10 +1861,16 @@ function ct_contact_form_validate () {
1862
  $sender_email = '';
1863
  $sender_nickname = '';
1864
  $subject = '';
1865
- $message = '';
1866
  $contact_form = true;
1867
-
 
1868
  @ct_get_fields_any($sender_email, $message, $sender_nickname, $subject, $contact_form, $_POST);
 
 
 
 
 
 
1869
  //@header("CtGetFieldsAny: Passed");
1870
  cleantalk_debug("CtGetFieldsAny", "Passed");
1871
  //@header("CtSenderEmail: $sender_email");
@@ -1900,7 +1905,7 @@ function ct_contact_form_validate () {
1900
 
1901
 
1902
  $ct_base_call_result = ct_base_call(array(
1903
- 'message' => $subject . "\n\n" . $message,
1904
  'example' => null,
1905
  'sender_email' => $sender_email,
1906
  'sender_nickname' => $sender_nickname,
@@ -2038,10 +2043,10 @@ function ct_contact_form_validate_postdata () {
2038
  $post_info = '';
2039
  }
2040
 
2041
- $message = '';
2042
-
2043
  @ct_get_fields_any_postdata($message, $_POST);
2044
 
 
 
2045
  if(strlen(trim($message))<10)
2046
  {
2047
  return null;
200
  ct_init_session();
201
 
202
  if ($_SERVER['REQUEST_METHOD'] == 'POST') {
203
+ if (isset($_SESSION) && is_array($_SESSION) && !array_key_exists($ct_formtime_label, $_SESSION) && session_id() != '') {
204
  $ct_direct_post = 1;
205
  }
206
  } else {
207
  $_SESSION[$ct_formtime_label] = time();
208
  }
 
209
  };
210
 
211
  function ct_ajaxurl() {
1861
  $sender_email = '';
1862
  $sender_nickname = '';
1863
  $subject = '';
 
1864
  $contact_form = true;
1865
+ $message = array();
1866
+
1867
  @ct_get_fields_any($sender_email, $message, $sender_nickname, $subject, $contact_form, $_POST);
1868
+
1869
+ if ($subject != '') {
1870
+ $message = array_merge(array('subject' => $subject), $message);
1871
+ }
1872
+ $message = json_encode($message);
1873
+
1874
  //@header("CtGetFieldsAny: Passed");
1875
  cleantalk_debug("CtGetFieldsAny", "Passed");
1876
  //@header("CtSenderEmail: $sender_email");
1905
 
1906
 
1907
  $ct_base_call_result = ct_base_call(array(
1908
+ 'message' => $message,
1909
  'example' => null,
1910
  'sender_email' => $sender_email,
1911
  'sender_nickname' => $sender_nickname,
2043
  $post_info = '';
2044
  }
2045
 
 
 
2046
  @ct_get_fields_any_postdata($message, $_POST);
2047
 
2048
+ $message = json_encode($message);
2049
+
2050
  if(strlen(trim($message))<10)
2051
  {
2052
  return null;
inc/cleantalk-users.php CHANGED
@@ -166,11 +166,11 @@ $cnt_spam1=$r[0]['cnt'];
166
  {
167
  if($i==$page)
168
  {
169
- print "<a href='edit-comments.php?page=ct_check_spam&spam_page=$i'><b>$i</b></a> ";
170
  }
171
  else
172
  {
173
- print "<a href='edit-comments.php?page=ct_check_spam&spam_page=$i'>$i</a> ";
174
  }
175
  }
176
  ?>
@@ -185,6 +185,7 @@ $cnt_spam1=$r[0]['cnt'];
185
  <button class="button" id="ct_delete_checked_users"><?php _e('Delete selected', 'cleantalk'); ?></button>
186
  <?php
187
  }
 
188
  ?>
189
  <br /><br />
190
  <div id="ct_info_message"><?php _e("Anti-spam by CleanTalk will check all users against blacklists database and show you senders that have spam activity on other websites. Just click 'Find spam users' to start.", 'cleantalk'); ?>
@@ -362,12 +363,12 @@ function ct_ajax_insert_users()
362
  $rnd=mt_rand(1,10000);
363
  if($rnd<2000)
364
  {
365
- $email="stop_email@example.com";
366
  }
367
  else
368
  {
369
  $email="stop_email_$rnd@example.com";
370
  }
 
371
  $data = array(
372
  'user_login'=>"user_$rnd",
373
  'user_email'=>$email,
166
  {
167
  if($i==$page)
168
  {
169
+ print "<a href='users.php?page=ct_check_users&spam_page=$i'><b>$i</b></a> ";
170
  }
171
  else
172
  {
173
+ print "<a href='users.php?page=ct_check_users&spam_page=$i'>$i</a> ";
174
  }
175
  }
176
  ?>
185
  <button class="button" id="ct_delete_checked_users"><?php _e('Delete selected', 'cleantalk'); ?></button>
186
  <?php
187
  }
188
+ if($_SERVER['REMOTE_ADDR']=='127.0.0.1')print '<button class="button" id="ct_insert_users">Insert accounts</button><br />';
189
  ?>
190
  <br /><br />
191
  <div id="ct_info_message"><?php _e("Anti-spam by CleanTalk will check all users against blacklists database and show you senders that have spam activity on other websites. Just click 'Find spam users' to start.", 'cleantalk'); ?>
363
  $rnd=mt_rand(1,10000);
364
  if($rnd<2000)
365
  {
 
366
  }
367
  else
368
  {
369
  $email="stop_email_$rnd@example.com";
370
  }
371
+ $email="stop_email@example.com";
372
  $data = array(
373
  'user_login'=>"user_$rnd",
374
  'user_email'=>$email,
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === AntiSpam by CleanTalk - No Captcha, no comments & registrations spam ===
2
- Contributors: znaeff, shagimuratov, vlad-cleantalk
3
  Tags: anti-spam, antispam, bbpress, buddypress, captcha, capcha, captha, catcha, cf7 spam, comments, contact form spam, signup, spam, spammers, spammy, woocommerce, wordpress spam, booking, order, subscription, gravity spam, jetpack, bots, contact form 7, contact form, registrations, ninja, Fast Secure Contact, Gravity forms, formidable, mailchimp, s2member, protection, protect, email, akismet, plugin, contact, recaptcha, google captcha, google recaptcha, math, security, login, blacklist, prevent spam comments, wordpress, User Frontend, bulk delete, bulk remove, cloudflare, widget, review, auth forms, firewall, ddos, cleantalk, mailpoet, profile builder, comment spam, registration spam, spam comments, comment moderation, spam bots, block spam, signup spam, spam blocker, spam filter, user registration spam,pingback,trackback, spam trackbacks, anti-spam plugin, varnish, amp, spam free,cache, cdn
4
  Requires at least: 3.0
5
  Tested up to: 4.5
6
- Stable tag: 5.39.1
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -59,6 +59,18 @@ With the help of anti-spam by CleanTalk you can check existing comments to find
59
  = Check existing users for spam. Bulk account removal =
60
  With the help of anti-spam by CleanTalk you can check existing accounts to find and quickly delete spam users at once. For use this function, go to WP Console->Users->Check for spam.
61
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  = Low false/positive rate =
63
  This plugin uses multiple anti-spam tests to filter spam bots with as lower false/positive rate as possible. Multiple anti-spam tests avoid false/positive blocks for real website visitors even if one of the tests fail.
64
 
@@ -449,6 +461,13 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
449
  1. CleanTalk works faster than most of other anti-spam plugins.
450
 
451
  == Changelog ==
 
 
 
 
 
 
 
452
  = 5.39.1 2016-04-04 =
453
  * Improved AJAX based anti-spam test with HTTPS backends.
454
  * Added fix to avoid issue with empty ct_info_flag on JavaScript side.
@@ -1008,6 +1027,13 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
1008
  * First version
1009
 
1010
  == Upgrade Notice ==
 
 
 
 
 
 
 
1011
  = 5.39.1 2016-04-04 =
1012
  * Improved AJAX based anti-spam test with HTTPS backends.
1013
  * Added fix to avoid issue with empty ct_info_flag on JavaScript side.
1
  === AntiSpam by CleanTalk - No Captcha, no comments & registrations spam ===
2
+ Contributors: znaeff, shagimuratov
3
  Tags: anti-spam, antispam, bbpress, buddypress, captcha, capcha, captha, catcha, cf7 spam, comments, contact form spam, signup, spam, spammers, spammy, woocommerce, wordpress spam, booking, order, subscription, gravity spam, jetpack, bots, contact form 7, contact form, registrations, ninja, Fast Secure Contact, Gravity forms, formidable, mailchimp, s2member, protection, protect, email, akismet, plugin, contact, recaptcha, google captcha, google recaptcha, math, security, login, blacklist, prevent spam comments, wordpress, User Frontend, bulk delete, bulk remove, cloudflare, widget, review, auth forms, firewall, ddos, cleantalk, mailpoet, profile builder, comment spam, registration spam, spam comments, comment moderation, spam bots, block spam, signup spam, spam blocker, spam filter, user registration spam,pingback,trackback, spam trackbacks, anti-spam plugin, varnish, amp, spam free,cache, cdn
4
  Requires at least: 3.0
5
  Tested up to: 4.5
6
+ Stable tag: 5.40
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
59
  = Check existing users for spam. Bulk account removal =
60
  With the help of anti-spam by CleanTalk you can check existing accounts to find and quickly delete spam users at once. For use this function, go to WP Console->Users->Check for spam.
61
 
62
+ = Blocking users by country =
63
+ Automatically block comments and registration from the countries for which you have set a ban. This option is useful in cases of protection from manual spam and gains protection. If your site is not aimed at an international audience and you do not expect comments/users from other countries.
64
+
65
+ = Blocking comments by "stop words" =
66
+ You can block comments containing "stop words" to enhance spam filtering and blocking messages containing obscene words. You can add a certain words or phrases.
67
+
68
+ = Private Black Lists for Anti-Spam service =
69
+ Automatically block comments and registrations from your private black IP/email address list. This option helps to strengthen the protection of a manual spam or block unwanted comments from users.
70
+
71
+ = Private Black List for Spam FireWall =
72
+ It allows you to add individual IP addresses and subnets to Spam FireWall. It blocks attacks from IP addresses are not included in the SFW base yet. This option can help to block HTTP/HTTPS DDoS, SQL, brute force attacks and any others that are made through the HTTP/HTTPS.
73
+
74
  = Low false/positive rate =
75
  This plugin uses multiple anti-spam tests to filter spam bots with as lower false/positive rate as possible. Multiple anti-spam tests avoid false/positive blocks for real website visitors even if one of the tests fail.
76
 
461
  1. CleanTalk works faster than most of other anti-spam plugins.
462
 
463
  == Changelog ==
464
+ = 5.40 2016-04-19 =
465
+ * Added JSON encoding for posts that were protected via Custom contact forms option. It allows show anti-spam logs in the Dashboard in more comfortable view.
466
+ * Minor fix in plugin settings.
467
+ * Fixed pagination for bulk users spam test.
468
+ * Fixed issue with unknown _SESSION.
469
+ * Fixed issue with double SpamFireWall database upload.
470
+
471
  = 5.39.1 2016-04-04 =
472
  * Improved AJAX based anti-spam test with HTTPS backends.
473
  * Added fix to avoid issue with empty ct_info_flag on JavaScript side.
1027
  * First version
1028
 
1029
  == Upgrade Notice ==
1030
+ = 5.40 2016-04-19 =
1031
+ * Added JSON encoding for posts that were protected via Custom contact forms option. It allows show anti-spam logs in the Dashboard in more comfortable view.
1032
+ * Minor fix in plugin settings.
1033
+ * Fixed pagination for bulk users spam test.
1034
+ * Fixed issue with unknown _SESSION.
1035
+ * Fixed issue with double SpamFireWall database upload.
1036
+
1037
  = 5.39.1 2016-04-04 =
1038
  * Improved AJAX based anti-spam test with HTTPS backends.
1039
  * Added fix to avoid issue with empty ct_info_flag on JavaScript side.