Causing a JavaScript error on every page
-
Join me on a little adventure through plugin code.
My client reported that their WooCommerce orders were coming in with no shipping address. I discovered a JavaScript error that was appearing on every single page of their site, “Error: invalid version specified” which was tied to loading the Facebook JavaScript SDK.
I had a hunch this JavaScript error was causing a cascading effect that was preventing Woo’s JavaScript that dynamically shows the shipping address fields and the “Ship to a different address?” checkbox from working.
Now, to check that, I just had to figure out which plugin on their site was trying to load this Facebook SDK with an “invalid version.”
Ultimately I had to download their entire
pluginsdirectory and do a multi-file search to find the culprit, which was this plugin, Simple Share Buttons Adder.I deactivated Simple Share Buttons Adder and, sure enough, the WooCommerce checkout page started working, and the JavaScript error on every page of the site was now gone.
I’m guessing it’s probably a fairly trivial fix within this plugin (probably in lines 130-132 of
class-styles.php) to resolve the issue.
The topic ‘Causing a JavaScript error on every page’ is closed to new replies.