Title: Stops working with Autoptimize
Last modified: October 29, 2016

---

# Stops working with Autoptimize

 *  Resolved [Mr. W](https://wordpress.org/support/users/gabriel-winnberg/)
 * (@gabriel-winnberg)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/stops-working-with-autoptimize/)
 * Hello,
 * Smart Variations stops working when Autoptimize is minifying JS. A number of 
   different behaviors and errors depending on Autoptimize settings. I’ve excluded
   all js from /wp-content/plugins/smart-variations-images/assets/js but that doesn’t
   resolv it. I get these errors:
 * Uncaught ReferenceError: jQuery is not defined(anonymous function) @ jquery.ez-
   plus.min.js:2
    Uncaught ReferenceError: jQuery is not defined(anonymous function)
   @ svi-frontend.min.js:1
 * The swatches show, it seems to be loading an image (there is a pause when the
   swatches gray out) but no image is displayed.
 * It starts working again when I switch off JS optimization.
 * What should I try next?

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/stops-working-with-autoptimize/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/stops-working-with-autoptimize/page/2/?output_format=md)

 *  [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/stops-working-with-autoptimize/#post-8372472)
 * > What should I try next?
 * add `js/jquery/jquery.js` to the JS optimization exclusions gabriel 🙂
 * frank
 *  Thread Starter [Mr. W](https://wordpress.org/support/users/gabriel-winnberg/)
 * (@gabriel-winnberg)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/stops-working-with-autoptimize/#post-8372707)
 * Hey Frank!
 * Thanks, still doesn’t work. I excluded these:
 * js/jquery/jquery.js
    jquery.ez-plus.js jquery.ez-plus.min.js svi-admin-settings.
   js svi-admin-settings.min.js svi-frontend.js svi-frontend.min.js
 * … and tried all combinations of JS exclusion options:
 * – ​Force JavaScript in head
    – ​Add try-catch wrapping – Aggregate inline JS
 * Should there be file paths in the exclusion list like js/jquery/jquery.js?
 * Cheers,
    Gabriel
    -  This reply was modified 9 years, 6 months ago by [Mr. W](https://wordpress.org/support/users/gabriel-winnberg/).
 *  Thread Starter [Mr. W](https://wordpress.org/support/users/gabriel-winnberg/)
 * (@gabriel-winnberg)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/stops-working-with-autoptimize/#post-8372710)
 * Oh, BTW from [https://sv.wordpress.org/plugins/autoptimize/faq/](https://sv.wordpress.org/plugins/autoptimize/faq/):
 * “**Why is jquery.js not optimized**
    Starting from AO 2.1 WordPress core’s jquery.
   js is not optimized for the simple reason a lot of popular plugins inject inline
   JS that is not aggregated either (due to possible cache size issues with unique
   code in inline JS) which relies on jquery being available, so excluding jquery.
   js ensures that most sites will work out of the box. If you want optimize jquery
   as well, you can remove it from the JS optimization exclusion-list (you might
   have to enable “also aggregate inline JS” as well or switch to “force JS in head”).”
 *  [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/stops-working-with-autoptimize/#post-8372901)
 * weird, as
 * > Uncaught ReferenceError: jQuery is not defined(anonymous function)
 * indicates jquery is not available when `jquery.ez-plus.min.js` and `svi-frontend.
   min.js` are loaded. but if jquery, jquery.ez-plus.min.js and svi-frontend.min.
   js all are excluded, then this might not be related to autoptimize …
 * anyways; hard to troubleshoot further without a URL, could you share that?
 * (I know that jquery is excluded by default since 2.1 -as i’m ao’s developer-,
   but you could have changed that setting, couldn’t you? 😉 )
 *  Thread Starter [Mr. W](https://wordpress.org/support/users/gabriel-winnberg/)
 * (@gabriel-winnberg)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/stops-working-with-autoptimize/#post-8372929)
 * Haha ok, I completely missed that! 😉
    I’m talking to the right guy then …
 * I have changed the setting back and forth a number of times.
 * It’s a development site, I’ll PM you.
 *  Plugin Author [RosendoLabs](https://wordpress.org/support/users/drosendo/)
 * (@drosendo)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/stops-working-with-autoptimize/#post-8373627)
 * HI,
 * So, are thing solved?
 *  [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/stops-working-with-autoptimize/#post-8373703)
 * no, not yet David.
 * what is weird is that even when aggregating all JS code and loading it at the
   very end of the HTML (or when not aggregating inline JS and excluding jquery.
   js and all JS of your plugin), the code is complaining about $container.imagesLoaded(…).
   progress not being a function, although imagesLoaded.pgkd.min.js is present and
   loaded before the JS that is throwing the error …
 * is imagesLoaded(…).progress part of imagesLoaded.pgkd.min.js which you load from
   cdnjs.cloudflare.com? is there any specific reason you’re not including that 
   file in the local JS?
 * frank
 *  Plugin Author [RosendoLabs](https://wordpress.org/support/users/drosendo/)
 * (@drosendo)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/stops-working-with-autoptimize/#post-8373709)
 * Hi,
 * No specific reason, just less files. 🙂 Maybe I should include them as fallback.
 *  [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/stops-working-with-autoptimize/#post-8373718)
 * well … my gut feeling says loading that file locally would solve the autoptimization-
   problems, so I think Gabriel would be very interested 😉
 *  Plugin Author [RosendoLabs](https://wordpress.org/support/users/drosendo/)
 * (@drosendo)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/stops-working-with-autoptimize/#post-8373732)
 * It’s the first issue im experiencing of this kind. It’s just strange being that.
   
   User has to dequeue the imagesLoaded and use a local file for debugging purpose.
   If it works then, I believe I shall add the files to the plugin.
 * THanks,
    David
 *  [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/stops-working-with-autoptimize/#post-8373756)
 * so Gabriel, are you up for that? 🙂
 *  Thread Starter [Mr. W](https://wordpress.org/support/users/gabriel-winnberg/)
 * (@gabriel-winnberg)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/stops-working-with-autoptimize/#post-8373765)
 * I would, Frank. 🙂
 * I’m no specialist on CDNs, but could it be CloudFlare related? I see they got
   a datacenter in Stockholm (where I am) already in 2012 and did have a few problems
   for some time, not sure today.
 * Anything you want med to do?
 * G.
 *  Thread Starter [Mr. W](https://wordpress.org/support/users/gabriel-winnberg/)
 * (@gabriel-winnberg)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/stops-working-with-autoptimize/#post-8373767)
 * Oh, just got your PM, Frank.
 *  Thread Starter [Mr. W](https://wordpress.org/support/users/gabriel-winnberg/)
 * (@gabriel-winnberg)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/stops-working-with-autoptimize/#post-8373772)
 * David, the url on your profile page doesn’t work.
    Was looking for you e-mail.
 *  Thread Starter [Mr. W](https://wordpress.org/support/users/gabriel-winnberg/)
 * (@gabriel-winnberg)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/stops-working-with-autoptimize/#post-8373774)
 * Absolutely. How do I dequeue the imagesLoaded and use a local file?

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/stops-working-with-autoptimize/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/stops-working-with-autoptimize/page/2/?output_format=md)

The topic ‘Stops working with Autoptimize’ is closed to new replies.

 * ![](https://ps.w.org/smart-variations-images/assets/icon-256x256.png?rev=2094600)
 * [Smart Variations Images & Swatches for WooCommerce](https://wordpress.org/plugins/smart-variations-images/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/smart-variations-images/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/smart-variations-images/)
 * [Active Topics](https://wordpress.org/support/plugin/smart-variations-images/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/smart-variations-images/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/smart-variations-images/reviews/)

 * 16 replies
 * 3 participants
 * Last reply from: [RosendoLabs](https://wordpress.org/support/users/drosendo/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/stops-working-with-autoptimize/page/2/#post-8373792)
 * Status: resolved