Plugin Directory

Changeset 3476219


Ignore:
Timestamp:
03/06/2026 09:33:44 AM (3 weeks ago)
Author:
rocketcomunicazione
Message:

2.3.7

Location:
rc-site-manager-optimization/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • rc-site-manager-optimization/trunk/includes/admin.php

    r3474847 r3476219  
    334334    <?php
    335335    rc_sm_clear_cache_js();
    336 }, 20);
     336}, 9999);
    337337
    338338
     
    400400
    401401    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);
    403403    } else {
    404404        $msg = __('HTML cache cleared.', $td);
     
    447447
    448448    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);
    450450    } else {
    451451        $msg = __('Domain cache cleared.', $td);
  • rc-site-manager-optimization/trunk/rc-site-manager-optimization.php

    r3474847 r3476219  
    33 * Plugin Name: RC Site Manager & Optimization
    44 * Description: All-in-one Wordpress manager: control WooCommerce, SEO, caching, media, and multilingual tools from one dashboard.
    5  * Version: 2.3.6
     5 * Version: 2.3.7
    66 * Author: Rocket Comunicazione
    77 * Author URI: https://www.rocketcomunicazione.com
     
    1818
    1919
    20 define('RC_SM_PLUGIN_VERSION', '2.3.6');
     20define('RC_SM_PLUGIN_VERSION', '2.3.7');
    2121
    2222define( 'RC_SM_SITE_URL', home_url() );
  • rc-site-manager-optimization/trunk/readme.txt

    r3474847 r3476219  
    55Tested up to: 6.9
    66Requires PHP: 8.1
    7 Stable tag: 2.3.6
     7Stable tag: 2.3.7
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    160160== Changelog ==
    161161
     162
     163= 2.3.7 - March 6, 2026 =
     164* Minor bug fixes and improvement
    162165
    163166= 2.3.6 - March 4, 2026 =
     
    286289== Upgrade Notice ==
    287290
     291= 2.3.7 - March 6, 2026 =
     292Minor bug fixes.
     293
    288294= 2.3.6 - March 4, 2026 =
    289295Add System info in Utility.
  • rc-site-manager-optimization/trunk/utility/tab_system.php

    r3474847 r3476219  
    1818            <?php echo rc_sm_system_info_table( rc_sm_system_info_db() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
    1919
    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 ?>
    2222        </div>
    2323    </div>
     
    3333            <?php echo rc_sm_system_info_table( rc_sm_system_info_disk() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
    3434
     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
    3538            <h4>DNS</h4>
    3639            <?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  
    2323    $version_html = $version_ok
    2424        ? '<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>';
    2626
    2727    return [
     
    3838    global $wpdb;
    3939
    40     // REST API
    4140    $rest_url      = get_rest_url();
    4241    $rest_response = wp_remote_get( $rest_url, [ 'timeout' => 5, 'sslverify' => false ] );
     
    4443    $rest_html = $rest_ok
    4544        ? 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
    4947    $discourage      = get_option( 'blog_public' ) == '0';
    5048    $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>'
    5250        : esc_html__( 'No', 'rc-site-manager-optimization' );
    5351
     
    5856        __( 'Multisite', 'rc-site-manager-optimization' )                 => [ 'value' => is_multisite() ? __( 'Yes', 'rc-site-manager-optimization' ) : __( 'No', 'rc-site-manager-optimization' ), 'source' => 'is_multisite()' ],
    5957        __( '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 ],
    6159        __( 'Discourage Search Engines', 'rc-site-manager-optimization' ) => [ 'value' => $discourage_html, 'source' => "get_option('blog_public')", 'raw' => true ],
    6260    ];
     
    7775function rc_sm_system_info_server(): array {
    7876    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()' ],
    8381    ];
    8482}
     
    9795            $size_str = $size_mb . ' MB';
    9896            $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>'
    10098                : esc_html( $size_str );
    10199        } else {
    102100            $value = __( 'Not found', 'rc-site-manager-optimization' );
    103101        }
    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 ];
    105104    }
    106105
     
    122121    $records = @dns_get_record( $host, DNS_ALL );
    123122
    124     // CDN detection — header map
    125123    $cdn_headers = [
    126124        'HTTP_CF_RAY'                 => 'Cloudflare',
     
    155153    }
    156154
    157     // Fallback: cerca nel valore di HTTP_VIA
    158155    if ( ! $cdn && isset( $_SERVER['HTTP_VIA'] ) ) {
    159156        $via     = strtolower( sanitize_text_field( $_SERVER['HTTP_VIA'] ) );
     
    175172    $cdn_html = $cdn
    176173        ? '<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>';
    178175
    179176    $server_ip = isset( $_SERVER['SERVER_ADDR'] ) ? sanitize_text_field( $_SERVER['SERVER_ADDR'] ) : 'N/A';
     
    225222}
    226223
     224function 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
    227321function rc_sm_system_info_table( array $data ): string {
    228322    $html = '<table class="widefat striped rc_sm_table_system">';
     
    230324        $is_raw = ! empty( $row['raw'] );
    231325        $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>';
    235329        $html .= '</tr>';
    236330    }
     
    238332    return $html;
    239333}
     334
     335function 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.