Spam protection, AntiSpam, FireWall by CleanTalk - Version 2.4.11

Version Description

2013-08-02 = * Removed spam tests for self-made pingbacks * Tested up to WP 3.6

Download this release

Release Info

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

Code changes from version 2.4.10 to 2.4.11

Files changed (4) hide show
  1. cleantalk.class.php +2 -29
  2. cleantalk.php +24 -7
  3. readme.txt +20 -17
  4. screenshot-4.png +0 -0
cleantalk.class.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Cleantalk base class
4
  *
5
- * @version 0.20.2
6
  * @package Cleantalk
7
  * @subpackage Base
8
  * @author Сleantalk team (welcome@cleantalk.ru)
@@ -22,12 +22,6 @@ require_once(dirname(__FILE__) . '/cleantalk.xmlrpc.php');
22
  */
23
  class CleantalkResponse {
24
 
25
- /**
26
- * Unique user ID
27
- * @var string
28
- */
29
- public $sender_id = null;
30
-
31
  /**
32
  * Is stop words
33
  * @var int
@@ -143,7 +137,6 @@ class CleantalkResponse {
143
 
144
  // Разбираем xmlrpcresp ответ с клинтолка
145
  if ($obj->val !== 0) {
146
- $this->sender_id = (isset($obj->val['sender_id'])) ? $obj->val['sender_id'] : null;
147
  $this->stop_words = isset($obj->val['stop_words']) ? $obj->val['stop_words'] : null;
148
  $this->comment = $obj->val['comment'];
149
  $this->blacklisted = (isset($obj->val['blacklisted'])) ? $obj->val['blacklisted'] : null;
@@ -246,7 +239,7 @@ class CleantalkRequest {
246
  * valid are 1|0
247
  * @var int
248
  */
249
- public $allow_links = 0;
250
 
251
  /**
252
  * Time form filling
@@ -673,9 +666,6 @@ class Cleantalk {
673
 
674
  $response = new CleantalkResponse(null, $result);
675
 
676
- if (!empty($response->sender_id)) {
677
- $this->setSenderId($response->sender_id);
678
- }
679
  return $response;
680
  }
681
 
@@ -740,23 +730,6 @@ class Cleantalk {
740
  return $response;
741
  }
742
 
743
- /**
744
- * Function to get the SenderID
745
- * @return string
746
- */
747
- public function getSenderId() {
748
- return ( isset($_COOKIE['ct_sender_id']) && !empty($_COOKIE['ct_sender_id']) ) ? $_COOKIE['ct_sender_id'] : '';
749
- }
750
-
751
- /**
752
- * Function to change the SenderID
753
- * @param $senderId
754
- * @return bool
755
- */
756
- private function setSenderId($senderId) {
757
- return @setcookie('ct_sender_id', $senderId);
758
- }
759
-
760
  /**
761
  * Function to get the message hash from Cleantalk.ru comment
762
  * @param $message
2
  /**
3
  * Cleantalk base class
4
  *
5
+ * @version 0.20.3
6
  * @package Cleantalk
7
  * @subpackage Base
8
  * @author Сleantalk team (welcome@cleantalk.ru)
22
  */
23
  class CleantalkResponse {
24
 
 
 
 
 
 
 
25
  /**
26
  * Is stop words
27
  * @var int
137
 
138
  // Разбираем xmlrpcresp ответ с клинтолка
139
  if ($obj->val !== 0) {
 
140
  $this->stop_words = isset($obj->val['stop_words']) ? $obj->val['stop_words'] : null;
141
  $this->comment = $obj->val['comment'];
142
  $this->blacklisted = (isset($obj->val['blacklisted'])) ? $obj->val['blacklisted'] : null;
239
  * valid are 1|0
240
  * @var int
241
  */
242
+ public $allow_links = null;
243
 
244
  /**
245
  * Time form filling
666
 
667
  $response = new CleantalkResponse(null, $result);
668
 
 
 
 
669
  return $response;
670
  }
671
 
730
  return $response;
731
  }
732
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
733
  /**
734
  * Function to get the message hash from Cleantalk.ru comment
735
  * @param $message
cleantalk.php CHANGED
@@ -1,13 +1,15 @@
1
  <?php
2
  /*
3
- Plugin Name: CleanTalk
4
  Plugin URI: http://cleantalk.org/wordpress
5
- Description: Plug-in filters spam bots in the comments of a blog without move to trash or approval in the queue. Spam protection is not visible for visitors and administrators of a blog. The plug-in not uses CAPTCHA or Q&A to stop spam-bots. It's simple and clever antispam for your blog.
6
- Version: 2.4.10
7
  Author: СleanTalk team <welcome@cleantalk.ru>
8
  Author URI: http://cleantalk.org
9
  */
10
 
 
 
11
  add_action('init', 'ct_init_locale');
12
  add_action('delete_comment', 'ct_delete_comment_meta'); // param - comment ID
13
  add_action('comment_form', 'ct_add_hidden_fields');
@@ -192,6 +194,7 @@ function ct_add_hidden_fields($post_id = 0) {
192
  * Public action 'parse_request' - Inits session value
193
  */
194
  function ct_set_session() {
 
195
  if (ct_is_user_enable() === false) {
196
  return false;
197
  }
@@ -230,11 +233,25 @@ function ct_check($comment) {
230
  // this action is called just when WP process POST request (adds new comment)
231
  // this action is called by wp-comments-post.php
232
  // after processing WP makes redirect to post page with comment's form by GET request (see above)
233
- global $wpdb, $current_user, $comment_post_id;
234
 
235
  if (ct_is_user_enable() === false) {
236
  return $comment;
237
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  $options = ct_get_options();
239
 
240
  $comment_post_id = $comment['comment_post_ID'];
@@ -270,7 +287,7 @@ function ct_check($comment) {
270
  if ($user_info === false)
271
  $user_info = '';
272
 
273
- $post_info['comment_type'] = $comment['comment_type'];
274
  $post_info['post_url'] = ct_post_url(null, $comment_post_id);
275
 
276
  $post_info = json_encode($post_info);
@@ -315,7 +332,7 @@ function ct_check($comment) {
315
  $ct_request->sender_email = $comment['comment_author_email'];
316
  $ct_request->sender_nickname = $comment['comment_author'];
317
  $ct_request->sender_ip = $ct->ct_session_ip($_SERVER['REMOTE_ADDR']);
318
- $ct_request->agent = 'wordpress-2410';
319
  $ct_request->sender_info = $user_info;
320
  $ct_request->submit_time = $submit_time;
321
  $ct_request->js_on = $checkjs;
@@ -331,7 +348,7 @@ function ct_check($comment) {
331
  )
332
  );
333
  }
334
-
335
  if ($ct_result->stop_queue == 1) {
336
  $err_text = '<center><b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ' . __('Spam protection', 'cleantalk') . "</center><br><br>\n" . $ct_result->comment;
337
  $err_text .= '<script>setTimeout("history.back()", 5000);</script>';
1
  <?php
2
  /*
3
+ Plugin Name: CleanTalk. Anti-spam app
4
  Plugin URI: http://cleantalk.org/wordpress
5
+ Description: Plug-in filters spam bots in the comments of a blog without move to trash. Spam protection is invisible for visitors of a blog. The plug-in not uses CAPTCHA or Q&A to stop spam-bots. It's simple, smart antispam for your blog.
6
+ Version: 2.4.11
7
  Author: СleanTalk team <welcome@cleantalk.ru>
8
  Author URI: http://cleantalk.org
9
  */
10
 
11
+ $ct_agent_version = 'wordpress-2411';
12
+
13
  add_action('init', 'ct_init_locale');
14
  add_action('delete_comment', 'ct_delete_comment_meta'); // param - comment ID
15
  add_action('comment_form', 'ct_add_hidden_fields');
194
  * Public action 'parse_request' - Inits session value
195
  */
196
  function ct_set_session() {
197
+
198
  if (ct_is_user_enable() === false) {
199
  return false;
200
  }
233
  // this action is called just when WP process POST request (adds new comment)
234
  // this action is called by wp-comments-post.php
235
  // after processing WP makes redirect to post page with comment's form by GET request (see above)
236
+ global $wpdb, $current_user, $comment_post_id, $ct_agent_version;
237
 
238
  if (ct_is_user_enable() === false) {
239
  return $comment;
240
  }
241
+
242
+ $wp_host = null;
243
+ if (preg_match("@^(?:https?://)([^/:]+)@i", get_permalink($comment['comment_post_ID']), $matches))
244
+ $wp_host = $matches[1];
245
+
246
+ $author_host = null;
247
+ if (preg_match("@^(?:https?://)([^/:]+)@i", $comment['comment_author_url'], $matches))
248
+ $author_host = $matches[1];
249
+
250
+ // Skip tests for selfmade pingback's
251
+ if ($comment['comment_type'] == 'pingback' && $wp_host !== null && $wp_host === $author_host) {
252
+ return $comment;
253
+ }
254
+
255
  $options = ct_get_options();
256
 
257
  $comment_post_id = $comment['comment_post_ID'];
287
  if ($user_info === false)
288
  $user_info = '';
289
 
290
+ $post_info['comment_type'] = $comment['comment_type'];
291
  $post_info['post_url'] = ct_post_url(null, $comment_post_id);
292
 
293
  $post_info = json_encode($post_info);
332
  $ct_request->sender_email = $comment['comment_author_email'];
333
  $ct_request->sender_nickname = $comment['comment_author'];
334
  $ct_request->sender_ip = $ct->ct_session_ip($_SERVER['REMOTE_ADDR']);
335
+ $ct_request->agent = $ct_agent_version;
336
  $ct_request->sender_info = $user_info;
337
  $ct_request->submit_time = $submit_time;
338
  $ct_request->js_on = $checkjs;
348
  )
349
  );
350
  }
351
+
352
  if ($ct_result->stop_queue == 1) {
353
  $err_text = '<center><b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ' . __('Spam protection', 'cleantalk') . "</center><br><br>\n" . $ct_result->comment;
354
  $err_text .= '<script>setTimeout("history.back()", 5000);</script>';
readme.txt CHANGED
@@ -1,19 +1,19 @@
1
  === Plugin Name ===
2
  Contributors: znaeff, default.asp, shagimuratov, aleontiev
3
- Tags: comments, spam, cleantalk, anti-spam, antispam, captcha, comment, spambot, spam-bot, recaptcha, block spam, Spam Free, spamfree
4
  Requires at least: 3.1.2
5
  License: GPLv2
6
- Tested up to: 3.5.1
7
- Stable tag: 2.4.10
8
 
9
- No spam in the comments. Smart, simple antispam without CAPTCHA.
10
 
11
  == Description ==
12
  1. Stops spam bots in the comments.
13
  1. Invisible spam protection for visitors.
14
- 1. Antispam without CAPTCHA.
15
 
16
- Plug-in filters spam bots in the comments of a blog without move to trash or approval in the queue. The plugin is not visible for visitors and administrators of a blog. The plug-in not uses CAPTCHA or Q&A to stop spam bots. It's simple and clever antispam for your blog.
17
 
18
  Every new comment compares with article and previous comments. If the relevance of the comment is good enough it gets approval at the blog without manual approval.
19
 
@@ -21,18 +21,18 @@ This plugin is a client application for anti-spam service cleantalk.org. It is f
21
 
22
  == Installation ==
23
 
24
- Please use <a href="http://cleantalk.org/install/wordpress" target="_blank">Setup manual</a> at the plugin's site
25
 
26
  == Frequently Asked Questions ==
27
 
28
- = How plugin stop spam? =
29
- Plugin uses several simple tests to stop spambots
30
 
31
- * Blacklists checks by Email, IP in lists with several billions records.
 
32
  * JavaScript availability.
33
  * Comment submit time.
34
  * Relevance test for the comment.
35
- * Spam signatures.
36
 
37
  = How plugin works? =
38
 
@@ -40,19 +40,22 @@ Plugin sends a comment's text and several previous approved comments to the serv
40
 
41
  = Why do I need one more anti-spam plugin? =
42
 
43
- 1. The plugin is more effective than CAPTCHA because use several methods to stop spambots.
44
- 1. This plugin stops spam-bots automatically, plugin invisible for blog visitors and admins.
45
  1. CleanTalk automatically approves relevant, not spam comments.
46
 
47
  == Screenshots ==
48
 
49
- 1. Plug-in's antispam work scheme
50
- 1. CleanTalk stops spam comment
51
- 1. CleanTalk settings to filter spam-bots
52
- 1. Service Control panel at cleantalk.org
53
 
54
  == Changelog ==
55
 
 
 
 
 
56
  = 2.4.10 2013-07-24 =
57
  * Fixed warning in PHP 5.4
58
  * Fixed bug with disabling comments test for Administrators, Authors and Editors
1
  === Plugin Name ===
2
  Contributors: znaeff, default.asp, shagimuratov, aleontiev
3
+ Tags: spam, antispam, anti-spam, spambot, spam-bot, stop spam, spammers, spamfree, captcha, recaptcha, comment, comments, plugin
4
  Requires at least: 3.1.2
5
  License: GPLv2
6
+ Tested up to: 3.6
7
+ Stable tag: 2.4.11
8
 
9
+ No spam in the comments. Smart, simple anti-spam app without CAPTCHA.
10
 
11
  == Description ==
12
  1. Stops spam bots in the comments.
13
  1. Invisible spam protection for visitors.
14
+ 1. Anti-spam without CAPTCHA.
15
 
16
+ Plugin filters spam bots in the comments of a blog without move to trash or approval in the queue. The plugin is not visible for visitors and administrators of a blog. The plugin not uses CAPTCHA or Q&A to stop spammers. It's simple and clever antispam for your blog.
17
 
18
  Every new comment compares with article and previous comments. If the relevance of the comment is good enough it gets approval at the blog without manual approval.
19
 
21
 
22
  == Installation ==
23
 
24
+ Please use <a href="http://cleantalk.org/install/wordpress" target="_blank">Antispam setup manual</a> at the plugin's site.
25
 
26
  == Frequently Asked Questions ==
27
 
28
+ = How plugin stops spam? =
29
+ Plugin uses several simple tests to stop spammers.
30
 
31
+ * Spam bots signatures.
32
+ * Blacklists checks by Email, IP, web-sites domain names.
33
  * JavaScript availability.
34
  * Comment submit time.
35
  * Relevance test for the comment.
 
36
 
37
  = How plugin works? =
38
 
40
 
41
  = Why do I need one more anti-spam plugin? =
42
 
43
+ 1. The plugin is more effective than CAPTCHA because use several methods to stop spammers.
44
+ 1. This plugin stops spam bots automatically, plugin invisible for blog visitors and admins.
45
  1. CleanTalk automatically approves relevant, not spam comments.
46
 
47
  == Screenshots ==
48
 
49
+ 1. Antispam work scheme of plugin
50
+ 1. Plugin stops spammer comment
51
+ 1. Antispam settings to filter spam bots
 
52
 
53
  == Changelog ==
54
 
55
+ = 2.4.11 2013-08-02 =
56
+ * Removed spam tests for self-made pingbacks
57
+ * Tested up to WP 3.6
58
+
59
  = 2.4.10 2013-07-24 =
60
  * Fixed warning in PHP 5.4
61
  * Fixed bug with disabling comments test for Administrators, Authors and Editors
screenshot-4.png DELETED
Binary file