Plugin Directory

Changeset 2978978


Ignore:
Timestamp:
10/14/2023 08:25:20 AM (2 years ago)
Author:
futtta
Message:

getting ready for 3.1.9

Location:
autoptimize/trunk
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • autoptimize/trunk/autoptimize.php

    r2929681 r2978978  
    44 * Plugin URI: https://autoptimize.com/pro/
    55 * Description: Makes your site faster by optimizing CSS, JS, Images, Google fonts and more.
    6  * Version: 3.1.8.1
     6 * Version: 3.1.9
    77 * Author: Frank Goossens (futtta)
    88 * Author URI: https://autoptimize.com/pro/
     
    2222}
    2323
    24 define( 'AUTOPTIMIZE_PLUGIN_VERSION', '3.1.8.1' );
     24define( 'AUTOPTIMIZE_PLUGIN_VERSION', '3.1.9' );
    2525
    2626// plugin_dir_path() returns the trailing slash!
  • autoptimize/trunk/classes/autoptimizeCache.php

    r2786932 r2978978  
    388388            $caller = isset( $dbt[1]['function'] ) ? $dbt[1]['function'] : null;
    389389            if ( 'et_core_clear_wp_cache' === $caller ) {
    390                 _doing_it_wrong( 'autoptimizeCache::clearall', 'Divi devs: please don\'t clear Autoptimize\'s cache, it is unneeded and can break sites. You can contact me at [email protected] to discuss.', 'Autoptimize 2.9.6' );
     390                if ( apply_filters( 'autoptimize_filter_cache_divi_wrong_complain', true ) ) {
     391                    _doing_it_wrong( 'autoptimizeCache::clearall', 'Divi devs: please don\'t clear Autoptimize\'s cache, it is unneeded and can break sites. You can contact me at [email protected] to discuss.', 'Autoptimize 2.9.6' );
     392                }
    391393                return false;
    392394            }
  • autoptimize/trunk/classes/autoptimizeConfig.php

    r2903008 r2978978  
    336336<tr valign="top" class="css_sub" id="autoptimize_css_defer_inline">
    337337<th scope="row"></th>
    338 <td><label><textarea rows="10" cols="10" style="width:100%;" placeholder="<?php _e( 'Paste the above the fold CSS here. You can leave this empty when using the automated Critical CSS integration.', 'autoptimize' ); ?>" name="autoptimize_css_defer_inline"><?php echo autoptimizeStyles::sanitize_css( autoptimizeOptionWrapper::get_option( 'autoptimize_css_defer_inline' ) ); ?></textarea></label></td>
     338<td><label><textarea rows="10" cols="10" style="width:100%;" spellcheck="false" placeholder="<?php _e( 'Paste the above the fold CSS here. You can leave this empty when using the automated Critical CSS integration.', 'autoptimize' ); ?>" name="autoptimize_css_defer_inline"><?php echo autoptimizeStyles::sanitize_css( autoptimizeOptionWrapper::get_option( 'autoptimize_css_defer_inline' ) ); ?></textarea></label></td>
    339339</tr>
    340340<tr valign="top" class="css_sub css_aggregate">
     
    809809    {
    810810        static $config = array(
    811             'autoptimize_html'                           => 0,
     811            'autoptimize_html'                           => 1,
    812812            'autoptimize_html_keepcomments'              => 0,
    813813            'autoptimize_html_minify_inline'             => 0,
    814814            'autoptimize_enable_site_config'             => 1,
    815             'autoptimize_js'                             => 0,
     815            'autoptimize_js'                             => 1,
    816816            'autoptimize_js_aggregate'                   => 0,
    817817            'autoptimize_js_defer_not_aggregate'         => 1,
     
    822822            'autoptimize_js_include_inline'              => 0,
    823823            'autoptimize_js_forcehead'                   => 0,
    824             'autoptimize_css'                            => 0,
     824            'autoptimize_css'                            => 1,
    825825            'autoptimize_css_aggregate'                  => 0,
    826826            'autoptimize_css_exclude'                    => '',
  • autoptimize/trunk/classes/autoptimizeCriticalCSSSettings.php

    r2882657 r2978978  
    190190                    <div data-dismissible="i-know-about-disable-cron-forever" class="notice-warning notice is-dismissible"><p>
    191191                    <?php
    192                     _e( 'WordPress cron (for task scheduling) seems to be disabled. Have a look at <a href="https://wordpress.org/plugins/autoptimize-criticalcss/faq/" target="_blank">the FAQ</a> or the info in the Job Queue instructions if all jobs remain in "N" status and no rules are created.', 'autoptimize' );
     192                    _e( 'WordPress cron (for task scheduling) seems to be disabled. Have a look at <a href="https://blog.futtta.be/2023/03/17/how-to-fix-autoptimize-critical-css-cron-issue/" target="_blank">the FAQ</a> or the info in the Job Queue instructions if all jobs remain in "N" status and no rules are created.', 'autoptimize' );
    193193                    ?>
    194194                    </p></div>
  • autoptimize/trunk/classes/autoptimizeImages.php

    r2929681 r2978978  
    10851085
    10861086            // set default exclusions.
    1087             $exclude_lazyload_array = array( 'skip-lazy', 'data-no-lazy', 'notlazy', 'data-src', 'data-srcset', 'data:image/', 'data-lazyload', 'rev-slidebg', 'loading="eager"' );
     1087            $exclude_lazyload_array = array( 'skip-lazy', 'data-no-lazy', 'notlazy', 'data-src', 'data-srcset', 'data:image/', 'data-lazyload', 'rev-slidebg', 'loading="eager"', 'fetchpriority="high"' );
    10881088
    10891089            // add from setting.
  • autoptimize/trunk/classes/autoptimizeMain.php

    r2879913 r2978978  
    192192
    193193                // And disable Jetpack's site accelerator if JS or CSS opt. are active.
    194                 if ( class_exists( 'Jetpack' ) && apply_filters( 'autoptimize_filter_main_disable_jetpack_cdn', true ) && ( $conf->get( 'autoptimize_js' ) || $conf->get( 'autoptimize_css' ) ) ) {
    195                     add_filter( 'jetpack_force_disable_site_accelerator', '__return_true' );
     194                if ( class_exists( 'Jetpack' ) && apply_filters( 'autoptimize_filter_main_disable_jetpack_cdn', true ) && ( $conf->get( 'autoptimize_js' ) || $conf->get( 'autoptimize_css' ) || autoptimizeImages::imgopt_active() ) ) {
     195                    add_filter( 'jetpack_force_disable_site_accelerator', '__return_true' ); // this does not seemt to work any more?
     196                    add_filter( 'jetpack_photon_skip_for_url', '__return_true' );
    196197                }
    197198
     
    225226            new autoptimizePartners();
    226227            new autoptimizeExitSurvey();
     228            new autoptimizeProTab();
    227229        }
    228230    }
     
    750752    {
    751753        echo '<div class="updated"><p>';
    752         printf( __( 'Thank you for installing and activating Autoptimize. Please configure it under %1$sSettings -> Autoptimize%2$s to start improving your site\'s performance.', 'autoptimize' ), '<a href="options-general.php?page=autoptimize">', '</a>' );
     754        printf( __( 'Thank you for installing and activating Autoptimize. Your site is being optimized immediately, please test the frontend to ensure everything still works as expected. If needed you can change JavaScript or CSS optimization settings under %1$sSettings -> Autoptimize%2$s .', 'autoptimize' ), '<a href="options-general.php?page=autoptimize">', '</a>' );
    753755        echo '</p></div>';
    754756    }
  • autoptimize/trunk/classes/autoptimizeScripts.php

    r2851119 r2978978  
    378378
    379379                        // not aggregating but deferring?
    380                         if ( $this->defer_not_aggregate && false === $this->aggregate && ( str_replace( $this->dontmove, '', $path ) === $path || ( apply_filters( 'autoptimize_filter_js_defer_external', true ) && str_replace( $this->dontmove, '', $orig_tag ) === $orig_tag ) ) && strpos( $new_tag, ' defer' ) === false && strpos( $new_tag, ' async' ) === false ) {
    381                             $new_tag = str_replace( '<script ', '<script defer ', $new_tag );
     380                        if ( $this->defer_not_aggregate && false === $this->aggregate && ( str_replace( $this->dontmove, '', $path ) === $path || ( apply_filters( 'autoptimize_filter_js_defer_external', true ) && str_replace( $this->dontmove, '', $orig_tag ) === $orig_tag ) ) && strpos( $new_tag, ' defer' ) === false ) {
     381                            if ( false !== strpos( $new_tag, ' async' ) && true === apply_filters( 'autoptimize_filter_js_defer_trumps_async', true ) ) {
     382                                // remove async flag to ensure JS is properly deferred, otherwise the asynced JS might fire
     383                                // before deferred inlined JS is executed, off course except filter is set to false which
     384                                // re-institutes previous behavior.
     385                                $new_tag = str_replace( array( " async='async'", ' async="async"', ' async=async', ' async' ), '', $new_tag );
     386                            }
     387                           
     388                            if ( false === strpos( $new_tag, ' async' ) ) {
     389                                // either async wasn't there to begin with or it was removed.
     390                                // if async is there, the autoptimize_filter_js_defer_trumps_async
     391                                // filter was set to false and in that case defer should not be added.
     392                                $new_tag = str_replace( '<script ', '<script defer ', $new_tag );
     393                            }
    382394                        }
    383395
     
    461473
    462474                            $new_tag       = '<script defer ' . $_id . 'src="data:text/javascript;base64,' . base64_encode( $match[3] ) . '"></script>';
    463                             $this->content = str_replace( $tag, $new_tag, $this->content );
     475                            $this->content = str_replace( $this->hide_comments( $tag ), $new_tag, $this->content );
    464476                            $tag           = '';
    465477                        } else {
  • autoptimize/trunk/classes/autoptimizeUtils.php

    r2903008 r2978978  
    410410            $_page_cache_constants = array(
    411411                'NgInx' => 'NGINX_HELPER_BASENAME',
    412                 'Kinsta' => 'KINSTA_CACHE_ZONE',
     412                'Kinsta' => 'KINSTAMU_VERSION',
    413413                'Presslabs' => 'PL_INSTANCE_REF',
    414414                'Cache Enabler' => 'CACHE_ENABLER_VERSION',
     
    491491     */
    492492    public static function is_ao_settings() {
    493         $_is_ao_settings = ( str_replace( array( 'autoptimize', 'autoptimize_imgopt', 'ao_critcss', 'autoptimize_extra', 'ao_partners', 'ao_pro_boosters' ), '', $_SERVER['REQUEST_URI'] ) !== $_SERVER['REQUEST_URI'] ? true : false );
     493        $_is_ao_settings = ( str_replace( array( 'autoptimize', 'autoptimize_imgopt', 'ao_critcss', 'autoptimize_extra', 'ao_partners', 'ao_pro_boosters', 'ao_pro_pagecache', 'ao_protab' ), '', $_SERVER['REQUEST_URI'] ) !== $_SERVER['REQUEST_URI'] ? true : false );
    494494        return $_is_ao_settings;
    495495    }
     
    557557                // localhost IPv4/ IPv6.
    558558                $_is_local_server = true;
    559             } elseif ( 0 === strpos( $_domain, '127.' ) || 0 === strpos( $_domain, '192.168.' ) || 0 === strpos( $_domain, 'fd' ) ) {
     559            } elseif ( 0 === strpos( $_domain, '127.' ) || 0 === strpos( $_domain, '192.168.' ) || 0 === strpos( $_domain, '10.' ) || 0 === strpos( $_domain, 'fd' ) ) {
    560560                // private ranges so unreachable for imgopt/ CCSS.
     561                // fixme; 172.16.0.0–172.31.255.255 also private.
    561562                $_is_local_server = true;
    562563            } elseif ( autoptimizeUtils::str_ends_in( $_domain, '.local') ) {
  • autoptimize/trunk/classes/critcss-inc/admin_settings_explain.php

    r2703914 r2978978  
    3535                        if ( '200' == wp_remote_retrieve_response_code( $ccss_expl_resp ) ) {
    3636                            $ccss_explanation = wp_kses_post( wp_remote_retrieve_body( $ccss_expl_resp ) );
    37                             set_transient( 'ao3_ccss_explain', $ccss_explanation, WEEK_IN_SECONDS );
     37                            set_transient( $_transient, $ccss_explanation, WEEK_IN_SECONDS );
    3838                        }
    3939                    }
  • autoptimize/trunk/classes/critcss-inc/admin_settings_rules.js.php

    r2786932 r2978978  
    233233        jQuery("#critcss_addedit_file").val(crit_file);
    234234        jQuery("#critcss_addedit_css").attr("placeholder", "<?php _e( 'Loading critical CSS...', 'autoptimize' ); ?>");
     235        jQuery("#critcss_addedit_css").attr("spellcheck",false);
    235236        jQuery("#critcss_addedit_type").attr("disabled",true);
    236237
     
    265266        // default: paths, hide content type field
    266267        jQuery("#critcss_addedit_type").val("paths");
     268        jQuery("#critcss_addedit_css").attr("spellcheck",false);
    267269        jQuery("#critcss_addedit_pagetype_wrapper").hide();
    268270
     
    316318function editDefaultCritCss(){
    317319    document.getElementById("dummyDefault").value=document.getElementById("autoptimize_css_defer_inline").value;
     320    jQuery("#dummyDefault").attr("spellcheck",false);
    318321    jQuery("#default_critcss_wrapper").dialog({
    319322        autoOpen: true,
     
    337340function editAdditionalCritCss(){
    338341    document.getElementById("dummyAdditional").value=document.getElementById("autoptimize_ccss_additional").value;
     342    jQuery("#dummyAdditional").attr("spellcheck",false);
    339343    jQuery("#additional_critcss_wrapper").dialog({
    340344        autoOpen: true,
  • autoptimize/trunk/readme.txt

    r2952963 r2978978  
    33Tags: optimize, minify, performance, images, core web vitals, lazy-load, pagespeed, google fonts
    44Donate link: http://blog.futtta.be/2013/10/21/do-not-donate-to-me/
    5 Requires at least: 5.3 
    6 Tested up to: 6.3
     5Requires at least: 5.3
     6Tested up to: 6.4
    77Requires PHP: 5.6
    88Stable tag: 3.1.8.1
     
    2121> We provide great [Premium Support and Web Performance Optimization services](https://misc.optimizingmatters.com/partners/?from=partnertab&partner=autoptimizepro), check out our offering on [https://accelera.site/](https://misc.optimizingmatters.com/partners/?from=partnertab&partner=autoptimizepro)!
    2222
    23 (Speed-surfing image under  creative commons [by LL Twistiti](https://www.flickr.com/photos/twistiti/818552808/))
     23(Speed-surfing image under creative commons [by LL Twistiti](https://www.flickr.com/photos/twistiti/818552808/))
    2424
    2525== Installation ==
     
    320320== Changelog ==
    321321
     322= 3.1.9 =
     323* improvement: activate JS, CSS & HTML optimization upon plugin activation (hat tip to Adam Silverstein (developer relations engineer at Google))
     324* improvement: also defer asynced JS (to ensure execution order remains intact; asynced JS should not execute before deferred inline JS which it might depend upon)
     325* improvement: exclude images from being lazyloaded if they have fetchpriority attribute set to high (as done by WordPress core since 6.3)
     326* bugfix: disable spellcheck on CSS textarea's (above the fold CSS/ critical CSS) which in some cases caused browser issues
     327* add tab to explain Autoptimize Pro.
     328* confirmed working with WordPress 6.4 (beta 3)
     329* some other minor changes/ improvements/ filters, see the [GitHub commit log](https://github.com/futtta/autoptimize/commits/beta).
     330
    322331= 3.1.8.1 =
    323332* urgent fix for PHP error, sorry about that!
Note: See TracChangeset for help on using the changeset viewer.