Changeset 3476219
- Timestamp:
- 03/06/2026 09:33:44 AM (3 weeks ago)
- Location:
- rc-site-manager-optimization/trunk
- Files:
-
- 5 edited
-
includes/admin.php (modified) (3 diffs)
-
rc-site-manager-optimization.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
utility/tab_system.php (modified) (2 diffs)
-
utility/tab_system_fn.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
rc-site-manager-optimization/trunk/includes/admin.php
r3474847 r3476219 334 334 <?php 335 335 rc_sm_clear_cache_js(); 336 }, 20);336 }, 9999); 337 337 338 338 … … 400 400 401 401 if ( $success_count > 0 ) { 402 $msg = sprintf(__('Cache cleared and regenerated (%s records).', $td), $success_count);402 $msg = sprintf(__('Cache cleared and regenerated. <br>%s records (Desktop and Mobile).', $td), $success_count); 403 403 } else { 404 404 $msg = __('HTML cache cleared.', $td); … … 447 447 448 448 if ( $success_count > 0 ) { 449 $msg = sprintf(__('Cache cleared and regenerated (%s records).', $td), $success_count);449 $msg = sprintf(__('Cache cleared and regenerated. <br>%s records (Desktop and Mobile).', $td), $success_count); 450 450 } else { 451 451 $msg = __('Domain cache cleared.', $td); -
rc-site-manager-optimization/trunk/rc-site-manager-optimization.php
r3474847 r3476219 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.3. 65 * Version: 2.3.7 6 6 * Author: Rocket Comunicazione 7 7 * Author URI: https://www.rocketcomunicazione.com … … 18 18 19 19 20 define('RC_SM_PLUGIN_VERSION', '2.3. 6');20 define('RC_SM_PLUGIN_VERSION', '2.3.7'); 21 21 22 22 define( 'RC_SM_SITE_URL', home_url() ); -
rc-site-manager-optimization/trunk/readme.txt
r3474847 r3476219 5 5 Tested up to: 6.9 6 6 Requires PHP: 8.1 7 Stable tag: 2.3. 67 Stable tag: 2.3.7 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.3.7 - March 6, 2026 = 164 * Minor bug fixes and improvement 162 165 163 166 = 2.3.6 - March 4, 2026 = … … 286 289 == Upgrade Notice == 287 290 291 = 2.3.7 - March 6, 2026 = 292 Minor bug fixes. 293 288 294 = 2.3.6 - March 4, 2026 = 289 295 Add System info in Utility. -
rc-site-manager-optimization/trunk/utility/tab_system.php
r3474847 r3476219 18 18 <?php echo rc_sm_system_info_table( rc_sm_system_info_db() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> 19 19 20 <h4><?php echo esc_html__( ' Log', 'rc-site-manager-optimization' ); ?></h4>21 <?php echo rc_sm_system_info_table ( rc_sm_system_info_logs() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>20 <h4><?php echo esc_html__( 'Environment', 'rc-site-manager-optimization' ); ?></h4> 21 <?php echo rc_sm_system_info_table_env( rc_sm_system_info_environment() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> 22 22 </div> 23 23 </div> … … 33 33 <?php echo rc_sm_system_info_table( rc_sm_system_info_disk() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> 34 34 35 <h4><?php echo esc_html__( 'Log', 'rc-site-manager-optimization' ); ?></h4> 36 <?php echo rc_sm_system_info_table( rc_sm_system_info_logs() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> 37 35 38 <h4>DNS</h4> 36 39 <?php echo rc_sm_system_info_table( rc_sm_system_info_dns() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> -
rc-site-manager-optimization/trunk/utility/tab_system_fn.php
r3474847 r3476219 23 23 $version_html = $version_ok 24 24 ? '<span class="rc_sm_bold rc_sm_color_success">' . esc_html( $php_version ) . '</span>' 25 : '<span class="rc_sm_bold rc_sm_color_ danger">' . esc_html( $php_version ) . '</span>';25 : '<span class="rc_sm_bold rc_sm_color_error">' . esc_html( $php_version ) . '</span>'; 26 26 27 27 return [ … … 38 38 global $wpdb; 39 39 40 // REST API41 40 $rest_url = get_rest_url(); 42 41 $rest_response = wp_remote_get( $rest_url, [ 'timeout' => 5, 'sslverify' => false ] ); … … 44 43 $rest_html = $rest_ok 45 44 ? esc_html__( 'Active', 'rc-site-manager-optimization' ) 46 : '<span class="rc_sm_bold rc_sm_color_danger">' . esc_html__( 'Not reachable', 'rc-site-manager-optimization' ) . '</span>'; 47 48 // Discouraging search engines 45 : '<span class="rc_sm_bold rc_sm_color_error">' . esc_html__( 'Not reachable', 'rc-site-manager-optimization' ) . '</span>'; 46 49 47 $discourage = get_option( 'blog_public' ) == '0'; 50 48 $discourage_html = $discourage 51 ? '<span class="rc_sm_bold rc_sm_color_ danger">' . esc_html__( 'Yes, search engines discouraged', 'rc-site-manager-optimization' ) . '</span>'49 ? '<span class="rc_sm_bold rc_sm_color_error">' . esc_html__( 'Yes, search engines discouraged', 'rc-site-manager-optimization' ) . '</span>' 52 50 : esc_html__( 'No', 'rc-site-manager-optimization' ); 53 51 … … 58 56 __( 'Multisite', 'rc-site-manager-optimization' ) => [ 'value' => is_multisite() ? __( 'Yes', 'rc-site-manager-optimization' ) : __( 'No', 'rc-site-manager-optimization' ), 'source' => 'is_multisite()' ], 59 57 __( 'Debug Mode', 'rc-site-manager-optimization' ) => [ 'value' => defined( 'WP_DEBUG' ) && WP_DEBUG ? __( 'Enabled', 'rc-site-manager-optimization' ) : __( 'Disabled', 'rc-site-manager-optimization' ), 'source' => 'WP_DEBUG' ], 60 __( 'REST API', 'rc-site-manager-optimization' ) => [ 'value' => $rest_html, 'source' => 'get_rest_url()','raw' => true ],58 __( 'REST API', 'rc-site-manager-optimization' ) => [ 'value' => $rest_html, 'source' => 'get_rest_url()', 'raw' => true ], 61 59 __( 'Discourage Search Engines', 'rc-site-manager-optimization' ) => [ 'value' => $discourage_html, 'source' => "get_option('blog_public')", 'raw' => true ], 62 60 ]; … … 77 75 function rc_sm_system_info_server(): array { 78 76 return [ 79 __( 'Server Software', 'rc-site-manager-optimization' ) => [ 'value' => isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_text_field( $_SERVER['SERVER_SOFTWARE'] ) : '', 'source' => '$_SERVER[\'SERVER_SOFTWARE\']' ],80 __( 'OS', 'rc-site-manager-optimization' ) => [ 'value' => PHP_OS, 'source' => 'PHP_OS' ],81 __( 'Hostname', 'rc-site-manager-optimization' ) => [ 'value' => php_uname( 'n' ), 'source' => "php_uname('n')" ],82 __( 'Current Server Time', 'rc-site-manager-optimization' ) => [ 'value' => gmdate( 'd/m/Y H:i:s' ) . ' UTC', 'source' => 'gmdate()' ],77 __( 'Server Software', 'rc-site-manager-optimization' ) => [ 'value' => isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_text_field( $_SERVER['SERVER_SOFTWARE'] ) : '', 'source' => '$_SERVER[\'SERVER_SOFTWARE\']' ], 78 __( 'OS', 'rc-site-manager-optimization' ) => [ 'value' => PHP_OS, 'source' => 'PHP_OS' ], 79 __( 'Hostname', 'rc-site-manager-optimization' ) => [ 'value' => php_uname( 'n' ), 'source' => "php_uname('n')" ], 80 __( 'Current Server Time', 'rc-site-manager-optimization' ) => [ 'value' => gmdate( 'd/m/Y H:i:s' ) . ' UTC', 'source' => 'gmdate()' ], 83 81 ]; 84 82 } … … 97 95 $size_str = $size_mb . ' MB'; 98 96 $value = $size_mb > 5 99 ? '<span class="rc_sm_bold rc_sm_color_ danger">' . esc_html( $size_str ) . '</span>'97 ? '<span class="rc_sm_bold rc_sm_color_error">' . esc_html( $size_str ) . '</span>' 100 98 : esc_html( $size_str ); 101 99 } else { 102 100 $value = __( 'Not found', 'rc-site-manager-optimization' ); 103 101 } 104 $data[ $label ] = [ 'value' => $value, 'source' => esc_html( $path ?: 'N/A' ), 'raw' => true ]; 102 $short_path = $path ? preg_replace( '#^.*?(/public_html/)#', '$1', $path ) : 'N/A'; 103 $data[ $label ] = [ 'value' => $value, 'source' => esc_html( $short_path ), 'raw' => true ]; 105 104 } 106 105 … … 122 121 $records = @dns_get_record( $host, DNS_ALL ); 123 122 124 // CDN detection — header map125 123 $cdn_headers = [ 126 124 'HTTP_CF_RAY' => 'Cloudflare', … … 155 153 } 156 154 157 // Fallback: cerca nel valore di HTTP_VIA158 155 if ( ! $cdn && isset( $_SERVER['HTTP_VIA'] ) ) { 159 156 $via = strtolower( sanitize_text_field( $_SERVER['HTTP_VIA'] ) ); … … 175 172 $cdn_html = $cdn 176 173 ? '<span class="rc_sm_bold rc_sm_color_success">' . esc_html( $cdn ) . '</span>' 177 : '<span class="rc_sm_bold rc_sm_color_ danger">None</span>';174 : '<span class="rc_sm_bold rc_sm_color_error">None</span>'; 178 175 179 176 $server_ip = isset( $_SERVER['SERVER_ADDR'] ) ? sanitize_text_field( $_SERVER['SERVER_ADDR'] ) : 'N/A'; … … 225 222 } 226 223 224 function rc_sm_system_info_environment(): array { 225 $rows = []; 226 $update_plugins = get_site_transient( 'update_plugins' ); 227 $update_core = get_site_transient( 'update_core' ); 228 $today = current_time( 'timestamp' ); 229 230 $days_html = function( $mtime ) use ( $today ) { 231 if ( ! $mtime ) return ''; 232 $days = (int) floor( ( $today - $mtime ) / DAY_IN_SECONDS ); 233 return $days > 30 234 ? ' <span class="rc_sm_bold rc_sm_color_error">(' . $days . ')</span>' 235 : ' (' . $days . ')'; 236 }; 237 238 // Core 239 $core_mtime = @filemtime( ABSPATH . 'wp-includes/version.php' ); 240 $core_new_version = ''; 241 if ( ! empty( $update_core->updates ) ) { 242 foreach ( $update_core->updates as $update ) { 243 if ( isset( $update->response ) && $update->response === 'upgrade' ) { 244 $core_new_version = $update->current ?? ''; 245 break; 246 } 247 } 248 } 249 $core_name = 'WordPress ' . get_bloginfo( 'version' ); 250 if ( $core_new_version ) { 251 $core_name .= ' <span class="rc_sm_bold rc_sm_color_error">' . esc_html( $core_new_version ) . '</span>'; 252 } 253 $core_date = $core_mtime ? date_i18n( 'd/m/Y', $core_mtime ) . $days_html( $core_mtime ) : 'N/A'; 254 $rows[] = [ 'type' => 'Core', 'name' => $core_name, 'date' => $core_date ]; 255 256 // Builder — match esatto sulla cartella 257 $builder_exact_slugs = [ 258 'elementor', 'elementor-pro', 'bb-plugin', 'js_composer', 'oxygen', 259 'bricks', 'brizy', 'cornerstone', 'fusion-builder', 'siteorigin-panels', 260 'divi-builder', 'visualcomposer', 'zionbuilder', 'breakdance', 'cwicly', 261 'generateblocks', 'kadence-blocks', 'greenshift-blocks', 262 'stackable-ultimate-gutenberg-blocks', 263 ]; 264 265 $active_plugins = get_option( 'active_plugins', [] ); 266 $builders = []; 267 $plugins = []; 268 269 foreach ( $active_plugins as $plugin_file ) { 270 $full_path = WP_PLUGIN_DIR . '/' . $plugin_file; 271 if ( ! file_exists( $full_path ) ) continue; 272 273 $plugin_data = get_plugin_data( $full_path, false, false ); 274 $name = $plugin_data['Name'] ?? $plugin_file; 275 $version = $plugin_data['Version'] ?? ''; 276 $mtime = @filemtime( $full_path ); 277 $date = $mtime ? date_i18n( 'd/m/Y', $mtime ) . $days_html( $mtime ) : 'N/A'; 278 279 $new_version = ''; 280 if ( ! empty( $update_plugins->response[ $plugin_file ]->new_version ) ) { 281 $new_version = $update_plugins->response[ $plugin_file ]->new_version; 282 } 283 284 $name_html = esc_html( $name . ' ' . $version ); 285 if ( $new_version ) { 286 $name_html .= ' <span class="rc_sm_bold rc_sm_color_error">' . esc_html( $new_version ) . '</span>'; 287 } 288 289 $is_builder = in_array( dirname( $plugin_file ), $builder_exact_slugs ); 290 $entry = [ 'type' => $is_builder ? 'Builder' : 'Plugin', 'name' => $name_html, 'date' => $date ]; 291 292 if ( $is_builder ) $builders[] = $entry; 293 else $plugins[] = $entry; 294 } 295 296 foreach ( $builders as $b ) $rows[] = $b; 297 298 // Theme: parent + child se esiste 299 $active_theme = wp_get_theme(); 300 $themes_to_show = []; 301 if ( $active_theme->parent() ) { 302 $themes_to_show[] = $active_theme->parent(); 303 $themes_to_show[] = $active_theme; 304 } else { 305 $themes_to_show[] = $active_theme; 306 } 307 308 foreach ( $themes_to_show as $theme ) { 309 $theme_name = $theme->get( 'Name' ) . ' ' . $theme->get( 'Version' ); 310 $theme_path = get_theme_root() . '/' . $theme->get_stylesheet() . '/style.css'; 311 $theme_mtime = @filemtime( $theme_path ); 312 $theme_date = $theme_mtime ? date_i18n( 'd/m/Y', $theme_mtime ) . $days_html( $theme_mtime ) : 'N/A'; 313 $rows[] = [ 'type' => 'Theme', 'name' => esc_html( $theme_name ), 'date' => $theme_date ]; 314 } 315 316 foreach ( $plugins as $p ) $rows[] = $p; 317 318 return $rows; 319 } 320 227 321 function rc_sm_system_info_table( array $data ): string { 228 322 $html = '<table class="widefat striped rc_sm_table_system">'; … … 230 324 $is_raw = ! empty( $row['raw'] ); 231 325 $html .= '<tr>'; 232 $html .= '<td class="rc_sm_width_ 5"><strong>' . esc_html( $label ) . '</strong></td>';233 $html .= '<td >' . ( $is_raw ? wp_kses_post( $row['value'] ) : esc_html( $row['value'] ) ) . '</td>';234 $html .= '<td ><code>' . esc_html( $row['source'] ) . '</code></td>';326 $html .= '<td class="rc_sm_width_4"><strong>' . esc_html( $label ) . '</strong></td>'; 327 $html .= '<td class="rc_sm_width_4">' . ( $is_raw ? wp_kses_post( $row['value'] ) : esc_html( $row['value'] ) ) . '</td>'; 328 $html .= '<td class="rc_sm_width_4"><code>' . esc_html( $row['source'] ) . '</code></td>'; 235 329 $html .= '</tr>'; 236 330 } … … 238 332 return $html; 239 333 } 334 335 function rc_sm_system_info_table_env( array $rows ): string { 336 $html = '<table class="widefat striped rc_sm_table_system">'; 337 foreach ( $rows as $row ) { 338 $html .= '<tr>'; 339 $html .= '<td class="rc_sm_width_4"><strong>' . esc_html( $row['type'] ) . '</strong></td>'; 340 $html .= '<td class="rc_sm_width_4">' . wp_kses_post( $row['name'] ) . '</td>'; 341 $html .= '<td class="rc_sm_width_4">' . wp_kses_post( $row['date'] ) . '</td>'; 342 $html .= '</tr>'; 343 } 344 $html .= '</table>'; 345 return $html; 346 }
Note: See TracChangeset
for help on using the changeset viewer.