Changeset 1109255
- Timestamp:
- 03/10/2015 07:00:58 AM (11 years ago)
- Location:
- cleantalk-spam-protect/trunk
- Files:
-
- 2 edited
-
cleantalk-admin.php (modified) (8 diffs)
-
cleantalk-common.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cleantalk-spam-protect/trunk/cleantalk-admin.php
r1103993 r1109255 26 26 */ 27 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;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 29 30 30 $ct_options = ct_get_options(); … … 36 36 } 37 37 } 38 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 ///$aaa = strtotime("+24 minutes", time()); 39 45 if (time() > $ct_options['next_account_status_check']) { 46 // if (TRUE) { 40 47 $result = false; 41 48 if (function_exists('curl_init') && function_exists('json_decode') && ct_valid_key($ct_options['apikey'])) { 42 $url = 'https:// cleantalk.org/app_notice';49 $url = 'https://api.cleantalk.org'; 43 50 $server_timeout = 2; 44 51 $data['auth_key'] = $ct_options['apikey']; 45 $data[' param'] = 'notice_paid_till';52 $data['method_name'] = 'notice_paid_till'; 46 53 47 54 $ch = curl_init(); … … 62 69 curl_close($ch); 63 70 64 $notice_check_timeout = $trial_notice_check_timeout;65 71 if ($result) { 66 72 $result = json_decode($result, true); 73 $result = $result['data']; // !!!! 74 //$result['show_notice'] = 1; 75 //$result['renew'] = 1; 76 67 77 if (isset($result['show_notice'])) { 68 78 if ($result['show_notice'] == 1 && isset($result['trial']) && $result['trial'] == 1) { 79 $notice_check_timeout = $trial_notice_check_timeout; 69 80 $show_ct_notice_trial = true; 81 } 82 if ($result['show_notice'] == 1 && isset($result['renew']) && $result['renew'] == 1) { 83 $notice_check_timeout = $account_notice_check_timeout; 84 $show_ct_notice_renew = true; 70 85 } 71 86 … … 81 96 82 97 // Save next status request time 83 $ct_options['next_account_status_check'] = strtotime("+$notice_check_timeout hours", time()); 98 // $ct_options['next_account_status_check'] = strtotime("+$notice_check_timeout hours", time()); 99 $ct_options['next_account_status_check'] = strtotime("+$notice_check_timeout minutes", time()); // MINUTES for debug 84 100 $ct_account_status_check = time(); 85 101 update_option('cleantalk_settings', $ct_options); … … 87 103 88 104 if ($result) { 89 setcookie($ct_notice_trial_label, (string) $show_ct_notice_trial, strtotime("+$trial_notice_showtime minutes"), '/'); 105 if($show_ct_notice_trial == true){ 106 setcookie($ct_notice_trial_label, (string) $show_ct_notice_trial, strtotime("+$trial_notice_showtime minutes"), '/'); 107 } 108 if($show_ct_notice_renew == true){ 109 setcookie($ct_notice_renew_label, (string) $show_ct_notice_renew, strtotime("+$renew_notice_showtime minutes"), '/'); 110 } 90 111 } 91 112 } … … 263 284 */ 264 285 function admin_notice_message(){ 265 global $show_ct_notice_trial, $show_ct_notice_ online, $ct_plugin_name, $ct_options;286 global $show_ct_notice_trial, $show_ct_notice_renew, $show_ct_notice_online, $ct_plugin_name, $ct_options; 266 287 267 288 $user_token = ''; … … 278 299 if ($show_notice && $show_ct_notice_trial) { 279 300 echo '<div class="updated"><h3>' . sprintf(__("%s trial period ends, please upgrade to %s!", 'cleantalk'), "<a href=\"options-general.php?page=cleantalk\">$ct_plugin_name</a>", "<a href=\"http://cleantalk.org/my/bill/recharge?utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%20backend%20trial$user_token\" target=\"_blank\"><b>premium version</b></a>") . '</h3></div>'; 301 $show_notice = false; 302 } 303 304 if ($show_notice && $show_ct_notice_renew) { 305 $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" />' . "</a>"; 306 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</b></a>") . '<br /><br />' . $button_html . '</h3></div>'; 280 307 $show_notice = false; 281 308 } … … 453 480 } 454 481 455 456 482 // Skip test call if the function executet during account status check 457 483 if ($ct_account_status_check > 0 && time() - $ct_account_status_check < 5) { -
cleantalk-spam-protect/trunk/cleantalk-common.php
r1104242 r1109255 1 1 <?php 2 2 3 $ct_agent_version = 'wordpress-42 0';3 $ct_agent_version = 'wordpress-421'; 4 4 $ct_plugin_name = 'Anti-spam by CleanTalk'; 5 5 $ct_checkjs_frm = 'ct_checkjs_frm'; … … 36 36 $show_ct_notice_trial = false; 37 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 38 44 // COOKIE label for online notice flag 39 45 $ct_notice_online_label = 'ct_notice_online'; … … 50 56 // Trial notice show time in minutes 51 57 $trial_notice_showtime = 10; 58 59 // Renew notice show time in minutes 60 //$renew_notice_showtime = 10; 61 $renew_notice_showtime = 2; 52 62 53 63 // COOKIE label for WP Landing Page proccessing result
Note: See TracChangeset
for help on using the changeset viewer.