Spam protection, AntiSpam, FireWall by CleanTalk - Version 4.1

Version Description

2014-10-13 = * Optimized code for manual moderation feedback sending. * Optimized anti spam algorithms for comments, contacts and signups.

Download this release

Release Info

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

Code changes from version 4.0 to 4.1

Files changed (4) hide show
  1. cleantalk-admin.php +1 -1
  2. cleantalk.class.php +1 -1
  3. cleantalk.php +19 -13
  4. readme.txt +10 -3
cleantalk-admin.php CHANGED
@@ -327,7 +327,7 @@ function admin_notice_message(){
327
  echo '</b></h3></div>';
328
  }
329
 
330
- ct_send_feedback();
331
 
332
  return true;
333
  }
327
  echo '</b></h3></div>';
328
  }
329
 
330
+ //ct_send_feedback(); -- removed to ct_do_this_hourly()
331
 
332
  return true;
333
  }
cleantalk.class.php CHANGED
@@ -343,7 +343,7 @@ class Cleantalk {
343
  * Server connection timeout in seconds
344
  * @var int
345
  */
346
- private $server_timeout = 15;
347
 
348
  /**
349
  * Cleantalk server url
343
  * Server connection timeout in seconds
344
  * @var int
345
  */
346
+ private $server_timeout = 3;
347
 
348
  /**
349
  * Cleantalk server url
cleantalk.php CHANGED
@@ -3,14 +3,14 @@
3
  Plugin Name: Anti-spam by CleanTalk
4
  Plugin URI: http://cleantalk.org
5
  Description: Cloud antispam for comments, registrations and contacts. The plugin doesn't use CAPTCHA, Q&A, math, counting animals or quiz to stop spam bots.
6
- Version: 4.0
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
 
11
  define('CLEANTALK_PLUGIN_DIR', plugin_dir_path(__FILE__));
12
 
13
- $ct_agent_version = 'wordpress-40';
14
  $ct_plugin_name = 'Anti-spam by CleanTalk';
15
  $ct_checkjs_frm = 'ct_checkjs_frm';
16
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
@@ -156,6 +156,7 @@ add_action('ct_hourly_event_hook', 'ct_do_this_hourly');
156
  function ct_do_this_hourly() {
157
  // do something every hour
158
  delete_spam_comments();
 
159
  }
160
 
161
  if (is_admin()) {
@@ -569,14 +570,7 @@ ctSetCookie("%s", "%s");
569
  <script type="text/javascript">
570
  var ct_input_name = \'%s\';
571
  var ct_input_value = document.getElementById(ct_input_name).value;
572
- var ct_input_challenge = %s;
573
- document.getElementById(ct_input_name).value = document.getElementById(ct_input_name).value.replace(ct_input_value, ct_input_challenge);
574
- if (document.getElementById(ct_input_name).value == ct_input_value) {
575
- document.getElementById(ct_input_name).value = ct_set_challenge(ct_input_challenge);
576
- }
577
- function ct_set_challenge(val) {
578
- return val;
579
- };
580
  </script>
581
  ';
582
  $html = sprintf($html, $field_id, $field_name, $ct_checkjs_def, $field_id, $ct_input_challenge);
@@ -917,7 +911,7 @@ function js_test($field_name = 'ct_checkjs', $data = null, $random_key = false)
917
 
918
  if (isset($data[$field_name])) {
919
  $js_post_value = $data[$field_name];
920
-
921
  //
922
  // Random key check
923
  //
@@ -1479,6 +1473,7 @@ function ct_wpcf7_spam($spam) {
1479
  $sender_email = null;
1480
  $sender_nickname = null;
1481
  $message = '';
 
1482
  foreach ($_POST as $k => $v) {
1483
  if ($sender_email === null && preg_match("/^\S+@\S+\.\S+$/", $v)) {
1484
  $sender_email = $v;
@@ -1489,8 +1484,19 @@ function ct_wpcf7_spam($spam) {
1489
  if ($sender_nickname === null && preg_match("/-name$/", $k)) {
1490
  $sender_nickname = $v;
1491
  }
 
 
 
 
1492
  }
1493
-
 
 
 
 
 
 
 
1494
  $ct_base_call_result = ct_base_call(array(
1495
  'message' => $message,
1496
  'example' => null,
@@ -1501,7 +1507,7 @@ function ct_wpcf7_spam($spam) {
1501
  ));
1502
  $ct = $ct_base_call_result['ct'];
1503
  $ct_result = $ct_base_call_result['ct_result'];
1504
-
1505
  if ($ct_result->spam == 1) {
1506
  $spam = true;
1507
  $ct_cf7_comment = $ct_result->comment;
3
  Plugin Name: Anti-spam by CleanTalk
4
  Plugin URI: http://cleantalk.org
5
  Description: Cloud antispam for comments, registrations and contacts. The plugin doesn't use CAPTCHA, Q&A, math, counting animals or quiz to stop spam bots.
6
+ Version: 4.1
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
 
11
  define('CLEANTALK_PLUGIN_DIR', plugin_dir_path(__FILE__));
12
 
13
+ $ct_agent_version = 'wordpress-41';
14
  $ct_plugin_name = 'Anti-spam by CleanTalk';
15
  $ct_checkjs_frm = 'ct_checkjs_frm';
16
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
156
  function ct_do_this_hourly() {
157
  // do something every hour
158
  delete_spam_comments();
159
+ ct_send_feedback();
160
  }
161
 
162
  if (is_admin()) {
570
  <script type="text/javascript">
571
  var ct_input_name = \'%s\';
572
  var ct_input_value = document.getElementById(ct_input_name).value;
573
+ document.getElementById(ct_input_name).value = document.getElementById(ct_input_name).value.replace(ct_input_value, %s);
 
 
 
 
 
 
 
574
  </script>
575
  ';
576
  $html = sprintf($html, $field_id, $field_name, $ct_checkjs_def, $field_id, $ct_input_challenge);
911
 
912
  if (isset($data[$field_name])) {
913
  $js_post_value = $data[$field_name];
914
+
915
  //
916
  // Random key check
917
  //
1473
  $sender_email = null;
1474
  $sender_nickname = null;
1475
  $message = '';
1476
+ $subject = '';
1477
  foreach ($_POST as $k => $v) {
1478
  if ($sender_email === null && preg_match("/^\S+@\S+\.\S+$/", $v)) {
1479
  $sender_email = $v;
1484
  if ($sender_nickname === null && preg_match("/-name$/", $k)) {
1485
  $sender_nickname = $v;
1486
  }
1487
+ if ($subject === '' && ct_get_data_from_submit($k, 'subject')) {
1488
+ $subject = $v;
1489
+ }
1490
+
1491
  }
1492
+
1493
+ if ($subject != '') {
1494
+ if ($message != '') {
1495
+ $message = "\n\n" . $message;
1496
+ }
1497
+ $message = sprintf("%s%s", $subject, $message);
1498
+ }
1499
+
1500
  $ct_base_call_result = ct_base_call(array(
1501
  'message' => $message,
1502
  'example' => null,
1507
  ));
1508
  $ct = $ct_base_call_result['ct'];
1509
  $ct_result = $ct_base_call_result['ct_result'];
1510
+
1511
  if ($ct_result->spam == 1) {
1512
  $spam = true;
1513
  $ct_cf7_comment = $ct_result->comment;
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: znaeff, shagimuratov
3
  Tags: antispam, anti-spam, anti spam, spam, spammers, captcha, comments, registration, contact form, blacklist, math, signup, formidable, bot, spam bots, spammy, s2member, wordpress, support, BuddyPress, bbpress, landing pages, fast secure contact form, WooCommerce, jetpack, cf7, form
4
  Requires at least: 3.0
5
  Tested up to: 4.0
6
- Stable tag: 4.0
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -39,7 +39,7 @@ The anti spam method offered by CleanTalk allows to switch from the methods that
39
 
40
  The CleanTalk is premium anti spam for WordPress, please look at the <a href="http://cleantalk.org/price">pricing</a>. We try to provide the service at the highest level and we can not afford to offer a free version of our service, as this will immediately affect the quality of providing anti spam protection. Paying for a year of service, you save a lot more and get:
41
 
42
- * 100% protection against spambots
43
  * Time and resources saving
44
  * More registrations/comments/visitors
45
  * Protect several websites at once at different CMS
@@ -110,7 +110,7 @@ There are a few reasons for this:
110
 
111
  * With the indexing of your web-site by the search systems, appearance of external links and better search results position, your web-site attracts more and more spambots.
112
  * Non-transparent protection systems like CAPTCHA or question/answer, that don't have spam attacks statistics, don't let you see the whole picture, or the picture is incomplete.
113
- * Counting methods for spam attacks and spambots are different for different systems, which explains the diversity. We seek to provide detailed statistics.
114
 
115
  = Why my dummy "spam" comment passed to the WordPress? =
116
  The plugin has several options to detect spam bots and humans. If you just post spammy text like this,
@@ -151,6 +151,10 @@ WordPress 3.0 at least. PHP 4, 5 with CURL or file_get_contents() function and e
151
  1. Anti spam stopped spam bot at the CAPTCHA less registration form.
152
 
153
  == Changelog ==
 
 
 
 
154
  = 4.0 2014-10-06 =
155
  * Improved anti spam protection for custom contact forms.
156
  * Improved anti spam protection for registration forms.
@@ -404,6 +408,9 @@ WordPress 3.0 at least. PHP 4, 5 with CURL or file_get_contents() function and e
404
  * First version
405
 
406
  == Upgrade Notice ==
 
 
 
407
  = 4.0 2014-10-06 =
408
  Major anti spam improvements for registration and contact forms.
409
 
3
  Tags: antispam, anti-spam, anti spam, spam, spammers, captcha, comments, registration, contact form, blacklist, math, signup, formidable, bot, spam bots, spammy, s2member, wordpress, support, BuddyPress, bbpress, landing pages, fast secure contact form, WooCommerce, jetpack, cf7, form
4
  Requires at least: 3.0
5
  Tested up to: 4.0
6
+ Stable tag: 4.1
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
39
 
40
  The CleanTalk is premium anti spam for WordPress, please look at the <a href="http://cleantalk.org/price">pricing</a>. We try to provide the service at the highest level and we can not afford to offer a free version of our service, as this will immediately affect the quality of providing anti spam protection. Paying for a year of service, you save a lot more and get:
41
 
42
+ * 100% protection against spam bots
43
  * Time and resources saving
44
  * More registrations/comments/visitors
45
  * Protect several websites at once at different CMS
110
 
111
  * With the indexing of your web-site by the search systems, appearance of external links and better search results position, your web-site attracts more and more spambots.
112
  * Non-transparent protection systems like CAPTCHA or question/answer, that don't have spam attacks statistics, don't let you see the whole picture, or the picture is incomplete.
113
+ * Counting methods for spam attacks and spam bots are different for different systems, which explains the diversity. We seek to provide detailed statistics.
114
 
115
  = Why my dummy "spam" comment passed to the WordPress? =
116
  The plugin has several options to detect spam bots and humans. If you just post spammy text like this,
151
  1. Anti spam stopped spam bot at the CAPTCHA less registration form.
152
 
153
  == Changelog ==
154
+ = 4.1 2014-10-13 =
155
+ * Optimized code for manual moderation feedback sending.
156
+ * Optimized anti spam algorithms for comments, contacts and signups.
157
+
158
  = 4.0 2014-10-06 =
159
  * Improved anti spam protection for custom contact forms.
160
  * Improved anti spam protection for registration forms.
408
  * First version
409
 
410
  == Upgrade Notice ==
411
+ = 4.1 2014-10-13 =
412
+ Minor anti spam improvements for contacts, registration and contact forms.
413
+
414
  = 4.0 2014-10-06 =
415
  Major anti spam improvements for registration and contact forms.
416