I always felt somewhat torn between my love for F1 and my political/ ethical green-leftist point of view, so I was very glad to learn about “Formula E” earlier this year. This new competition focuses entirely on identical (a Dallara chassis and a Mc-Laren engine, next year other constructors will be allowed) electrically-powered single-seat racing cars, competing on street circuits in major cities around the world.
Well, past weekend the first e-Prix took place in China (Beijing) and it was a great race with lots of close racing, exciting overtaking and one very heavy crash between P1 Nicolas Prost and P2 Nick Heidfeld seconds before the finish with Di Grassi taking a victory he did not really expect any more at P3. You can watch the full race here or, if you have less time, enjoy this fan-made summary;
I love me some Flying Lotus and it so happens he just released the first track of his forthcoming album “You’re Dead”. The song is called “Never Catch me” and it features Kendrick Lamar in the first part and a friggin’ great bass-synth in the second part (around 2:30).
Flying Lotus – Never Catch Me (feat. Kendrick Lamar) (Official Audio)
Autoptimize 1.9 was released yesterday but unfortunately some reports were coming in about JS optimization being broken. At first I suspected the problem being related to small changes that added semi-colons to individual blocks of script (before being aggregated), but tests with some impacted users showed this was not the case.
The breakthrough came in this thread in Autoptimize’s support forum, where user “grief-of-these-days” confirmed the problem started with the update of WP SEO and specifically the “sitelinks search box“-functionality that was added in WP SEO 1.6. Sitelinks Search Box comes as an inline script of type “application/ld+json”, that contains a name-less JSON-object with “linked data”. Autoptimize detected, aggregated and minimized this name-less object, but that not only defies the sitelinks search box mechanism, but potentially also broke the optimized JS itself. So I updated & enabled WP SEO, confirmed the problem, identified “potentialAction” as unique string to base exclusion on and pushed out 1.9.1 which will now no longer Autoptimize Sitelinks Search Box-code.
So who broke your WordPress today, WP SEO or Autoptmize? Well, WP SEO’s update may have made the bug appear, but based on the fact that json-ld is standardized and as such will probably be also present in other guises, Autoptimize should really just exclude any script of the “application/ld+json”-type from being aggregated & minimized (and not just that of the Sitelinks Search Box). Adding to the to-do-list now!
Autoptimize comes with a “Add try-catch wrapping?”-option, which wraps every aggregated script in a try-catch-block, to avoid an error in one script to block the others.
I considered enabling this option by default, as it would prevent JS optimization occasionally breaking sites badly. I discussed this with a number of smart people and searched the web, eventually stumbling on this blogpost which offers an alternative for try-catch because;
So given this damning evidence of severe performance degradation, “try/catch wrapping” will not be enabled by default and although Ryan’s alternative approach has its merits, I’m weary of the caveats so I won’t include that (for now anyway). If your site breaks when enabling JS optimization in Autoptimize, you can enable try/catch wrapping as a quick workaround, but finding the offending script and excluding it from being optimized is clearly the better solution.