Blog Post

Support for PHP 8.1 and 8.2 in plugins and WordPress

In December 2022, PHP 8.2 was released. PHP 7.4 has reached the End Of Life stage and is no longer officially updated or supported, with PHP 8.0 only getting securing fixes, making PHP 8.1 and PHP 8.2 the only officially supported and updated releases.

But the officially supported PHP versions are one thing, but the PHP versions used by most hosting companies and what WordPress and WordPress plugins support are quite different. In the past month, I have done a lot of testing of both WordPress and my plugins with PHP 8.0, PHP 8.1, and PHP 8.2. I have also analyzed the usage statistics gathered by WordPress.org and Dev4Press.com.

PHP Usage Statistics

According to WordPress.org statistics, PHP 7.4 is the most popular version with 53%, PHP 8.0 is at 13%, PHP 8.1 is at around 8%, and PHP 8.2 is at 1%. Older PHP 7 versions total around 19%, with PHP 5 versions still holding around 7%. This shows a slow addition rate for PHP 8.0, which is mostly caused by many older WordPress plugins and themes having major issues with PHP 8.0 and newer versions.

Our statistics on Dev4Press.com show similar trends, with PHP 7.4 being the most popular version at 62%, PHP 8.0 being just above 15%, PHP 8.1 is around 14%, and PHP 8.2 at 2%. Older PHP 7 versions total around 8%, with PHP 5 versions under 1%. We have a smaller data set available, but PHP 8 versions are still far from widespread adoption.

WordPress Compatibility

I have only tested the latest WordPress 6.1 and 6.2 versions because it is unrealistic that newer PHP versions will be properly supported in old versions of WordPress.

WP 6.1

WordPress 6.1 works fine with PHP 8.0; I have not seen any errors logged during testing. But, with PHP 8.1, while WordPress did work correctly, error logs were getting filled by the deprecated warnings.

Some of the deprecated warnings with PHP 8.2 in WordPress core were captured with the DebugPress plugin.

Most of these were related to the Requests library handling HTTP requests functionalities. One of these deprecated warnings affects the function for stripping tags from content, and it is for the preg_replace() core function and will pop up on most pages where the content is edited. Other than this, WordPress works fine with PHP 8.1. And the same happens with PHP 8.2 – mostly the same deprecated warnings and no other errors.

WP 6.2

With WordPress 6.2, things have improved a lot, and with normal use, I have not encountered warnings in WordPress core using PHP 8.1 or PHP 8.2.

I expect the next major WordPress version to get proper updates for these deprecated warnings in the latest PHP releases.

Dev4Press Plugins Compatibility

I have tested the latest versions of many Dev4Press plugins in the past few months, and so far, I have not found any issues with PHP 8.0. But, the testing with PHP 8.1 and PHP 8.2 did reveal several issues, some were deprecated warnings (similar to WordPress), and some were actual warnings, with no critical errors encountered. And I have started releasing updates to many plugins to fix these issues with PHP, and more such updates are expected in the coming months. So far, most plugins are updated and working fine, with no errors or warnings, even with the latest PHP 8.2. A few more plugins will continue getting updates throughout the Summer.

My development setups include all the latest builds for PHP 7.3 to PHP 8.2, and for this year, PHP 7.3 will remain supported for all Dev4Press plugins. The goal for 2023 is to have all plugins updated to work without any warnings or errors with PHP 8.2 and to prepare for the 8.3 coming out in late 2023.

WordPress Plugins and Themes

Well, this is very hard to test and gauge at this point. I did test third-party plugins and themes I use regularly, and most of them are working fine with PHP 8 versions, with some throwing the same deprecated warnings as WordPress.

But, when I attempted to randomly test many WordPress plugins from WordPress.org, even some very popular plugins, there were all sorts of issues, including critical errors, leaving the test website completely broken. PHP 8.2 is, in general, not supported by the majority of plugins. Hopefully, this will improve this year.

What about hosting companies?

As usual, it is hard to determine what is happening with a wide range of hosting companies and PHP support. I use SiteGround, and they offer all PHP versions from PHP 7.3 to PHP 8.2, with PHP 7.4 being the default. They do revisit that every year, so I expect that sometime this year, PHP 8.0 will be the default version.

I have access to several other hosting companies; most generally offer at least PHP 8.0 or even higher. But, many companies still have PHP 5.6 as a default version, and from what I can see on websites like Reddit and Twitter, based on user experience, many hosting companies are still far from having newer PHP 8 versions available. PHP 7 adoption is much better. I suspect that a lot of hosting companies don’t want to invest a lot of time testing newer PHP versions, and a lot of them also want to avoid user issues with running old plugins on new PHP, so using PHP 7.3 or 7.4 is still the safest solution for most users and most hosting companies.

PHP after PHP 7

With PHP 7 officially no longer supported or updated, PHP 8 is the clear future, and the performance improvements, features improvements, and modernized syntax of new PHP is a very interesting proposition. I look forward to a better PHP experience in the coming years. For PHP 8 to grow in the WordPress ecosystem, plugin and theme developers need to increase the time dedicated to testing new PHP versions and fixing their plugins and themes to make them compatible with new PHP versions. This will push WordPress users and hosting companies to speed up the PHP 8 adoption. Hopefully, by the end of 2023, we will see much different statistics with PHP 8 versions starting to dominate global usage.

Let me know what you think about PHP 8 adoption, what is stopping you from doing that, how many plugins you use that have problems with new PHP versions, and what is your hosting company currently supporting.

Please wait...

About the author

Milan Petrovic
Milan Petrovic

CEO and Lead developer of Dev4Press Web Development company, working with WordPress since 2008, first as a freelancer, later founding own development company. Author of more than 250 plugins and more than 20 themes.

Subscribe to Dev4Press Newsletter

Get the latest announcements, release digests, promotions and exclusive discounts, and general Dev4Press-related news straight into your mailbox.


This form collects your email (optionally your name) for the purpose of sending you newsletters. Check out our Privacy Policy for more information on how we store and manage your data. We will not send you any spam. Newsletters are sent 2 to 4 times every month.

Latest From The Blog

plugins release coresocial pro 3 2

coreSocial Pro 3.2

A new major update for coreSocial Pro, version 3.2, brings a new internal share network to copy the current URL. There are many minor updates and improvements, and the plugin also uses a new version of the shared library.
plugins release sweeppress pro 5 2

SweepPress Pro 5.2

Version 5.2 is a minor scope update that brings a new shared library, expanded lists of values for CRON, options, metadata detections, improvements to the CRON panel filtering, and a few fixes.
plugins relase gd topic prefix pro 4.0

GD Topic Prefix Pro 4.0 for bbPress

A brand new major update for GD Topic Prefix Pro for bbPress is released, and version 4.0 is a smaller scope update that completes all the previous development plans, updates the shared library, and more.

Leave a Comment

WP Rocket - Make WordPress Load Fast in a Few Clicks
SiteGround - Managed WordPress Hosting
0
49
0
0
0
1
0