Spam protection, AntiSpam, FireWall by CleanTalk - Version 4.18

Version Description

2015-02-17 = * Fixed bug with comments approvement - moved ct_unmark_red() to cleantalk-admin.php * Added PayPal 'payment_status' in skip list. * Added Akismet 'spam' status processing.

Download this release

Release Info

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

Code changes from version 4.17 to 4.18

Files changed (5) hide show
  1. cleantalk-admin.php +11 -0
  2. cleantalk-common.php +1 -1
  3. cleantalk-public.php +11 -17
  4. cleantalk.php +1 -1
  5. readme.txt +10 -2
cleantalk-admin.php CHANGED
@@ -517,4 +517,15 @@ function ct_update_option($option_name) {
517
  }
518
  }
519
 
 
 
 
 
 
 
 
 
 
 
 
520
  ?>
517
  }
518
  }
519
 
520
+ /**
521
+ * Unmark bad words
522
+ * @param string $message
523
+ * @return string Cleat comment
524
+ */
525
+ function ct_unmark_red($message) {
526
+ $message = preg_replace("/\<font rel\=\"cleantalk\" color\=\"\#FF1000\"\>(\S+)\<\/font>/iu", '$1', $message);
527
+
528
+ return $message;
529
+ }
530
+
531
  ?>
cleantalk-common.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- $ct_agent_version = 'wordpress-417';
4
  $ct_plugin_name = 'Anti-spam by CleanTalk';
5
  $ct_checkjs_frm = 'ct_checkjs_frm';
6
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
1
  <?php
2
 
3
+ $ct_agent_version = 'wordpress-418';
4
  $ct_plugin_name = 'Anti-spam by CleanTalk';
5
  $ct_checkjs_frm = 'ct_checkjs_frm';
6
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
cleantalk-public.php CHANGED
@@ -10,9 +10,9 @@ function ct_init() {
10
  $ct_options = ct_get_options();
11
 
12
  ct_init_session();
13
-
14
  if ($_SERVER['REQUEST_METHOD'] == 'POST') {
15
- if (!array_key_exists($ct_formtime_label, $_SESSION) && session_id() != '') {
16
  $ct_direct_post = 1;
17
  }
18
  } else {
@@ -545,7 +545,7 @@ function ct_preprocess_comment($comment) {
545
  if ((int) $approved_comments == 0 || $ct_result->stop_words !== null) {
546
 
547
  if ($ct_result->allow == 1 && get_option('comment_moderation') !== '1') {
548
- add_filter('pre_comment_approved', 'ct_set_approved');
549
  setcookie($ct_approved_request_id_label, $ct_result->id, 0, '/');
550
  }
551
  if ($ct_result->allow == 0) {
@@ -680,11 +680,15 @@ function ct_set_not_approved() {
680
 
681
  /**
682
  * @author Artem Leontiev
683
- * Public filter 'pre_comment_approved' - Mark comment approved always
684
  * @return int 1
685
  */
686
- function ct_set_approved() {
687
- return 1;
 
 
 
 
688
  }
689
 
690
  /**
@@ -738,17 +742,6 @@ function ct_mark_red($comment_id, $comment_status) {
738
  wp_update_comment($comment);
739
  }
740
 
741
- /**
742
- * Unmark bad words
743
- * @param string $message
744
- * @return string Cleat comment
745
- */
746
- function ct_unmark_red($message) {
747
- $message = preg_replace("/\<font rel\=\"cleantalk\" color\=\"\#FF1000\"\>(\S+)\<\/font>/iu", '$1', $message);
748
-
749
- return $message;
750
- }
751
-
752
  /**
753
  * Tests plugin activation status
754
  * @return bool
@@ -1481,6 +1474,7 @@ function ct_contact_form_validate () {
1481
  $skip_params = array(
1482
  'ipn_track_id', // PayPal IPN #
1483
  'txn_type', // PayPal transaction type
 
1484
  );
1485
  if (is_array($_POST)) {
1486
  foreach ($_POST as $k => $v) {
10
  $ct_options = ct_get_options();
11
 
12
  ct_init_session();
13
+
14
  if ($_SERVER['REQUEST_METHOD'] == 'POST') {
15
+ if (is_array($_SESSION) && !array_key_exists($ct_formtime_label, $_SESSION) && session_id() != '') {
16
  $ct_direct_post = 1;
17
  }
18
  } else {
545
  if ((int) $approved_comments == 0 || $ct_result->stop_words !== null) {
546
 
547
  if ($ct_result->allow == 1 && get_option('comment_moderation') !== '1') {
548
+ add_filter('pre_comment_approved', 'ct_set_approved', 99, 2);
549
  setcookie($ct_approved_request_id_label, $ct_result->id, 0, '/');
550
  }
551
  if ($ct_result->allow == 0) {
680
 
681
  /**
682
  * @author Artem Leontiev
683
+ * Public filter 'pre_comment_approved' - Mark comment approved if it's not 'spam' only
684
  * @return int 1
685
  */
686
+ function ct_set_approved($approved, $comment) {
687
+ if ($approved == 'spam'){
688
+ return $approved;
689
+ }else {
690
+ return 1;
691
+ }
692
  }
693
 
694
  /**
742
  wp_update_comment($comment);
743
  }
744
 
 
 
 
 
 
 
 
 
 
 
 
745
  /**
746
  * Tests plugin activation status
747
  * @return bool
1474
  $skip_params = array(
1475
  'ipn_track_id', // PayPal IPN #
1476
  'txn_type', // PayPal transaction type
1477
+ 'payment_status', // PayPal payment status
1478
  );
1479
  if (is_array($_POST)) {
1480
  foreach ($_POST as $k => $v) {
cleantalk.php CHANGED
@@ -3,7 +3,7 @@
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: 4.17
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
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: 4.18
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: znaeff, shagimuratov
3
  Tags: akismet, anti spam, antispam, bbpress spam, buddypress spam, captcha antispam, cf7 spam, comments spam, contact form spam, fast secure contact form spam, form, Formidable spam, jetpack spam, landing pages, math, registration spam, s2member spam, signup spam, spam, spammers, spammy, WooCommerce spam, wordpress spam, booking spam, order spam, subscriptions spam, comments, gravity spam, gravity forms spam
4
  Requires at least: 3.0
5
- Tested up to: 4.1
6
- Stable tag: 4.17
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -171,6 +171,11 @@ WordPress 3.0 at least. PHP 4, 5 with CURL or file_get_contents() function and e
171
  1. Setup Android/iOS app to have push notices when new legitiamte comments/registrations or contactcs appears on the website.
172
 
173
  == Changelog ==
 
 
 
 
 
174
  = 4.17 2015-02-12 =
175
  * New base class.
176
  * Divided code to 3 separate files - common, public and admin.
@@ -497,6 +502,9 @@ WordPress 3.0 at least. PHP 4, 5 with CURL or file_get_contents() function and e
497
  * First version
498
 
499
  == Upgrade Notice ==
 
 
 
500
  = 4.17 2015-02-12 =
501
  New base class, divided code to 3 separate files - common, public and admin.
502
 
2
  Contributors: znaeff, shagimuratov
3
  Tags: akismet, anti spam, antispam, bbpress spam, buddypress spam, captcha antispam, cf7 spam, comments spam, contact form spam, fast secure contact form spam, form, Formidable spam, jetpack spam, landing pages, math, registration spam, s2member spam, signup spam, spam, spammers, spammy, WooCommerce spam, wordpress spam, booking spam, order spam, subscriptions spam, comments, gravity spam, gravity forms spam
4
  Requires at least: 3.0
5
+ Tested up to: 4.1.1
6
+ Stable tag: 4.18
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
171
  1. Setup Android/iOS app to have push notices when new legitiamte comments/registrations or contactcs appears on the website.
172
 
173
  == Changelog ==
174
+ = 4.18 2015-02-17 =
175
+ * Fixed bug with comments approvement - moved ct_unmark_red() to cleantalk-admin.php
176
+ * Added PayPal 'payment_status' in skip list.
177
+ * Added Akismet 'spam' status processing.
178
+
179
  = 4.17 2015-02-12 =
180
  * New base class.
181
  * Divided code to 3 separate files - common, public and admin.
502
  * First version
503
 
504
  == Upgrade Notice ==
505
+ = 4.18 2015-02-17 =
506
+ Bugfix - fixed bug with comments approvement, PayPal 'payment_status' and Akismet 'spam' status processing.
507
+
508
  = 4.17 2015-02-12 =
509
  New base class, divided code to 3 separate files - common, public and admin.
510