WP SEO vs Autoptimize; who broke your WordPress?

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!

14 thoughts on “WP SEO vs Autoptimize; who broke your WordPress?”

  1. This might be the reason why JS optimization has a tendency to break a myriad of other JS-based functionality too, although nothing’s broken my entire WP yet. *knock on wood* So far my solution has been to turn off JS optimization if excluding files doesn’t seem to work but maybe eventually, once this issue is solved, I might not need to do that! Keep up the good work. ^_^

    Reply
    • JS optimization can indeed be tricky and there’s no silver bullet I’m afraid. Testing, excluding and continuous follow-up (esp. after plugin updates) are needed. But maybe some knocking on wood can help as well, indeed? 😉

      Reply
  2. Hey Frank, thanks for your plugin, I am using it on my site. It reduced time to render my home page by 3 seconds!?! I am also using WP SEO Yoast. I have created a child theme of WP twenty twelve (very basic), just a few tweaks. Then I noticed that, when I use the child theme (not the original twenty twelve), and when I am logged in (not when I am logged out), and then look at one of the sub-pages (not the home page), I get no CSS rendering for the page.
    Then I disabled css optimizations checkbox inside autoptimize and the CSS rendered just fine, and everything was swell.
    Just thought this might help. And if you respond, I might learn something.

    Reply
  3. All In One SEO Pack + Autoptimize + Quick Cache is the best and fastest combination that I’ve tried. If you have a VPS or root access to install other software, you can use Ubuntu Tuned or RHEL Tuned on Throuput Performance.. My test site outruns just about every cache system I’ve tested, and even beats the $39.00 WP-Rocket Plug-in.. Tutorial and all details are on my test site, http://mywpdev.com

    Reply
  4. You know, I’ve never heard of Autoptimize…I’m going to have to check your plugin out! I definitely like the fact that you pay attention to issues and post about fixing them…off to check it out now!

    Reply
  5. Hi Frank,
    Great work on the plugin. Use it on all my sites. Is there any way to enable the minification, or at least the file combining on the wp-admin area?
    Cheers!
    Danny

    Reply
      • Even combining the files? Combining the css files should be pretty harmless I guess. Saves a lot of http requests in my current case.
        Just a thought!
        Groeten,
        Danny

        Reply
        • Well, the big advantage of not doing the backend is that no matter what a user does in the autoptimize config, it simply cannot brake the wp-admin area. If AO were to act on that as well, some people would simply lock themselves out, and that would be hell to support 😉
          frank

          Reply
      • I understand your concerns 🙂
        Still, I’d be willing pay for it (paid plugin style).
        You could hide it under an “Unsupported Expert Settings – may destroy your site” button which you hide under Advanced settings haha

        Reply

Leave a Reply to frank Cancel reply

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