DEV Community

loading...
Cover image for Did I upgrade WordPress to PHP 8 too early?

Did I upgrade WordPress to PHP 8 too early?

Ingo Steinke
Web Development, Web Performance, Art and Music, Nature and Travel, Sustainability
・2 min read

This week, a WordPress instance started to show a strange bevahior. After upgrading the Polylang plugin failed, everything else still seemed to work fine, but still no chance to upgrade Polylang, but I did not take the time to check the error logs (hidden somewhere on the shared host).

Another upgrade failure (500 internal server error), when Google Site Kit had an update available.

No Plugin Updates, No Image Uploads

Then we tried to upload a new image to a post, which constantly failed with the message "Post-processing of the image failed. If this is a photo or a large image, please scale it down to 2500 pixels and upload it again", you should watch the video carefully."

The generic error message was not helpful, but rather misleading. Uploading a smaller image did not help.

I check the update page, WordPress was up to date, version 5.7 already installed without issues when it was released. Two plugins outdated, both still failing when trying to update.

PHP 8

Finally I logged into the hosting provider's server settings to find out that it was another update that might have come in too early: PHP 8!

While WordPress core seems to work fine with PHP 8, at least the basic functionality, but after I went back onto safe ground and selected "PHP 7.4 (recommended)" for all domains serving WordPress, everything is now working as it should.

mea culpa

To be fair, it was my fault. Some time ago, I had to make sure there are no more outdated PHP versions in use. Instead of switching to the recommended 7.4, I went for 8 without doing proper research.

But others did: Yoast published a WordPress and PHP 8 Compatibility report in 2020 which dives deep into all of the details.

Conclusion

Did I upgrade WordPress to PHP 8 too early? Probably so, but no damage done, as it was just a personal blog mainly used to try out WordPress features. So I tried, and I found out, and I will be sure to run any proper production system for my customers with the latest stable version of PHP 7.

What is your experience? Did you upgrade to PHP 8? How did you benefit? Is your site faster? What did you have to fix to make it work?

Discussion (9)

Collapse
lucagrandicelli profile image
Luca Grandicelli • Edited

Also, as i wrote on my latest post, plugin updates are a complete madness and often expose the entire system to non-tested code updates that can easilly break the platform. It is not a coincidence that the WordPress community has lately put so much effort in making the recovery error page more friendly...

Collapse
matthijsewoud profile image
⚡️

This is so true. I'm blessed that I do most of the development within a single parent-theme for myself, but some clients insist on using certain plugins. And if something break with an update, it's usually one of those plugins.

Collapse
matthijsewoud profile image
⚡️

Oh dear, I know the feel. I was lucky that I only updated on my dev machines (basically docker containers), and that my hosting provider doesn't offer 8 yet.
Lucky because a couple of plugins (and I only use 1-3 depending on the install), broke the website. Most of my clients and containers would be fine, but there's one or two that I know can't update yet.

What bothers me is how those plugin owners (Sucuri, mostly) don't have a public git repo where you can submit a pull request to :(

Collapse
ingosteinke profile image
Ingo Steinke Author

@matthijsewoud, WordPress plugins are released into their SVN (although I think most plugin developers, like me, do use git for development), and WP offers an issue tracker and contact options on the plugin pages on wordpress.org, so could try to contact the developers to tell them you are actually interested in contributing fixes.

Collapse
matthijsewoud profile image
⚡️

That's true, and it is a valid way to contact them.

It just sort of feels empty, and hard to navigate around? When you post an issue or pull request on GitHub, you you they see it; it's out there. If someone else has the same issue or wants to help, they know the pull request is already there.
The WP issue tracker, as far as I can tell, is just simple forum. Or rather, a subforum of the WordPress support pages, dedicated to that one plugin. There's no tags, and developer feedback is, well, minimal. It just feels like contacting the void, rather than the developers.

Collapse
lucagrandicelli profile image
Luca Grandicelli

Yep, probably you should look into SVN, which is the official tracking system of the WordPress ecosystem. However, i often do "freeze" a production website and clone it onto a staging server where i test every new update (even core). Only after that, i move onto production and not before having waited at lease a couple of weeks (unless it's some sort of important security update).

Collapse
matthijsewoud profile image
⚡️

I don't think SVN and GIT by themselves do issue tracking, though they may support tagging of issue numbers, they don't offer any ways to publicise ways to work with said repo. I think SourceForge is used for many SVN repos, and GitHub for many git repos.

Thread Thread
lucagrandicelli profile image
Luca Grandicelli

No no, i mean you have always to contact the devs via the wordpress.org (if it's free) repo. On SVN you might find hints of the current bug tracking, but that's not a standard.

Collapse
lucagrandicelli profile image
Luca Grandicelli

I haven't yet and won't on WordPress untill every needed plugin has confirmed support. I've been working with this platform for so long now that i learnt that when it comes to plugin updates, you must be extremely cautious. For PHP updates it's better to wait untill your shared hosting provider doesn't force you to.