Spam protection, AntiSpam, FireWall by CleanTalk - Version 4.4

Version Description

2014-10-29 = * Improved anti spam JS test for CF7. * Fixed 'noscript' text in FaceBook Like preview in Valenti theme.

Download this release

Release Info

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

Code changes from version 4.2 to 4.4

Files changed (4) hide show
  1. cleantalk-admin.php +0 -3
  2. cleantalk.class.php +1 -1
  3. cleantalk.php +15 -48
  4. readme.txt +22 -18
cleantalk-admin.php CHANGED
@@ -295,9 +295,6 @@ input[type=submit] {padding: 10px; background: #3399FF; color: #fff; border:0 no
295
  function admin_notice_message(){
296
  global $show_ct_notice_trial, $show_ct_notice_online, $ct_plugin_name;
297
 
298
- if (ct_active() === false)
299
- return false;
300
-
301
  $options = ct_get_options();
302
  $user_token = '';
303
  if (isset($options['user_token']) && $options['user_token'] != '') {
295
  function admin_notice_message(){
296
  global $show_ct_notice_trial, $show_ct_notice_online, $ct_plugin_name;
297
 
 
 
 
298
  $options = ct_get_options();
299
  $user_token = '';
300
  if (isset($options['user_token']) && $options['user_token'] != '') {
cleantalk.class.php CHANGED
@@ -403,7 +403,7 @@ class Cleantalk {
403
  * Minimal server response in miliseconds to catch the server
404
  *
405
  */
406
- public $min_server_timeout = 150;
407
 
408
  /**
409
  * Function checks whether it is possible to publish the message
403
  * Minimal server response in miliseconds to catch the server
404
  *
405
  */
406
+ public $min_server_timeout = 100;
407
 
408
  /**
409
  * Function checks whether it is possible to publish the message
cleantalk.php CHANGED
@@ -3,21 +3,20 @@
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.2
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-42';
14
  $ct_plugin_name = 'Anti-spam by CleanTalk';
15
  $ct_checkjs_frm = 'ct_checkjs_frm';
16
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
17
  $ct_session_request_id_label = 'request_id';
18
  $ct_session_register_ok_label = 'register_ok';
19
 
20
- $ct_checkjs_cf7 = 'ct_checkjs_cf7';
21
  $ct_cf7_comment = '';
22
 
23
  $ct_checkjs_jpcf = 'ct_checkjs_jpcf';
@@ -119,7 +118,6 @@ add_action('bp_before_registration_submit_buttons','ct_register_form');
119
  add_filter('bp_signup_validate', 'ct_registration_errors');
120
 
121
  // Contact Form7
122
- add_filter('wpcf7_form_elements', 'ct_wpcf7_form_elements');
123
  add_filter('wpcf7_spam', 'ct_wpcf7_spam');
124
 
125
  // JetPack Contact form
@@ -208,10 +206,11 @@ function ct_init() {
208
 
209
  $jetpack_active_modules = get_option('jetpack_active_modules');
210
  if (
211
- (class_exists('Jetpack', false) && $jetpack_active_modules && in_array('comments', $jetpack_active_modules)) ||
212
- (defined('LANDINGPAGES_CURRENT_VERSION'))
213
  || (defined('WS_PLUGIN__S2MEMBER_PRO_VERSION'))
214
- || (defined('WOOCOMMERCE_VERSION'))
 
215
  ) {
216
  add_action('wp_footer', 'ct_footer_add_cookie', 1);
217
  }
@@ -527,7 +526,7 @@ function ct_comment_form($post_id) {
527
  return false;
528
  }
529
 
530
- ct_add_hidden_fields(null, 'ct_checkjs', false, false);
531
 
532
  return null;
533
  }
@@ -579,8 +578,8 @@ document.getElementById(ct_input_name).value = document.getElementById(ct_input_
579
  ';
580
  $html = sprintf($html, $field_id, $field_name, $ct_checkjs_def, $field_id, $ct_input_challenge);
581
  };
582
-
583
- $html .= '<noscript><p><b>Please enable JavaScript to pass anti-spam protection!</b><br />Here are the instructions how to enable JavaScript in your web browser <a href="http://www.enable-javascript.com" rel="nofollow" target="_blank">http://www.enable-javascript.com</a>.<br />' . $ct_plugin_name . '.</p></noscript>';
584
 
585
  // Simplify JS code
586
  // and fixing issue with wpautop()
@@ -784,7 +783,7 @@ function ct_preprocess_comment($comment) {
784
  $checkjs = js_test('ct_checkjs', $_COOKIE);
785
  } else {
786
  $post_info['comment_type'] = $comment['comment_type'];
787
- $checkjs = js_test('ct_checkjs', $_POST);
788
  }
789
 
790
  $post_info['post_url'] = ct_post_url(null, $comment_post_id);
@@ -1062,30 +1061,16 @@ function ct_unmark_red($message) {
1062
  return $message;
1063
  }
1064
 
1065
- /**
1066
- * Tests plugin activation status
1067
- * @return bool
1068
- */
1069
- function ct_active(){
1070
- $ct_active = false;
1071
- foreach (get_option('active_plugins') as $k => $v) {
1072
- if (preg_match("/cleantalk.php$/", $v))
1073
- $ct_active = true;
1074
- }
1075
-
1076
- return $ct_active;
1077
- }
1078
  /**
1079
  * Tests plugin activation status
1080
  * @return bool
1081
  */
1082
  function ct_plugin_active($plugin_name){
1083
- $active = false;
1084
  foreach (get_option('active_plugins') as $k => $v) {
1085
  if ($plugin_name == $v)
1086
- $active = true;
1087
  }
1088
- return $active;
1089
  }
1090
 
1091
  /**
@@ -1129,7 +1114,6 @@ function ct_get_checkjs_value($random_key = false) {
1129
  $key = md5($options['apikey'] . '+' . get_option('admin_email'));
1130
  }
1131
 
1132
-
1133
  return $key;
1134
  }
1135
 
@@ -1449,28 +1433,11 @@ function ct_contact_form_is_spam($form) {
1449
  }
1450
 
1451
 
1452
- /**
1453
- * Inserts anti-spam hidden to CF7
1454
- */
1455
- function ct_wpcf7_form_elements($html) {
1456
- global $ct_checkjs_cf7;
1457
- global $wpdb, $current_user, $ct_checkjs_cf7;
1458
-
1459
- $options = ct_get_options();
1460
- if ($options['contact_forms_test'] == 0) {
1461
- return $html;
1462
- }
1463
-
1464
- $html .= ct_add_hidden_fields(null, $ct_checkjs_cf7, true);
1465
-
1466
- return $html;
1467
- }
1468
-
1469
  /**
1470
  * Test CF7 message for spam
1471
  */
1472
  function ct_wpcf7_spam($spam) {
1473
- global $wpdb, $current_user, $ct_agent_version, $ct_checkjs_cf7, $ct_cf7_comment;
1474
 
1475
  $options = ct_get_options();
1476
  if ($spam === true)
@@ -1480,7 +1447,7 @@ function ct_wpcf7_spam($spam) {
1480
  return $spam;
1481
  }
1482
 
1483
- $checkjs = js_test($ct_checkjs_cf7, $_POST);
1484
 
1485
  $post_info['comment_type'] = 'feedback';
1486
  $post_info = json_encode($post_info);
@@ -1495,7 +1462,7 @@ function ct_wpcf7_spam($spam) {
1495
  if ($sender_email === null && preg_match("/^\S+@\S+\.\S+$/", $v)) {
1496
  $sender_email = $v;
1497
  }
1498
- if ($message === '' && preg_match("/(\-message|\w*message\w*)$/", $k)) {
1499
  $message = $v;
1500
  }
1501
  if ($sender_nickname === null && preg_match("/-name$/", $k)) {
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.4
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-44';
14
  $ct_plugin_name = 'Anti-spam by CleanTalk';
15
  $ct_checkjs_frm = 'ct_checkjs_frm';
16
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
17
  $ct_session_request_id_label = 'request_id';
18
  $ct_session_register_ok_label = 'register_ok';
19
 
 
20
  $ct_cf7_comment = '';
21
 
22
  $ct_checkjs_jpcf = 'ct_checkjs_jpcf';
118
  add_filter('bp_signup_validate', 'ct_registration_errors');
119
 
120
  // Contact Form7
 
121
  add_filter('wpcf7_spam', 'ct_wpcf7_spam');
122
 
123
  // JetPack Contact form
206
 
207
  $jetpack_active_modules = get_option('jetpack_active_modules');
208
  if (
209
+ (class_exists('Jetpack', false) && $jetpack_active_modules && in_array('comments', $jetpack_active_modules))
210
+ || (defined('LANDINGPAGES_CURRENT_VERSION'))
211
  || (defined('WS_PLUGIN__S2MEMBER_PRO_VERSION'))
212
+ || (defined('WOOCOMMERCE_VERSION'))
213
+ || (defined('WPCF7_VERSION'))
214
  ) {
215
  add_action('wp_footer', 'ct_footer_add_cookie', 1);
216
  }
526
  return false;
527
  }
528
 
529
+ ct_add_hidden_fields(true, 'ct_checkjs', false, false);
530
 
531
  return null;
532
  }
578
  ';
579
  $html = sprintf($html, $field_id, $field_name, $ct_checkjs_def, $field_id, $ct_input_challenge);
580
  };
581
+
582
+ //$html .= '<noscript><p><b>Please enable JavaScript to pass anti-spam protection!</b><br />Here are the instructions how to enable JavaScript in your web browser <a href="http://www.enable-javascript.com" rel="nofollow" target="_blank">http://www.enable-javascript.com</a>. <br />' . $ct_plugin_name . '.</p></noscript>';
583
 
584
  // Simplify JS code
585
  // and fixing issue with wpautop()
783
  $checkjs = js_test('ct_checkjs', $_COOKIE);
784
  } else {
785
  $post_info['comment_type'] = $comment['comment_type'];
786
+ $checkjs = js_test('ct_checkjs', $_POST, true);
787
  }
788
 
789
  $post_info['post_url'] = ct_post_url(null, $comment_post_id);
1061
  return $message;
1062
  }
1063
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1064
  /**
1065
  * Tests plugin activation status
1066
  * @return bool
1067
  */
1068
  function ct_plugin_active($plugin_name){
 
1069
  foreach (get_option('active_plugins') as $k => $v) {
1070
  if ($plugin_name == $v)
1071
+ return true;
1072
  }
1073
+ return false;
1074
  }
1075
 
1076
  /**
1114
  $key = md5($options['apikey'] . '+' . get_option('admin_email'));
1115
  }
1116
 
 
1117
  return $key;
1118
  }
1119
 
1433
  }
1434
 
1435
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1436
  /**
1437
  * Test CF7 message for spam
1438
  */
1439
  function ct_wpcf7_spam($spam) {
1440
+ global $wpdb, $current_user, $ct_agent_version, $ct_cf7_comment;
1441
 
1442
  $options = ct_get_options();
1443
  if ($spam === true)
1447
  return $spam;
1448
  }
1449
 
1450
+ $checkjs = js_test('ct_checkjs', $_COOKIE);
1451
 
1452
  $post_info['comment_type'] = 'feedback';
1453
  $post_info = json_encode($post_info);
1462
  if ($sender_email === null && preg_match("/^\S+@\S+\.\S+$/", $v)) {
1463
  $sender_email = $v;
1464
  }
1465
+ if ($message === '' && preg_match("/(\-message|\w*message\w*|contact|comment)$/", $k)) {
1466
  $message = $v;
1467
  }
1468
  if ($sender_nickname === null && preg_match("/-name$/", $k)) {
readme.txt CHANGED
@@ -1,21 +1,21 @@
1
- === Anti-spam by CleanTalk (no CAPTCHA) ===
2
  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.2
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
- No captcha, no spam comments, no spam registrations, no spam contact emails, no spam trackbacks. Cloud, CAPTCHA less, premium antispam for WordPress.
11
 
12
  == Description ==
13
  No CAPTCHA, no questions, no counting animals, no puzzles, no math and no spam bots.
14
 
15
  = Anti spam features =
16
- 1. Stops spam bots comments.
17
- 1. Stops spam bots signups.
18
- 1. Stops spam bots contacts emails.
19
  1. Stops spam trackbacks.
20
 
21
  = Spam protection =
@@ -50,11 +50,6 @@ The CleanTalk is premium anti spam for WordPress, please look at the <a href="ht
50
  * No captcha, puzzles, etc.
51
  * Free mobile app to control anti spam function at your website.
52
 
53
- = How to protect sites from spam bots without CAPTCHA? =
54
- The most popular method is CAPTCHA -- the annoying picture with curved and sloping symbols, which are offered to the visitor to fill in. It is supposed that spam bots won’t discern these CAPTCHA, but a visitor will. CAPTCHA provokes great irritation, but if one wants to speak out, he has to fill in these symbols time after time, making mistakes and starting once again.
55
- Sometimes CAPTCHA reminds doodle 2x year old child. For users with vision problems captcha is just an insurmountable obstacle. Users hate captcha. Captcha for users means "hate". Unreadable CAPTCHA stops about 80% of site visitors. After 2 failed attempts to bring it up to 95% reject further attempts.
56
- At the sight of CAPTCHA and after input errors, many visitors leave the resource. Thus, CAPTCHA helps to protect the resource both from spam bots and visitors. CAPTCHA is not a panacea from spam. Doubts concerning the Need for CAPTCHA?
57
-
58
  = Additional features =
59
  * Online, daily and weekly anti spam reports traffic VS spam.
60
  * Apps for iPhone, Android to control anti spam service, comments, signups, contacts. With traffic and spam statistics for last 7 days.
@@ -62,7 +57,6 @@ At the sight of CAPTCHA and after input errors, many visitors leave the resource
62
 
63
  = We recommend =
64
  * Audience engagement plugin <a href="http://wordpress.org/plugins/feedweb/">Feedweb</a>
65
- * The Best Content Editor plugin <a href="http://wordpress.org/plugins/zedity/">Zedity</a>
66
 
67
  == Installation ==
68
  1. Download, install and activate the plugin.
@@ -77,7 +71,7 @@ The setup is done! You can control anti spam plugin by <a href="http://cleantalk
77
  == Frequently Asked Questions ==
78
 
79
  = How does the plugin work with spam comments? =
80
- Spam comments moves to SPAM folder. First comment from a new author plugin compares with post and previous comments. If the relevance of the comment is good enough it gets approval at the blog without manual approval.
81
 
82
  = How does the plugin stop spam? =
83
  Plugin uses several simple tests to stop spammers.
@@ -94,11 +88,14 @@ Yes, it will. The plugin compatible with any WordPress themes.
94
  Please use email **stop_email@example.com** for comments, contacts or signups. Also you can see comments processed by plugin for last 7 days at <a href="http://cleantalk.org/my/show_requests">Control panel</a> or look at folder "Spam" for banned comments.
95
 
96
  = Is the plugin effective against spam bots? =
97
- Plugin Anti-spam by CleanTalk stops up to 100% of spam comments, spam signups (registrations) and spam contact emails. More over, by determining the relevance of the comment text, the plugin stops about 96% spam comments submitted manually via browser.
98
 
99
  = What about pingback, trackback spam? =
100
  Plugin by default pass pingbacks without any checks. All trackbacks will be blocked if the sender have spam activity.
101
 
 
 
 
102
  = Should I use another anti spam plugins? =
103
  CleanTalk stops up to 100% of spam bots, so you can disable other anti spam plugins (especially CAPTCHA like anti spam plugins). In some cases several anti-spam plugins can conflict, so it will be better use just one plugin.
104
 
@@ -146,13 +143,17 @@ WordPress 3.0 at least. PHP 4, 5 with CURL or file_get_contents() function and e
146
  * Russian (ru_RU)
147
 
148
  == Screenshots ==
149
- 1. Plugin settings screen.
150
- 1. Android app main screen.
151
  1. Anti spam stopped spam bot at the CAPTCHA less registration form.
152
 
153
  == Changelog ==
 
 
 
 
154
  = 4.2 2014-10-20 =
155
- * Fixed double checks issue for BuddyPress.
156
  * Increased timeout limits to find the work server.
157
 
158
  = 4.1 2014-10-13 =
@@ -412,6 +413,9 @@ WordPress 3.0 at least. PHP 4, 5 with CURL or file_get_contents() function and e
412
  * First version
413
 
414
  == Upgrade Notice ==
 
 
 
415
  = 4.2 2014-10-20 =
416
  Increased plugin perfomance for BuddyPress registrations.
417
 
1
+ === Anti-spam by CleanTalk ===
2
  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, akismet
4
  Requires at least: 3.0
5
  Tested up to: 4.0
6
+ Stable tag: 4.4
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
+ No captcha, no spam comments, no spam registrations, no spam contact emails and no spam bots. Cloud, CAPTCHA less, premium antispam for WordPress.
11
 
12
  == Description ==
13
  No CAPTCHA, no questions, no counting animals, no puzzles, no math and no spam bots.
14
 
15
  = Anti spam features =
16
+ 1. Stops spam comments.
17
+ 1. Stops spam signups.
18
+ 1. Stops spam contacts emails.
19
  1. Stops spam trackbacks.
20
 
21
  = Spam protection =
50
  * No captcha, puzzles, etc.
51
  * Free mobile app to control anti spam function at your website.
52
 
 
 
 
 
 
53
  = Additional features =
54
  * Online, daily and weekly anti spam reports traffic VS spam.
55
  * Apps for iPhone, Android to control anti spam service, comments, signups, contacts. With traffic and spam statistics for last 7 days.
57
 
58
  = We recommend =
59
  * Audience engagement plugin <a href="http://wordpress.org/plugins/feedweb/">Feedweb</a>
 
60
 
61
  == Installation ==
62
  1. Download, install and activate the plugin.
71
  == Frequently Asked Questions ==
72
 
73
  = How does the plugin work with spam comments? =
74
+ Spam comments moves to SPAM folder or you can set option to silent ban spam comments.
75
 
76
  = How does the plugin stop spam? =
77
  Plugin uses several simple tests to stop spammers.
88
  Please use email **stop_email@example.com** for comments, contacts or signups. Also you can see comments processed by plugin for last 7 days at <a href="http://cleantalk.org/my/show_requests">Control panel</a> or look at folder "Spam" for banned comments.
89
 
90
  = Is the plugin effective against spam bots? =
91
+ Plugin Anti-spam by CleanTalk stops up to 100% of spam comments, spam signups (registrations) and spam contact emails.
92
 
93
  = What about pingback, trackback spam? =
94
  Plugin by default pass pingbacks without any checks. All trackbacks will be blocked if the sender have spam activity.
95
 
96
+ = Can I use CleanTalk with Akismet? =
97
+ Sure, you can use CleanTalk with Akismet. In this case probably you will have bigger false/positive rate (when legitimate comments/signups denies), but you will have stronger antispam protection at website.
98
+
99
  = Should I use another anti spam plugins? =
100
  CleanTalk stops up to 100% of spam bots, so you can disable other anti spam plugins (especially CAPTCHA like anti spam plugins). In some cases several anti-spam plugins can conflict, so it will be better use just one plugin.
101
 
143
  * Russian (ru_RU)
144
 
145
  == Screenshots ==
146
+ 1. Anti spam plugin settings.
147
+ 1. Android app main.
148
  1. Anti spam stopped spam bot at the CAPTCHA less registration form.
149
 
150
  == Changelog ==
151
+ = 4.4 2014-10-29 =
152
+ * Improved anti spam JS test for CF7.
153
+ * Fixed 'noscript' text in FaceBook Like preview in Valenti theme.
154
+
155
  = 4.2 2014-10-20 =
156
+ * Fixed double checks issue for BuddyPress registrations.
157
  * Increased timeout limits to find the work server.
158
 
159
  = 4.1 2014-10-13 =
413
  * First version
414
 
415
  == Upgrade Notice ==
416
+ = 4.4 2014-10-29 =
417
+ Improved JS checking for CF7.
418
+
419
  = 4.2 2014-10-20 =
420
  Increased plugin perfomance for BuddyPress registrations.
421