Autoptimize 2.7; final stretch, testers needed!

Autoptimize 2.7 is in the final stages and the beta version can as of now be downloaded from https://downloads.wordpress.org/plugin/autoptimize.zip
Main new features:

So who want to test? Feedback in the comments please! 🙂

Autoptimize 2.6: testers for multisite wanted

Over the last couple of months Juanfran Granados from Mirai, an hotelier agency that used WordPress extensively, worked hard to add multisite administration capabilities to Autoptimize:

  • If AO has been network-activated, there will be an entry-point in the network settings screens where one can configure Autoptimize for the entire network.
  • On the subsites the AO settings screen will show a message that settings are done at a network level
  • On the network-AO-settings there is an option to allow AO to be configured per site
  • if AO has not been network-activated, things work as they do now; all settings are done on a per-site level

I have just merged his code into separate branch on Github and given that significant changes that went into this (almost all files changed), I need you and you and you and … to download and test that multisite-test branch before I merge the changes into the beta branch. Looking forward to your feedback!

Autoptimize to allow optimizing whitelisted resources only (and more)

Although work is still ongoing on what will become Autoptimize 2.0, I thought I’d share an (API-only) feature that allows developers/ web agencies to only aggregate & minify a fixed set of known-good resources only. This whitelist-based optimization will allow for a more stable situation upon delivery of your project to customers, as the CSS/ JS of plugins that are installed by your customer will not be autoptimized, so the site is less likely to break by accident.
The following example-code shows how to tell Autoptimize to only aggregate & minify jquery.js and jquery-migrate.min.js;

add_filter('autoptimize_filter_js_whitelist','example_js_whitelist');
function example_js_whitelist() {
return "jquery.js,jquery-migrate.min.js";
}

Using autoptimize_filter_css_whitelist allows you to accomplish the exact same things for CSS. The guys over at gigaom.com are already using autoptimize_filter_js_whitelist, so we must at least be doing something right there.
Some other new filters that might prove helpful;

  • autoptimize_filter_css_removables and autoptimize_filter_js_removables will allow you to specify which CSS or JS should actually be removed alltogether (Google Fonts, Emoji’s, … all in case you don’t like dequeuing off course)
  • autoptimize_filter_css_inlinesize allows you to specify up until how many characters of optimized CSS should be inlined instead of linked (can be useful for print CSS). Default value is 128, but I might bump that to 256 actually.
  • passing “true” to autoptimize_filter_css_fonts_cdn will tell AO to try to switch the font URL’s to your CDN
  • autoptimize_filter_cssjs_multidomain takes an array which can be used to tell AO that are also to be considered local domains and resources from those can be optimize (warning; as AO aggregates from the filesystem, this only works if the resources are actually local)
  • autoptimize_filter_cachecheck_do, autoptimize_filter_cachecheck_frequency and autoptimize_filter_cachecheck_maxsize can be used to control the wp-cronned cachechecker that will get triggered daily

Non-API improvements include performance optimizations, out-of-the box support for WPML subdomain-based language-variations and a whole heap of smaller improvements and bugfixes (e.g. the fact that if you have multiple title-tags, the optimized CSS would be injected in front of every one of those).
So yeah, I’d say we almost have ourselves a release. Only major thing still to go in; swapping the “look only in head” for an “include inline code” option. And testing of course, but that’s one area where I am looking at YOU, dear reader! Download the in-development version from GitHub and test away!