featured image for tech article about PHP 8

Is your plugin ready for PHP 8? Maybe I should ask if you’re ready for WordPress 5.6? Either way, there will be changes. Breaking ones. Read them all on PHP 8’s GitHub page.

PHP 8 comes out on Thanksgiving and WordPress 5.6 comes out 12 calendar days later. So, yay! Not so much? Also, why are there any software releases after October 15? If you believe in holidays, then believe in holidays. Sheesh.

I’ve reached out to my clients who build plugins and themes and none of them are surprised by either WordPress 5.6 coming or PHP 8. They’re a bit bummed that it means another holiday testing their code, but yeah. Welcome to plugin development in WordPress, right? Nothing new to see here, folks.

When is PHP 8 Coming Out?

General availability or GA of PHP 8 will be on 26 November, according to their calendar. PHP has 4 release candidates and the fourth will be on 12 November.

PHP Release Candidate 2 is available for testing as of 16 October and the third will drop 29 October. (PHP is international so the date is European style.)

When is WordPress 5.6 Coming Out?

The final release is set to come out December 8 according to this post on Make WordPress.

WordPress has a call for testing PHP 8 right now for 5.6. Testing feedback in the form of GitHub or Trac tickets closes November 17.

And, yes, WordPress 5.6 will have support for PHP 8. So you may as well make your plugin ready. Right?

“Even though WordPress 5.6 will add support for PHP 8.0, no changes will be made to the minimum required version of PHP at this time.” Andrei Draganescu (10/6/2020)

How Does PHP Affect My WordPress Website?

If you’re reading this and you’re a website owner but not a product or plugin developer, that’s okay. The bottom line is this: it’s best practices to have your software as up-to-date as possible. If you’re not sure, check with your web host.

WordPress is a content management system that uses PHP to talk between the servers, your website, and the browser. Generally, your website host determines how high you can upgrade your site’s PHP. My site is hosted on Pressable and I was on PHP 7.2, for example. I just upgraded to PHP 7.4. That was as high as I could go.

Should I Refactor for PHP 8?

Maybe. My suggestion from a strategic standpoint and manpower is to be ready for the future. In marketing and public relations, we like to be ahead of the story. It seems to me you save yourself a lot of work later if you plan for the future now.

“Refactoring WordPress plugins is no joke. But if you start with small functions like this and gradually work your way around the codebase, it gets easier.” Tom McFarlin

Maybe start another dev branch that is PHP 8 ready but wrapped to support down to 7.2 or something. 7.4 might be a better route, but it’s up to you.

We like to honor backward compatibility in WordPress but Gutenberg is already a major breaking change (though I seem to be the only one saying it). But that’s another blog post.

“PHP 8 is actually already at RC2 and will be released nov 26th. Re: WP vs PHP8 – as things stand, expect breakage in unexpected places. Most of WP is untested on PHP 8 and with WPs reliance on type juggling, things *will* break.” Juliette on Twitter 

How Should PHP 8 Affect My WordPress Plugin?

PHP 8 and WordPress plugins may be a bit of a challenge. Like I noted earlier, WordPress 5.6 (as of right now) will support PHP 8. Some of my friends, however, worry about some issues that will cause breakage.

Marketing Your Plugin’s Compatibility with PHP 8 and WordPress 5.6

Yes, you should let people know that your plugin is compatible with WordPress 5.6 and/or PHP 8. Start your GitHub repos, begin your documentation, write blog posts, include notes on update schedules on product pages. Tweet. Yeah. You should tell people.

Note that Josepha wrote: “WordPress 5.6 includes seven Gutenberg plugin releases.” SEVEN. So, maybe check those out.

What about Laravel and PHP 8?

Developers like Carl Alexander and Josh Pollock will be upgrading their Laravel products to PHP 8 right away. Why? Well, it’s a pretty complicated issue in WordPress. Laravel is newer.

What about Microsoft and PHP 8?

When I read this quote on the Microsoft externals channel, I was aghast. It sounded like PHP 8 wouldn’t work on Windows Servers.

“We are not, however, going to be supporting PHP for Windows in any capacity for version 8.0 and beyond.” Dale Hirt, Service Engineer Microsoft

But, thankfully, after writing a comment on The WP Tavern, Andrey set me straight.

“PHP language is still absolutely supported and works on Windows.Microsoft discontinued donation of time and infrastructure to the process of producing Windows binaries of PHP. Just that.” Andrey “Rarst” Savchenko

He’s nice like that. One of my favorite people on the planet!

OMG This is So Long! TL;DR

  • PHP 8 releases November 26.
  • WordPress 5.6 Releases December 8.

2 Comments

  1. […] to Bridget Willard, that is later this […]

  2. WunderAutomation 1.5.9 - Wundermatics on November 8, 2020 at 2:15 am

    […] PHP 8 is about to be released and WordPress promises PHP 8 support in version 5.6 we think it’s about time to abandon our support for PHP 5.6. WooCommerce bumped up their PHP […]

Leave a Comment





  
Please enter an e-mail address

This site uses Akismet to reduce spam. Learn how your comment data is processed.