Support » Plugin: Autoptimize » 1.9.0 breaks JS

  • Resolved EliseLeb


    Just updated to latest plugin version (but NOT 4.0 WordPress) and my JS stopped working.

    The symptom:
    JS based tab and contact form display at once on page, instead of being a slide out menu and dynamic tabs. Unselecting Autoptimze JS makes the JS work again. Worked fine before update.

    Error from Chrome dev panel:
    Uncaught SyntaxError: Unexpected token : autoptimize_e7495824fb16cf37f7867bee3c8aab50.js:1

    This is the offending line:
    var mytheme_urls={theme_base_url:’’,framework_base_url:’’};;{“@context”:””,”@type”:”WebSite”,”url”:””,”potentialAction”:{“@type”:”SearchAction”,”target”:”{search_term}”,”query-input”:”required name=search_term”}};

    I tried:
    – Save and clear cache
    – Use the advance options (force head, look in head, try/catch)

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Frank Goossens


    Now that is one great support request Elise, thanks for the detailed info!

    It seems -not sure why yet- autoptimize adds a semi-colon where it should not. i propose to start out adding “mytheme_urls” to the comma seperated JS exclusion list (and if that doesn’t work, maybe “potentialAction” as well).

    I’ll run some tests and come back with here once I know why the semi-colon got added.



    I can confirm this behaviour, but as I’ve found on my installation, it seemed to be caused not by update of Autoptimize, but by the update of WordPress SEO plugin, that “Implemented new sitelinks search box json+ld code” (according to their changelog).

    In their latest update they added a script of type "application/ld+json" which was inproperly processed by Autoptimize.

    I’m not sure this is the same case, though, yet the symptom is the same. ^^’

    Plugin Author Frank Goossens


    Thanks for confirming Grief-of-these-days, this might be the reason for most issues I’ve seen mentioned the last couple of days. I’ll investigate and might push out a version which excludes “potentialAction”.

    Plugin Author Frank Goossens


    Pushing out 1.9.1 now, which will exclude WP SEO’s “potentialAction” by default.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘1.9.0 breaks JS’ is closed to new replies.