Title: html optimization breaks widget plugin
Last modified: April 23, 2020

---

# html optimization breaks widget plugin

 *  Resolved [Jason](https://wordpress.org/support/users/shaffnert03/)
 * (@shaffnert03)
 * [6 years ago](https://wordpress.org/support/topic/html-optimization-breaks-widget-plugin/)
 * I just installed Autoptimize and have been configuring and by and large love 
   it!
 * I noticed however that one widget I use, based on this plugin: [https://wordpress.org/plugins/wp-tab-widget/](https://wordpress.org/plugins/wp-tab-widget/),
   seems to not load.
 * I began working through the instructions for excluding the plugin from js and
   css optimization and worked through a variety of settings only to discover that
   even turning off js and css optimization still left the plugin broken! Accordingly
   I tested turning off html optimization and it started working again! Furthermore,
   it continued to work if I then turned js and css optimizations back on without
   any non-default exclusions.
 * So, weirdly, it seems it’s the html optimization that’s causing this plugin to
   fail to load, not the others. Unfortunately there’s not option to exclude a plugin
   from html optimization like there is with the others so for now I’ve just had
   to turn this feature off.
 * Is this a bug? If so is there a fix coming? Is there a way to get html exclusion
   added like the others so I could turn it back on but exclude this plugin? Any
   help would be appreciated; thanks!
    -  This topic was modified 6 years ago by [Jason](https://wordpress.org/support/users/shaffnert03/).

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

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [6 years ago](https://wordpress.org/support/topic/html-optimization-breaks-widget-plugin/#post-12719465)
 * No idea why that would happen I’m afraid. Can you enable HTML opt and then
    1.
   check the browser console for errors? 2. copy/paste the resulting HTML and put
   it up on pastebin.com or a github gist for me to review?
 *  Thread Starter [Jason](https://wordpress.org/support/users/shaffnert03/)
 * (@shaffnert03)
 * [6 years ago](https://wordpress.org/support/topic/html-optimization-breaks-widget-plugin/#post-12719542)
 * Browser console definitely has errors; the warnings below are there even when
   the site works fine but enabling html optimization adds all the errors in the
   below. Pastebin of html at [https://pastebin.com/6ppEmEX6](https://pastebin.com/6ppEmEX6).
 *     ```
       DevTools failed to parse SourceMap: chrome-extension://gighmmpiobklfepjocnamgkkbiglidom/include.preload.js.map
       (index):72 Uncaught ReferenceError: jQuery is not defined
           at (index):72
       (index):84 Uncaught ReferenceError: jQuery is not defined
           at (index):84
       (anonymous)	@	(index):84
       (index):91 Asset CleanUp: "LIVE MODE" (test mode is not enabled, thus, all the plugin changes are visible for everyone: you, the logged-in administrator and the regular visitors)
       notes-common-v2.js?ver=8.4.2-202017:158 Uncaught ReferenceError: jQuery is not defined
           at notes-common-v2.js?ver=8.4.2-202017:158
       admin-bar-v2.js?ver=8.4.2-202017:2 Uncaught ReferenceError: _ is not defined
           at admin-bar-v2.js?ver=8.4.2-202017:2
       autoptimize_8a97e797…eacee51b58d9a5.js:2 Uncaught ReferenceError: jQuery is not defined
           at autoptimize_8a97e797…eacee51b58d9a5.js:2
       admin-bar.min.js?ver=5.4:2 Uncaught TypeError: f.hoverintent is not a function
           at HTMLDocument.<anonymous> (admin-bar.min.js?ver=5.4:2)
       (index):1 A cookie associated with a cross-site resource at http://wordpress.com/ was set without the <code>SameSite</code> attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with <code>SameSite=None</code> and <code>Secure</code>. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.
       (index):1 A cookie associated with a cross-site resource at https://wordpress.com/ was set without the <code>SameSite</code> attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with <code>SameSite=None</code> and <code>Secure</code>. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.
       DevTools failed to parse SourceMap: chrome-extension://gighmmpiobklfepjocnamgkkbiglidom/include.postload.js.map
       ??-eJzTLy/QzcxLzilNS…xqZmZqXEWALkfL7E=:8 JQMIGRATE: Migrate is installed, version 1.4.1
       DevTools failed to parse SourceMap: chrome-extension://gighmmpiobklfepjocnamgkkbiglidom/include.preload.js.map
       (index):164 Uncaught ReferenceError: jQuery is not defined
           at (index):164
       DevTools failed to parse SourceMap: chrome-extension://gighmmpiobklfepjocnamgkkbiglidom/include.postload.js.map
       ```
   
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [6 years ago](https://wordpress.org/support/topic/html-optimization-breaks-widget-plugin/#post-12719604)
 * OK, so;
    1. something (not AO’s HTML minifier) is removing quotes. this could
   be the case if you’re using both W3 Total Cache & AO at the same time, in which
   case W3TC’s HTML minifier is “forced upon” AO (a known bug in W3TC 2. jQuery 
   is not defined means you will have to ensure jQuery is not optimized or asynced
   or deferred. 3. you’re also using Asset Cleanup which offers optimization features
   as well, that might make things a tad more .. fragile as depending on configuration
   there might or might not be conflicts 😉
 *  Thread Starter [Jason](https://wordpress.org/support/users/shaffnert03/)
 * (@shaffnert03)
 * [6 years ago](https://wordpress.org/support/topic/html-optimization-breaks-widget-plugin/#post-12719767)
 * So, to make sure I’m understanding, it sounds likely to be the W3 Total Cache
   known bug that’s causing this issue? If this is a known bug, is there a known
   workaround?
 * On 2 – will look into that.
 * on 3 – The issue is there are page-specific unloads that I’m able to do in Asset
   Cleanup which Autoptimizer doesn’t seem to enable. I’ve turned off all other 
   settings in Asset Cleanup though so that shouldn’t be an issue; I’m basically
   only using it for page-specific unloads.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [6 years ago](https://wordpress.org/support/topic/html-optimization-breaks-widget-plugin/#post-12719778)
 * re W3TC; only 2 solutions i.e. disabling HTML opt. or swapping W3TC for another
   page cache plugin (I favor KeyCDN Cache Enabler or WP Super Cache).

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

The topic ‘html optimization breaks widget plugin’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/html-optimization-breaks-widget-plugin/#post-12719778)
 * Status: resolved