WordPress 5.6 will ship with the latest jQuery library next month. This is a major update that all plugin and theme developers should begin testing against. Last week, Marius Jensen announced the change on the Make Core blog.
The following jQuery-related libraries are expected to ship in the update (WordPress Trac ticket):
- jQuery 3.5.1
- jQuery Migrate 3.3.2
- jQuery UI 1.12.1
This change is not surprising. Lead developer Andrew Ozz announced the original three-phase transition to update the jQuery library earlier this June. The end goal is for WordPress to bundle the most up-to-date version and keep it updated going forward. WordPress has fallen behind and relied on an older version for several release cycles. As a result, much of the plugin and theme ecosystem has relied on outdated features.
The three steps of the process are as follows:
- WordPress 5.5: Remove the jQuery Migrate 1.x script.
- WordPress 5.6: Update to the latest jQuery, jQuery UI, and jQuery Migrate scripts.
- WordPress 5.7: Remove the jQuery Migrate script.
If the removing, adding, and once again removing jQuery Migrate sounds confusing, it is because it can be. jQuery Migrate is essentially a helper script that allows developers to “migrate” to newer versions of jQuery. It is a backward-compatibility fix. The version of jQuery Migrate being re-added in WordPress 5.6 corresponds to newer versions of jQuery. It is being added as a temporary fix to give plugin and theme developers time to update their code. The hope is that developers will no longer rely on it by the time WordPress 5.7 ships.
“Following the best practices and the recommendations of the jQuery team, Migrate should be used as a helper tool, not as a permanent backwards compatibility solution,” said Ozz in our discussion a few months ago. “Ideally, WordPress will be able to do this.”
Whether jQuery Migrate is removed in WordPress 5.7 remains to be seen. Right now, it is a tentative goal. Thus far, the process is still on track. Much of this also depends on how smooth the WordPress 5.6 ship sails. The 5.5 release sunk, at least for many users. This is a result that we do not want to repeat.
Navigating all of this is no small feat for end-users. They rely on WordPress, plugin, and theme developers to keep things running smoothly. With a month left before the launch of WordPress 5.6, plugin and theme authors need to start testing to make sure their projects work with the latest version of WordPress.
Expecting some issues with WordPress 5.5, the WordPress development team created the Enable jQuery Migrate Helper plugin to ease the transition for users on WordPress 5.5. In the first week, the plugin had over 10,000 active installations. Today, it has over 200,000 users. This number is not necessarily indicative of plugins and themes with outdated code. Presumably, some percentage of these users no longer need the plugin because their extensions have been updated while they have yet to deactivate it. There is no public data on who is using the plugin and why.
The plugin is still useful right now. It logs deprecation notices and makes them available to users. If the plugin does not log any notices after a week or two, users are encouraged to deactivate the plugin. If they are still seeing notices, they should contact their theme or plugin developers, depending on what is triggering the notices. When users update to WordPress 5.6, they should no longer need the plugin.
We will be six months into this process for the next major release. Developers have had ample time to make adjustments. Let this be a friendly reminder to test plugins and themes during the 5.6 beta cycle.
Plugin and theme authors should test with the
SCRIPT_DEBUG constant enabled in their
wp-config.php files. More information is available via the Debugging in WordPress documentation.
Jensen has published a guide on updating jQuery in unmaintained themes or plugins. It is primarily geared toward end-users who are comfortable enough going the DIY route. However, developers can find some useful information in the tutorial too.