Elephant in the Server Room: >50% of WordPress Sites Run PHP That's EOL by Jan
Hacker News

Elephant in the Server Room: >50% of WordPress Sites Run PHP That's EOL by Jan

Comments

Over half of all WordPress sites are running a version of PHP that will be out of official support by January. About a third are already on versions the PHP project has stopped fixing,¹ and PHP 8.2, the second most popular version, joins them when its support ends on 31 December.²

It has been a lot worse, though. Just after PHP 7.4 reached end of life in 2022, the figure was closer to nine in ten.³

The title comes from PHP's mascot, an elephant called the ElePHPant.⁴ The elephant in the room, as I see it, is how much old PHP is still out there, and how much of it only gets patched because Linux distributions, paid support services and hosts carry on fixing it behind the scenes, often without site owners knowing.

October's PHP2Shell scare showed how much good that can do, and also how much of it relied on people going out of their way to help, because when more critical fixes came out four weeks later the PHP project left the old versions out. Plugins aren't waiting either, with WooCommerce and Contact Form 7 both moving on from old PHP whatever the host does.

Which PHP versions are WordPress sites running?

PHP 8.3 is the most common version, on 28% of sites, with 8.2 close behind. The surprise is in third place, where PHP 7.4 is still on 14% of WordPress sites four years after the PHP project stopped fixing it, which is more than PHP 8.4, even though 8.4 has been out for two years.⁵

Share of WordPress sites on each PHP version:

  • 5.x and older: 1.9%
  • 7.0: 0.5%
  • 7.1: 0.3%
  • 7.2: 1.2%
  • 7.3: 1.2%
  • 7.4: 13.9%
  • 8.0: 3.2%
  • 8.1: 8.8%
  • 8.2: 22.1%
  • 8.3: 28.3%
  • 8.4: 11.3%
  • 8.5: 7.1%
  • 8.6: 0.1%

PHP 8.6 only came out on 19 November, so it's barely registering yet.⁶

When each version stops getting official fixes

The PHP project gives each version two years of normal bug fixes, then two more years of security fixes only.² After that it's "end of life", which in PHP's own words means users "may be exposed to unpatched security vulnerabilities".

If nobody upgraded at all, more than half of WordPress sites would be past official support on 1 January, and four in five a year later when PHP 8.3 runs out too. People do upgrade, of course, so that's a worst case rather than a forecast.

Between the 2 November snapshot and today, the share of sites on 8.2 or older fell by about 2.4 points, and if it carried on at that pace the figure on 1 January would be nearer 50% than 53%.

October: PHP2Shell and an exception for old PHP

What end of life means in practice got tested twice this autumn. On 21 October the PHP project fixed two critical bugs, together known as PHP2Shell, that could let someone run their own code on a server without logging in.⁷ Details had leaked the day before,⁸ and it was serious enough that government sites in several European countries were taken offline as a precaution.⁹ I covered it at the time in that week's This week in WordPress.

The official fixes were for PHP 8.2 to 8.5, but the PHP project also made an exception for older versions: "Given the severity of these vulnerabilities, the PHP security team provided minimal source-backports for PHP 7.4, PHP 8.0, and PHP 8.1".⁷ It didn't have to, and I don't think anyone could have complained if it hadn't.

The companies that look after older PHP for a living went further still. Ubuntu fixed every version it supports, back to PHP 5.5 on Ubuntu 14.04 (through its paid Ubuntu Pro subscription for 20.04 and older),¹⁰ and CloudLinux, which makes an operating system for shared hosting, shipped fixed builds of all 16 PHP versions its customers use, from 5.2 to 8.5.¹¹ Its reasoning is that a shared server holds hundreds of accounts, each pinned to whatever PHP version its site was built for, and forcing them all onto a new one breaks sites.

November: no exception this time

Four weeks later, on 19 November, PHP put out another batch of security fixes, seven of them rated critical.¹² Most need a fairly unusual setup to be exploited, but on some server configurations one could let someone run code on the server through an ordinary WordPress request.¹³

This time the official fixes were for 8.2 to 8.5 only, with no source patches for anything older. CloudLinux again shipped builds for its old versions,¹⁴ but where a host doesn't use something like it, there may be nobody patching an old version for these bugs.

Who still patches old PHP

Once the PHP project stops fixing a version, fixes can still come from three other places, and which of them applies (if any) depends on the host.

  • Your server's Linux distribution. Distributions such as Ubuntu keep fixing the PHP they ship on their own timetable, so Ubuntu 22.04 still fixes PHP 8.1, and 20.04 still fixes 7.4 through its Ubuntu Pro subscription.¹⁰ The same goes for PHP 8.2 after December, as Debian 12 ships 8.2 and is covered by Debian's long-term support team until 30 June 2028,¹⁵ and Red Hat supports its 8.2 package until May 2029,¹⁶ so some of the sites on 8.2 will carry on getting fixes. That only helps if the host uses the distribution's own PHP, and many shared hosts don't, because they offer several versions side by side.¹¹
  • A paid extended support service. TuxCare, part of CloudLinux, sells extended support for PHP 5.2 to 8.5, which hosts pay for as a yearly licence. It aims to fix critical bugs within 14 days, had PHP2Shell fixes out on the same day, and stops sending fixes if the licence lapses.¹⁷
  • The host's own promise. WP Engine announced in 2022 that it would keep supporting PHP 7.4 "into 2024".¹⁸ It still offers 7.4 today and patched it for PHP2Shell, though I couldn't find anything saying for how long.¹⁹

Fixes like these usually keep the old version number,²⁰ so a patched PHP 7.4 and an unpatched one look exactly the same from inside WordPress. When I call a version unsupported in this post, I mean the PHP project has stopped fixing it, and only the host can say whether someone else still is.

Are plugins moving on from old PHP?

Plugins on WordPress.org each say which version of PHP they need, and WordPress normally won't update a plugin to a version that needs newer PHP than the site has,²¹ so a site on older PHP stops getting that plugin's updates altogether, new features and bug fixes as well as security fixes. I pulled that setting for the 1,000 most popular plugins to see how many have moved on.²²

Most haven't, with 94% of them still saying they'll run on PHP 7.4 or older (or not giving a minimum at all) and only six needing PHP 8.3.

A plugin's page shows this setting as "PHP version 7.4 or higher", but the "or higher" part isn't something anyone has necessarily checked. WordPress plugins say the oldest PHP version they need, but there's nowhere for them to say the newest one they've been tested on. Even the minimum is just what the developer puts in the plugin's readme. WordPress enforces it, but nobody checks it, and some of those "older than 7.0" plugins probably haven't been tried on PHP that old in years.

Plugins do give a "Tested up to" for WordPress itself, and the same thing for PHP, for plugins and themes, was proposed in 2020 so WordPress could warn about untested ones the way it does for WordPress versions, but it hasn't been added.²³ So a plugin that breaks on PHP 8.4 can still say it needs "7.4 or higher", and nothing warns you before you switch.

A few very big ones are moving, though. WooCommerce 11.6, due in February, needs PHP 8.1, and shops on 7.4 or 8.0 will be stuck on 11.5, which will only get fixes for the most severe vulnerabilities.²¹ WooCommerce announced that in September, which is a fair bit of notice. Hostinger's own plugin, on more than 3 million sites, already needs 8.1. Contact Form 7, on more than 10 million sites, moved faster, jumping from PHP 7.4 to 8.3 in version 6.2 in October.²⁴ That follows a policy its developer published last December of requiring whatever PHP version WordPress recommends,²⁵ but it rules out about 53% of WordPress sites, including everyone on PHP 8.2, which still has official support. Several recent reviews say an automatic update took their sites down,²⁶ even though WordPress normally holds back a plugin update the site's PHP can't run.

None of the other big names I checked, including Elementor, Yoast SEO, Wordfence, Jetpack, Rank Math, WPForms, Gravity Forms and ACF, has announced a change yet, though Elementor and Gravity Forms already recommend 8.3,²⁷ and these minimums can go up in any update.

Whether it should be a plugin's job to push sites onto newer PHP is another question. Plenty of people running WordPress sites don't know what PHP is, and the sites that stop getting updates are mostly the ones nobody is keeping an eye on, so they're the least likely to notice.

How quickly sites move on

Old PHP hanging around on WordPress sites is nothing new. WordPress.org only publishes today's figures, but the Internet Archive has been saving copies since 2017, and WordPress.org published a full set in 2015.²⁸

Share of WordPress sites on each PHP version since 2015. Dashed lines: when the PHP project stopped fixing 5.6, 7.4 and 8.1. Dots are the dates there are figures for, and dotted stretches are gaps with none. Pick a version to highlight it.

Back in March 2015, more than half of WordPress sites were on PHP 5.2 or 5.3, both of which the PHP project had already stopped fixing, and 5.2 had been out of support for over four years. PHP 5.6 took over after that, and was still on a quarter of sites nine months after its own support ended.

PHP 7.4 has been the odd one out since then. It peaked on 57% of WordPress sites in December 2022, right around the time the PHP project stopped fixing it, and no version since has come close.

A few things lined up for 7.4. It's sometimes remembered as a long-term support release, but PHP has never had those. The LTS was Ubuntu's, as Ubuntu 20.04 LTS and Debian 11 both shipped 7.4 as their default,²⁹ and WordPress's own requirements page kept recommending it until July 2025.³⁰ PHP 8.0 was a harder move too, with more breaking changes, which may be why it never got above 15% of sites and a lot of them seem to have skipped it.³¹ And a lot of those 7.4 sites are probably just quiet. A site built a few years ago still works, its owner has never had a reason to look at the PHP version, and unless the host moves it on, nothing changes.

Share of WordPress sites on PHP past official support. Dashed lines: a PHP version reaches end of life (the last one is 8.2, on 31 December). Dotted stretches are gaps with no figures.

Read on Hacker News ↗ ← Back to News

Comments

No comments yet. Start the discussion.