• Resolved jaromt

    (@jaromt)


    Hi, I’m using Exit popup plugin to display Contact form 7 form in popup. However, when I activated Autoptimize and enabled javascript optimization, plugin stopped working. When I excluded exit-popup script from Autoptimize, unchecked “Minify excluded CSS and JS files?” and checked “Force JavaScript in <head>?”, plugin is working again, but pagespeed is slower than with javascript optimization disabled and form in popup is not showing successful message after submission but page is reloaded without popup. Is it possible to set up javascript optimization to make that plugin work correctly?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    so what happens if you just add plugins/exit-popup to the comma-separated JS optimization exclusion list but not force JS in head? if it does not work, what error(s) are shown on the browser console?

    Thread Starter jaromt

    (@jaromt)

    I tried it, but it doesn’t work. There is an error Uncaught ReferenceError: jQuery is not defined at <anonymous>:1:1 at CookieControl.Cookie.dequeueNonAsyncScripts (uc.js:1) at HTMLScriptElement.a.onload. I think that this error is not related to that plugin.
    js/jquery/jquery.js script is also excluded.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Uncaught ReferenceError: jQuery

    does indicate jQuery is not loading early enough though … can you check the page source, is it there? does it have an async or defer attribute?

    Thread Starter jaromt

    (@jaromt)

    I finally found where was the problem. jQuery script is deregistered and custom jQuery script is enqueued in functions.php file. I excluded that custom jQuery script from Autoptimize and now exit popup is showing even with exit-poup.js script not excluded.
    Thanks for your advice.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    good job jaromt 🙂

    feel free to leave a review of the plugin and support here! 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Javascript optimization set up’ is closed to new replies.