• Resolved saltykey

    (@saltykey)


    When I updated the plugin (Autoptimize), I noticed a few JS functions on my site ceased working. (Ex: a smooth-scroll feature in the footer, a lightbox plugin, and an accordion-style FAQ plugin).

    At first I thought it was a caching issue, so I had the host company restart the server to completely purge the system cache. I also disabled the Memcached (database caching) with no success. I also reset the permalinks (I thought it might be a permalinks issue). My debug bar wasn’t throwing me any errors, which made the problem even more peculiar. I also tried adding the demo code for a collapse feature from Bootstrap (the theme uses Bootstrap) and couldn’t get it to work.

    When I un-checked the “Optimize JavaScript Code?” option, everything started working again. I still have Autoptimize active and the HTML and CSS code optimization checked.

    It’s a great plugin. Overall I’m very happy. Just curious if they are any fixes you can recommend. I tried excluding all of the .js files and tried different options (e.g. forcing JS in header, adding try-catch wrapping, etc.) but the problem persists.

    My host provides server-level caching (Varnish) and database caching (Memcached). Could it still be a caching issue? Thanks again for the help.

    https://www.ads-software.com/plugins/autoptimize/

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

    (@futtta)

    Plugin causes conflicts with jQuery-based functions […] I tried excluding all of the .js files and tried different options (e.g. forcing JS in header, adding try-catch wrapping, etc.) but the problem persists.

    try adding jquery.js to the JS optimizatoin exclusions. if that does not work, open your browser’s (error) console to see any/ all JS errors and post those here. based on that feedback we’ll see how to proceed.

    Could it still be a caching issue?

    probably not, but hard to say without being able to see your site ??

    frank

    Thread Starter saltykey

    (@saltykey)

    Hi Frank,

    Thanks so much for the response. I have checked the “Optimize JavaScript” option on my site: https://www.saltykey.com/

    I have also added wp-includes/js/jquery/jquery.js to “Exclude scripts from Autoptimize” field.

    I have these errors in the Error Console:

    Timestamp: 3/30/2016 3:15:52 AM
    Error: ReferenceError: Elevator is not defined
    Source File: https://www.saltykey.com/security/
    Line: 136

    Timestamp: 3/30/2016 3:15:52 AM
    Error: SyntaxError: invalid regular expression flag f
    Source File: https://www.saltykey.com/wp-content/cache/autoptimize/js/autoptimize_1f3a39c5c291b8b4f2557390e79ed702.js
    Line: 178, Column: 141
    Source Code:
    lts;},isnumeric:function(x){var anum=/(^\d+$)|(^\d+\.\d+$)/if(anum.test(x)){return true;}

    Elevator is one of the plugins I’m using on the site. Another one that’s having trouble is a FAQ plugin on this page: https://www.saltykey.com/security/

    The green pluses (+) are supposed to open and close when clicked (it uses a jQuery toggle feature. The name of the plugin is HTML5 Responsive FAQs. You can see them working correctly on the dev site: https://saltykey.mscspace.com/security/

    Thanks again for the help. It’s greatly appreciated. ??

    Thread Starter saltykey

    (@saltykey)

    Forgot to mention I also have “Add try-catch wrapping?” and “Force JavaScript in <head>?” options checked. The other options are un-checked.

    Plugin Author Frank Goossens

    (@futtta)

    ok, exclude wpdevart_lightbox_front.js as well and see what happens.

    (the problem is missing semi-colons in wpdevart_lightbox_front.js, which breaks when minified as eloquently articulated by Douglas Crockford albeit in an other context ?? )

    frank

    Thread Starter saltykey

    (@saltykey)

    That did the trick!

    Many, many thanks for your help. That had been bugging me for a while (pun intended).

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Plugin causes conflicts with jQuery-based functions’ is closed to new replies.