Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.103.1

Version Description

September 14 2018 = * Fix: Error when saving settings. * Fix: Error when getting key automatically.

Download this release

Release Info

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

Code changes from version 5.103 to 5.103.1

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.103
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
@@ -65,6 +65,11 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
65
  $apbct->base_name = 'cleantalk-spam-protect/cleantalk.php';
66
 
67
  $apbct->settings['apikey'] = defined('CLEANTALK_ACCESS_KEY') ? CLEANTALK_ACCESS_KEY : $apbct->settings['apikey'];
 
 
 
 
 
68
 
69
  // Self cron
70
  if(!defined('DOING_CRON') || (defined('DOING_CRON') && DOING_CRON !== true)){
@@ -864,5 +869,4 @@ function ct_mail_send_connection_report() {
864
  $apbct->data['connection_reports']['negative_report'] = array();
865
  $apbct->data['connection_reports']['since'] = date('d M');
866
  $apbct->saveData();
867
- CleantalkCron::updateTask('send_connection_report', 'ct_mail_send_connection_report', 3600);
868
  }
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.103.1
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
65
  $apbct->base_name = 'cleantalk-spam-protect/cleantalk.php';
66
 
67
  $apbct->settings['apikey'] = defined('CLEANTALK_ACCESS_KEY') ? CLEANTALK_ACCESS_KEY : $apbct->settings['apikey'];
68
+ $apbct->key_is_ok = !empty($apbct->data['key_is_ok']) ? $apbct->data['key_is_ok'] : 0;
69
+ $apbct->key_is_ok = isset($apbct->data['testing_failed']) && $apbct->data['testing_failed'] == 0 ? 1 : $apbct->key_is_ok;
70
+
71
+ $apbct->data['user_counter']['since'] = isset($apbct->data['user_counter']['since']) ? $apbct->data['user_counter']['since'] : date('d M');
72
+ $apbct->data['connection_reports']['since'] = isset($apbct->data['connection_reports']['since']) ? $apbct->data['user_counter']['since'] : date('d M');
73
 
74
  // Self cron
75
  if(!defined('DOING_CRON') || (defined('DOING_CRON') && DOING_CRON !== true)){
869
  $apbct->data['connection_reports']['negative_report'] = array();
870
  $apbct->data['connection_reports']['since'] = date('d M');
871
  $apbct->saveData();
 
872
  }
inc/cleantalk-admin.php CHANGED
@@ -95,7 +95,7 @@ function ct_dashboard_statistics_widget_output( $post, $callback_args ) {
95
  // Notice at the bottom
96
  if(isset($current_user) && in_array('administrator', $current_user->roles)){
97
 
98
- if($blocked > 0){
99
  echo '<div class="ct_widget_wprapper_total_blocked">'
100
  .'<img src="'.plugins_url('/cleantalk-spam-protect/inc/images/logo_color.png').'" class="ct_widget_small_logo"/>'
101
  .'<span title="'.__('This is the count from the CleanTalk\'s cloud and could be different to admin bar counters', 'cleantalk').'">'
95
  // Notice at the bottom
96
  if(isset($current_user) && in_array('administrator', $current_user->roles)){
97
 
98
+ if($apbct->spam_count && $apbct->spam_count > 0){
99
  echo '<div class="ct_widget_wprapper_total_blocked">'
100
  .'<img src="'.plugins_url('/cleantalk-spam-protect/inc/images/logo_color.png').'" class="ct_widget_small_logo"/>'
101
  .'<span title="'.__('This is the count from the CleanTalk\'s cloud and could be different to admin bar counters', 'cleantalk').'">'
inc/cleantalk-common.php CHANGED
@@ -362,9 +362,6 @@ function ct_send_feedback($feedback_request = null) {
362
 
363
  $ct->sendFeedback($ct_request);
364
 
365
- $ct->work_url = '162.243.144.2';
366
- $ct->server_change = true;
367
-
368
  if ($ct->server_change) {
369
  update_option(
370
  'cleantalk_server',
362
 
363
  $ct->sendFeedback($ct_request);
364
 
 
 
 
365
  if ($ct->server_change) {
366
  update_option(
367
  'cleantalk_server',
inc/cleantalk-public.php CHANGED
@@ -2303,9 +2303,6 @@ function ct_enqueue_scripts_public($hook){
2303
 
2304
  global $current_user, $apbct;
2305
 
2306
-
2307
-
2308
-
2309
  if($apbct->settings['registrations_test'] || $apbct->settings['comments_test'] || $apbct->settings['contact_forms_test'] || $apbct->settings['general_contact_forms_test'] || $apbct->settings['wc_checkout_test'] || $apbct->settings['check_external'] || $apbct->settings['check_internal'] || $apbct->settings['bp_private_messages'] || $apbct->settings['general_postdata_test']){
2310
 
2311
  // Differnt JS params
2303
 
2304
  global $current_user, $apbct;
2305
 
 
 
 
2306
  if($apbct->settings['registrations_test'] || $apbct->settings['comments_test'] || $apbct->settings['contact_forms_test'] || $apbct->settings['general_contact_forms_test'] || $apbct->settings['wc_checkout_test'] || $apbct->settings['check_external'] || $apbct->settings['check_internal'] || $apbct->settings['bp_private_messages'] || $apbct->settings['general_postdata_test']){
2307
 
2308
  // Differnt JS params
inc/cleantalk-settings.php CHANGED
@@ -701,8 +701,8 @@ function apbct_settings__validate($settings) {
701
  }
702
 
703
  // Auto getting key
704
- if (isset($_POST['submit']) && $_POST['submit'] == 'get_key_auto')
705
- {
706
  $website = parse_url(get_option('siteurl'),PHP_URL_HOST);
707
  $platform = 'wordpress';
708
  $timezone = $_POST['ct_admin_timezone'];
@@ -713,7 +713,6 @@ function apbct_settings__validate($settings) {
713
 
714
  if(isset($result['user_token'])){
715
  $apbct->data['user_token'] = $result['user_token'];
716
- $apbct->saveData();
717
  }
718
 
719
  if(!empty($result['auth_key'])){
@@ -722,6 +721,7 @@ function apbct_settings__validate($settings) {
722
 
723
  }else{
724
  $apbct->error_add('key_get', $result);
 
725
  }
726
  }
727
 
@@ -755,6 +755,10 @@ function apbct_settings__validate($settings) {
755
  $apbct->error_add('key_invalid', __('Testing is failed. Please check the Access key.', 'cleantalk'));
756
  }
757
 
 
 
 
 
758
  // Server error when notice_validate_key
759
  }else{
760
  $apbct->error_add('key_invalid', $result);
@@ -769,16 +773,15 @@ function apbct_settings__validate($settings) {
769
  }
770
 
771
  // A-B test with SFW
772
- if(!$apcbt->data['ab_test']['sfw_enabled']){
773
- if($apbct->service_id % 2 == 1)
774
  $settings['spam_firewall'] = 0;
775
  else
776
  $settings['spam_firewall'] = 1;
777
- $apcbt->data['ab_test']['sfw_enabled'] = true;
778
  }
779
-
780
- $apbct->saveData();
781
 
 
782
 
783
  return $settings;
784
  }
701
  }
702
 
703
  // Auto getting key
704
+ if (isset($_POST['submit']) && $_POST['submit'] == 'get_key_auto'){
705
+
706
  $website = parse_url(get_option('siteurl'),PHP_URL_HOST);
707
  $platform = 'wordpress';
708
  $timezone = $_POST['ct_admin_timezone'];
713
 
714
  if(isset($result['user_token'])){
715
  $apbct->data['user_token'] = $result['user_token'];
 
716
  }
717
 
718
  if(!empty($result['auth_key'])){
721
 
722
  }else{
723
  $apbct->error_add('key_get', $result);
724
+ return $settings;
725
  }
726
  }
727
 
755
  $apbct->error_add('key_invalid', __('Testing is failed. Please check the Access key.', 'cleantalk'));
756
  }
757
 
758
+ // Deleting legacy
759
+ if(isset($apbct->data['testing_failed']))
760
+ unset($apbct->data['testing_failed']);
761
+
762
  // Server error when notice_validate_key
763
  }else{
764
  $apbct->error_add('key_invalid', $result);
773
  }
774
 
775
  // A-B test with SFW
776
+ if(!$apbct->data['ab_test']['sfw_enabled']){
777
+ if($apbct->service_id && $apbct->service_id % 2 == 1)
778
  $settings['spam_firewall'] = 0;
779
  else
780
  $settings['spam_firewall'] = 1;
781
+ $apbct->data['ab_test']['sfw_enabled'] = true;
782
  }
 
 
783
 
784
+ $apbct->saveData();
785
 
786
  return $settings;
787
  }
lib/CleantalkState.php CHANGED
@@ -61,6 +61,7 @@ class CleantalkState
61
  'send_connection_reports' => 0, //Send connection reports to Cleantalk servers
62
  'show_link' => 0,
63
  'async_js' => 0,
 
64
 
65
  // GDPR
66
  'gdpr_forms_id' => '',
@@ -129,6 +130,7 @@ class CleantalkState
129
 
130
  // Misc
131
  'feedback_request' => '',
 
132
  );
133
 
134
  public $def_network_settings = array(
@@ -137,7 +139,7 @@ class CleantalkState
137
  'key_is_ok' => 0,
138
  'spbc_key' => '',
139
  'user_token' => '',
140
- 'service_id' => '',
141
  );
142
 
143
  public function __construct($option_prefix, $options = array('settings'), $wpms = false)
61
  'send_connection_reports' => 0, //Send connection reports to Cleantalk servers
62
  'show_link' => 0,
63
  'async_js' => 0,
64
+ 'debug_ajax' => 0,
65
 
66
  // GDPR
67
  'gdpr_forms_id' => '',
130
 
131
  // Misc
132
  'feedback_request' => '',
133
+ 'key_is_ok' => 0,
134
  );
135
 
136
  public $def_network_settings = array(
139
  'key_is_ok' => 0,
140
  'spbc_key' => '',
141
  'user_token' => '',
142
+ 'service_id' => 0,
143
  );
144
 
145
  public function __construct($option_prefix, $options = array('settings'), $wpms = false)
readme.txt CHANGED
@@ -516,6 +516,10 @@ Yes, it is. Please read this article,
516
  10. Website's options.
517
 
518
  == Changelog ==
 
 
 
 
519
  = 5.103 September 13 2018 =
520
  * Fix: Gravity Forms response message.
521
  * Fix: SpamFireWall redirect to 404 page.
@@ -1642,6 +1646,10 @@ Yes, it is. Please read this article,
1642
  * First version
1643
 
1644
  == Upgrade Notice ==
 
 
 
 
1645
  = 5.103 September 13 2018 =
1646
  * Fix: Gravity Forms response message.
1647
  * Fix: SpamFireWall redirect to 404 page.
516
  10. Website's options.
517
 
518
  == Changelog ==
519
+ = 5.103.1 September 14 2018 =
520
+ * Fix: Error when saving settings.
521
+ * Fix: Error when getting key automatically.
522
+
523
  = 5.103 September 13 2018 =
524
  * Fix: Gravity Forms response message.
525
  * Fix: SpamFireWall redirect to 404 page.
1646
  * First version
1647
 
1648
  == Upgrade Notice ==
1649
+ = 5.103.1 September 14 2018 =
1650
+ * Fix: Error when saving settings.
1651
+ * Fix: Error when getting key automatically.
1652
+
1653
  = 5.103 September 13 2018 =
1654
  * Fix: Gravity Forms response message.
1655
  * Fix: SpamFireWall redirect to 404 page.