AOPro 1.2; delay JS, CSS & HTML as long as you want

Autoptimize Pro has “Boosters” to delay JavaScript (esp. interesting for external resources), CSS and HTML (which can be very impactful for long and/ or complex pages). Up until today’s release the delay was either until user interaction OR a set timeout of 5 seconds, but now you can choose the delay time yourself, setting it to e.g. 20s or 3s or -and that’s where things get a teeny bit shady- 0s to disable the time-out, waiting for user-interaction to load the delayed resources.

Setting the delay to 0 is a bit shady because at that point you are hiding those assets for performance tests which -although artificial- is likely to improve (lab test) performance scores. If you do use the 0s delay then do take into account that *real* users will still need to load/ render those assets and that that still may be a sub-optimal experience.

Autoptimize 2.9 final beta, testers wanted!

I just upped Autoptimize 2.9 beta to version 4, which is likely to be the last version before the official 2.9 release (eta end June/ early July).
Main new features;

You can download the beta from Github (do disable 2.8.x before activating 2.9-beta-4) and you can log any issues/ bugs over at https://github.com/futtta/autoptimize/issues
Looking forward to your feedback!

Santa wrapping up Autoptimize 2.8!

I’m sure you have been good this year so Santa cannot but put a nice ribbon around the next version of Autoptimize, out later this month. These are the most important changes:

  • JavaScript: new option “defer but don’t aggregate” which *might* help with “total blocking time”
  • Images: add field to list images to be excluded from image optimization
  • Critical CSS: major improvements of the job processing mechanism, reducing time spent from up to 1 minute to just a couple of seconds.
  • Critical CSS: under “advanced options” replace “request limit” with “queue processing time limit” (default 30s).
  • Extra | Google Fonts: better parsing of version 2 Google Font URL’s (/css2/).
  • Misc. other minor fixes, see the GitHub commit log

In case you want to give Santa a hand with all that wrapping up, you can always download the Beta version here and take it out for a spin.

Autoptimize 2.2 coming your way, care to test?

So work on Autoptimize 2.2 is almost finished and I need your help testing this version before releasing (targeting May, but that depends on you!). The more people I have testing, the faster I might be able to push this thing out and there’s a lot to look forward to;

  • New option: enable/ disable AO for logged in users for all you pagebuilders out there
  • New option: enable/ disable AO for cart/ checkout pages of WooCommerce, Easy Digital Downloads & WP eCommerce
  • New minification/ caching system, significantly speeding up your site for non-cached pages (previously part of a power-up)
  • Switched to rel=preload + Filamentgroup’s loadCSS for CSS deferring
  • Additional support for HTTP/2 setups (no GUI, you might need to have a look at the API to see/ use all possibilities)
  • Important improvements to the logic of which JS/ CSS can be optimized (getPath function) increasing reliability of the aggregation process
  • Updated to a newer version of the CSS Minification component (albeit not the 3.x one, which seems a tad too fresh and which would require me to drop support for PHP 5.2 which will come but just not yet)
  • API: Lots of extra filters, making AO (even) more flexible.
  • Lots of bugfixes and smaller improvements (see GitHub commit log)

So if you want to help:

  1. Download the zip-file from Github
  2. Overwrite the contents of wp-content/plugins/autoptimize with the contents of autoptimize-master from the zip
  3. Test and if any bug (regression) create an issue in GitHub (if it doesn’t exist already).

Very much looking forward to your feedback!

Preparing (for) Autoptimize 2.0.3 or 2.1.0

It’s that time of the year again where I humbly ask Autoptimize’s users to download and test the “beta”-version of the upcoming release. I’m not entirely sure whether this should be 2.0.3 (a minor release) or 2.1.0 (a major one), but I’ll let you guys & girls decide, OK?
Anyway, the following changes are in said new release;

  • Autoptimize now adds a small menu to the admin-toolbar (can be disabled with a filter) that shows the cache size and provides the possibility to purge the cache. A big thanks to Pablo Custo for his hard work on this nice feature!
  • If the cache size becomes too big, a mail will be sent to the site admin (pass `false` to `autoptimize_filter_cachecheck_sendmail` filter to disable or pass alternative email to the `autoptimize_filter_cachecheck_mailto` filter)
  • An extra tab is shown (can be hidden with a filter) with information about my upcoming premium power-ups and other optimization tools- and services.
  • Misc. bugfixes & small improvements (see the commit-log on GitHub)

So, if you’re curious about Pablo’s beautiful menu or if you just want to help Autoptimize out, download the beta and provide me with your feedback. If all goes well, we’ll be able to push it (2.1.0?) out in the first half of August!

Bringing Autoptimize 2.0 (beta) to a Christmas-tree near you

While over the last couple of months Autoptimize was quietly picking up users to reach 100.000 active installations, work was ongoing on the next version, the magical 2.0 (the PowerUps mentioned here before are still on the roadmap, albeit with some delay as I want AO 2.0 out first). Yesterday I uploaded what I consider to be the first Beta of Autoptimize 2.0 to the wordpress.org plugin repository and before inviting you to download & test this release I think this is the ideal moment to document some of the changes in that new version. Here goes;

  • Option to (de-)activate aggregation of inline JS and CSS which would allow to fix or prevent some of the recurring problems people have with AO (I’ll post a follow-up post on this with more info soon).
  • Option to remove Google Fonts (special request from my favorite user who obviously doesn’t like (Google) Fonts and who is too lazy to just dequeue them).
  • On average 30% faster minification (I’ll spill the beans on how that was done and what this implies in a later blogpost)!
  • Cache-size will be checked daily and a notice will be shown on your wp-admin pages if cache size goes over 512 MB (threshold can be changed using a filter).
  • Small autoptimized CSS (e.g. some print CSS) will be inlined instead of linked (256 characters by default, can be changed using a filter).
  • New in API: filters to declare a JS and CSS whitelist, where only files in that whitelist are autoptimized and all others are left untouched.
  • New in API: filters to declare “removable” CSS and JS, upon which Autoptimize will simply delete that code (emoji’s for example, if you prefer not to dequeue them).
  • lots of small and bigger bugfixes, I won’t bother you with a full list but have a look at the commmit log on GitHub.

I consider the code for this version feature-complete (have to keep some things up my sleeve for later versions), but what is needed now is testing, bug-reporting, bug-fixing and more testing. And translations, if you’re into those (I already contacted some earlier contributors). You can download Autoptimize 2.0 beta here, bug-reports are more then welcome on GitHub as an issue.
I’m pretty excited about this new version, so I’m looking forward to your feedback! Who knows we can push this out before the year is over?

Is your string zipped?

While looking into a strange issue on a multisite WordPress installation which optimized the pages of the main but not of the sub-blogs, I needed code to check whether a string was gzipped or not. I found this like-a-boss code-snippet on StackOverflow which worked for gzencoded strings:

$is_gzip = 0 === mb_strpos($mystery_string , "\x1f" . "\x8b" . "\x08");

But this does not work for strings compressed with gzcompress or gzdeflate, which don’t have the GZIP header data, so in the end I came up with this less funky function which somewhat brutally simply tries to gzuncompress and gzinflate the string:

function isGzipped($in) {
  if (mb_strpos($in , "\x1f" . "\x8b" . "\x08")===0) {
    return true;
  } else if (@gzuncompress($in)!==false) {
    return true;
  } else if (@gzinflate($in)!==false) {
    return true;
  } else {
    return false;
  }
}

Klunky, but it works. Now if only this would confirm my “educated guess” that the original problem was due to a compressed string.

ORI vouwfiets geplooid en gewogen

ori MI8 (of is het M9?)Eergisteren plat gereden met m’n Vero in Brussel, de nochtans bijzonder stevige maar vooral nieuwe buitenband bleek grondig naar de knoppen. Ik heb m’n fietsje dus binnengebracht bij Mobibikes en daar kreeg ik als vriendelijke maar ongetwijfeld ook commercieel verantwoorde geste ter vervanging een Ori MI8 in de handen gestopt. Als Christophe hoopt op een vermelding op m’n blog, heeft hij geluk, want dit lijkt wel heel sterk op een blogpost over Ori vouwfietsen, niet?
De Ori (ook verkocht als Mezzo) is even Brits als oer-vouwer Brompton en werd ontworpen door ex-Benetton F1 ingenieur Jon Whyte (die eerder ook al “full rear suspension” MTB’s voor Marin tekende). De MI8 lijkt overigens op een modernere versie van z’n befaamde stalen landgenoot (kijk maar op deze foto), met een scharnierloos monocoque aluminium frame met zelfsluitende koppelingen aan  achter- en voorwiel, Shimano Nexus 8-speedpotversnellingen” en een heel strak design dat mooi assorteert met m’n zwarte fietsmuts.
Enkele korte ritjes maken geen uitgebreide test, maar ik kan wel zeggen dat de overstap van m’n Vero (Dahon) naar de Ori MI8 niet zonder slag of stoot ging. Ge had me moeten horen vloeken toen ik dat klereding op de trein niet proper opgeplooid kreeg. En de goeie raad van de conducteur, heel de weg tussen Lokeren en Dendermonde, hielp ook voor geen meter. Het kan nochtans best snel, kijk maar:

Folding an Ori foldingbike really fast

En inderdaad, ik ben over de middag nog even gaan oefenen en dat ging al heel wat vlotter. Voor de rest is de afstand tussen het zadel het stuur de stuurpen betrekkelijk klein, maar al bij al is de Ori MI8 een knappe, lichte en snelle vouwfiets. Een ideaal opstapje naar een Birdy, misschien?