Plugin Directory

Changeset 3150542


Ignore:
Timestamp:
09/12/2024 07:17:56 AM (15 months ago)
Author:
ignatggeorgiev
Message:

Bump to 7.6.5

Location:
sg-cachepress/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • sg-cachepress/trunk/core/Admin/Admin.php

    r3056105 r3150542  
    6969    /**
    7070     * Check if it's a multisite, but the single site
    71      * has no permisions to edit optimizer settings.
     71     * has no permissions to edit optimizer settings.
    7272     *
    7373     * @since  5.0.0
     
    9898        // Hide all error in our page.
    9999        if (
    100             isset( $_GET['page'] ) &&
     100            isset( $_GET['page'] ) && // phpcs:ignore
    101101            array_key_exists( $_GET['page'], $this->subpages ) // phpcs:ignore
    102102        ) {
     
    133133            'all'
    134134        );
    135 
    136135    }
    137136
     
    208207        $show_notice = (int) get_site_option( 'siteground_optimizer_memcache_notice', 0 );
    209208
    210         // Bail if the current user is not admin or if we sholdn't  display notice.
     209        // Bail if the current user is not admin or if we shouldn't  display notice.
    211210        if (
    212211            ! is_admin() ||
     
    231230            esc_attr( $class ),
    232231            esc_html( $message ),
    233             admin_url( 'admin-ajax.php?action=dismiss_memcache_notice' )
     232            esc_url( admin_url( 'admin-ajax.php?action=dismiss_memcache_notice' ) )
    234233        );
    235234    }
     
    345344
    346345        if ( ! is_network_admin() ) {
    347             echo '<script>window.addEventListener("load", function(){ SGOptimizer.init({ domElementId: "root", page: SGOptimizer.PAGE.' . $id . ',config:' . json_encode( $data ) . '})});</script>';
     346            echo '<script>window.addEventListener("load", function(){ SGOptimizer.init({ domElementId: "root", page: SGOptimizer.PAGE.' . esc_html( $id ) . ',config:' . wp_json_encode( $data ) . '})});</script>';
    348347        } else {
    349348            $data['rest_base'] = untrailingslashit( get_rest_url( null, Rest::REST_NAMESPACE ) );
  • sg-cachepress/trunk/core/Loader/Loader.php

    r3115310 r3150542  
    182182            // Check if class exists.
    183183            if ( ! class_exists( $class ) ) {
    184                 throw new \Exception( 'Unknown library type "' . $library . '".' );
     184                throw new \Exception( 'Unknown library type "' . esc_html( $library ) . '".' );
    185185            }
    186186
  • sg-cachepress/trunk/core/Message_Service/Message_Service.php

    r2971883 r3150542  
    99class Message_Service {
    1010    /**
    11      * React responce messages.
     11     * React response messages.
    1212     *
    1313     * @since 6.0.0
     
    7373
    7474        if ( is_null( $type ) ) {
    75             return sprintf( __( '%s', 'sg-cachepress' ), $messages[ $option ] );
     75            return $messages[ $option ];
    7676        }
    7777
    7878        if ( true === $result ) {
    7979            if ( 1 === $type ) {
     80                /* translators: 1: the message option */
    8081                return sprintf( __( '%s Enabled', 'sg-cachepress' ), $messages[ $option ] );
    8182            }
    82 
     83            /* translators: 1: the message option */
    8384            return sprintf( __( '%s Disabled', 'sg-cachepress' ), $messages[ $option ] );
    8485
     
    8687
    8788        if ( 1 === $type ) {
     89            /* translators: 1: the message option */
    8890            return sprintf( __( 'Could not enable %s', 'sg-cachepress' ), $messages[ $option ] );
    8991        }
    90 
     92        /* translators: 1: the message option */
    9193        return sprintf( __( 'Could not disable %s', 'sg-cachepress' ), $messages[ $option ] );
    9294    }
  • sg-cachepress/trunk/core/Modules/Modules.php

    r2971883 r3150542  
    1818     */
    1919    private static $instance;
     20
     21
     22    /**
     23     * The Optimizer plugin tabs placeholder.
     24     *
     25     * @var array.
     26     */
     27    public $tabs;
    2028
    2129    /**
     
    212220
    213221    /**
    214      * List of all tabs.
    215      *
    216      * @since 5.0.0
    217      *
    218      * @access private
    219      *
    220      * @var array List of all optimizer tabs.
    221      */
    222     public $tabs = array(
    223         'supercacher' => array(
    224             'title'   => 'SuperCacher Settings',
    225             'modules' => array(
    226                 'dynamic_cache',
    227                 'memcached',
    228             ),
    229         ),
    230         'environment' => array(
    231             'title'   => 'Environment Optimization',
    232             'modules' => array(
    233                 'ssl',
    234                 'hearbeat_control',
    235                 'database_optimization',
    236                 'gzip',
    237                 'browser_cache',
    238             ),
    239         ),
    240         'frontend'    => array(
    241             'title'   => 'Frontend Optimization',
    242             'modules' => array(
    243                 'html',
    244                 'javascript',
    245                 'css',
    246                 'query_strings',
    247                 'emojis',
    248             ),
    249         ),
    250         'images'      => array(
    251             'title'   => 'Media Optimization',
    252             'modules' => array(
    253                 'optimize_images',
    254                 'lazyload_images',
    255             ),
    256         ),
    257         'analytics'   => array(
    258             'title' => 'Speed Test',
    259         ),
    260     );
    261 
    262     /**
    263222     * List of multisite tabs.
    264223     *
     
    480439        ),
    481440    );
     441
     442    /**
     443     * The constructor.
     444     */
     445    public function __construct() {
     446        // Load the tabs array with translated titles.
     447        $this->initialize_tabs();
     448    }
     449
     450    /**
     451    * List of all tabs.
     452    *
     453    * @since 7.6.5
     454    *
     455    * @access private
     456    *
     457    * A method that initialize a list of all optimizer tabs.
     458    */
     459    private function initialize_tabs() {
     460        $this->tabs = array(
     461            'supercacher' => array(
     462                'title'   => __( 'SuperCacher Settings', 'sg-cachepress' ),
     463                'modules' => array(
     464                    'dynamic_cache',
     465                    'memcached',
     466                ),
     467            ),
     468            'environment' => array(
     469                'title'   => __( 'Environment Optimization', 'sg-cachepress' ),
     470                'modules' => array(
     471                    'ssl',
     472                    'hearbeat_control',
     473                    'database_optimization',
     474                    'gzip',
     475                    'browser_cache',
     476                ),
     477            ),
     478            'frontend'    => array(
     479                'title'   => __( 'Frontend Optimization', 'sg-cachepress' ),
     480                'modules' => array(
     481                    'html',
     482                    'javascript',
     483                    'css',
     484                    'query_strings',
     485                    'emojis',
     486                ),
     487            ),
     488            'images'      => array(
     489                'title'   => __( 'Media Optimization', 'sg-cachepress' ),
     490                'modules' => array(
     491                    'optimize_images',
     492                    'lazyload_images',
     493                ),
     494            ),
     495            'analytics'   => array(
     496                'title' => __( 'Speed Test', 'sg-cachepress' ),
     497            ),
     498        );
     499    }
     500
    482501
    483502    /**
     
    540559
    541560        $message = sprintf(
     561            /* translators: 1: list of conflicting plugins, 2: module names */
    542562            __( '<strong>Important message from Speed Optimizer by SiteGround plugin</strong>: We have detected that there is duplicate functionality with other plugins installed on your site: <strong>%1$s</strong> and have deactivated the following functions from our plugin: <strong>%2$s</strong>. If you wish to enable them, please do that from the Speed Optimizer by SiteGround config page.', 'sg-cachepress' ),
    543563            implode( ', ', $excluded['conflicting_plugins'] ),
     
    548568            '<div class="%1$s" style="position: relative"><p style="max-width: 90%%!important;">%2$s</p><button type="button" class="notice-dismiss dismiss-memcache-notice" data-link="%3$s"><span class="screen-reader-text">Dismiss this notice.</span></button></div>',
    549569            esc_attr( 'notice notice-error sg-optimizer-notice' ),
    550             $message,
    551             admin_url( 'admin-ajax.php?action=dismiss_blocking_plugins_notice' )
     570            wp_kses_post( $message ),
     571            esc_url( admin_url( 'admin-ajax.php?action=dismiss_blocking_plugins_notice' ) )
    552572        );
    553573    }
     
    575595
    576596        $message = sprintf(
     597            /* translators: 1: list of conflicting plugins */
    577598            __( '<strong>Important warning from Speed Optimizer by SiteGround plugin</strong>: We have detected that there is duplicate functionality with other plugins installed on your site: <strong>%s</strong>. Please note that having two plugins with the same functionality may actually decrease your site\'s performance and hurt your pages loading times so we recommend you to leave only one of the plugins active.', 'sg-cachepress' ),
    578599            implode( ', ', $excluded['conflicting_plugins'] )
     
    582603            '<div class="%1$s" style="position: relative"><p style="max-width: 90%%!important;">%2$s</p><button type="button" class="notice-dismiss dismiss-memcache-notice" data-link="%3$s"><span class="screen-reader-text">Dismiss this notice.</span></button></div>',
    583604            esc_attr( 'notice notice-error sg-optimizer-notice' ),
    584             $message,
    585             admin_url( 'admin-ajax.php?action=dismiss_cache_plugins_notice' )
     605            wp_kses_post( $message ),
     606            esc_url( admin_url( 'admin-ajax.php?action=dismiss_cache_plugins_notice' ) )
    586607        );
    587608    }
     
    685706        // Build tabs data.
    686707        foreach ( $this->tabs as $tab_slug => $tab ) {
    687             $active_tabs[ $tab_slug ] = __( $tab['title'], 'sg-cachepress' );
     708            $active_tabs[ $tab_slug ] = $tab['title'];
    688709        }
    689710
  • sg-cachepress/trunk/core/Performance_Reports/Performance_Reports.php

    r2971883 r3150542  
    2727     */
    2828    public function __construct() {
    29         $currentDate = time();
    30         $cron_first_time = ( date( 'j', $currentDate ) <= 20 ) ? strtotime( '20 ' . date( 'M Y', $currentDate ) ) : strtotime( '20 ' . date( 'M Y', strtotime( '+1 month', $currentDate ) ) );
     29        $current_date    = time();
     30        $cron_first_time = ( gmdate( 'j', $current_date ) <= 20 ) ? strtotime( '20 ' . gmdate( 'M Y', $current_date ) ) : strtotime( '20 ' . gmdate( 'M Y', strtotime( '+1 month', $current_date ) ) );
    3131
    3232        // Initiate the Email Service Class.
     
    9696
    9797    /**
    98      * Get assets from remote json.
     98     * Get assets from remote JSON.
    9999     *
    100100     * @since 7.4.0
     
    132132        $assets['default']['lang'] = 'default';
    133133
    134         // Return the correct assets, title and marketing urls.
     134        // Return the correct assets, title and marketing URLs.
    135135        return $assets['default'];
    136136    }
     
    230230                    'score' => $score,
    231231                    'total' => $feature['config']['max_score'],
    232                     'text'  => __( $score . ' out of ' . $feature['config']['max_score'], 'sg-cachepress' ),
     232                    'text'  => $score . __( ' out of ', 'sg-cachepress' ) . $feature['config']['max_score'],
    233233                );
    234234
     
    252252                    'score' => $score,
    253253                    'total' => $feature['config']['max_score'],
    254                     'text'  => __( $score . ' out of ' . $feature['config']['max_score'], 'sg-cachepress' ),
     254                    'text'  => $score . __( ' out of ', 'sg-cachepress' ) . $feature['config']['max_score'],
    255255                );
    256256
     
    298298            'score' => $score,
    299299            'total' => $feature_config['max_score'],
    300             'text'  => __( $score . ' out of ' . $feature_config['max_score'], 'sg-cachepress' ),
     300            'text'  => $score . __( ' out of ', 'sg-cachepress' ) . $feature_config['max_score'],
    301301        );
    302302    }
     
    354354
    355355    /**
    356      * Update the performance report receipient when admin email is updated.
     356     * Update the performance report recipient when admin email is updated.
    357357     *
    358358     * @since 7.4.0
     
    371371        }
    372372
    373         // Bail if the receipient does not match the previous admin email address set.
     373        // Bail if the recipient does not match the previous admin email address set.
    374374        if ( $old_value !== $current_receipient ) {
    375375            return;
    376376        }
    377377
    378         // Update the receipient to the new admin email set.
     378        // Update the recipient to the new admin email set.
    379379        update_option( 'siteground_optimizer_performace_receipient', $new_value );
    380380    }
    381381
    382382    /**
    383      * This function registers montly interval for the cron.
     383     * This function registers monthly interval for the CRON.
    384384     *
    385385     * @since 7.4.0
  • sg-cachepress/trunk/readme.txt

    r3135504 r3150542  
    55Requires PHP: 7.0
    66Tested up to: 6.6
    7 Stable tag: 7.6.4
     7Stable tag: 7.6.5
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    119119== Changelog ==
    120120
     121= Version 7.6.5 =
     122Release Date: Sept 12th, 2024
     123
     124* Performance Reports improvements
     125* Message Service improvements
     126* Admin pages improvements
     127
    121128= Version 7.6.4 =
    122129Release Date: Aug 14th, 2024
  • sg-cachepress/trunk/sg-cachepress.php

    r3135504 r3150542  
    1111 * Plugin URI:        https://siteground.com
    1212 * Description:       This plugin will link your WordPress application with all the performance optimizations provided by SiteGround
    13  * Version:           7.6.4
     13 * Version:           7.6.5
    1414 * Author:            SiteGround
    1515 * Author URI:        https://www.siteground.com
     
    3333// Define version constant.
    3434if ( ! defined( __NAMESPACE__ . '\VERSION' ) ) {
    35     define( __NAMESPACE__ . '\VERSION', '7.6.4' );
     35    define( __NAMESPACE__ . '\VERSION', '7.6.5' );
    3636}
    3737
Note: See TracChangeset for help on using the changeset viewer.