Tag Archives: test

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

Watch this video on YouTube.

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?