<img alt="" src="https://secure.rate8deny.com/219258.png" style="display:none;">

Wordpress PHP 8 Challenges

6 Minute Read

PHP 8.0 is the latest version of the popular server-side scripting language that powers a large percentage of websites on the internet, including many WordPress websites. While PHP 8.0 brings a host of new features and improvements, it also presents some challenges for developers and site owners when it comes to compatibility with WordPress.


What's new in PHP 8?

PHP 8, released in November 2020, introduced several new features and improvements, including:

    1. JIT Compiler: The most significant change in PHP 8 is the addition of a Just-In-Time (JIT) compiler. This new feature can improve the performance of PHP scripts by up to 30%. The JIT compiler dynamically translates PHP code into machine code, which allows for faster execution of the code.

    2. Union Types: Another new feature in PHP 8 is the ability to use union types in function and method arguments, return types, and properties. This allows developers to specify that a parameter or property can have more than one data type.

    3. Named Arguments: PHP 8 introduces named arguments, which allows developers to pass arguments to functions using the name of the parameter instead of its position. This can improve code readability and reduce errors caused by incorrect argument order.

    4. Attributes: Attributes provide a way to add metadata to classes, functions, and methods. This can be used to provide additional information to tools like IDEs, or to implement custom annotations.

    5. Match Expressions: PHP 8 introduces a new match expression, which is similar to a switch statement, but with improved syntax and functionality. It can be used to compare a value against multiple options and return a result based on the first match.

    6. Constructor Property Promotion: This new feature allows developers to declare and initialize class properties directly in the constructor, which can make code shorter and more readable.

These are just a few of the new features and improvements introduced in PHP 8. Other changes include improvements to error handling, improvements to the null-safe operator, and improvements to the string functions. Overall, PHP 8 is a significant update that provides developers with new tools and features to improve their code.


Wordpress PHP 8 Issues

One of the main challenges of PHP 8.0 with WordPress websites is compatibility with plugins and themes. Many plugins and themes may not have been updated to be compatible with the new version of PHP, which could cause errors and issues on your website. This can be especially problematic for site owners who rely heavily on plugins and themes to add functionality and customize their site.

Another challenge of PHP 8.0 with WordPress is that some WordPress core functions and features may not work as expected. WordPress is built using PHP, so changes to the language can impact how WordPress works. For example, some plugins that rely on certain WordPress functions may not work as expected with PHP 8.0, leading to errors and issues on your website.

In addition, PHP 8.0 introduces some changes to the language itself, which may require developers to update their code to be compatible with the new version. This can be a time-consuming process, and may require significant changes to existing code. Developers will need to thoroughly test their code on PHP 8.0 to ensure that it works as expected.

Finally, there is the issue of hosting. Not all hosting providers support PHP 8.0, so site owners may need to switch to a different hosting provider in order to use the new version. This can be a hassle, especially if you have a large, complex website with many plugins and themes.

So, what can site owners do to mitigate the challenges of PHP 8.0 with WordPress? First and foremost, it's important to ensure that all plugins and themes are updated to be compatible with PHP 8.0. This may require reaching out to plugin and theme developers to ask if they have plans to update their products.

Secondly, site owners can work with developers to update their custom code to be compatible with PHP 8.0. This may require significant changes to existing code, so it's important to budget time and resources for this process.

Finally, site owners may need to consider switching to a hosting provider that supports PHP 8.0. This may involve migrating your website to a new server, which can be a complex process. Site owners should work with their hosting provider to ensure that all necessary steps are taken to ensure a smooth migration.

If you're not compatible with PHP 8, you'll end us seeing this screen when you go to your website:

There has been a critical error on this website.
Learn more about troubleshooting WordPress.

wordpress-There has been a critical error on this website

How do you know if your Wordpress plugins are compatible with PHP 8?

To know if your WordPress plugins are compatible with PHP 8, you can take the following steps:

    1. Check the plugin's documentation: The first step is to check the documentation provided by the plugin developer. If they have updated their plugin to be compatible with PHP 8, they will usually mention it in the documentation. Check the plugin's website or the WordPress Plugin Directory for any information regarding PHP 8 compatibility.

    2. Test the plugin on a local or staging environment: Create a local or staging environment of your website and update the PHP version to 8.0. Install the plugin and test it to see if it works properly. If there are any issues, check the plugin's support forum or contact the developer for help.

    3. Use compatibility plugins: There are plugins available that can help check plugin compatibility with PHP 8. One such plugin is "PHP Compatibility Checker" by WP Engine. This plugin scans your website for any code that may not be compatible with PHP 8 and provides a report. You can use this report to identify any plugins that may need updating.

    4. Contact the plugin developer: If you are still unsure about whether a plugin is compatible with PHP 8, contact the developer directly. Many developers are happy to answer questions and provide support to their users. You can usually find contact information on the plugin's website or in the WordPress Plugin Directory.

It's important to ensure that all plugins are fully compatible with PHP 8 before updating your website's PHP version. Using incompatible plugins can cause errors and issues on your website, which can impact performance and user experience.


Kinsta Forcing ALL Wordpress Websites to PHP 8.0

Kinsta is a premium WordPress hosting provider that prides itself on its cutting-edge technology and exceptional performance. In early 2023, Kinsta made the decision to force all of its customers to switch to PHP 8, the latest version of the PHP language, in order to take advantage of its significant performance improvements.

The move was controversial at first, as many WordPress site owners rely heavily on plugins and themes that may not be fully compatible with PHP 8. However, Kinsta was determined to push forward with the change, believing that the benefits of the new version outweighed any potential drawbacks.

There have been significant downtimes to customers that do not have a wordpress maintenance package, or dedicated developer to check for compatibility issues. With most hosting providers (like WPEngine) there is the option to downgrade version of PHP back to PHP 7.4, however Kinsta removed this option completely and fully committed to all users being on PHP 8.0.

Since the switch to PHP 8, Kinsta customers that were fully compatible have reported significant performance improvements, with faster page load times and smoother overall site operation. Kinsta has also provided extensive support and guidance to help customers navigate the transition, including detailed documentation and helpful resources for updating plugins and themes. While the move to PHP 8 may have been a bold move, it appears to have paid off for Kinsta and its customers in the long run.

How to check your PHP version for Wordpress?

To check the PHP version of a WordPress website, you can follow these steps:

    1. Log in to the WordPress dashboard of your website.

    2. Install and activate the "Display PHP Version" plugin from the WordPress Plugin Directory.

    3. Once activated, the plugin will add a widget to the WordPress dashboard that displays the PHP version of your website.

Alternatively, you can also check the PHP version using an FTP client, such as FileZilla. Here's how:

    1. Connect to your website using an FTP client.

    2. Navigate to the root directory of your website.

    3. Look for a file named "phpinfo.php" and download it to your computer.

    4. Open the file in a text editor and look for the line that says "PHP Version".

    5. The number next to "PHP Version" is the version of PHP that your website is using.

It's important to note that the "phpinfo.php" file should be deleted from your server once you've checked the PHP version, as leaving it on your server could pose a security risk.

Will I have to start using PHP 8?

There is no requirement for all WordPress websites to start using PHP 8. The use of PHP 8 is optional, and website owners can choose to continue using an older version of PHP if they wish.

However, it's important to note that PHP 5.6 and 7.0 are no longer supported and receive no security updates, so using these older versions can put your website at risk. WordPress recommends using at least PHP 7.3, which is still receiving security updates.

While there is no requirement to use PHP 8 if you're using Wordpress (unless your hosting provider requires it), it is recommended for website owners who want to take advantage of the performance improvements and new features introduced in this latest version of PHP. However, before upgrading to PHP 8, website owners should ensure that all of their plugins and themes are compatible with PHP 8, as using incompatible software can cause errors and issues on their website.

Wordpress PHP 8 Conclusion

In conclusion, PHP 8.0 presents some challenges for WordPress websites, particularly when it comes to compatibility with plugins and themes. This can have a serious impact on your SEO performance. However, with careful planning and collaboration between site owners and developers, these challenges can be overcome. Site owners should take the time to ensure that their website is fully compatible with PHP 8.0 in order to take advantage of its new features and improvements.

You wouldn't have to deal with issues like this if you used Hubspot CMS instead of Wordpress, which we discuss the differences and pros and cons of each content management system.

Matt Sullivan

Matt Sullivan

Husband + Father | CEO of Torro | Building the internet since 2007.

Matt Sullivan is a seasoned and distinguished figure in the digital marketing and web design industry, with a career spanning since 2007. Renowned for his innovative approach and extensive expertise, Matt has been at the forefront of the industry, building several startups and agencies. As the Founder and CEO of Torro Media, he has cemented his status as a leading authority in the field. His deep understanding of web design, SEO, digital marketing, and Google Ads, honed over more than a decade, has been instrumental in driving business growth and digital transformation.