Author: Geoffrey Sagers
If you are anything like me, you want the latest and greatest. In the area of web development, that can definitely be a double-edged sword. Using only the latest technology you shut out many users who either must use older browser due to corporate restrictions, or choose not to upgrade.
The most current version (as of today is 3.1.1), but the most commonly used version by a large margin is still version 1 with close to 90% of all sites using it. So why is this? Some is just a webmaster overlooking an upgrade, but a fair amount is also because it just works.
I was puzzled. In looking through the add-on script, but saw nothing out of the ordinary. It used jQuery 1.7, but the differences between minor versions (after 1.6) is fairly small, so I didn’t think that was it. After a little rummaging, I managed to change WordPress to use version 1.7 (which is not recommended) just to verify, and that didn’t fix the problem.
After changing it back to version 1.13 in WordPress, I tried updating the script to use version 1.13 — but this also failed to bring it back to life. I was getting stumped.
Some of what STG helps its clients accomplish is to streamline systems. This particular client had had many web developers over the years, and each one brought in more plugins and addons to fit the client’s current needs. In looking through their WordPress installation, they had 37 plugins installed. My next step was to update each of the plugins. These also went off without a hitch, except one, that needed a file-by-file replacement (not ideal, but still worked fine in the end).
Still the problem remained. It had been several hours, and I was starting to become frustrated. As I looked through the plugins, and there was one that — according to its description, kept jQuery at the latest version. This sounded promising, so I disabled it. Eureka! The problem was solved! Just to double check, I re-enabled it, and sure enough the problem re-appeared. To make a final pass, I copied the output of the page to a new document, re-enabled it, then did it again. When comparing these two files, I found that despite version 1.7 being loaded in the header of the page as expected, this plugin was loading version 3.1 further down. Problem solved!
In conclusion, when updating your scripts you didn’t write, watch for irregularities that probably will pop up from time to time. Keep your own scripts as up-to-date as possible, maintaining a balance between cutting-edge and audience capability. When keeping your site updated, keep up a regimen validating the use of plugins and scripts, and when they are not useful anymore, disable, or better yet, remove them. This will save you, and others like you, countless hours in the future debugging code.
Senior Web Developer
Software Technology Group