Changeset 3150542
- Timestamp:
- 09/12/2024 07:17:56 AM (15 months ago)
- Location:
- sg-cachepress/trunk
- Files:
-
- 7 edited
-
core/Admin/Admin.php (modified) (6 diffs)
-
core/Loader/Loader.php (modified) (1 diff)
-
core/Message_Service/Message_Service.php (modified) (3 diffs)
-
core/Modules/Modules.php (modified) (8 diffs)
-
core/Performance_Reports/Performance_Reports.php (modified) (8 diffs)
-
readme.txt (modified) (2 diffs)
-
sg-cachepress.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sg-cachepress/trunk/core/Admin/Admin.php
r3056105 r3150542 69 69 /** 70 70 * Check if it's a multisite, but the single site 71 * has no permis ions to edit optimizer settings.71 * has no permissions to edit optimizer settings. 72 72 * 73 73 * @since 5.0.0 … … 98 98 // Hide all error in our page. 99 99 if ( 100 isset( $_GET['page'] ) && 100 isset( $_GET['page'] ) && // phpcs:ignore 101 101 array_key_exists( $_GET['page'], $this->subpages ) // phpcs:ignore 102 102 ) { … … 133 133 'all' 134 134 ); 135 136 135 } 137 136 … … 208 207 $show_notice = (int) get_site_option( 'siteground_optimizer_memcache_notice', 0 ); 209 208 210 // Bail if the current user is not admin or if we sho ldn't display notice.209 // Bail if the current user is not admin or if we shouldn't display notice. 211 210 if ( 212 211 ! is_admin() || … … 231 230 esc_attr( $class ), 232 231 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' ) ) 234 233 ); 235 234 } … … 345 344 346 345 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>'; 348 347 } else { 349 348 $data['rest_base'] = untrailingslashit( get_rest_url( null, Rest::REST_NAMESPACE ) ); -
sg-cachepress/trunk/core/Loader/Loader.php
r3115310 r3150542 182 182 // Check if class exists. 183 183 if ( ! class_exists( $class ) ) { 184 throw new \Exception( 'Unknown library type "' . $library. '".' );184 throw new \Exception( 'Unknown library type "' . esc_html( $library ) . '".' ); 185 185 } 186 186 -
sg-cachepress/trunk/core/Message_Service/Message_Service.php
r2971883 r3150542 9 9 class Message_Service { 10 10 /** 11 * React respon ce messages.11 * React response messages. 12 12 * 13 13 * @since 6.0.0 … … 73 73 74 74 if ( is_null( $type ) ) { 75 return sprintf( __( '%s', 'sg-cachepress' ), $messages[ $option ] );75 return $messages[ $option ]; 76 76 } 77 77 78 78 if ( true === $result ) { 79 79 if ( 1 === $type ) { 80 /* translators: 1: the message option */ 80 81 return sprintf( __( '%s Enabled', 'sg-cachepress' ), $messages[ $option ] ); 81 82 } 82 83 /* translators: 1: the message option */ 83 84 return sprintf( __( '%s Disabled', 'sg-cachepress' ), $messages[ $option ] ); 84 85 … … 86 87 87 88 if ( 1 === $type ) { 89 /* translators: 1: the message option */ 88 90 return sprintf( __( 'Could not enable %s', 'sg-cachepress' ), $messages[ $option ] ); 89 91 } 90 92 /* translators: 1: the message option */ 91 93 return sprintf( __( 'Could not disable %s', 'sg-cachepress' ), $messages[ $option ] ); 92 94 } -
sg-cachepress/trunk/core/Modules/Modules.php
r2971883 r3150542 18 18 */ 19 19 private static $instance; 20 21 22 /** 23 * The Optimizer plugin tabs placeholder. 24 * 25 * @var array. 26 */ 27 public $tabs; 20 28 21 29 /** … … 212 220 213 221 /** 214 * List of all tabs.215 *216 * @since 5.0.0217 *218 * @access private219 *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 /**263 222 * List of multisite tabs. 264 223 * … … 480 439 ), 481 440 ); 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 482 501 483 502 /** … … 540 559 541 560 $message = sprintf( 561 /* translators: 1: list of conflicting plugins, 2: module names */ 542 562 __( '<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' ), 543 563 implode( ', ', $excluded['conflicting_plugins'] ), … … 548 568 '<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>', 549 569 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' ) ) 552 572 ); 553 573 } … … 575 595 576 596 $message = sprintf( 597 /* translators: 1: list of conflicting plugins */ 577 598 __( '<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' ), 578 599 implode( ', ', $excluded['conflicting_plugins'] ) … … 582 603 '<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>', 583 604 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' ) ) 586 607 ); 587 608 } … … 685 706 // Build tabs data. 686 707 foreach ( $this->tabs as $tab_slug => $tab ) { 687 $active_tabs[ $tab_slug ] = __( $tab['title'], 'sg-cachepress' );708 $active_tabs[ $tab_slug ] = $tab['title']; 688 709 } 689 710 -
sg-cachepress/trunk/core/Performance_Reports/Performance_Reports.php
r2971883 r3150542 27 27 */ 28 28 public function __construct() { 29 $current Date= 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 ) ) ); 31 31 32 32 // Initiate the Email Service Class. … … 96 96 97 97 /** 98 * Get assets from remote json.98 * Get assets from remote JSON. 99 99 * 100 100 * @since 7.4.0 … … 132 132 $assets['default']['lang'] = 'default'; 133 133 134 // Return the correct assets, title and marketing urls.134 // Return the correct assets, title and marketing URLs. 135 135 return $assets['default']; 136 136 } … … 230 230 'score' => $score, 231 231 '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'], 233 233 ); 234 234 … … 252 252 'score' => $score, 253 253 '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'], 255 255 ); 256 256 … … 298 298 'score' => $score, 299 299 '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'], 301 301 ); 302 302 } … … 354 354 355 355 /** 356 * Update the performance report rec eipient when admin email is updated.356 * Update the performance report recipient when admin email is updated. 357 357 * 358 358 * @since 7.4.0 … … 371 371 } 372 372 373 // Bail if the rec eipient does not match the previous admin email address set.373 // Bail if the recipient does not match the previous admin email address set. 374 374 if ( $old_value !== $current_receipient ) { 375 375 return; 376 376 } 377 377 378 // Update the rec eipient to the new admin email set.378 // Update the recipient to the new admin email set. 379 379 update_option( 'siteground_optimizer_performace_receipient', $new_value ); 380 380 } 381 381 382 382 /** 383 * This function registers mont ly interval for the cron.383 * This function registers monthly interval for the CRON. 384 384 * 385 385 * @since 7.4.0 -
sg-cachepress/trunk/readme.txt
r3135504 r3150542 5 5 Requires PHP: 7.0 6 6 Tested up to: 6.6 7 Stable tag: 7.6. 47 Stable tag: 7.6.5 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 119 119 == Changelog == 120 120 121 = Version 7.6.5 = 122 Release Date: Sept 12th, 2024 123 124 * Performance Reports improvements 125 * Message Service improvements 126 * Admin pages improvements 127 121 128 = Version 7.6.4 = 122 129 Release Date: Aug 14th, 2024 -
sg-cachepress/trunk/sg-cachepress.php
r3135504 r3150542 11 11 * Plugin URI: https://siteground.com 12 12 * Description: This plugin will link your WordPress application with all the performance optimizations provided by SiteGround 13 * Version: 7.6. 413 * Version: 7.6.5 14 14 * Author: SiteGround 15 15 * Author URI: https://www.siteground.com … … 33 33 // Define version constant. 34 34 if ( ! defined( __NAMESPACE__ . '\VERSION' ) ) { 35 define( __NAMESPACE__ . '\VERSION', '7.6. 4' );35 define( __NAMESPACE__ . '\VERSION', '7.6.5' ); 36 36 } 37 37
Note: See TracChangeset
for help on using the changeset viewer.