Coming up: Autoptimize 1.8 with API and inlined CSS

I’ve been working on a new Autoptimize version over the last couple of weeks and consider it largely finished now. The following features are in:

  • Optionally inline all CSS as suggested by Hamed (warning: can result in improved pagespeed-score but lower page speed! I’ll write a blogpost about when to use and not to use this one shortly)
  • Simple API Set of filters to provide a simple API (including example code) to change Autoptimize behavior to
    • conditionally disable Autoptimize on a per request-basis
    • change the CSS- and JS-excludes
    • change the limit for CSS background-images to be inlined in the CSS
    • define what JS-files are moved behind the aggregated one
    • change the defer-attribute on the aggregated JS script-tag
  • Improvement: updated upstream CSS minifier
  • Improvement: switch default delivery of optimized CSS/JS-files from dynamic PHP to static files
  • Improvement (force gzip of static files) and bugfix (force expiry for dynamic files, thanks to Willem Razenberg) in .htaccess
  • Bugfix: fail gracefully when things go wrong (e.g. the CSS import aggregation gone haywire resulting in empty aggregated CSS-files that was reported by Danka)
  • Bugfix: stop import-statements in CSS comments to be taken into acccount as seen by Joseph from blog-it-solutions.de
  • Bugfix: fix for blur in CSS breaking as reported by Chris of clickpanic.com
  • Updated translations

Some more testing and a couple of translations are still to be updated and we’re good to go for a release early January. You’re welcome to join in on the fun off course; download the test-version here and let me know what works and -more importantly- what is broken!

5 thoughts on “Coming up: Autoptimize 1.8 with API and inlined CSS”

  1. Just downloaded the test version you have on your site. Seems to work great, with the one current hiccup I’ve run into being that with debug on, WordPress spits out:
    Notice: Undefined variable: ao_noptimize in /var/www/test.mysite.com/wp-content/plugins/autoptimize/autoptimize.php on line 128
    The line is:
    $ao_noptimize = (bool) apply_filters( ‘autoptimize_filter_noptimize’, $ao_noptimize );
    I tossed a $ao_noptimize = false in front of it to quiet it down :p
    Anyway, just thought I’d let you know. I’ve tried a few CSS/JS plugins and this one is definitely becoming my favourite. It’s also the only one that seems to nicely put deferred javascript in the footer, and now can inline CSS (you wouldn’t believe how many plugin mixes I went through in an attempt to get those 2 things to work well!). Still playing with it on the test site, but I’ll definitely be putting it on the live sites soon. So thanks! 🙂

    Reply
  2. I would like to mention this is working absolutely amazing. With the previous one I had to remove a lot of the CSS files from being optimized because it was causing issues, as well as a lot of JS files. No js files removed and only 3 CSS files. Great updated, and the URI thing I didn’t realize it was there before, activated, took off 3 seconds of load time. My site is now loading at 2.3 seconds and was at 8 seconds before. I give you props for your amazing work.

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.