Title: Optimize JavaScript Code breaks site since update
Last modified: August 31, 2016

---

# Optimize JavaScript Code breaks site since update

 *  [bcr8tive](https://wordpress.org/support/users/bcr8tive/)
 * (@bcr8tive)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/)
 * Hi,
 * I discovered since the update that my posts had huge (arbitrary) gaps between
   them. So I set about finding the problem – and finally did.
 * When I have the option “Optimize JavaScript Code?” checked – the gaps are there–
   when I disable it, it goes away. The plugin worked great, WITH Javascript code
   enabled – AND helped my page speed, now it doesn’t and I have no idea what is
   doing what between the plugin and my theme – or if this is also something to 
   do with the new “caching” option – I already have a cache plugin –
 * Here’s an example of the site with the gap (I currently have the option disabled
   so that isn’t displaying until I can work it out)
 * Here is a screenshot of the site with the gap:
    [http://lrhcreative.com/misc-imgs/gaps.jpg](http://lrhcreative.com/misc-imgs/gaps.jpg)
 * Here is my site: [bcr8tive.com](http://bcr8tive.com/)
 * [https://wordpress.org/plugins/autoptimize/](https://wordpress.org/plugins/autoptimize/)

Viewing 15 replies - 16 through 30 (of 34 total)

[←](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/?output_format=md)
[1](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/?output_format=md)
2 [3](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/page/3/?output_format=md)

 *  Thread Starter [bcr8tive](https://wordpress.org/support/users/bcr8tive/)
 * (@bcr8tive)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/page/2/#post-7175564)
 * I’ll try sussing out the bug you saw now –
 * I’ve opened up your area if you want to try accessing the site again
    [bcr8tive.com](http://bcr8tive.com/)
 * Thanks Frank
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/page/2/#post-7175565)
 * no luck, still blocked. can you open up for an ip-range; 178.51.*.*?
 *  Thread Starter [bcr8tive](https://wordpress.org/support/users/bcr8tive/)
 * (@bcr8tive)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/page/2/#post-7175566)
 * Yes, let me hunt, hang on
 *  Thread Starter [bcr8tive](https://wordpress.org/support/users/bcr8tive/)
 * (@bcr8tive)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/page/2/#post-7175567)
 * Done – all clear
 *  Thread Starter [bcr8tive](https://wordpress.org/support/users/bcr8tive/)
 * (@bcr8tive)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/page/2/#post-7175568)
 * Hi Frank,
 * **Update:**
    Checking that Javascript error and couldn’t locate it –
 * Then I installed the plugin update when I saw it was available –
 * Ran the test – couldn’t locate the error…
 * Disabled the plugin … cleared the cache…
 * Ran the test again and the error goes away.
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/page/2/#post-7175569)
 * I see no js error either ..
 * you have no autoptimize running now (CSS nor JS)?
 *  Thread Starter [bcr8tive](https://wordpress.org/support/users/bcr8tive/)
 * (@bcr8tive)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/page/2/#post-7175570)
 * Sigh .. no after I updated it and still saw the error – I disabled it then tested
   again and the error was gone …
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/page/2/#post-7175571)
 * well, as:
    * the problem you originally posted about (the gaps) only are apparent
   when enabling JS optimization * the rollback to 2.0.0 didn’t solve your problem,
   so the problem is likely caused by something else.
 * I would propose to:
    1. re-enable AO with HTLM & CSS optimization. 2. once you
   have a “proven good” baseline we could try looking into JS?
 * frank
 *  Thread Starter [bcr8tive](https://wordpress.org/support/users/bcr8tive/)
 * (@bcr8tive)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/page/2/#post-7175572)
 * Ok, that’s what I did – the error is back…
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/page/2/#post-7175578)
 * > the error is back
 * the error as in the gaps (I don’t seem them though?
    or do you mean the google
   pagespeed warning?
 * frank
 *  Thread Starter [bcr8tive](https://wordpress.org/support/users/bcr8tive/)
 * (@bcr8tive)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/page/2/#post-7175579)
 * No, the Java error is back – the gaps only come back if I enable the Java Script
   option… I did as you said above and enabled the html and the css.
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/page/2/#post-7175580)
 * I don’t see a java(script) error, can you copy-paste it?
 *  Thread Starter [bcr8tive](https://wordpress.org/support/users/bcr8tive/)
 * (@bcr8tive)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/page/2/#post-7175581)
 * the same one that you brought to my attention with the Java Console?
 * It went away when I disabled the plugin – you said to reinstall and re-enable
   the plugin and turn on html and css but not the java – I did that and when I 
   did, the java console error returned.
 * [http://bcr8tive.com/wp-content/uploads/2016/03/java-error.jpg](http://bcr8tive.com/wp-content/uploads/2016/03/java-error.jpg)
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/page/2/#post-7175582)
 * hold it; just spotted this one:
 * > SyntaxError: illegal character
 * this one is due to the HTML optimizer choking an a HTML-type comment inside javascript;
 *     ```
       <script type="text/javascript">
   
       <!-- #GooglePlusOne -->
   
       (function (w, d, load) {
       ...
       }(window, document,
        ['//assets.pinterest.com/js/pinit.js']
       ));
       </script>
       ```
   
 * becomes:
 *     ```
       <script type="text/javascript">#GooglePlusOne -->
   
       (function (w, d, load) {
       ...
       }(window, document,
        ['//assets.pinterest.com/js/pinit.js']
       ));</script>
       ```
   
 * solution: either (have someone) fix the plugin that incorrectly uses a HTML comment
   inside javascript or disable HTML autoptimizing (which is the least important
   one).
 * frank
 *  Thread Starter [bcr8tive](https://wordpress.org/support/users/bcr8tive/)
 * (@bcr8tive)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/page/2/#post-7175583)
 * I dont know which plugin is writing that and the only someone I have working 
   on this is me – and you … if you know, and let me know, I’ll pull it through 
   ftp and look at it –
 * Regarding the plugin, I disabled the html – and the error is gone again.
 * However, its the **Optimize JavaScript Code** option that initially broke, and
   also the one that Pagespeed needs the most .. without causing the gaps (lol)
 * round and round we go ..
 * Have to go to bed, its morning here – will catch up with you tomorrow.
 * xo

Viewing 15 replies - 16 through 30 (of 34 total)

[←](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/?output_format=md)
[1](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/?output_format=md)
2 [3](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/page/3/?output_format=md)

The topic ‘Optimize JavaScript Code breaks site since update’ 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/)

## Tags

 * [javascript code](https://wordpress.org/support/topic-tag/javascript-code/)
 * [javascript errors](https://wordpress.org/support/topic-tag/javascript-errors/)

 * 34 replies
 * 2 participants
 * Last reply from: [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/optimize-javascript-code-breaks-site-since-update/page/3/#post-7175590)
 * Status: not resolved