Yogesh Chauhan's Blog

WordPress 5.7 is migrating to latest jQuery version and people are freaking out

in jQuery & WordPress on February 11, 2021

The WordPress Core will not use the legacy jQuery anymore. It will be upgraded from version 1.12.4 to 3.5.1.

For non tech folks, here is a quick intro on jQuery

jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.

With a combination of versatility and extensibility, jQuery has changed the way that millions of people write JavaScript.

WordPress 5.7

WordPress 5.7 is scheduled to release on March 9, 2021

You can checkout their plan roundup here.

Actually they started testing before they released WordPress 5.5 and I was kinda expecting it to be released in the WordPress releases 5.5 or 5.6. But WordPress is a massive feature rich application so it’s hard to just bump some version and go for the next one.

The new version of jQuery will be helpful with many latest design features, advanced user interactions and most importantly security.

Who is freaking out?

Developers! (No offence)

And I don’t blame them. I am a developer and when I saw that, I freaked out as few of my themes and plugins depend on the older version.

There are tons of themes, websites and plugins that depend on the older versions and things will be challenging for them if they don’t update their code and keep their plugins and themes up to date.

Do you need to worry about your site?

That’s a valid question.

If you’ve developed your website you must know whether you’ve used jQuery or not.

Most of the plugin developers are displaying notifications on the plugin page or on the dashboard to keep admin posted on what their move is.

But if you’re not sure or if you’ve missed the notification or if you want to be on the safe side then follow this:

For the plugins that are dependent on the older version of jQuery, check their official website or contact them directly to make sure you will get their latest version that is up to date with WordPress version as well.

TEST before launch

Have multi dev?

If you have a server that provides multi-development environments then try to spin up a test version of your current website and see how that goes. If everything goes well, go ahead and launch it.

If not, go for the old way: local dev

If your server doesn’t provide any multi-development environments then just download the website and spin up it on local machine.

No matter what option you go for remember to test, test and test.

Refer official WordPress docs

WordPress has an amazing guide to handle all jQuery issues. Go through it in case you experience any issues or just go through it to see the major issues. The explanation is pretty well written.

Install “Enable jQuery Migrate Helper” Plugin

WordPress guide also has info on this plugin. The plugin has been developed by the WordPress team.

As per the plugin intro, “It serves as a temporary solution, enabling the migration script for your site to give your plugin and theme authors some more time to update, and test, their code.”

“Enable jQuery Migrate Helper” Plugin will let you downgrade to a previous version of jQuery temporarily.

Do not rely on the plugin for a long time. It is developed for a short time fix only. Upgrade plugins or remove them if they don’t have the latest jQuery support.

Refer official jQuery docs

jQuery has a guide on upgrade since months when they launched the version 3 and the guide is very extensive and in detail.

In the same guide, they also have “jQuery Migrate Plugin” section in which they talk about how they have created the plugin to simplify the migration. Go over those docs and get yourself familiarized with the migration process.

What if nothing works and your site breaks?

Don’t worry!

First thing first. Check the error and what’s it related to.

If it’s related to jQuery then check if a theme is causing it or a plugin and contact the developers accordingly.

Most Read

#1 Solution to the error “Visual Studio Code can’t be opened because Apple cannot check it for malicious software” #2 How to add Read More Read Less Button using JavaScript? #3 How to check if radio button is checked or not using JavaScript? #4 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #5 How to uninstall Cocoapods from the Mac OS? #6 PHP Login System using PDO Part 1: Create User Registration Page

Recently Posted

#Apr 8 JSON.stringify() in JavaScript #Apr 7 Middleware in NextJS #Jan 17 4 advanced ways to search Colleague #Jan 16 Colleague UI Basics: The Search Area #Jan 16 Colleague UI Basics: The Context Area #Jan 16 Colleague UI Basics: Accessing the user interface
You might also like these
How to draw an SVG path on scroll using JavaScript?JavaScriptKanban vs Scrum: The two frameworks of agile principlesMiscellaneousHow to make WordPress main stylesheet (style.css)?WordPressHow to remove special characters (dash, asterisk etc) from any string in PHP?PHPHow services and dependency injection work in Angular?Angularuser_can vs current_user_can in WordPressWordPress