Version 3 of WordPress Libs is now stable and ready for general use. This is a major version update with breaking changes so be sure to read on before you update existing projects.
You may have noticed that we have not written a release article in a while although a few minor versions have been released. The last few versions were all slowly integrating the new WordPress systems and preparing for version 3.
Purpose
It has been almost exactly 2 years since version 2 was released. Since that time we have maintained backward compatibility with every change. Over time we accumulated a lot of deprecated methods, actions, and classes. Version 3 does not initially add any new features, but instead cleared out all the previously deprecated code and gives us a fresh starting point to start adding new code.
Requirements
We updated the requirements for PHP and WordPress core to more recent versions so we can start tapping into modern abilities.
The majority of WordPress sites are now on PHP version 7.4
so there will be very little impact from the new PHP version requirement.
It is unlikely that sites using legacy version of WordPress core are actively updating their development dependencies so we expect very little impact from the new WordPress version requirement.
- The minimum WordPress core version is now
5.5.0
. - The minimum PHP version is now
7.3.0
.
If you plan to stay on version 2
due to PHP version or WP version limitations, you’ll likely want to lock your project to ^2.24.2
.
Migration
To assist in migration we properly deprecated everything within version 2.24
which was removed in version 3
. Using the built-in WordPress deprecation handlers, we enabled notices anytime a deprecated item is used.
To being migration, lock your project to version ^2.24.2
and set your WP_DEBUG
constant to true
. Using your site like normal and/or running your unit tests will automatically start displaying notices for anything which no longer exists on version 3
.
Note: It is recommended not to enable
WP_DEBUG
on production environments as the deprecated notices will be shown to your users.
If you still need something that was deprecated, you must copy it into your own code before updating.
Once you have resolved all deprecations, you are ready to update to version 3
.