Changeset 3487675
- Timestamp:
- 03/21/2026 09:14:43 AM (7 days ago)
- Location:
- rc-site-manager-optimization/trunk
- Files:
-
- 8 edited
-
agency/check_url/check_url_function.php (modified) (2 diffs)
-
crons/pagespeed.php (modified) (2 diffs)
-
includes/functions/pagespeed.php (modified) (2 diffs)
-
rc-site-manager-optimization.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
settings/settings_function.php (modified) (3 diffs)
-
settings/settings_script.js (modified) (5 diffs)
-
settings/tab_premium_fn.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
rc-site-manager-optimization/trunk/agency/check_url/check_url_function.php
r3487089 r3487675 74 74 $url_group = esc_html($row->url_group); 75 75 $last_response = $row->last_response; 76 $last_check = $row->last_check ? esc_html(date_i18n('d/m/Y H:i', strtotime($row->last_check))) : ''; 76 $last_check = ''; 77 if ($row->last_check) { 78 $dt_lc = new DateTime($row->last_check, wp_timezone()); 79 $last_check = esc_html(date_i18n('d/m/Y H:i', $dt_lc->getTimestamp())); 80 } 77 81 78 82 $ps_html = rc_sm_pagespeed_performance_html($url); … … 310 314 $history_id = $total - $index; 311 315 $response = esc_html($entry['response']); 312 $date = esc_html(date_i18n('d/m/Y H:i:s', strtotime($entry['date']))); 316 $dt_entry = new DateTime($entry['date'], wp_timezone()); 317 $date = esc_html(date_i18n('d/m/Y H:i:s', $dt_entry->getTimestamp())); 313 318 314 319 $badge_class = 'rc_sm_bg_secondary'; -
rc-site-manager-optimization/trunk/crons/pagespeed.php
r3487409 r3487675 55 55 56 56 } else { 57 // Già verificato → processa solo se: 58 // 1. Sono passate le 06:00 di oggi 59 // 2. L'ultimo check è precedente alle 06:00 di oggi 60 $last_check_dt = new DateTime($record->last_check, $timezone); 61 if ($now >= $daily_threshold && $last_check_dt < $daily_threshold) { 57 $last_check_dt = new DateTime($record->last_check, $timezone); 58 $last_check_ts = $last_check_dt->getTimestamp(); 59 $now_ts = $now->getTimestamp(); 60 61 // Processa se: 62 // 1. Ultimo check > 24 ore fa (URL nuovo o aggiunto dopo le 06:00) 63 // 2. OPPURE: sono passate le 06:00 di oggi e l'ultimo check è precedente alle 06:00 di oggi (reset giornaliero) 64 $older_than_24h = ($now_ts - $last_check_ts) > 24 * HOUR_IN_SECONDS; 65 $daily_reset = ($now >= $daily_threshold && $last_check_dt < $daily_threshold); 66 67 if ($older_than_24h || $daily_reset) { 62 68 $records[] = $record; 63 69 } … … 195 201 196 202 function rc_sm_pagespeed_log($message, $log_file) { 197 $timestamp = date('Y-m-d H:i:s');203 $timestamp = current_time('mysql'); 198 204 $entry = "[{$timestamp}] {$message}\n"; 199 205 file_put_contents($log_file, $entry, FILE_APPEND); -
rc-site-manager-optimization/trunk/includes/functions/pagespeed.php
r3485061 r3487675 80 80 if (empty($history)) return ''; 81 81 82 $last = end($history); 82 // Ordina per data DESC e prendi il più recente 83 usort($history, function($a, $b) { 84 $da = isset($a['date']) ? strtotime($a['date']) : 0; 85 $db = isset($b['date']) ? strtotime($b['date']) : 0; 86 return $db - $da; 87 }); 88 $last = $history[0]; 89 90 // Valido solo se entro 24 ore (confronto in timezone WP) 91 if (!empty($last['date'])) { 92 $dt = new DateTime($last['date'], wp_timezone()); 93 $entry_time = $dt->getTimestamp(); 94 if ((current_time('timestamp') - $entry_time) > 24 * HOUR_IN_SECONDS) return ''; 95 } 83 96 84 97 if (isset($last['error'])) { … … 86 99 } 87 100 88 // Mostra solo un device se specificato (0 = desktop, 1 = mobile)89 101 if ($device === '1' || $device === 1) { 90 102 if (!isset($last['mobile']['performance'])) return ''; -
rc-site-manager-optimization/trunk/rc-site-manager-optimization.php
r3487409 r3487675 3 3 * Plugin Name: RC Site Manager & Optimization 4 4 * Description: All-in-one Wordpress manager: control WooCommerce, SEO, caching, media, and multilingual tools from one dashboard. 5 * Version: 2.4. 75 * Version: 2.4.8 6 6 * Author: Rocket Comunicazione 7 7 * Author URI: https://www.rocketcomunicazione.com … … 14 14 15 15 16 define('RC_SM_PLUGIN_VERSION', '2.4. 7');16 define('RC_SM_PLUGIN_VERSION', '2.4.8'); 17 17 18 18 define( 'RC_SM_SITE_URL', home_url() ); -
rc-site-manager-optimization/trunk/readme.txt
r3487409 r3487675 5 5 Tested up to: 6.9 6 6 Requires PHP: 8.1 7 Stable tag: 2.4. 77 Stable tag: 2.4.8 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 160 160 == Changelog == 161 161 162 163 = 2.4.8 - March 21, 2026 = 164 * Minor bug fixes and improvement 162 165 163 166 = 2.4.7 - March 20, 2026 = … … 319 322 == Upgrade Notice == 320 323 324 = 2.4.8 - March 21, 2026 = 325 Minor bug fixes. 326 321 327 = 2.4.7 - March 20, 2026 = 322 328 Minor bug fixes. -
rc-site-manager-optimization/trunk/settings/settings_function.php
r3487409 r3487675 182 182 // Hook AJAX per verifica licenza premium 183 183 add_action('wp_ajax_rc_sm_premium_verify_licence', function () { 184 185 // Security verification 184 186 185 if (!rc_sm_security_ajax_verify()) { 187 186 return; 188 187 } 189 190 $slug = rc_sm_security_ajax_get_param('slug', '');188 189 $slug = rc_sm_security_ajax_get_param('slug', ''); 191 190 $licence_key = rc_sm_security_ajax_get_param('licence_key', ''); 192 193 if (empty($slug) || empty($licence_key)) {191 192 if (empty($slug)) { 194 193 wp_send_json_error(array('message' => __('Missing required parameters.', 'rc-site-manager-optimization'))); 195 194 return; 196 195 } 197 196 197 // Chiave vuota → elimina licenza dal DB 198 if (empty($licence_key)) { 199 $saved_licences = rc_sm_tb_settings_get_value('premium_licences'); 200 if (!empty($saved_licences)) { 201 unset($saved_licences[$slug]); 202 rc_sm_premium_licence_save($saved_licences); 203 } 204 wp_send_json_success(array( 205 'message' => __('Licence removed.', 'rc-site-manager-optimization'), 206 'valid' => false, 207 'expires_at' => '' 208 )); 209 wp_die(); 210 } 211 198 212 $result = rc_sm_premium_licence_verify($slug, $licence_key); 199 213 200 214 if ($result['valid']) { 201 215 wp_send_json_success(array( 202 'message' => $result['message'],203 'valid' => true,216 'message' => $result['message'], 217 'valid' => true, 204 218 'expires_at' => $result['expires_at'] 205 219 )); … … 207 221 wp_send_json_error(array('message' => $result['message'])); 208 222 } 209 223 210 224 wp_die(); 211 225 }); … … 220 234 $api_key = rc_sm_security_ajax_get_param('api_key', ''); 221 235 222 if (empty($slug) || empty($api_key)) {236 if (empty($slug)) { 223 237 wp_send_json_error(array('message' => __('Missing required parameters.', 'rc-site-manager-optimization'))); 224 238 return; 239 } 240 241 // Chiave vuota → elimina API key dal DB 242 if (empty($api_key)) { 243 rc_sm_api_key_delete($slug); 244 wp_send_json_success(array('message' => __('API Key removed.', 'rc-site-manager-optimization'))); 245 wp_die(); 225 246 } 226 247 -
rc-site-manager-optimization/trunk/settings/settings_script.js
r3487409 r3487675 149 149 } 150 150 151 // Campo vuoto o con valore: invia sempre al server 151 152 var licenceKey = $input.val().trim(); 152 if (!licenceKey) {153 $item.find('.rc_sm_licence_message')154 .html('<div class="rc_sm_notice" style="margin-bottom:30px;"><div class="rc_sm_notice_error">Please enter a licence key.</div></div>').show();155 resetBtn();156 return;157 }158 159 153 verifyLicence(slug, licenceKey, $item, resetBtn, false); 160 154 }); … … 213 207 } 214 208 }).done(function (response) { 215 if (response && response.success ) {209 if (response && response.success && response.data.valid !== false) { 216 210 $status.html('<span class="rc_sm_color_success"><span class="dashicons dashicons-marker" style="line-height:inherit;"></span> Active</span>'); 217 211 if (!silent) { … … 220 214 } 221 215 } else { 222 var errMsg = (response && response.data && response.data.message) ? response.data.message : 'Invalid licence key.';216 var msg = (response && response.data && response.data.message) ? response.data.message : 'Licence removed.'; 223 217 $status.html('<span class="rc_sm_color_error"><span class="dashicons dashicons-marker" style="line-height:inherit;"></span> Not activated</span>'); 224 218 if (!silent) { 225 $message.html('<div class="rc_sm_notice" style="margin-bottom:30px;"><div class="rc_sm_notice_error">' + errMsg + '</div></div>').show();226 rc_sm_js_notice_fly_show( errMsg, 'error');219 $message.html('<div class="rc_sm_notice" style="margin-bottom:30px;"><div class="rc_sm_notice_error">' + msg + '</div></div>').show(); 220 rc_sm_js_notice_fly_show(msg, 'error'); 227 221 } 228 222 } … … 285 279 } 286 280 281 // Campo vuoto o con valore: invia sempre al server 287 282 var key = $input.val().trim(); 288 if (!key) {289 $item.find('.rc_sm_api_key_message')290 .html('<div class="rc_sm_notice" style="margin-bottom:30px;"><div class="rc_sm_notice_error">Please enter an API key.</div></div>').show();291 resetBtn();292 return;293 }294 295 283 verifyApiKey(slug, key, $item, resetBtn, false); 296 284 }); … … 350 338 }).done(function (response) { 351 339 if (response && response.success) { 340 var msg = (response.data && response.data.message) ? response.data.message : 'API Key valid and active.'; 352 341 $status.html('<span class="rc_sm_color_success"><span class="dashicons dashicons-marker" style="line-height:inherit;"></span> Active</span>'); 353 342 if (!silent) { 354 $message.html('<div class="rc_sm_notice" style="margin-bottom:30px;"><div class="rc_sm_notice_success">' + (response.data.message || 'API Key valid and active.')+ '</div></div>').show();355 rc_sm_js_notice_fly_show( response.data.message || 'API Key activated successfully.', 'success');343 $message.html('<div class="rc_sm_notice" style="margin-bottom:30px;"><div class="rc_sm_notice_success">' + msg + '</div></div>').show(); 344 rc_sm_js_notice_fly_show(msg, 'success'); 356 345 } 357 346 } else { -
rc-site-manager-optimization/trunk/settings/tab_premium_fn.php
r3487409 r3487675 49 49 $html .= '<div class="rc_sm_bs_col_6 rc_sm_bs_col_align">'; 50 50 $html .= '<div class="rc_sm_licence_status" style="margin-top:0;">'; 51 $html .= '<span class="rc_sm_color_warning"><span class="dashicons dashicons-update" style="line-height:inherit;"></span> ' . esc_html__( 'Checking', 'rc-site-manager-optimization' ) . '...</span>'; 51 if ( $has_key === '1' ) { 52 $html .= '<span class="rc_sm_color_warning"><span class="dashicons dashicons-update" style="line-height:inherit;"></span> ' . esc_html__( 'Checking', 'rc-site-manager-optimization' ) . '...</span>'; 53 } else { 54 $html .= '<span class="rc_sm_color_error"><span class="dashicons dashicons-marker" style="line-height:inherit;"></span> ' . esc_html__( 'Not activated', 'rc-site-manager-optimization' ) . '</span>'; 55 } 52 56 $html .= '</div>'; 53 57 $html .= '</div>'; … … 103 107 $html .= '<div class="rc_sm_bs_col_6 rc_sm_bs_col_align">'; 104 108 $html .= '<div class="rc_sm_api_key_status" style="margin-top:0;">'; 105 $html .= '<span class="rc_sm_color_warning"><span class="dashicons dashicons-update" style="line-height:inherit;"></span> ' . esc_html__( 'Checking', 'rc-site-manager-optimization' ) . '...</span>'; 109 if ( $has_key === '1' ) { 110 $html .= '<span class="rc_sm_color_warning"><span class="dashicons dashicons-update" style="line-height:inherit;"></span> ' . esc_html__( 'Checking', 'rc-site-manager-optimization' ) . '...</span>'; 111 } else { 112 $html .= '<span class="rc_sm_color_error"><span class="dashicons dashicons-marker" style="line-height:inherit;"></span> ' . esc_html__( 'Not activated', 'rc-site-manager-optimization' ) . '</span>'; 113 } 106 114 $html .= '</div>'; 107 115 $html .= '</div>';
Note: See TracChangeset
for help on using the changeset viewer.