Changeset 3401333
- Timestamp:
- 11/23/2025 02:59:14 PM (4 months ago)
- Location:
- autoptimize
- Files:
-
- 13 edited
- 13 copied
-
tags/3.1.14 (copied) (copied from autoptimize/trunk)
-
tags/3.1.14/autoptimize.php (copied) (copied from autoptimize/trunk/autoptimize.php) (2 diffs)
-
tags/3.1.14/classes/autoptimizeBase.php (modified) (1 diff)
-
tags/3.1.14/classes/autoptimizeCSSmin.php (copied) (copied from autoptimize/trunk/classes/autoptimizeCSSmin.php) (1 diff)
-
tags/3.1.14/classes/autoptimizeConfig.php (copied) (copied from autoptimize/trunk/classes/autoptimizeConfig.php)
-
tags/3.1.14/classes/autoptimizeCriticalCSSBase.php (modified) (1 diff)
-
tags/3.1.14/classes/autoptimizeCriticalCSSCore.php (copied) (copied from autoptimize/trunk/classes/autoptimizeCriticalCSSCore.php)
-
tags/3.1.14/classes/autoptimizeCriticalCSSCron.php (copied) (copied from autoptimize/trunk/classes/autoptimizeCriticalCSSCron.php) (1 diff)
-
tags/3.1.14/classes/autoptimizeExtra.php (copied) (copied from autoptimize/trunk/classes/autoptimizeExtra.php)
-
tags/3.1.14/classes/autoptimizeImages.php (copied) (copied from autoptimize/trunk/classes/autoptimizeImages.php) (1 diff)
-
tags/3.1.14/classes/autoptimizeMain.php (modified) (1 diff)
-
tags/3.1.14/classes/autoptimizeProTab.php (copied) (copied from autoptimize/trunk/classes/autoptimizeProTab.php)
-
tags/3.1.14/classes/autoptimizeScripts.php (copied) (copied from autoptimize/trunk/classes/autoptimizeScripts.php)
-
tags/3.1.14/classes/autoptimizeVersionUpdatesHandler.php (copied) (copied from autoptimize/trunk/classes/autoptimizeVersionUpdatesHandler.php)
-
tags/3.1.14/classes/critcss-inc/admin_settings_rules.php (copied) (copied from autoptimize/trunk/classes/critcss-inc/admin_settings_rules.php)
-
tags/3.1.14/config/autoptimize_404_handler.php (modified) (1 diff)
-
tags/3.1.14/readme.txt (copied) (copied from autoptimize/trunk/readme.txt) (2 diffs)
-
trunk/autoptimize.php (modified) (2 diffs)
-
trunk/classes/autoptimizeBase.php (modified) (1 diff)
-
trunk/classes/autoptimizeCSSmin.php (modified) (1 diff)
-
trunk/classes/autoptimizeCriticalCSSBase.php (modified) (1 diff)
-
trunk/classes/autoptimizeCriticalCSSCron.php (modified) (1 diff)
-
trunk/classes/autoptimizeImages.php (modified) (1 diff)
-
trunk/classes/autoptimizeMain.php (modified) (1 diff)
-
trunk/config/autoptimize_404_handler.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
autoptimize/tags/3.1.14/autoptimize.php
r3208241 r3401333 4 4 * Plugin URI: https://autoptimize.com/pro/ 5 5 * Description: Makes your site faster by optimizing CSS, JS, Images, Google fonts and more. 6 * Version: 3.1.1 36 * Version: 3.1.14 7 7 * Author: Frank Goossens (futtta) 8 8 * Author URI: https://autoptimize.com/pro/ … … 22 22 } 23 23 24 define( 'AUTOPTIMIZE_PLUGIN_VERSION', '3.1.1 3' );24 define( 'AUTOPTIMIZE_PLUGIN_VERSION', '3.1.14' ); 25 25 26 26 // plugin_dir_path() returns the trailing slash! -
autoptimize/tags/3.1.14/classes/autoptimizeBase.php
r2878905 r3401333 600 600 $content 601 601 ); 602 603 // Check for error (for example, an error can occur if $content is very large). 604 if ( null === $content ) { 605 $error_message = 'Autoptimize: preg_replace_callback() failed'; 606 if ( function_exists( 'preg_last_error_msg' ) ) { 607 $error_message .= ': ' . preg_last_error_msg(); 608 } 609 error_log( $error_message ); 610 } 602 611 } 603 612 -
autoptimize/tags/3.1.14/classes/autoptimizeCSSmin.php
r3208241 r3401333 40 40 // regex see tests at https://regex101.com/r/ofGQG9/1 41 41 if ( apply_filters( 'autoptimize_filter_css_hide_calc', true ) ) { 42 $css = autoptimizeBase::replace_contents_with_marker_if_exists( 'CALC', 'calc(', '#(calc|min|max|clamp)\([^; ]*\)#m', $css );42 $css = autoptimizeBase::replace_contents_with_marker_if_exists( 'CALC', 'calc(', '#(calc|min|max|clamp)\([^;}]*\)#m', $css ); 43 43 } 44 44 -
autoptimize/tags/3.1.14/classes/autoptimizeCriticalCSSBase.php
r3048250 r3401333 281 281 ); 282 282 283 if ( strpos( $this->_options['domain'], 'http' ) === false && strpos( $this->_options['domain'], 'uggc' ) === 0) {283 if ( ( strpos( $this->_options['domain'], 'http' ) === false && strpos( $this->_options['domain'], 'uggc' ) === 0 ) || 'abar' === $this->_options['domain'] ) { 284 284 $this->_options['domain'] = str_rot13( $this->_options['domain'] ); 285 285 } elseif ( strpos( $this->_options['domain'], 'http' ) !== false ) { -
autoptimize/tags/3.1.14/classes/autoptimizeCriticalCSSCron.php
r3208241 r3401333 96 96 97 97 // Initialize counters. 98 if ( 0 == $rtimelimit ) {98 if ( empty( $rtimelimit ) || 0 == $rtimelimit ) { 99 99 // no time limit set, let's go with 1000 seconds. 100 100 $rtimelimit = 1000; 101 101 } 102 $mt = time() + $rtimelimit; // maxtime queue processing can run.102 $mt = time() + (int) $rtimelimit; // maxtime queue processing can run. 103 103 $jc = 1; // job count number. 104 104 $jr = 1; // jobs requests number. -
autoptimize/tags/3.1.14/classes/autoptimizeImages.php
r3208241 r3401333 1057 1057 $tag = str_replace( $_from, $_to, $tag ); 1058 1058 1059 // and remove title, alt, class and id. 1060 $tag = preg_replace( '/ ((?:title|alt|class|id|loading|fetchpriority|decoding|data-no-lazy|width|height)=".*")/Um', '', $tag ); 1061 if ( str_replace( array( ' title=', ' class=', ' alt=', ' id=', ' fetchpriority=', ' decoding=', ' data-no-lazy=' ), '', $tag ) !== $tag ) { 1062 // 2nd regex pass if still title/ class/ alt in case single quotes were used iso doubles. 1063 $tag = preg_replace( '/ ((?:title|alt|class|id|loading|fetchpriority|decoding|data-no-lazy)=\'.*\')/Um', '', $tag ); 1064 } 1065 1059 // and using kses, remove all unneeded attributes 1060 // keeping only those we *know* are OK and/ or needed 1061 $allowed_html = array( 1062 'link' => array( 1063 'rel' => true, 1064 'as' => true, 1065 'href' => true, 1066 'imagesizes' => true, 1067 'imagesrcset' => true, 1068 'type' => true, 1069 'media' => true, 1070 ), 1071 ); 1072 $tag = wp_kses( $tag, $allowed_html ); 1073 1066 1074 return $tag; 1067 1075 } -
autoptimize/tags/3.1.14/classes/autoptimizeMain.php
r3048250 r3401333 766 766 { 767 767 echo '<div class="updated"><p>'; 768 printf( esc_html_ e( 'Autoptimize has just been updated. Please %1$stest your site now%2$s and adapt Autoptimize config if needed.', 'autoptimize' ), '<strong>', '</strong>' );768 printf( esc_html__( 'Autoptimize has just been updated. Please %1$stest your site now%2$s and adapt Autoptimize config if needed.', 'autoptimize' ), '<strong>', '</strong>' ); 769 769 echo '</p></div>'; 770 770 } -
autoptimize/tags/3.1.14/config/autoptimize_404_handler.php
r2786932 r3401333 43 43 if ( $original_request !== $fallback_target && file_exists( $fallback_path ) ) { 44 44 // error_log( 'Autoptimize file ' . $original_request . ' not found, using fallback instead.' ); 45 header( 'HTTP/1.1 30 1 Moved Permanently' );45 header( 'HTTP/1.1 302 Found' ); 46 46 header( 'Location: ' . $fallback_target ); 47 47 } else { -
autoptimize/tags/3.1.14/readme.txt
r3298738 r3401333 6 6 License URI: [https://www.gnu.org/licenses/gpl-3.0.html](https://www.gnu.org/licenses/gpl-3.0.html) 7 7 Requires at least: 5.3 8 Tested up to: 6. 89 Requires PHP: 5.610 Stable tag: 3.1.1 38 Tested up to: 6.9 9 Requires PHP: 7.1 10 Stable tag: 3.1.14 11 11 12 12 Autoptimize speeds up your website by optimizing JS, CSS, images (incl. lazy-load), HTML and Google Fonts, asyncing JS, removing emoji cruft and more. … … 322 322 == Changelog == 323 323 324 = 3.1.14 = 325 * improve HTML output for <link rel="preload" images (based on report by Muhammad) 326 * let the 404-handler issue a 302 iso 301 HTTP response (as mentioned by thefitrv) 327 * small improvement in critical CSS cron job handling in case of an empty "time limit" (thanks for the help Jason) 328 * fix bug in "domain binding" in critical CSS advanced options (reported by Hazel) 329 * catch and report (exceptional) JS optimization issues causing preg_replace_callback to crash out (in case of a huge amount of JS code), thanks siliconforks 330 * confirmed OK with WordPress 6.9 331 324 332 = 3.1.13 = 325 333 * multiple minor changes/ improvements/ bugfixes, see the [GitHub commit log](https://github.com/futtta/autoptimize/commits/beta). -
autoptimize/trunk/autoptimize.php
r3208241 r3401333 4 4 * Plugin URI: https://autoptimize.com/pro/ 5 5 * Description: Makes your site faster by optimizing CSS, JS, Images, Google fonts and more. 6 * Version: 3.1.1 36 * Version: 3.1.14 7 7 * Author: Frank Goossens (futtta) 8 8 * Author URI: https://autoptimize.com/pro/ … … 22 22 } 23 23 24 define( 'AUTOPTIMIZE_PLUGIN_VERSION', '3.1.1 3' );24 define( 'AUTOPTIMIZE_PLUGIN_VERSION', '3.1.14' ); 25 25 26 26 // plugin_dir_path() returns the trailing slash! -
autoptimize/trunk/classes/autoptimizeBase.php
r2878905 r3401333 600 600 $content 601 601 ); 602 603 // Check for error (for example, an error can occur if $content is very large). 604 if ( null === $content ) { 605 $error_message = 'Autoptimize: preg_replace_callback() failed'; 606 if ( function_exists( 'preg_last_error_msg' ) ) { 607 $error_message .= ': ' . preg_last_error_msg(); 608 } 609 error_log( $error_message ); 610 } 602 611 } 603 612 -
autoptimize/trunk/classes/autoptimizeCSSmin.php
r3208241 r3401333 40 40 // regex see tests at https://regex101.com/r/ofGQG9/1 41 41 if ( apply_filters( 'autoptimize_filter_css_hide_calc', true ) ) { 42 $css = autoptimizeBase::replace_contents_with_marker_if_exists( 'CALC', 'calc(', '#(calc|min|max|clamp)\([^; ]*\)#m', $css );42 $css = autoptimizeBase::replace_contents_with_marker_if_exists( 'CALC', 'calc(', '#(calc|min|max|clamp)\([^;}]*\)#m', $css ); 43 43 } 44 44 -
autoptimize/trunk/classes/autoptimizeCriticalCSSBase.php
r3048250 r3401333 281 281 ); 282 282 283 if ( strpos( $this->_options['domain'], 'http' ) === false && strpos( $this->_options['domain'], 'uggc' ) === 0) {283 if ( ( strpos( $this->_options['domain'], 'http' ) === false && strpos( $this->_options['domain'], 'uggc' ) === 0 ) || 'abar' === $this->_options['domain'] ) { 284 284 $this->_options['domain'] = str_rot13( $this->_options['domain'] ); 285 285 } elseif ( strpos( $this->_options['domain'], 'http' ) !== false ) { -
autoptimize/trunk/classes/autoptimizeCriticalCSSCron.php
r3208241 r3401333 96 96 97 97 // Initialize counters. 98 if ( 0 == $rtimelimit ) {98 if ( empty( $rtimelimit ) || 0 == $rtimelimit ) { 99 99 // no time limit set, let's go with 1000 seconds. 100 100 $rtimelimit = 1000; 101 101 } 102 $mt = time() + $rtimelimit; // maxtime queue processing can run.102 $mt = time() + (int) $rtimelimit; // maxtime queue processing can run. 103 103 $jc = 1; // job count number. 104 104 $jr = 1; // jobs requests number. -
autoptimize/trunk/classes/autoptimizeImages.php
r3208241 r3401333 1057 1057 $tag = str_replace( $_from, $_to, $tag ); 1058 1058 1059 // and remove title, alt, class and id. 1060 $tag = preg_replace( '/ ((?:title|alt|class|id|loading|fetchpriority|decoding|data-no-lazy|width|height)=".*")/Um', '', $tag ); 1061 if ( str_replace( array( ' title=', ' class=', ' alt=', ' id=', ' fetchpriority=', ' decoding=', ' data-no-lazy=' ), '', $tag ) !== $tag ) { 1062 // 2nd regex pass if still title/ class/ alt in case single quotes were used iso doubles. 1063 $tag = preg_replace( '/ ((?:title|alt|class|id|loading|fetchpriority|decoding|data-no-lazy)=\'.*\')/Um', '', $tag ); 1064 } 1065 1059 // and using kses, remove all unneeded attributes 1060 // keeping only those we *know* are OK and/ or needed 1061 $allowed_html = array( 1062 'link' => array( 1063 'rel' => true, 1064 'as' => true, 1065 'href' => true, 1066 'imagesizes' => true, 1067 'imagesrcset' => true, 1068 'type' => true, 1069 'media' => true, 1070 ), 1071 ); 1072 $tag = wp_kses( $tag, $allowed_html ); 1073 1066 1074 return $tag; 1067 1075 } -
autoptimize/trunk/classes/autoptimizeMain.php
r3048250 r3401333 766 766 { 767 767 echo '<div class="updated"><p>'; 768 printf( esc_html_ e( 'Autoptimize has just been updated. Please %1$stest your site now%2$s and adapt Autoptimize config if needed.', 'autoptimize' ), '<strong>', '</strong>' );768 printf( esc_html__( 'Autoptimize has just been updated. Please %1$stest your site now%2$s and adapt Autoptimize config if needed.', 'autoptimize' ), '<strong>', '</strong>' ); 769 769 echo '</p></div>'; 770 770 } -
autoptimize/trunk/config/autoptimize_404_handler.php
r2786932 r3401333 43 43 if ( $original_request !== $fallback_target && file_exists( $fallback_path ) ) { 44 44 // error_log( 'Autoptimize file ' . $original_request . ' not found, using fallback instead.' ); 45 header( 'HTTP/1.1 30 1 Moved Permanently' );45 header( 'HTTP/1.1 302 Found' ); 46 46 header( 'Location: ' . $fallback_target ); 47 47 } else { -
autoptimize/trunk/readme.txt
r3298738 r3401333 6 6 License URI: [https://www.gnu.org/licenses/gpl-3.0.html](https://www.gnu.org/licenses/gpl-3.0.html) 7 7 Requires at least: 5.3 8 Tested up to: 6. 89 Requires PHP: 5.610 Stable tag: 3.1.1 38 Tested up to: 6.9 9 Requires PHP: 7.1 10 Stable tag: 3.1.14 11 11 12 12 Autoptimize speeds up your website by optimizing JS, CSS, images (incl. lazy-load), HTML and Google Fonts, asyncing JS, removing emoji cruft and more. … … 322 322 == Changelog == 323 323 324 = 3.1.14 = 325 * improve HTML output for <link rel="preload" images (based on report by Muhammad) 326 * let the 404-handler issue a 302 iso 301 HTTP response (as mentioned by thefitrv) 327 * small improvement in critical CSS cron job handling in case of an empty "time limit" (thanks for the help Jason) 328 * fix bug in "domain binding" in critical CSS advanced options (reported by Hazel) 329 * catch and report (exceptional) JS optimization issues causing preg_replace_callback to crash out (in case of a huge amount of JS code), thanks siliconforks 330 * confirmed OK with WordPress 6.9 331 324 332 = 3.1.13 = 325 333 * multiple minor changes/ improvements/ bugfixes, see the [GitHub commit log](https://github.com/futtta/autoptimize/commits/beta).
Note: See TracChangeset
for help on using the changeset viewer.