Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.127.2

Version Description

October 8 2019 = * Integration: SeedProd Coming Soon Page Pro. * Fix: WooCommerce double reuqests. * Fix: Static JS key.

Download this release

Release Info

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

Code changes from version 5.127.1 to 5.127.2

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, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
6
- Version: 5.127.1
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  Text Domain: cleantalk
@@ -189,7 +189,13 @@ if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
189
  add_action( 'wp_ajax_nopriv_nf_ajax_submit', 'apbct_form__ninjaForms__testSpam', 1);
190
  add_action( 'wp_ajax_nf_ajax_submit', 'apbct_form__ninjaForms__testSpam', 1);
191
  add_action( 'ninja_forms_process', 'apbct_form__ninjaForms__testSpam', 1); // Depricated ?
192
-
 
 
 
 
 
 
193
  // Public actions
194
  if(!is_admin() && !apbct_is_ajax()){
195
 
3
  Plugin Name: Anti-Spam 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.
6
+ Version: 5.127.2
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  Text Domain: cleantalk
189
  add_action( 'wp_ajax_nopriv_nf_ajax_submit', 'apbct_form__ninjaForms__testSpam', 1);
190
  add_action( 'wp_ajax_nf_ajax_submit', 'apbct_form__ninjaForms__testSpam', 1);
191
  add_action( 'ninja_forms_process', 'apbct_form__ninjaForms__testSpam', 1); // Depricated ?
192
+
193
+ // SeedProd Coming Soon Page Pro integration
194
+ add_action( 'wp_ajax_seed_cspv5_subscribe_callback', 'apbct_form__seedprod_coming_soon__testSpam', 1 );
195
+ add_action( 'wp_ajax_nopriv_seed_cspv5_subscribe_callback', 'apbct_form__seedprod_coming_soon__testSpam', 1 );
196
+ add_action( 'wp_ajax_seed_cspv5_contactform_callback', 'apbct_form__seedprod_coming_soon__testSpam', 1 );
197
+ add_action( 'wp_ajax_nopriv_seed_cspv5_contactform_callback', 'apbct_form__seedprod_coming_soon__testSpam', 1 );
198
+
199
  // Public actions
200
  if(!is_admin() && !apbct_is_ajax()){
201
 
inc/cleantalk-common.php CHANGED
@@ -430,8 +430,8 @@ function ct_get_checkjs_value(){
430
 
431
  // Use static JS keys
432
  if(
433
- $apbct->settings['use_static_js_key'] === 1 ||
434
- ($apbct->settings['use_static_js_key'] === -1 && apbct_is_cache_plugins_persist())
435
  ){
436
  $key = hash('sha256', $apbct->api_key.ct_get_admin_email().$apbct->salt);
437
 
430
 
431
  // Use static JS keys
432
  if(
433
+ $apbct->settings['use_static_js_key'] == 1 ||
434
+ ($apbct->settings['use_static_js_key'] == -1 && apbct_is_cache_plugins_persist())
435
  ){
436
  $key = hash('sha256', $apbct->api_key.ct_get_admin_email().$apbct->salt);
437
 
inc/cleantalk-public.php CHANGED
@@ -112,10 +112,13 @@ function apbct_init() {
112
  add_filter('si_contact_form_validate', 'ct_si_contact_form_validate');
113
  }
114
 
115
- // WooCoomerse signups
116
- if(class_exists('WooCommerce'))
117
- add_filter('woocommerce_register_post', 'ct_register_post', 1, 3);
118
-
 
 
 
119
  // WooCommerce whishlist
120
  if(class_exists('WC_Wishlists_Wishlist'))
121
  add_filter('wc_wishlists_create_list_args', 'ct_woocommerce_wishlist_check', 1, 1);
@@ -1396,8 +1399,8 @@ function apbct_js_test($field_name = 'ct_checkjs', $data = null) {
1396
 
1397
  // Check static key
1398
  if(
1399
- $apbct->settings['use_static_js_key'] === 1 ||
1400
- ($apbct->settings['use_static_js_key'] === -1 && apbct_is_cache_plugins_persist())
1401
  ){
1402
  $ct_challenge = ct_get_checkjs_value();
1403
  $out = preg_match("/$ct_challenge/", $js_key) ? 1 : 0;
@@ -1748,12 +1751,15 @@ function ct_registration_errors($errors, $sanitized_user_login = null, $user_ema
1748
  return $errors;
1749
  }
1750
 
1751
- // This hack can be helpfull when plugin uses with untested themes&signups plugins.
1752
- $checkjs_post = apbct_js_test($ct_checkjs_register_form, $_POST);
1753
- $checkjs_cookie = apbct_js_test($ct_checkjs_register_form, $_COOKIE);
1754
- $checkjs = $checkjs_post || $checkjs_cookie;
1755
-
1756
-
 
 
 
1757
  $sender_info = array(
1758
  'post_checkjs_passed' => $checkjs_post,
1759
  'cookie_checkjs_passed' => $checkjs_cookie,
@@ -2309,6 +2315,55 @@ function apbct_form__ninjaForms__changeResponse( $data ) {
2309
 
2310
  }
2311
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2312
  /**
2313
  * Changes email notification for succes subscription for Ninja Forms
2314
  *
@@ -2884,15 +2939,10 @@ function ct_contact_form_validate() {
2884
  !empty($_POST['woocommerce_checkout_place_order']) ||
2885
  strpos($_SERVER['REQUEST_URI'], 'wc-ajax=wc_ppec_start_checkout') !== false
2886
  ){
2887
- $post_info['comment_type'] = 'order';
2888
  if($apbct->settings['wc_checkout_test'] == 0){
2889
- if ( $apbct->settings['wc_register_from_order'] == 1 && ! is_user_logged_in() ) {
2890
- $post_info['comment_type'] = 'wc_register_from_order';
2891
- } else {
2892
- remove_filter('woocommerce_register_post', 'ct_register_post', 1 );
2893
- return null;
2894
- }
2895
  }
 
2896
  }
2897
 
2898
  $ct_temp_msg_data = ct_get_fields_any($_POST);
112
  add_filter('si_contact_form_validate', 'ct_si_contact_form_validate');
113
  }
114
 
115
+ // WooCommerce registration
116
+ if(class_exists('WooCommerce')){
117
+ if( $apbct->settings['wc_register_from_order'] == 1 ){
118
+ add_filter( 'woocommerce_registration_errors', 'ct_registration_errors', 1, 3 );
119
+ }
120
+ }
121
+
122
  // WooCommerce whishlist
123
  if(class_exists('WC_Wishlists_Wishlist'))
124
  add_filter('wc_wishlists_create_list_args', 'ct_woocommerce_wishlist_check', 1, 1);
1399
 
1400
  // Check static key
1401
  if(
1402
+ $apbct->settings['use_static_js_key'] == 1 ||
1403
+ ($apbct->settings['use_static_js_key'] == -1 && apbct_is_cache_plugins_persist())
1404
  ){
1405
  $ct_challenge = ct_get_checkjs_value();
1406
  $out = preg_match("/$ct_challenge/", $js_key) ? 1 : 0;
1751
  return $errors;
1752
  }
1753
 
1754
+ if(current_filter('woocommerce_registration_errors')){
1755
+ $checkjs = apbct_js_test('ct_checkjs', $_COOKIE);
1756
+ }else{
1757
+ // This hack can be helpfull when plugin uses with untested themes&signups plugins.
1758
+ $checkjs_post = apbct_js_test($ct_checkjs_register_form, $_POST);
1759
+ $checkjs_cookie = apbct_js_test($ct_checkjs_register_form, $_COOKIE);
1760
+ $checkjs = $checkjs_post || $checkjs_cookie;
1761
+ }
1762
+
1763
  $sender_info = array(
1764
  'post_checkjs_passed' => $checkjs_post,
1765
  'cookie_checkjs_passed' => $checkjs_cookie,
2315
 
2316
  }
2317
 
2318
+ function apbct_form__seedprod_coming_soon__testSpam() {
2319
+
2320
+ global $apbct;
2321
+
2322
+ if(
2323
+ $apbct->settings['contact_forms_test'] == 0
2324
+ || ($apbct->settings['protect_logged_in'] != 1 && is_user_logged_in()) // Skip processing for logged in users.
2325
+ || apbct_exclusions_check__url()
2326
+ ){
2327
+ return;
2328
+ }
2329
+
2330
+ $ct_temp_msg_data = ct_get_fields_any($_REQUEST);
2331
+
2332
+ $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
2333
+ $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
2334
+ $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
2335
+ $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
2336
+ if ($subject != '') {
2337
+ $message = array_merge(array('subject' => $subject), $message);
2338
+ }
2339
+
2340
+ $post_info['comment_type'] = 'contact_form_wordpress_seedprod_coming_soon';
2341
+
2342
+ $base_call_result = apbct_base_call(
2343
+ array(
2344
+ 'message' => $message,
2345
+ 'sender_email' => $sender_email,
2346
+ 'sender_nickname' => $sender_nickname,
2347
+ 'post_info' => $post_info,
2348
+ )
2349
+ );
2350
+
2351
+ $ct_result = $base_call_result['ct_result'];
2352
+ if ($ct_result->allow == 0) {
2353
+ global $ct_comment;
2354
+ $ct_comment = $ct_result->comment;
2355
+
2356
+ $response = array(
2357
+ 'status' => 200,
2358
+ 'html' => "<h1>".__('Spam protection by CleanTalk', 'cleantalk')."</h1><h2>".$ct_result->comment."</h2>"
2359
+ );
2360
+
2361
+ echo sanitize_text_field($_GET['callback']) . '(' . json_encode($response) . ')';
2362
+ exit();
2363
+ }
2364
+
2365
+ }
2366
+
2367
  /**
2368
  * Changes email notification for succes subscription for Ninja Forms
2369
  *
2939
  !empty($_POST['woocommerce_checkout_place_order']) ||
2940
  strpos($_SERVER['REQUEST_URI'], 'wc-ajax=wc_ppec_start_checkout') !== false
2941
  ){
 
2942
  if($apbct->settings['wc_checkout_test'] == 0){
2943
+ return null;
 
 
 
 
 
2944
  }
2945
+ $post_info['comment_type'] = 'order';
2946
  }
2947
 
2948
  $ct_temp_msg_data = ct_get_fields_any($_POST);
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: safronik
3
  Tags: spam, antispam, protection, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 5.3
6
- Stable tag: 5.127.1
7
  License: GPLv2
8
 
9
  Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
@@ -568,6 +568,11 @@ If your website has forms that send data to external sources, you can enable opt
568
  10. Website's options.
569
 
570
  == Changelog ==
 
 
 
 
 
571
  = 5.127.1 October 7 2019 =
572
  * Fix: WPMS settings logic.
573
  * Using default database storage engine for tables.
@@ -1998,6 +2003,11 @@ If your website has forms that send data to external sources, you can enable opt
1998
  * First version
1999
 
2000
  == Upgrade Notice ==
 
 
 
 
 
2001
  = 5.127.1 October 7 2019 =
2002
  * Fix: WPMS settings logic.
2003
  * Using default database storage engine for tables.
3
  Tags: spam, antispam, protection, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 5.3
6
+ Stable tag: 5.127.2
7
  License: GPLv2
8
 
9
  Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
568
  10. Website's options.
569
 
570
  == Changelog ==
571
+ = 5.127.2 October 8 2019 =
572
+ * Integration: SeedProd Coming Soon Page Pro.
573
+ * Fix: WooCommerce double reuqests.
574
+ * Fix: Static JS key.
575
+
576
  = 5.127.1 October 7 2019 =
577
  * Fix: WPMS settings logic.
578
  * Using default database storage engine for tables.
2003
  * First version
2004
 
2005
  == Upgrade Notice ==
2006
+ = 5.127.2 October 8 2019 =
2007
+ * Integration: SeedProd Coming Soon Page Pro.
2008
+ * Fix: WooCommerce double reuqests.
2009
+ * Fix: Static JS key.
2010
+
2011
  = 5.127.1 October 7 2019 =
2012
  * Fix: WPMS settings logic.
2013
  * Using default database storage engine for tables.