Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.50.1

Version Description

October 24 2016 = * Improved filtration in contact forms. * SpamFireWall: Fixed issue with SFW logs * Skipping service fields: Fast Secure Contact Froms, QU Forms, Custom Contact Forms

Download this release

Release Info

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

Code changes from version 5.50 to 5.50.1

cleantalk.php CHANGED
@@ -3,12 +3,12 @@
3
  Plugin Name: Spam Protection by CleanTalk
4
  Plugin URI: http://cleantalk.org
5
  Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms. Formerly Anti-Spam by CleanTalk.
6
- Version: 5.50
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
- $cleantalk_plugin_version='5.50';
11
- $ct_agent_version = 'wordpress-550';
12
  $cleantalk_executed=false;
13
  $ct_sfw_updated = false;
14
 
3
  Plugin Name: Spam Protection by CleanTalk
4
  Plugin URI: http://cleantalk.org
5
  Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms. Formerly Anti-Spam by CleanTalk.
6
+ Version: 5.50.1
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
+ $cleantalk_plugin_version='5.50.1';
11
+ $ct_agent_version = 'wordpress-5501';
12
  $cleantalk_executed=false;
13
  $ct_sfw_updated = false;
14
 
inc/cleantalk-common.php CHANGED
@@ -694,15 +694,15 @@ function delete_spam_comments() {
694
  * Get data from an ARRAY recursively
695
  * @return array
696
  */
697
- function ct_get_fields_any($arr, $message=array(), $email=null, $nickname=null, $subject=null, $contact=true) {
698
- $skip_params = array(
699
  'ipn_track_id', // PayPal IPN #
700
  'txn_type', // PayPal transaction type
701
  'payment_status', // PayPal payment status
702
  'ccbill_ipn', //CCBill IPN
703
  'ct_checkjs' //skip ct_checkjs field
704
  );
705
- $obfuscate_params = array(
706
  'password',
707
  'password0',
708
  'password1',
@@ -711,26 +711,43 @@ function ct_get_fields_any($arr, $message=array(), $email=null, $nickname=null,
711
  'pwd',
712
  'user_pass'
713
  );
714
- $skip_fields_params = array(
 
 
 
715
  'form_id',
716
  'form_nonce',
717
  'ccf_form',
718
  'form_page',
719
- 'form_nonce'
 
 
 
 
 
 
 
 
 
 
 
720
  );
721
- foreach($skip_params as $key=>$value){
 
722
  if(@array_key_exists($value,$_GET)||@array_key_exists($value,$_POST))
723
  $contact = false;
724
- }
725
- //*/
726
  if(count($arr)){
727
- foreach($arr as $key=>$value){
728
  if(!is_array($value) && !is_object($value) && @get_class($value)!='WP_User'){
729
- // Skip empty or work fields
730
- if($value==='' || in_array($key, $skip_fields_params))
 
731
  continue;
 
732
  // Obfuscate private data
733
- if (in_array($key, $obfuscate_params)){
734
  $value = ct_obfuscate_param($value);
735
  $message[$key] = $value;
736
  continue;
@@ -739,9 +756,10 @@ function ct_get_fields_any($arr, $message=array(), $email=null, $nickname=null,
739
  // Removes shortcodes to do better spam filtration on server side.
740
  $value = strip_shortcodes($value);
741
 
742
- if (in_array($key, $skip_params) && $key!=0 && $key!='' || preg_match("/^ct_checkjs/", $key))
743
  $contact = false;
744
- //*/
 
745
  if (!$email && @preg_match("/^\S+@\S+\.\S+$/", $value)){
746
  $email = $value;
747
  }elseif ($nickname === null && ct_get_data_from_submit($key, 'name')){
@@ -749,14 +767,17 @@ function ct_get_fields_any($arr, $message=array(), $email=null, $nickname=null,
749
  }elseif ($subject === null && ct_get_data_from_submit($key, 'subject')){
750
  $subject = $value;
751
  }else{
752
- if(isset($message[$key]))
753
- $message[$key.'_2'] = $value;
754
- else
755
- $message[$key] = $value;
756
  }
 
757
  }else if(!is_object($value)&&@get_class($value)!='WP_User'){
758
 
759
- $temp = ct_get_fields_any($value, $message, $email, $nickname, $subject, $contact);
 
 
 
 
 
760
 
761
  $email = ($temp['email'] ? $temp['email'] : null);
762
  $nickname = ($temp['nickname'] ? $temp['nickname'] : null);
694
  * Get data from an ARRAY recursively
695
  * @return array
696
  */
697
+ function ct_get_fields_any($arr, $message=array(), $email=null, $nickname=null, $subject=null, $contact=true, $prev_name='') {
698
+ $skip_params = array( //Skip request if fields exists
699
  'ipn_track_id', // PayPal IPN #
700
  'txn_type', // PayPal transaction type
701
  'payment_status', // PayPal payment status
702
  'ccbill_ipn', //CCBill IPN
703
  'ct_checkjs' //skip ct_checkjs field
704
  );
705
+ $obfuscate_params = array( //Fields to replace with ****
706
  'password',
707
  'password0',
708
  'password1',
711
  'pwd',
712
  'user_pass'
713
  );
714
+ $skip_fields_params = array( //Array for known service fields
715
+ //Common
716
+ //'ct_checkjs',
717
+ //Custom Contact Forms
718
  'form_id',
719
  'form_nonce',
720
  'ccf_form',
721
  'form_page',
722
+ 'form_nonce',
723
+ //Qu Forms
724
+ 'iphorm_uid',
725
+ 'form_url',
726
+ 'post_id',
727
+ 'iphorm_ajax',
728
+ 'iphorm_id',
729
+ //Fast SecureContact Froms
730
+ 'fs_postonce_1',
731
+ 'fscf_submitted',
732
+ 'mailto_id',
733
+ 'si_contact_action'
734
  );
735
+
736
+ foreach($skip_params as $value){
737
  if(@array_key_exists($value,$_GET)||@array_key_exists($value,$_POST))
738
  $contact = false;
739
+ } unset($value);
740
+
741
  if(count($arr)){
742
+ foreach($arr as $key => $value){
743
  if(!is_array($value) && !is_object($value) && @get_class($value)!='WP_User'){
744
+
745
+ // Skip empty or work fields execept 0 feild
746
+ if($value==='' || in_array($key, $skip_fields_params, true)){
747
  continue;
748
+ }
749
  // Obfuscate private data
750
+ if (in_array($key, $obfuscate_params, true)){
751
  $value = ct_obfuscate_param($value);
752
  $message[$key] = $value;
753
  continue;
756
  // Removes shortcodes to do better spam filtration on server side.
757
  $value = strip_shortcodes($value);
758
 
759
+ if (in_array($key, $skip_params, true) && $key!=0 && $key!='' || preg_match("/^ct_checkjs/", $key)){
760
  $contact = false;
761
+ }
762
+
763
  if (!$email && @preg_match("/^\S+@\S+\.\S+$/", $value)){
764
  $email = $value;
765
  }elseif ($nickname === null && ct_get_data_from_submit($key, 'name')){
767
  }elseif ($subject === null && ct_get_data_from_submit($key, 'subject')){
768
  $subject = $value;
769
  }else{
770
+ $message[$prev_name.$key] = $value;
 
 
 
771
  }
772
+
773
  }else if(!is_object($value)&&@get_class($value)!='WP_User'){
774
 
775
+ $prev_name_original = $prev_name;
776
+ $prev_name = ($prev_name === '' ? $key.'_' : $prev_name.$key.'_');
777
+
778
+ $temp = ct_get_fields_any($value, $message, $email, $nickname, $subject, $contact, $prev_name);
779
+
780
+ $prev_name = $prev_name_original;
781
 
782
  $email = ($temp['email'] ? $temp['email'] : null);
783
  $nickname = ($temp['nickname'] ? $temp['nickname'] : null);
inc/cleantalk-sfw.class.php CHANGED
@@ -153,7 +153,7 @@ class CleanTalkSFW
153
 
154
  foreach($result as $key => $value){
155
  //Compile log
156
- $data[] = array(trim($value['ip']), $value['all'], $value['blocked'], $value['timestamp']);
157
  //Compile to return;
158
  $for_return['all'] = $for_return['all'] + $value['all'];
159
  $for_return['blocked'] = $for_return['blocked'] + $value['blocked'];
@@ -183,53 +183,4 @@ class CleanTalkSFW
183
  }else
184
  return false;
185
  }
186
-
187
- /* OLD Send and wipe SFW log
188
- public function send_logs_old()
189
- {
190
- global $ct_options, $ct_data;
191
- $ct_options = ct_get_options();
192
- $ct_data = ct_get_data();
193
-
194
- if(isset($ct_options['spam_firewall']))
195
- {
196
- $value = @intval($ct_options['spam_firewall']);
197
- }
198
- else
199
- {
200
- $value=0;
201
- }
202
-
203
- if($value==1 && isset($ct_data['sfw_log']))
204
- {
205
- $sfw_log=$ct_data['sfw_log'];
206
- $data=Array();
207
- foreach($sfw_log as $key=>$value)
208
- {
209
- $data[]=Array($key, $value['all'], $value['allow'], $value['datetime']);
210
- }
211
- $qdata = array (
212
- 'data' => json_encode($data),
213
- 'rows' => count($data),
214
- 'timestamp' => time()
215
- );
216
- if(!function_exists('sendRawRequest'))
217
- {
218
- require_once('cleantalk.class.php');
219
- }
220
-
221
- $result = sendRawRequest('https://api.cleantalk.org/?method_name=sfw_logs&auth_key='.$ct_options['apikey'],$qdata);
222
- $result = json_decode($result);
223
- if(isset($result->data) && isset($result->data->rows))
224
- {
225
- if($result->data->rows == count($data))
226
- {
227
- $ct_data['sfw_log']=Array();
228
- update_option('cleantalk_data', $ct_data);
229
- }
230
- }
231
-
232
- }
233
- }
234
- //*/
235
  }
153
 
154
  foreach($result as $key => $value){
155
  //Compile log
156
+ $data[] = array(trim($value['ip']), $value['all'], $value['all']-$value['blocked'], $value['timestamp']);
157
  //Compile to return;
158
  $for_return['all'] = $for_return['all'] + $value['all'];
159
  $for_return['blocked'] = $for_return['blocked'] + $value['blocked'];
183
  }else
184
  return false;
185
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  }
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Spam Protection by CleanTalk (no Captcha Anti-Spam) ===
2
  Contributors: znaeff, shagimuratov, serge00
3
- Tags: spam, anti-spam, antispam, anti spam, bbpress, buddypress, captcha, capcha, captha, catcha, cf7 spam, comments, contact form spam, signup, spammers, spammy, woocommerce, wordpress spam, subscription, gravity spam, jetpack, bots, contact form 7, contact form, registrations, ninja, Fast Secure Contact, Gravity forms, formidable, mailchimp, s2member, protection, protect, email, plugin, contact, recaptcha, google captcha, google recaptcha, blacklist, prevent spam comments, wordpress, User Frontend, bulk delete, bulk remove, widget, review, firewall, 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, anti-spam plugin, varnish, amp, spam free, userpro,honeypot,puzzle,quiz,survey,poll
4
  Requires at least: 3.0
5
  Tested up to: 4.6.1
6
- Stable tag: 5.50
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -386,6 +386,7 @@ To close the notice please save the plugin settings again or it will be closed a
386
 
387
  = I'm using PHP 4.2 version and i'm getting errors related with JSON. Why does it happens? =
388
  СleanTalk is no longer supports PHP lower than 5.2 version because the support code have incompatibility with PHP 7 version. Please, upgrade your PHP. If you couldn't perform that, let us know about it via support ticket here: https://cleantalk.org/my/support.
 
389
  == Other notes ==
390
 
391
  = Troubleshooting Guide =
@@ -483,6 +484,11 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
483
  1. The Dashboard with a map of most spam active countries per your account.
484
 
485
  == Changelog ==
 
 
 
 
 
486
  = 5.50 October 20 2016 =
487
  * Custom contact forms: integration.
488
  * Pirate Forms: integration.
@@ -1176,6 +1182,11 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
1176
 
1177
  == Upgrade Notice ==
1178
  == Changelog ==
 
 
 
 
 
1179
  = 5.50 October 20 2016 =
1180
  * Custom contact forms: integration.
1181
  * Pirate Forms: integration.
1
  === Spam Protection by CleanTalk (no Captcha Anti-Spam) ===
2
  Contributors: znaeff, shagimuratov, serge00
3
+ Tags: spam, anti-spam, antispam, anti spam, bbpress, buddypress, captcha, capcha, captha, catcha, cf7 spam, comments, contact form spam, signup, spammers, spammy, woocommerce, wordpress spam, subscription, gravity spam, jetpack, bots, contact form 7, contact form, registrations, ninja, Fast Secure Contact, Gravity forms, formidable, mailchimp, s2member, protection, protect, email, plugin, contact, recaptcha, google captcha, google recaptcha, blacklist, prevent spam comments, wordpress, User Frontend, bulk delete, bulk remove, widget, review, firewall, 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, anti-spam plugin, varnish, amp, spam free, userpro,honeypot,puzzle,quiz,survey,poll,security
4
  Requires at least: 3.0
5
  Tested up to: 4.6.1
6
+ Stable tag: 5.50.1
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
386
 
387
  = I'm using PHP 4.2 version and i'm getting errors related with JSON. Why does it happens? =
388
  СleanTalk is no longer supports PHP lower than 5.2 version because the support code have incompatibility with PHP 7 version. Please, upgrade your PHP. If you couldn't perform that, let us know about it via support ticket here: https://cleantalk.org/my/support.
389
+
390
  == Other notes ==
391
 
392
  = Troubleshooting Guide =
484
  1. The Dashboard with a map of most spam active countries per your account.
485
 
486
  == Changelog ==
487
+ = 5.50.1 October 24 2016 =
488
+ * Improved filtration in contact forms.
489
+ * SpamFireWall: Fixed issue with SFW logs
490
+ * Skipping service fields: Fast Secure Contact Froms, QU Forms, Custom Contact Forms
491
+
492
  = 5.50 October 20 2016 =
493
  * Custom contact forms: integration.
494
  * Pirate Forms: integration.
1182
 
1183
  == Upgrade Notice ==
1184
  == Changelog ==
1185
+ = 5.50.1 October 24 2016 =
1186
+ * Improved filtration in contact forms.
1187
+ * SpamFireWall: Fixed issue with SFW logs
1188
+ * Skipping service fields: Fast Secure Contact Froms, QU Forms, Custom Contact Forms
1189
+
1190
  = 5.50 October 20 2016 =
1191
  * Custom contact forms: integration.
1192
  * Pirate Forms: integration.