Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.131

Version Description

December 6 2019 = * Fix: WooCommerce registration. * Fix: Auto update on Wordperss Multisite. * Fix: URLs exceptions validation. * New: Secuirty improved. * Spam protection is improved. * Minor fixes ond improvments.

Download this release

Release Info

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

Code changes from version 5.130.1 to 5.131

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.130.1
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  Text Domain: cleantalk
@@ -226,7 +226,7 @@ if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
226
  if( $apbct->plugin_version == APBCT_VERSION && // Do not call with first start
227
  $apbct->settings['spam_firewall'] == 1 &&
228
  apbct_is_get() &&
229
- ! wp_doing_cron()
230
  ){
231
  apbct_sfw__check();
232
  }
@@ -553,7 +553,7 @@ function apbct_sfw__check()
553
  $apbct->data['sfw_counter']['all']++;
554
  $apbct->saveData();
555
  if(!headers_sent())
556
- setcookie ('ct_sfw_passed', '0', time()+86400*3, '/', parse_url(get_option('siteurl'),PHP_URL_HOST) ,false, true);
557
  }
558
  break;
559
  }else{
@@ -1161,6 +1161,10 @@ function apbct_rc__update(){
1161
  $title = __('Update Plugin');
1162
  $nonce = 'upgrade-plugin_' . $plugin;
1163
  $url = 'update.php?action=upgrade-plugin&plugin=' . urlencode( $plugin );
 
 
 
 
1164
 
1165
  $prev_version = APBCT_VERSION;
1166
 
@@ -1182,7 +1186,7 @@ function apbct_rc__update(){
1182
 
1183
  apbct_maintance_mode__disable();
1184
 
1185
- $result = activate_plugins( $plugin );
1186
 
1187
  // Changing response UP_TO_DATE to OK
1188
  if($upgrader->apbct_result === 'UP_TO_DATE')
@@ -1438,7 +1442,7 @@ function apbct_store__urls(){
1438
  // Saving
1439
  $apbct->settings['store_urls__sessions']
1440
  ? apbct_alt_session__save('apbct_urls', json_encode($urls))
1441
- : setcookie('apbct_urls', json_encode($urls), time()+86400*3, '/', parse_url(get_option('siteurl'),PHP_URL_HOST), false, true);
1442
 
1443
  // REFERER
1444
  // Get current fererer
@@ -1455,7 +1459,7 @@ function apbct_store__urls(){
1455
 
1456
  $apbct->settings['store_urls__sessions']
1457
  ? apbct_alt_session__save('apbct_site_referer', $new_site_referer)
1458
- : setcookie('apbct_site_referer', $new_site_referer, time()+86400*3, '/', parse_url(get_option('siteurl'),PHP_URL_HOST), false, true);
1459
  }
1460
 
1461
  $apbct->flags__url_stored = true;
@@ -1463,6 +1467,29 @@ function apbct_store__urls(){
1463
  }
1464
  }
1465
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1466
  /*
1467
  * Set Cookies test for cookie test
1468
  * Sets cookies with pararms timestamp && landing_timestamp && pervious_referer
@@ -1504,7 +1531,7 @@ function apbct_cookie(){
1504
  $apbct_timestamp = time();
1505
  $apbct->settings['set_cookies__sessions']
1506
  ? apbct_alt_session__save('apbct_timestamp', $apbct_timestamp)
1507
- : setcookie('apbct_timestamp', $apbct_timestamp, 0, '/', $domain, false, true);
1508
  $cookie_test_value['cookies_names'][] = 'apbct_timestamp';
1509
  $cookie_test_value['check_value'] .= $apbct_timestamp;
1510
  }
@@ -1513,7 +1540,7 @@ function apbct_cookie(){
1513
  if(apbct_get_server_variable( 'HTTP_REFERER' )){
1514
  $apbct->settings['set_cookies__sessions']
1515
  ? apbct_alt_session__save('apbct_prev_referer', apbct_get_server_variable( 'HTTP_REFERER' ))
1516
- : setcookie('apbct_prev_referer', apbct_get_server_variable( 'HTTP_REFERER' ), 0, '/', $domain, false, true);
1517
  $cookie_test_value['cookies_names'][] = 'apbct_prev_referer';
1518
  $cookie_test_value['check_value'] .= apbct_get_server_variable( 'HTTP_REFERER' );
1519
  }
@@ -1526,7 +1553,7 @@ function apbct_cookie(){
1526
  $site_landing_timestamp = time();
1527
  $apbct->settings['set_cookies__sessions']
1528
  ? apbct_alt_session__save('apbct_site_landing_ts', $site_landing_timestamp)
1529
- : setcookie('apbct_site_landing_ts', $site_landing_timestamp, 0, '/', $domain, false, true);
1530
  }
1531
  $cookie_test_value['cookies_names'][] = 'apbct_site_landing_ts';
1532
  $cookie_test_value['check_value'] .= $site_landing_timestamp;
@@ -1541,7 +1568,7 @@ function apbct_cookie(){
1541
 
1542
  $apbct->settings['set_cookies__sessions']
1543
  ? apbct_alt_session__save('apbct_page_hits', $page_hits)
1544
- : setcookie('apbct_page_hits', $page_hits, 0, '/', $domain, false, true);
1545
 
1546
  $cookie_test_value['cookies_names'][] = 'apbct_page_hits';
1547
  $cookie_test_value['check_value'] .= $page_hits;
@@ -1549,7 +1576,7 @@ function apbct_cookie(){
1549
  // Cookies test
1550
  $cookie_test_value['check_value'] = md5($cookie_test_value['check_value']);
1551
  if(!$apbct->settings['set_cookies__sessions'])
1552
- setcookie('apbct_cookies_test', urlencode(json_encode($cookie_test_value)), 0, '/', $domain, false, true);
1553
 
1554
  $apbct->flags__cookies_setuped = true;
1555
 
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.131
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  Text Domain: cleantalk
226
  if( $apbct->plugin_version == APBCT_VERSION && // Do not call with first start
227
  $apbct->settings['spam_firewall'] == 1 &&
228
  apbct_is_get() &&
229
+ ! apbct_wp_doing_cron()
230
  ){
231
  apbct_sfw__check();
232
  }
553
  $apbct->data['sfw_counter']['all']++;
554
  $apbct->saveData();
555
  if(!headers_sent())
556
+ apbct_cookie__set ('ct_sfw_passed', '0', time()+86400*3, '/', parse_url(get_option('siteurl'),PHP_URL_HOST), false, true, 'Lax' );
557
  }
558
  break;
559
  }else{
1161
  $title = __('Update Plugin');
1162
  $nonce = 'upgrade-plugin_' . $plugin;
1163
  $url = 'update.php?action=upgrade-plugin&plugin=' . urlencode( $plugin );
1164
+ $activate_for_network = false;
1165
+ if( APBCT_WPMS && is_main_site() && array_key_exists( $plugin, get_site_option( 'active_sitewide_plugins' ) ) ) {
1166
+ $activate_for_network = true;
1167
+ }
1168
 
1169
  $prev_version = APBCT_VERSION;
1170
 
1186
 
1187
  apbct_maintance_mode__disable();
1188
 
1189
+ $result = activate_plugins( $plugin, '', $activate_for_network );
1190
 
1191
  // Changing response UP_TO_DATE to OK
1192
  if($upgrader->apbct_result === 'UP_TO_DATE')
1442
  // Saving
1443
  $apbct->settings['store_urls__sessions']
1444
  ? apbct_alt_session__save('apbct_urls', json_encode($urls))
1445
+ : apbct_cookie__set('apbct_urls', json_encode($urls), time()+86400*3, '/', parse_url(get_option('siteurl'),PHP_URL_HOST), false, true, 'Lax');
1446
 
1447
  // REFERER
1448
  // Get current fererer
1459
 
1460
  $apbct->settings['store_urls__sessions']
1461
  ? apbct_alt_session__save('apbct_site_referer', $new_site_referer)
1462
+ : apbct_cookie__set('apbct_site_referer', $new_site_referer, time()+86400*3, '/', parse_url(get_option('siteurl'),PHP_URL_HOST), false, true, 'Lax');
1463
  }
1464
 
1465
  $apbct->flags__url_stored = true;
1467
  }
1468
  }
1469
 
1470
+ function apbct_cookie__set($name, $value = '', $expires = 0, $path = '', $domain = null, $secure = false, $httponly = false, $samesite = null ){
1471
+
1472
+ // For PHP 7.3+ and above
1473
+ if( version_compare( phpversion(), '7.3.0', '>=' ) ){
1474
+
1475
+ $params = array(
1476
+ 'expires' => $expires,
1477
+ 'path' => $path,
1478
+ 'domain' => $domain,
1479
+ 'secure' => $secure,
1480
+ 'httponly' => $httponly,
1481
+ );
1482
+
1483
+ if($samesite)
1484
+ $params['samesite'] = $samesite;
1485
+
1486
+ setcookie( $name, $value, $params );
1487
+
1488
+ // For PHP 5.6 - 7.2
1489
+ }else
1490
+ setcookie( $name, $value, $expires, $path, $domain, $secure, $httponly );
1491
+ }
1492
+
1493
  /*
1494
  * Set Cookies test for cookie test
1495
  * Sets cookies with pararms timestamp && landing_timestamp && pervious_referer
1531
  $apbct_timestamp = time();
1532
  $apbct->settings['set_cookies__sessions']
1533
  ? apbct_alt_session__save('apbct_timestamp', $apbct_timestamp)
1534
+ : apbct_cookie__set('apbct_timestamp', $apbct_timestamp, 0, '/', $domain, false, true, 'Lax' );
1535
  $cookie_test_value['cookies_names'][] = 'apbct_timestamp';
1536
  $cookie_test_value['check_value'] .= $apbct_timestamp;
1537
  }
1540
  if(apbct_get_server_variable( 'HTTP_REFERER' )){
1541
  $apbct->settings['set_cookies__sessions']
1542
  ? apbct_alt_session__save('apbct_prev_referer', apbct_get_server_variable( 'HTTP_REFERER' ))
1543
+ : apbct_cookie__set('apbct_prev_referer', apbct_get_server_variable( 'HTTP_REFERER' ), 0, '/', $domain, false, true, 'Lax' );
1544
  $cookie_test_value['cookies_names'][] = 'apbct_prev_referer';
1545
  $cookie_test_value['check_value'] .= apbct_get_server_variable( 'HTTP_REFERER' );
1546
  }
1553
  $site_landing_timestamp = time();
1554
  $apbct->settings['set_cookies__sessions']
1555
  ? apbct_alt_session__save('apbct_site_landing_ts', $site_landing_timestamp)
1556
+ : apbct_cookie__set('apbct_site_landing_ts', $site_landing_timestamp, 0, '/', $domain, false, true, 'Lax' );
1557
  }
1558
  $cookie_test_value['cookies_names'][] = 'apbct_site_landing_ts';
1559
  $cookie_test_value['check_value'] .= $site_landing_timestamp;
1568
 
1569
  $apbct->settings['set_cookies__sessions']
1570
  ? apbct_alt_session__save('apbct_page_hits', $page_hits)
1571
+ : apbct_cookie__set('apbct_page_hits', $page_hits, 0, '/', $domain, false, true, 'Lax' );
1572
 
1573
  $cookie_test_value['cookies_names'][] = 'apbct_page_hits';
1574
  $cookie_test_value['check_value'] .= $page_hits;
1576
  // Cookies test
1577
  $cookie_test_value['check_value'] = md5($cookie_test_value['check_value']);
1578
  if(!$apbct->settings['set_cookies__sessions'])
1579
+ apbct_cookie__set('apbct_cookies_test', urlencode(json_encode($cookie_test_value)), 0, '/', $domain, false, true, 'Lax' );
1580
 
1581
  $apbct->flags__cookies_setuped = true;
1582
 
inc/cleantalk-admin.php CHANGED
@@ -470,6 +470,7 @@ function apbct_admin__notice_message(){
470
  "<a href='{$settings_link}'>".$apbct->plugin_name."</a>",
471
  "<a href=\"http://cleantalk.org/my/bill/recharge?utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%20backend%20trial$user_token&cp_mode=antispam\" target=\"_blank\"><b>premium version</b></a>") .
472
  '</h3>
 
473
  </div>';
474
  $apbct->notice_show = false;
475
  }
470
  "<a href='{$settings_link}'>".$apbct->plugin_name."</a>",
471
  "<a href=\"http://cleantalk.org/my/bill/recharge?utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%20backend%20trial$user_token&cp_mode=antispam\" target=\"_blank\"><b>premium version</b></a>") .
472
  '</h3>
473
+ <h4 style = "color: gray">If you already paid for the service, please, re-save the plugin settings (WP Dashboard —> Settings —> Anti-Spam by CleanTalk) to dismiss the notice.</h4>
474
  </div>';
475
  $apbct->notice_show = false;
476
  }
inc/cleantalk-pluggable.php CHANGED
@@ -269,4 +269,20 @@ function apbct_is_in_referer( $str ){
269
 
270
  function apbct_is_in_uri( $str ){
271
  return stripos( apbct_get_server_variable('REQUEST_URI'), $str ) !== false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  }
269
 
270
  function apbct_is_in_uri( $str ){
271
  return stripos( apbct_get_server_variable('REQUEST_URI'), $str ) !== false;
272
+ }
273
+
274
+ /*
275
+ * Checking if current request is a cron job
276
+ * Support for wordpress < 4.8.0
277
+ *
278
+ * @return bool
279
+ */
280
+ function apbct_wp_doing_cron() {
281
+
282
+ if( function_exists( 'wp_doing_cron' ) ) {
283
+ return wp_doing_cron();
284
+ } else {
285
+ return ( defined( 'DOING_CRON' ) && DOING_CRON );
286
+ }
287
+
288
  }
inc/cleantalk-public.php CHANGED
@@ -115,6 +115,9 @@ function apbct_init() {
115
  // WooCommerce registration
116
  if(class_exists('WooCommerce')){
117
  add_filter( 'woocommerce_registration_errors', 'ct_registration_errors', 1, 3 );
 
 
 
118
  if( isset($_REQUEST['wc-ajax']) && $_REQUEST['wc-ajax'] == 'checkout' && $apbct->settings['wc_checkout_test'] == 0 && $apbct->settings['wc_register_from_order'] == 0 ){
119
  remove_filter( 'woocommerce_registration_errors', 'ct_registration_errors', 1 );
120
  }
@@ -718,6 +721,51 @@ function apbct_forms__search__testSpam( $search ){
718
  return $search;
719
  }
720
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
721
  /**
722
  * Public function - Tests for Pirate contact froms
723
  * return NULL
@@ -3063,29 +3111,21 @@ function ct_contact_form_validate() {
3063
  (isset($_POST['action']) && $_POST['action'] == 'wilcity_reset_password') || // Exception for reset password form. From Analysis uid=430898
3064
  (isset($_POST['action']) && $_POST['action'] == 'wilcity_login') || // Exception for login form. From Analysis uid=430898
3065
  (isset($_POST['qcfsubmit'])) || //Exception for submit quick forms - duplicates with qcfvalidate
3066
- apbct_is_in_uri('wc-ajax=update_order_review')
3067
  ) {
3068
  return null;
3069
  }
3070
 
 
 
 
 
3071
  // Do not execute anti-spam test for logged in users.
3072
  if (isset($_COOKIE[LOGGED_IN_COOKIE]) && $apbct->settings['protect_logged_in'] != 1)
3073
  return null;
3074
 
3075
  $post_info['comment_type'] = 'feedback_general_contact_form';
3076
 
3077
- // Skip the test if it's WooCommerce and the checkout test unset
3078
- if( apbct_is_in_uri('wc-ajax=checkout') ||
3079
- apbct_is_in_referer('wc-ajax=update_order_review') ||
3080
- !empty($_POST['woocommerce_checkout_place_order']) ||
3081
- apbct_is_in_uri('wc-ajax=wc_ppec_start_checkout')
3082
- ){
3083
- if($apbct->settings['wc_checkout_test'] == 0){
3084
- return null;
3085
- }
3086
- $post_info['comment_type'] = 'order';
3087
- }
3088
-
3089
  $ct_temp_msg_data = ct_get_fields_any($_POST);
3090
 
3091
  $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
@@ -3168,17 +3208,7 @@ function ct_contact_form_validate() {
3168
  echo $response;
3169
  die();
3170
 
3171
- }elseif(isset($_POST['_wp_http_referer']) && strpos($_POST['_wp_http_referer'],'wc-ajax=update_order_review')){ //WooCommerce checkout ("Place Oreder button")
3172
- $result = Array(
3173
- 'result' => 'failure',
3174
- 'messages' => "<ul class=\"woocommerce-error\"><li>".$ct_result->comment."</li></ul>",
3175
- 'refresh' => 'false',
3176
- 'reload' => 'false'
3177
- );
3178
- print json_encode($result);
3179
- die();
3180
-
3181
- }elseif(isset($_POST['action']) && $_POST['action'] == 'ct_check_internal'){
3182
  return $ct_result->comment;
3183
 
3184
  }elseif(isset($_POST['vfb-submit']) && defined('VFB_VERSION')){
115
  // WooCommerce registration
116
  if(class_exists('WooCommerce')){
117
  add_filter( 'woocommerce_registration_errors', 'ct_registration_errors', 1, 3 );
118
+ if ($apbct->settings['wc_checkout_test'] == 1) {
119
+ add_filter('woocommerce_checkout_process', 'ct_woocommerce_checkout_check', 1, 3);
120
+ }
121
  if( isset($_REQUEST['wc-ajax']) && $_REQUEST['wc-ajax'] == 'checkout' && $apbct->settings['wc_checkout_test'] == 0 && $apbct->settings['wc_register_from_order'] == 0 ){
122
  remove_filter( 'woocommerce_registration_errors', 'ct_registration_errors', 1 );
123
  }
721
  return $search;
722
  }
723
 
724
+ /**
725
+ * Test woocommerce checkout form for spam
726
+ *
727
+ */
728
+ function ct_woocommerce_checkout_check() {
729
+
730
+ //Getting request params
731
+ $ct_temp_msg_data = ct_get_fields_any($_POST);
732
+
733
+ $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
734
+ $sender_nickname = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '');
735
+ $subject = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '');
736
+ $contact_form = ($ct_temp_msg_data['contact'] ? $ct_temp_msg_data['contact'] : true);
737
+ $message = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : array());
738
+
739
+ if($subject != '')
740
+ $message = array_merge(array('subject' => $subject), $message);
741
+
742
+ $post_info['comment_type'] = 'order';
743
+ $post_info['post_url'] = apbct_get_server_variable( 'HTTP_REFERER' );
744
+
745
+ //Making a call
746
+ $base_call_result = apbct_base_call(
747
+ array(
748
+ 'message' => $message,
749
+ 'sender_email' => $sender_email,
750
+ 'sender_nickname' => $sender_nickname,
751
+ 'post_info' => $post_info,
752
+ 'js_on' => apbct_js_test('ct_checkjs', $_COOKIE),
753
+ 'sender_info' => array('sender_url' => null),
754
+ )
755
+ );
756
+
757
+ $ct_result = $base_call_result['ct_result'];
758
+
759
+ if ($ct_result->allow == 0) {
760
+ wp_send_json(array(
761
+ 'result' => 'failure',
762
+ 'messages' => "<ul class=\"woocommerce-error\"><li>".$ct_result->comment."</li></ul>",
763
+ 'refresh' => 'false',
764
+ 'reload' => 'false'
765
+ ));
766
+ }
767
+ }
768
+
769
  /**
770
  * Public function - Tests for Pirate contact froms
771
  * return NULL
3111
  (isset($_POST['action']) && $_POST['action'] == 'wilcity_reset_password') || // Exception for reset password form. From Analysis uid=430898
3112
  (isset($_POST['action']) && $_POST['action'] == 'wilcity_login') || // Exception for login form. From Analysis uid=430898
3113
  (isset($_POST['qcfsubmit'])) || //Exception for submit quick forms - duplicates with qcfvalidate
3114
+ apbct_is_in_uri('tin-canny-learndash-reporting/src/h5p-xapi/process-xapi-statement.php?v=asd') //Skip Tin Canny plugin
3115
  ) {
3116
  return null;
3117
  }
3118
 
3119
+ //Skip woocommerce checkout
3120
+ if (apbct_is_in_uri('wc-ajax=update_order_review') || apbct_is_in_uri('wc-ajax=checkout') || !empty($_POST['woocommerce_checkout_place_order']) || apbct_is_in_uri('wc-ajax=wc_ppec_start_checkout') || apbct_is_in_referer('wc-ajax=update_order_review')) {
3121
+ return null;
3122
+ }
3123
  // Do not execute anti-spam test for logged in users.
3124
  if (isset($_COOKIE[LOGGED_IN_COOKIE]) && $apbct->settings['protect_logged_in'] != 1)
3125
  return null;
3126
 
3127
  $post_info['comment_type'] = 'feedback_general_contact_form';
3128
 
 
 
 
 
 
 
 
 
 
 
 
 
3129
  $ct_temp_msg_data = ct_get_fields_any($_POST);
3130
 
3131
  $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '');
3208
  echo $response;
3209
  die();
3210
 
3211
+ }elseif(isset($_POST['action']) && $_POST['action'] == 'ct_check_internal'){
 
 
 
 
 
 
 
 
 
 
3212
  return $ct_result->comment;
3213
 
3214
  }elseif(isset($_POST['vfb-submit']) && defined('VFB_VERSION')){
inc/cleantalk-settings.php CHANGED
@@ -610,7 +610,9 @@ function apbct_settings__display() {
610
  function apbct_settings__display__network(){
611
  // If it's network admin dashboard
612
  if(is_network_admin()){
613
- $link = get_site_option('siteurl').'wp-admin/options-general.php?page=cleantalk';
 
 
614
  printf("<h2>" . __("Please, enter the %splugin settings%s in main site dashboard.", 'cleantalk') . "</h2>", "<a href='$link'>", "</a>");
615
  return;
616
  }
@@ -860,7 +862,7 @@ function apbct_settings__field__apikey(){
860
  echo '<input checked type="checkbox" id="license_agreed" onclick="apbctSettingsDependencies(\'apbct_setting---get_key_auto\');"/>';
861
  echo '<label for="spbc_license_agreed">';
862
  printf( __('I accept %sLicense Agreement%s.', 'cleantalk'),
863
- '<a href="https://cleantalk.org/publicoffer" target="_blank" style="color:#66b;">',
864
  '</a>'
865
  );
866
  echo "</label>";
@@ -1217,7 +1219,7 @@ function apbct_settings__validate($settings) {
1217
  $result === false
1218
  ? $apbct->error_add( 'exclusions_urls', 'is not valid: "' . $settings['exclusions__urls'] . '"', 'settings_validate' )
1219
  : $apbct->error_delete( 'exclusions_urls', true, 'settings_validate' );
1220
- $settings['exclusions_urls'] = $result ? $result: '';
1221
 
1222
  // Fields
1223
  $result = apbct_settings__sanitize__exclusions($settings['exclusions__fields'], $settings['exclusions__fields__use_regexp']);
610
  function apbct_settings__display__network(){
611
  // If it's network admin dashboard
612
  if(is_network_admin()){
613
+ $site_url = get_site_option('siteurl');
614
+ $site_url = preg_match( '/\/$/', $site_url ) ? $site_url : $site_url . '/';
615
+ $link = $site_url . 'wp-admin/options-general.php?page=cleantalk';
616
  printf("<h2>" . __("Please, enter the %splugin settings%s in main site dashboard.", 'cleantalk') . "</h2>", "<a href='$link'>", "</a>");
617
  return;
618
  }
862
  echo '<input checked type="checkbox" id="license_agreed" onclick="apbctSettingsDependencies(\'apbct_setting---get_key_auto\');"/>';
863
  echo '<label for="spbc_license_agreed">';
864
  printf( __('I accept %sLicense Agreement%s.', 'cleantalk'),
865
+ '<a class = "apbct_color--gray" href="https://cleantalk.org/publicoffer" target="_blank">',
866
  '</a>'
867
  );
868
  echo "</label>";
1219
  $result === false
1220
  ? $apbct->error_add( 'exclusions_urls', 'is not valid: "' . $settings['exclusions__urls'] . '"', 'settings_validate' )
1221
  : $apbct->error_delete( 'exclusions_urls', true, 'settings_validate' );
1222
+ $settings['exclusions__urls'] = $result ? $result: '';
1223
 
1224
  // Fields
1225
  $result = apbct_settings__sanitize__exclusions($settings['exclusions__fields'], $settings['exclusions__fields__use_regexp']);
lib/Cleantalk.php CHANGED
@@ -489,16 +489,19 @@ class Cleantalk {
489
  }
490
  }
491
 
492
- if (!$result || !CleantalkHelper::is_json($result)) {
493
  $response = null;
494
- $response['errno'] = 1;
495
- if ($curl_error) {
496
- $response['errstr'] = sprintf("CURL error: '%s'", $curl_error);
497
- } else {
498
- $response['errstr'] = 'No CURL support compiled in';
499
  }
500
- $response['errstr'] .= ' or disabled allow_url_fopen in php.ini.';
501
- $response = json_decode(json_encode($response));
 
 
 
 
 
502
 
503
  return $response;
504
  }
489
  }
490
  }
491
 
492
+ if (!$result) {
493
  $response = null;
494
+ $response['errno'] = 2;
495
+ if (!CleantalkHelper::is_json($result)) {
496
+ $response['errstr'] = 'Wrong server response format: ' . substr( $result, 100 );
 
 
497
  }
498
+ else {
499
+ $response['errstr'] = $curl_error
500
+ ? sprintf( "CURL error: '%s'", $curl_error )
501
+ : 'No CURL support compiled in';
502
+ $response['errstr'] .= ' or disabled allow_url_fopen in php.ini.';
503
+ }
504
+ $response = json_decode( json_encode( $response ) );
505
 
506
  return $response;
507
  }
lib/Cleantalk/Antispam/Helper.php CHANGED
@@ -151,7 +151,17 @@ class Helper
151
  }
152
 
153
  // Is private network
154
- if($ip_type === false || ($ip_type && (self::ip__is_private_network($ips['real'], $ip_type) || self::ip__mask_match($ips['real'], isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] . '/24' : '127.0.0.1' . '/24', $ip_type)))){
 
 
 
 
 
 
 
 
 
 
155
 
156
  // X-Forwarded-For
157
  if(isset($headers['X-Forwarded-For'])){
151
  }
152
 
153
  // Is private network
154
+ if($ip_type === false ||
155
+ ($ip_type &&
156
+ (self::ip__is_private_network($ips['real'], $ip_type) ||
157
+ self::ip__mask_match(
158
+ $ips['real'],
159
+ (isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] . '/24' : '127.0.0.1/24'),
160
+ $ip_type
161
+ )
162
+ )
163
+ )
164
+ ){
165
 
166
  // X-Forwarded-For
167
  if(isset($headers['X-Forwarded-For'])){
readme.txt CHANGED
@@ -1,13 +1,13 @@
1
  === Spam protection, AntiSpam, FireWall by CleanTalk ===
2
  Contributors: safronik
3
- Tags: spam, antispam, protection, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 5.3
6
  Requires PHP: 5.4
7
- Stable tag: 5.130.1
8
  License: GPLv2
9
 
10
- Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
11
 
12
  == Description ==
13
 
@@ -140,7 +140,7 @@ your safety.
140
  Service CleanTalk (this plugin is a client application for CleanTalk anti-spam service) records all filtered comments, registration and other spam attacks in the "Log of spam attacks" and stores the data in the log for up to 45 days. Using the log, you can ensure reliable protection of your website from spam and no false/positive filtering.
141
 
142
  = Spam FireWall =
143
- CleanTalk has an advanced option "Spam FireWall". This option allows blocking the most active spam bots before they get access to your website. It prevents spam bots from loading website pages so your web server doesn't have to perform all scripts on these pages. Also it prevents scanning of pages of the website by spam bots. Therefore Spam FireWall significantly reduces the load on your web server. Spam FireWall also makes CleanTalk the two-step protection from spam bots. Spam FireWall is the first step and it blocks the most active spam bots. CleanTalk Anti-Spam is the second step and checks all other requests on the website in the moment of submitting comments/registers etc.
144
 
145
  Spam FireWall is fully compatible with the most popular VPN services.
146
  Also, Spam FireWall supports all search engines Google, Bing, Yahoo, Baidu, MSN, Yandex and etc.
@@ -181,6 +181,7 @@ our own CleanTalk Cloud Service. Anti Spam by CleanTalk offers a free trial, you
181
  * Traffic increase and loyalty to the users.
182
  * 24/7 technical support.
183
  * Clear stats.
 
184
  * No captcha (reCaptcha), puzzles, etc.
185
  * Free mobile app to control anti-spam protection on your website.
186
 
@@ -197,7 +198,7 @@ The most popular anti spam method is CAPTCHA - the annoying picture with curved
197
  You do not have to work in IT to know what spam is. Besides piles of unwanted email, there are spam bots, or special software programs designed to act as human website visitors that post unwelcome messages over the Internet to advertise dubious services. More often than not spam messages do not even make sense. Similar to bacteria and virus mutations developing antibiotic resistance, spam bots are becoming more resilient in penetrating Internet firewalls and security layers.
198
 
199
  = CleanTalk's features =
200
- Anti-Spam by CleanTalk is one of the fastest plugins that allows you to lower the server load. One of the important parameters for each webmaster is the speed of the site, so we make sure that our plugin consumes as few server resources as possible. The Cloud Service provides the advantage: all data processing takes place in the Cloud.
201
 
202
  CleanTalk team has developed unique anti spam algorithms to assess visitors behavior. CleanTalk analyzes user behavior and the parameters of the filled forms. Our anti-spam module, being installed in your website, sends the behavior parameters of either a visitor or a spam bot. When these parameters are estimated, the anti spam service makes a decision - to post a message or to define it as spam and reject it. Based on these checks, the service forms its own list of email addresses used by spam bots.
203
 
@@ -567,6 +568,14 @@ If your website has forms that send data to external sources, you can enable opt
567
  10. Website's options.
568
 
569
  == Changelog ==
 
 
 
 
 
 
 
 
570
  = 5.130.1 November 20 2019 =
571
  * Fix: Plugin autoupdate issues.
572
  * FIx: Woocommerce checking.
1
  === Spam protection, AntiSpam, FireWall by CleanTalk ===
2
  Contributors: safronik
3
+ Tags: spam, antispam, woocommerce, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 5.3
6
  Requires PHP: 5.4
7
+ Stable tag: 5.131
8
  License: GPLv2
9
 
10
+ Spam protection, antispam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
11
 
12
  == Description ==
13
 
140
  Service CleanTalk (this plugin is a client application for CleanTalk anti-spam service) records all filtered comments, registration and other spam attacks in the "Log of spam attacks" and stores the data in the log for up to 45 days. Using the log, you can ensure reliable protection of your website from spam and no false/positive filtering.
141
 
142
  = Spam FireWall =
143
+ CleanTalk has an advanced option "Spam FireWall". Spam FireWall allows blocking the most active spam bots before they get access to your website. It prevents spam bots from loading website pages so your web server doesn't have to perform all scripts on these pages. Also it prevents scanning of pages of the website by spam bots. Therefore Spam FireWall significantly reduces the load on your web server. Spam FireWall also makes CleanTalk the two-step protection from spam bots. Spam FireWall is the first step and it blocks the most active spam bots. CleanTalk Anti-Spam is the second step and checks all other requests on the website in the moment of submitting comments/registers etc.
144
 
145
  Spam FireWall is fully compatible with the most popular VPN services.
146
  Also, Spam FireWall supports all search engines Google, Bing, Yahoo, Baidu, MSN, Yandex and etc.
181
  * Traffic increase and loyalty to the users.
182
  * 24/7 technical support.
183
  * Clear stats.
184
+ * Spam FireWall.
185
  * No captcha (reCaptcha), puzzles, etc.
186
  * Free mobile app to control anti-spam protection on your website.
187
 
198
  You do not have to work in IT to know what spam is. Besides piles of unwanted email, there are spam bots, or special software programs designed to act as human website visitors that post unwelcome messages over the Internet to advertise dubious services. More often than not spam messages do not even make sense. Similar to bacteria and virus mutations developing antibiotic resistance, spam bots are becoming more resilient in penetrating Internet firewalls and security layers.
199
 
200
  = CleanTalk's features =
201
+ Anti-Spam by CleanTalk with Spam FireWall is one of the fastest plugins that allows you to lower the server load. One of the important parameters for each webmaster is the speed of the site, so we make sure that our plugin consumes as few server resources as possible. The Cloud Service provides the advantage: all data processing takes place in the Cloud.
202
 
203
  CleanTalk team has developed unique anti spam algorithms to assess visitors behavior. CleanTalk analyzes user behavior and the parameters of the filled forms. Our anti-spam module, being installed in your website, sends the behavior parameters of either a visitor or a spam bot. When these parameters are estimated, the anti spam service makes a decision - to post a message or to define it as spam and reject it. Based on these checks, the service forms its own list of email addresses used by spam bots.
204
 
568
  10. Website's options.
569
 
570
  == Changelog ==
571
+ = 5.131 December 6 2019 =
572
+ * Fix: WooCommerce registration.
573
+ * Fix: Auto update on Wordperss Multisite.
574
+ * Fix: URLs exceptions validation.
575
+ * New: Secuirty improved.
576
+ * Spam protection is improved.
577
+ * Minor fixes ond improvments.
578
+
579
  = 5.130.1 November 20 2019 =
580
  * Fix: Plugin autoupdate issues.
581
  * FIx: Woocommerce checking.