Changeset 3805887
- Timestamp:
- 11/16/2026 06:52:00 PM (less than one hour ago)
- Location:
- globesign-speed-optimization/trunk
- Files:
-
- 3 edited
-
globesign-speed-optimization.php (modified) (2 diffs)
-
includes/class-gsso-optimizer.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
globesign-speed-optimization/trunk/globesign-speed-optimization.php
r3805838 r3805887 3 3 * Plugin Name: GlobeSign Speed Optimization 4 4 * Description: Safe, all-in-one speed optimization: page cache, browser cache, GZIP, minification, JS defer & delay, lazy loading, preloading and database cleanup. Built to never break your site. 5 * Version: 1.5. 25 * Version: 1.5.3 6 6 * Requires at least: 6.9 7 7 * Requires PHP: 7.4 … … 15 15 defined( 'ABSPATH' ) || exit; 16 16 17 define( 'GSSO_VERSION', '1.5. 2' );17 define( 'GSSO_VERSION', '1.5.3' ); 18 18 define( 'GSSO_FILE', __FILE__ ); 19 19 define( 'GSSO_DIR', plugin_dir_path( __FILE__ ) ); -
globesign-speed-optimization/trunk/includes/class-gsso-optimizer.php
r3805838 r3805887 85 85 86 86 $steps = array(); 87 88 // Theme compatibility fixes that stop the page jumping (always on: they 89 // only change code that would otherwise run a moment later). 90 $steps['theme_fixes'] = array( $this, 'theme_fixes' ); 87 91 88 92 if ( GSSO_Settings::get( 'google_fonts_swap' ) ) { … … 540 544 * above it synchronous, because it may depend on them. 541 545 */ 546 /** 547 * StylemixThemes themes (Consulting and others) size their "Spacing" blocks 548 * with an inline script right after each block, but only on document ready, 549 * so every spacer is 0px tall at first paint and the page jumps when they 550 * open (370px on the Consulting hero). jQuery is loaded in <head>, so the 551 * script can size its block immediately; the ready/resize handlers stay. 552 * The script is also marked so Defer/Delay leave it in place. 553 */ 554 public function theme_fixes( $html ) { 555 if ( false === strpos( $html, 'stmSpacing' ) ) { 556 return $html; 557 } 558 return preg_replace_callback( 559 '#<script\b([^>]*)>(.*?)</script>#is', 560 function ( $m ) { 561 if ( false !== stripos( $m[1], 'src=' ) || false === strpos( $m[2], 'spacingID' ) ) { 562 return $m[0]; 563 } 564 $body = preg_replace( 565 '/\$\(\s*document\s*\)\.ready\(\s*function\s*\(\)\s*\{\s*stmSpacing\(\);\s*\}\s*\);/', 566 'stmSpacing(); $(document).ready(function() { stmSpacing(); });', 567 $m[2], 568 1, 569 $count 570 ); 571 if ( ! $count ) { 572 return $m[0]; 573 } 574 return '<script data-no-defer="1"' . $m[1] . '>' . $body . '</script>'; 575 }, 576 $html 577 ); 578 } 579 542 580 /** Turn a script into one that runs on interaction (or after the timeout). */ 543 581 private static function delay_script( array $s ) { -
globesign-speed-optimization/trunk/readme.txt
r3805838 r3805887 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.5. 27 Stable tag: 1.5.3 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 128 128 == Changelog == 129 129 130 = 1.5.3 = 131 * Fix: on StylemixThemes themes (Consulting and others), "Spacing" blocks were 0px tall until the page finished loading and then opened up, pushing everything down (a large layout shift on the Consulting hero). Their sizing now runs immediately, so the page doesn't jump. Resizing still adjusts them as before. 132 130 133 = 1.5.2 = 131 134 * Fix: Minify JavaScript could break a file containing an "if" (or "for"/"while") with an empty body, such as if ( ... ) ; which made the browser reject the whole file. On the Consulting theme this stopped text from fading in. Minified files now keep that semicolon. … … 189 192 == Upgrade Notice == 190 193 194 = 1.5.3 = 195 Stops the page jumping on StylemixThemes themes (Consulting and others) caused by spacing blocks opening after load. 196 191 197 = 1.5.2 = 192 198 Fixes a JavaScript minification bug that could hide animated text on some themes, and reCAPTCHA errors on Contact Form 7 when delaying scripts.
Note:
See TracChangeset
for help on using the changeset viewer.