Spam protection, AntiSpam, FireWall by CleanTalk - Version 4.21

Version Description

2015-03-11 = * Added license renew notification.

Download this release

Release Info

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

Code changes from version 4.20 to 4.21

cleantalk-admin.php CHANGED
@@ -25,7 +25,7 @@ function ct_admin_add_page() {
25
  * Admin action 'admin_init' - Add the admin settings and such
26
  */
27
  function ct_admin_init() {
28
- global $show_ct_notice_trial, $ct_notice_trial_label, $show_ct_notice_online, $ct_notice_online_label, $trial_notice_showtime, $ct_plugin_name, $ct_options, $trial_notice_check_timeout, $account_notice_check_timeout, $ct_user_token_label, $ct_account_status_check;
29
 
30
  $ct_options = ct_get_options();
31
 
@@ -35,14 +35,20 @@ function ct_admin_init() {
35
  $show_ct_notice_trial = true;
36
  }
37
  }
 
 
 
 
 
 
38
 
39
  if (time() > $ct_options['next_account_status_check']) {
40
  $result = false;
41
  if (function_exists('curl_init') && function_exists('json_decode') && ct_valid_key($ct_options['apikey'])) {
42
- $url = 'https://cleantalk.org/app_notice';
43
  $server_timeout = 2;
44
  $data['auth_key'] = $ct_options['apikey'];
45
- $data['param'] = 'notice_paid_till';
46
 
47
  $ch = curl_init();
48
  curl_setopt($ch, CURLOPT_URL, $url);
@@ -61,13 +67,19 @@ function ct_admin_init() {
61
  $result = curl_exec($ch);
62
  curl_close($ch);
63
 
64
- $notice_check_timeout = $trial_notice_check_timeout;
65
  if ($result) {
66
  $result = json_decode($result, true);
 
 
67
  if (isset($result['show_notice'])) {
68
  if ($result['show_notice'] == 1 && isset($result['trial']) && $result['trial'] == 1) {
 
69
  $show_ct_notice_trial = true;
70
  }
 
 
 
 
71
 
72
  if ($result['show_notice'] == 0) {
73
  $notice_check_timeout = $account_notice_check_timeout;
@@ -86,7 +98,12 @@ function ct_admin_init() {
86
  }
87
 
88
  if ($result) {
89
- setcookie($ct_notice_trial_label, (string) $show_ct_notice_trial, strtotime("+$trial_notice_showtime minutes"), '/');
 
 
 
 
 
90
  }
91
  }
92
 
@@ -262,7 +279,7 @@ input[type=submit] {padding: 10px; background: #3399FF; color: #fff; border:0 no
262
  * @return bool
263
  */
264
  function admin_notice_message(){
265
- global $show_ct_notice_trial, $show_ct_notice_online, $ct_plugin_name, $ct_options;
266
 
267
  $user_token = '';
268
  if (isset($ct_options['user_token']) && $ct_options['user_token'] != '') {
@@ -280,6 +297,12 @@ function admin_notice_message(){
280
  $show_notice = false;
281
  }
282
 
 
 
 
 
 
 
283
  if ($show_notice && $show_ct_notice_online != '') {
284
  echo '<div class="updated"><h3><b>';
285
  if($show_ct_notice_online === 'Y'){
@@ -452,7 +475,6 @@ function ct_update_option($option_name) {
452
  return;
453
  }
454
 
455
-
456
  // Skip test call if the function executet during account status check
457
  if ($ct_account_status_check > 0 && time() - $ct_account_status_check < 5) {
458
  return;
25
  * Admin action 'admin_init' - Add the admin settings and such
26
  */
27
  function ct_admin_init() {
28
+ global $show_ct_notice_renew, $ct_notice_renew_label, $show_ct_notice_trial, $ct_notice_trial_label, $show_ct_notice_online, $ct_notice_online_label, $renew_notice_showtime, $trial_notice_showtime, $ct_plugin_name, $ct_options, $trial_notice_check_timeout, $account_notice_check_timeout, $ct_user_token_label, $ct_account_status_check;
29
 
30
  $ct_options = ct_get_options();
31
 
35
  $show_ct_notice_trial = true;
36
  }
37
  }
38
+ $show_ct_notice_renew = false;
39
+ if (isset($_COOKIE[$ct_notice_renew_label])) {
40
+ if ($_COOKIE[$ct_notice_renew_label] == 1) {
41
+ $show_ct_notice_renew = true;
42
+ }
43
+ }
44
 
45
  if (time() > $ct_options['next_account_status_check']) {
46
  $result = false;
47
  if (function_exists('curl_init') && function_exists('json_decode') && ct_valid_key($ct_options['apikey'])) {
48
+ $url = 'https://api.cleantalk.org';
49
  $server_timeout = 2;
50
  $data['auth_key'] = $ct_options['apikey'];
51
+ $data['method_name'] = 'notice_paid_till';
52
 
53
  $ch = curl_init();
54
  curl_setopt($ch, CURLOPT_URL, $url);
67
  $result = curl_exec($ch);
68
  curl_close($ch);
69
 
 
70
  if ($result) {
71
  $result = json_decode($result, true);
72
+ $result = $result['data']; // !!!!
73
+
74
  if (isset($result['show_notice'])) {
75
  if ($result['show_notice'] == 1 && isset($result['trial']) && $result['trial'] == 1) {
76
+ $notice_check_timeout = $trial_notice_check_timeout;
77
  $show_ct_notice_trial = true;
78
  }
79
+ if ($result['show_notice'] == 1 && isset($result['renew']) && $result['renew'] == 1) {
80
+ $notice_check_timeout = $account_notice_check_timeout;
81
+ $show_ct_notice_renew = true;
82
+ }
83
 
84
  if ($result['show_notice'] == 0) {
85
  $notice_check_timeout = $account_notice_check_timeout;
98
  }
99
 
100
  if ($result) {
101
+ if($show_ct_notice_trial == true){
102
+ setcookie($ct_notice_trial_label, (string) $show_ct_notice_trial, strtotime("+$trial_notice_showtime minutes"), '/');
103
+ }
104
+ if($show_ct_notice_renew == true){
105
+ setcookie($ct_notice_renew_label, (string) $show_ct_notice_renew, strtotime("+$renew_notice_showtime minutes"), '/');
106
+ }
107
  }
108
  }
109
 
279
  * @return bool
280
  */
281
  function admin_notice_message(){
282
+ global $show_ct_notice_trial, $show_ct_notice_renew, $show_ct_notice_online, $ct_plugin_name, $ct_options;
283
 
284
  $user_token = '';
285
  if (isset($ct_options['user_token']) && $ct_options['user_token'] != '') {
297
  $show_notice = false;
298
  }
299
 
300
+ if ($show_notice && $show_ct_notice_renew) {
301
+ $button_html = "<a href=\"http://cleantalk.org/my/bill/recharge?utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%20backend%20renew$user_token\" target=\"_blank\">" . '<input type="button" class="button button-primary" value="' . __('RENEW ANTI-SPAM', 'cleantalk') . '" />' . "</a>";
302
+ echo '<div class="updated"><h3>' . sprintf(__("Please renew your anti-spam license for %s.", 'cleantalk'), "<a href=\"http://cleantalk.org/my/bill/recharge?utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%20backend%20renew$user_token\" target=\"_blank\"><b>" . __('next year', 'cleantalk') ."</b></a>") . '<br /><br />' . $button_html . '</h3></div>';
303
+ $show_notice = false;
304
+ }
305
+
306
  if ($show_notice && $show_ct_notice_online != '') {
307
  echo '<div class="updated"><h3><b>';
308
  if($show_ct_notice_online === 'Y'){
475
  return;
476
  }
477
 
 
478
  // Skip test call if the function executet during account status check
479
  if ($ct_account_status_check > 0 && time() - $ct_account_status_check < 5) {
480
  return;
cleantalk-common.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- $ct_agent_version = 'wordpress-420';
4
  $ct_plugin_name = 'Anti-spam by CleanTalk';
5
  $ct_checkjs_frm = 'ct_checkjs_frm';
6
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
@@ -35,6 +35,12 @@ $ct_notice_trial_label = 'ct_notice_trial';
35
  // Flag to show trial notice
36
  $show_ct_notice_trial = false;
37
 
 
 
 
 
 
 
38
  // COOKIE label for online notice flag
39
  $ct_notice_online_label = 'ct_notice_online';
40
 
@@ -50,6 +56,9 @@ $account_notice_check_timeout = 24;
50
  // Trial notice show time in minutes
51
  $trial_notice_showtime = 10;
52
 
 
 
 
53
  // COOKIE label for WP Landing Page proccessing result
54
  $ct_wplp_result_label = 'ct_wplp_result';
55
 
1
  <?php
2
 
3
+ $ct_agent_version = 'wordpress-421';
4
  $ct_plugin_name = 'Anti-spam by CleanTalk';
5
  $ct_checkjs_frm = 'ct_checkjs_frm';
6
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
35
  // Flag to show trial notice
36
  $show_ct_notice_trial = false;
37
 
38
+ // COOKIE label for renew notice flag
39
+ $ct_notice_renew_label = 'ct_notice_renew';
40
+
41
+ // Flag to show renew notice
42
+ $show_ct_notice_renew = false;
43
+
44
  // COOKIE label for online notice flag
45
  $ct_notice_online_label = 'ct_notice_online';
46
 
56
  // Trial notice show time in minutes
57
  $trial_notice_showtime = 10;
58
 
59
+ // Renew notice show time in minutes
60
+ $renew_notice_showtime = 10;
61
+
62
  // COOKIE label for WP Landing Page proccessing result
63
  $ct_wplp_result_label = 'ct_wplp_result';
64
 
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.20
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.21
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
i18n/cleantalk-ru_RU.mo CHANGED
Binary file
readme.txt CHANGED
@@ -3,7 +3,7 @@ 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.20
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -175,6 +175,9 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
175
  1. Setup Android/iOS app to have push notices when new legitiamte comments/registrations or contactcs appears on the website.
176
 
177
  == Changelog ==
 
 
 
178
  = 4.20 2015-03-03 =
179
  * Added German, Italian, Polish, Portuguese translations.
180
  * Minor code fixes.
@@ -513,6 +516,9 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
513
  * First version
514
 
515
  == Upgrade Notice ==
 
 
 
516
  = 4.20 2015-03-03 =
517
  German, Italian, Polish, Portuguese translations, minor code fixes.
518
 
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.21
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
175
  1. Setup Android/iOS app to have push notices when new legitiamte comments/registrations or contactcs appears on the website.
176
 
177
  == Changelog ==
178
+ = 4.21 2015-03-11 =
179
+ * Added license renew notification.
180
+
181
  = 4.20 2015-03-03 =
182
  * Added German, Italian, Polish, Portuguese translations.
183
  * Minor code fixes.
516
  * First version
517
 
518
  == Upgrade Notice ==
519
+ = 4.21 2015-03-11 =
520
+ Added license renew notification.
521
+
522
  = 4.20 2015-03-03 =
523
  German, Italian, Polish, Portuguese translations, minor code fixes.
524