WordPress.org

Ready to get started?Download WordPress

Forums

Autoptimize
[resolved] A couple of small fixes (8 posts)

  1. BigDogSF
    Member
    Posted 4 months ago #

    I've been playing with Autoptimize off and on for the past month. I came back to it today, and finally got everything working nicely.

    I had some issues with an ajax pagination script for my WP-TYPES Toolset, but after excluding the script (wpv-ajax-pagination) everything is in working order.

    Autoptimize presents render blocking css in header - can this be fixed?
    Autoptimize presents Javascript that is not being minified - can this be fixed?
    If there were some way to optimize/sprite the social sharing plugin button pngs - (not sure this can be addressed)

    My google page speed score has gone from an 84 to 93. I did fix a couple other things though, like rerunning my media library through EWWW (made some changes to how pngs are handled and got some nice savings), adding an expiry to the .htaccess files (Use WP Supercache and it does not add expires) like this (use your own expires bys..this is just an example);

    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType text/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 2 days"
    </IfModule>
    ##End EXPIRES CACHING ##

    Reinstalled the Use Google Libraries plugin...this did not change the page speed score...but I can see a marked difference on the front end.

    I'm on a dedicated Apache Server with linux, Nginx, gzip and mod_rewrite enabled with 1tb connection.

    The site is media heavy, with an average of 30 images per page/post, and pulls in 20 plus rss feeds from other websites. Pages are feature heavy, and I have 55 plugins operating on the site. In addition, due to the nature of the site, the left primary sidebar contains approx 18 images, with upwards of 28 active widgets.

    The only places I can see room for improvement (due to the nature of the site) is as follows:

    Autoptimize presents render blocking css in header - can this be fixed?
    Autoptimize presents Javascript that is not being minified - can this be fixed?
    If there were some way to optimize/sprite the social sharing plugin button pngs - (not sure this can be addressed)

    All in all, not bad for this setup.

    Regards,
    Will

    https://wordpress.org/plugins/autoptimize/

  2. Frank Goossens
    Member
    Plugin Author

    Posted 4 months ago #

    Morning Will;
    That's a very nice case study! Does the pagespeed improvement translate into real performance gains as well (by using webpagetest.org) as well?

    Regarding your questions;

    • blocking CSS can be solved by inlining all CSS (which depending on your context can be good or bad) or by deferring (part of) the CSS. There's more info in this blog post.
    • normally JS is minimized, although pagespeed insight sometime claims even more could be optimized those gains are minimal
    • for the social sharing plugin; better to talk to the developer or to bake your own maybe?

    hope this helps,
    frank

  3. BigDogSF
    Member
    Posted 4 months ago #

    Thanks Frank....

    I found one more item in my error log...wondering what this is about:

    [24-Apr-2014 03:25:20 UTC] PHP Fatal error: Uncaught exception 'JSMin_UnterminatedStringException' with message 'JSMin: Unterminated String at byte 367496: "===a.STRING(4,5).toUpperCase()?r():!1):!1' in /home/collecto/public_html/wp-content/plugins/autoptimize/classes/external/php/minify-2.1.7-jsmin.php:203
    Stack trace:
    #0 /home/collecto/public_html/wp-content/plugins/autoptimize/classes/external/php/minify-2.1.7-jsmin.php(145): JSMin->action(1)
    #1 /home/collecto/public_html/wp-content/plugins/autoptimize/classes/external/php/minify-2.1.7-jsmin.php(84): JSMin->min()
    #2 /home/collecto/public_html/wp-content/plugins/autoptimize/classes/autoptimizeScripts.php(175): JSMin::minify('??? ...')
    #3 /home/collecto/public_html/wp-content/plugins/autoptimize/autoptimize.php(249): autoptimizeScripts->minify()
    #4 [internal function]: autoptimize_end_buffering('<!DOCTYPE html>...', 9)
    #5 /home/collecto/public_html/wp-content/plugins/wp-external-links/includes/class-wp-external-links.php(125): ob_end_flush()
    #6 [internal function]: WP_External_Links->callba in /home/collecto/public_html/wp-content/plugins/autoptimize/classes/external/php/minify-2.1.7-jsmin.php on line 203

    Regards,
    Will

  4. Frank Goossens
    Member
    Plugin Author

    Posted 4 months ago #

    hmm, that looks like a conflict between WP External Links and Autoptimize (or rather the JS minification component in Autoptimize). Do you see a lot of those errors, or is this a one-off?

  5. BigDogSF
    Member
    Posted 4 months ago #

    Here are the times: I cleared the error log last night after all updates (I review error reports and apply fixes or dismiss as not important)....and adding the Autopt plugin.

    [24-Apr-2014 03:25:20 UTC]
    [24-Apr-2014 04:17:46 UTC]
    [24-Apr-2014 04:30:57 UTC]
    [24-Apr-2014 09:12:02 UTC]
    [24-Apr-2014 20:07:09 UTC]
    [24-Apr-2014 20:25:06 UTC]
    [24-Apr-2014 22:17:37 UTC]
    [24-Apr-2014 23:19:19 UTC]

    Regards,
    Will

  6. Frank Goossens
    Member
    Plugin Author

    Posted 4 months ago #

    not too frequent, but still ... I would search your JS-files for

    ===a.STRING(4,5).toUpperCase()?r():!1):!1

    (or part of that) and exclude that file from being optimized, just to make sure this doesn't block Autoptimize (although I'm not sure it does, really).

  7. BigDogSF
    Member
    Posted 4 months ago #

    Hi Frank, In regards to the error and your suggestion regarding looking for the a.string. Nothing found like that.

    I looked at " /home/collecto/public_html/wp-content/plugins/wp-external-links/includes/class-wp-external-links.php(125): ob_end_flush()"

    and this is the code.

    /**
    * End output buffer
    */
    public function callback_flush_buffer() {
    ob_end_flush();
    }

    I'm still getting the above outlined error multiple times per day.

    Regards,
    Will

  8. Frank Goossens
    Member
    Plugin Author

    Posted 4 months ago #

    the output buffer stuff is not that relevant I think, the main problem is with the JS minimizer stumbling over that "Unterminated String at byte 367496". Given the fact that this only happens 10 times a day, the JavaScript (a.STRING(4,5).toUpperCase()) is probably hidden somewhere in a less frequently visited page, but it really should be there, somewhere.

    You _could_ gamble that it is in the inline code and just exclude "a.STRING(4" from being optimized?

Reply

You must log in to post.

About this Plugin

About this Topic