Recently I was asked to fix some broken features in a WordPress admin section. Now WordPress have an active release cycle and so it’s admin system is usually quite stable, so my first guess was a recent plugin update may of broken something.
Upon logging into the system I noticed that a few dashboard widgets were not loading up. In fact the Ajax calls in the dashboard modules were not returning a valid response. Continuing on to the widget section under themes/appearance I noticed that widgets could not be dragged and their containers could not be collapsed. Something was definitely broken and it looked like it was a client sided issue.
Looking back over the errors, I noticed that most of the issues centred around missing jQuery UI extensions so I took a look at the jQuery frameworks included in the blog and noticed that the core jQuery framework was actually missing in all cases.
Now the next challenge was to find, download and include the right jQuery versions in the correct directories.
Luckily some of the existing jQuery UI extensions were not minified so I could read the code and more importantly the code comments. Some of these comments mentioned what version of the code their were using. Unfortunately the jQuery UI website only allows you to download the last two versions of the framework and of course, the versions I needed were much earlier than these. Thankfully the jQuery team don’t clear out the tags in their GitHub repository so I was able to download all the old versions of the framework.
After I had everything I needed, I started uploading the missing files one by one and checking for new errors. Once this was finished I tested the frontend and the admin section again.