WordPress 6.6 Server Compatibility

As we explained in previous posts (WordPress 6.5, WordPress 6.4, WordPress 6.3), for each new version of WordPress, we aim to release an article explaining the compatibility of PHPPHP PHP (PHP: Hypertext Preprocessor) is a general-purpose scripting language especially suited to web development. PHP code is usually processed on a web server by a PHP interpreter. On a web server, the result of the interpreted and executed PHP code would form the whole or part of an HTTP response. with the WordPress versions and our team’s recommendation for that specific version.

On this occasion, once again, we will explain the details of compatibility, including “betaBeta Beta is the software development phase following alpha. A Beta phase generally begins when the software is feature complete but likely to contain a number of known or unknown bugs. Software in the beta phase will generally have many more bugs in it than completed software, speed or performance issues, and may still cause crashes or data loss. The focus of beta testing is reducing impacts to users, often incorporating usability testing. compatible” or “compatible with exceptions”.

So, here you have the compatibility information, this time, for WordPress 6.6.

HostingHosting A web hosting service is a type of Internet hosting service that allows individuals and organizations to make their website accessible via the World Wide Web. Team Recommendation

The Hosting Team’s recommendations for WordPress 6.6 are as follows (which may differ from the global ones).

  • PHP: 8.2.x
  • MySQLMySQL MySQL is an open-source relational database management system (RDBMS). MySQL is free and open-source software under the terms of the GNU General Public License.: 8.0.x
  • MariaDBMariaDB MariaDB is a fork of the MySQL relational database management system (RDBMS), intended to remain free and open-source software under the GNU General Public License. MariaDB intended to maintain high compatibility with MySQL, ensuring a drop-in replacement capability with library binary parity and exact matching with MySQL APIs and commands.: 10.11.x

IMPORTANT: These recommendations are intended, primarily, for new installations by hosting providers.

Where does that recommendation come from? We did review some configurations and options, we are going to explain.

WordPress’ serverServer A server is a piece of computer hardware or software that provides functionality for other programs or devices. Typical servers are database servers, file servers, mail servers, print servers, web servers, game servers, and application servers. requirements

Even if there are more stable software versions, that doesn’t mean they are the ones WordPress recommends.

WordPress 6.6 requirements:

  • PHP: 7.2.25+
  • MySQL: 5.5.5+
  • MariaDB: 5.5.5+

NOTE: Dropping support for PHP 7.0 and 7.1.

You can read more at Server requirements.

WordPress’ compatibility “at the time”

WordPress 6.6 (released on July 16, 2024) had the following components available (stable or security-maintained versions only, and RCRelease Candidate A beta version of software with the potential to be a final product, which is ready to release unless significant bugs emerge. only for informational purposes).

  • PHP: 8.1 (Security Support), 8.2 (Active Support), and 8.3 (Active Support).
  • MySQL: 8.0 (LTS), 8.2, 8.3, and 8.4 (LTS).
  • MariaDB: 10.5 (LTS), 10.6 (LTS), 10.11 (LTS), 11.1, 11.2, and 11.4 (LTS).
  • Apache HTTPDApache HTTPD The Apache HTTP Server, colloquially called Apache, is a free and open-source cross-platform web server software. The vast majority of Apache HTTP Server instances run on a Linux distribution, but current versions also run on Microsoft Windows, OpenVMS, and a wide variety of Unix-like systems.: 2.4.
  • nginxNGINX nginx is a web server that can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache. Nginx is free and open-source software, released under the terms of the 2-clause BSD license.: 1.26, and 1.27.

NOTE: PHP has extended the Security Support one extra year for actual (PHP 8.1, 8.2, and 8.3) and new PHP versions.

You can read more at WordPress Compatibility.

WordPress and PHP

PHP is a programming language on which WordPress code is based. This language runs on the server, and it is critical to keep it up to date, both for security and functionality.

WordPress supports many versions of PHP, some even obsolete (PHP Compatibility and WordPress Versions).

WordPress 6.6 (coreCore Core is the set of software required to run WordPress. The Core Team builds WordPress.) is:

  • fully compatible with 7.2 (1), 7.3 (1), and 7.4 (1).
  • compatible with exceptions with PHP 8.0 (1), 8.1, and 8.2.
  • beta compatible with 8.3.

(1) SECURITY ALERT: These versions are not officially maintained by PHP, so they are considered insecure and obsolete versions and should not be used in production. Check with your hosting provider about the security maintenance they can do.

What “compatible with exceptions” mean?

PHP 8.0

PHP 8.1

  • Not all “passing null to non-nullable” issues have been found. In PHP, you can tell a function exactly what type of information it should accept. If you tell a function to expect a certain type of information, and you give it nothing at all (null is like saying “nothing”), then PHP gets confused and gives an error. This problem happens when someone accidentally gives a function “nothing” when the function wasn’t designed to handle “nothing”.
  • _htmlentities() needs the default value of the flags parameter explicitly set_. According to htmlentities(), the default for flags for PHP 8.1 was “changed from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401”. All use cases for this functionality in WordPress Core are being investigated. NOTE: Has a patch, but moved to WordPress 6.7.
  • Replace most strip_tags() with wp_strip_tags().
    There are rare occasions when the strip_tags() function is passed a null value, which generates a warning that the string is deprecated. NOTE: Has a patch.
  • Update is_serialized function to accept Enums. Enums are not backwards compatible with older PHP versions. NOTE: Has a patch, but moved to WordPress 6.7.

PHP 8.2

What “beta” mean?

PHP 8.3

  • Deprecation notices. A deprecation notice is not an error, but rather an indicator of where additional work is needed for compatibility before PHP 9.0. With a deprecation notice, the PHP code will continue to work and nothing is broken.
  • Improve error handling for unserialize(). maybe_unserialize() function could still be confronted by data with trailing bytes. NOTE: Moved to WordPress 6.7.

Upgrading WordPress

Do you have a version earlier than WordPress 6.6? If so, we recommend you visit the Upgrading WordPress page, where you will find information on how to upgrade from WordPress 0.7 to WordPress 6.6.

Props: @luciaalcantara, @crixu, @annezazu.

#core, #php

The Image Revolution: AVIF and WebP

With the release of WordPress 6.6 in July, extended support for optimized image formats such as AVIF and WebP is being introduced. This update represents a significant improvement in how images are managed and served on the web, which is crucial for both developers and hostingHosting A web hosting service is a type of Internet hosting service that allows individuals and organizations to make their website accessible via the World Wide Web. companies. Below, we explore these formats in detail and their importance in image optimization compared to more traditional formats like JPEG.

What are AVIF and WebP?

AVIF

AVIF (AV1 Image File Format) is an image format derived from the AV1 video codec. It offers superior compression and image quality compared to traditional formats. Key features of AVIF include:

  • Efficient Compression: AVIF provides more efficient lossless and lossy compression than JPEG, resulting in significantly smaller file sizes.
  • Image Quality: Maintains high image quality even at high compression rates.
  • Transparency Support: Like PNG, AVIF supports transparency, making it ideal for a wide range of applications.
  • High Dynamic Range (HDR): AVIF supports HDR, enhancing visual quality on compatible devices.

WebP

WebP, developed by Google, is an image format designed to reduce image file sizes without compromising quality. Its key features include:

  • Lossy and Lossless Compression: Offers both lossy and lossless compression, adapting to different needs.
  • Transparency: Like AVIF and PNG, WebP supports transparency.
  • Animations: WebP can store animated images, offering an alternative to traditional GIFs with smaller file sizes.
  • Loading Speed: Due to its efficient compression, WebP images load faster, improving website performance.

Comparison with JPEG

JPEG has been the de facto standard for web images for many years. However, it has limitations compared to AVIF and WebP:

  • Compression: JPEG uses lossy compression that can result in visible artifacts at high compression rates.
  • File Size: JPEG images are typically larger than their AVIF and WebP counterparts for the same image quality.
  • Transparency and Animations: JPEG does not support transparency or animations, limiting its versatility.

Benefits for Hosting Companies

With the extended support for AVIF and WebP in WordPress 6.6, hosting companies should be prepared to take full advantage of these technologies. Here are some recommendations:

Installation of Necessary Libraries:

  • PHPPHP PHP (PHP: Hypertext Preprocessor) is a general-purpose scripting language especially suited to web development. PHP code is usually processed on a web server by a PHP interpreter. On a web server, the result of the interpreted and executed PHP code would form the whole or part of an HTTP response. GD and ImageMagick: Ensure that the PHP GD and ImageMagick libraries are updated and configured to support AVIF and WebP. This may involve installing additional dependencies or recompiling the libraries with support for these formats.
  • Libavif and Libwebp: These libraries are essential for the compression and decompression of AVIF and WebP images. Hosting companies should ensure they are installed on their servers.

Performance Optimization:

  • ServerServer A server is a piece of computer hardware or software that provides functionality for other programs or devices. Typical servers are database servers, file servers, mail servers, print servers, web servers, game servers, and application servers. Configuration: Adjust server settings to efficiently serve AVIF and WebP images. This includes configuring appropriate HTTPHTTP The Hypertext Transfer Protocol (HTTP) is protocol for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, where hypertext documents include hyperlinks to other resources that the user can easily access, for example by a mouse click or by tapping the screen in a web browser. headers for cachingCache A cache is a component that stores data so that future requests for that data can be served faster; the data stored in a cache might be the result of an earlier computation or a copy of data stored elsewhere. and compression.
  • Automatic Conversion: Implement solutions that automatically convert uploaded images to these optimized formats.

Education and Support:

  • Training: Provide clients with educational resources on the benefits of AVIF and WebP and how to use them on their websites.
  • Technical Support: Be prepared to assist clients with the configuration and use of these new formats.

Installation on Debian / Ubuntu

Installing libavif and libwebp

Update system packages:

   sudo apt update
   sudo apt upgrade -y

Install essential dependencies:

   sudo apt install -y build-essential cmake git

Install libwebp:

   sudo apt install -y libwebp-dev

Install libavif:
First, install libaom, a library needed for libavif.

   sudo apt install -y libaom-dev

Then proceed with libavif:

   git clone https://github.com/AOMediaCodec/libavif.git
   cd libavif
   mkdir build
   cd build
   cmake ..
   make
   sudo make install

Configuring PHP GD and ImageMagick

Install PHP and necessary extensions:

   sudo apt install -y php php-gd php-imagick

Verify that the extensions are enabled:

   php -m | grep -E 'gd|imagick'

Restart the web serverServer A server is a piece of computer hardware or software that provides functionality for other programs or devices. Typical servers are database servers, file servers, mail servers, print servers, web servers, game servers, and application servers.:

   sudo systemctl restart apache2  # For Apache
   sudo systemctl restart nginx  # For Nginx

Installation on CentOS / Red Hat

Installing libavif and libwebp

Update system packages:

   sudo yum update -y

Install essential dependencies:

   sudo yum groupinstall -y "Development Tools"
   sudo yum install -y epel-release
   sudo yum install -y cmake3 git

Install libwebp:

   sudo yum install -y libwebp-devel

Install libavif:
First, install libaom.

   sudo yum install -y libaom-devel

Then proceed with libavif:

   git clone https://github.com/AOMediaCodec/libavif.git
   cd libavif
   mkdir build
   cd build
   cmake3 ..
   make
   sudo make install

Configuring PHP GD and ImageMagick

Install PHP and necessary extensions:

   sudo yum install -y php php-gd php-pecl-imagick

Verify that the extensions are enabled:

   php -m | grep -E 'gd|imagick'

Restart the web server:

   sudo systemctl restart httpd  # For Apache
   sudo systemctl restart nginx  # For Nginx

Conclusion

By following these steps, hosting companies can ensure their servers are fully prepared to handle images in the AVIF and WebP formats. This will not only improve the quality and loading speed of images on their clients’ websites but also provide a significant competitive advantage in the hosting services market. The update to WordPress 6.6 in July will be a crucial moment to implement these strategies and lead in the support of next-generation image formats.

Props: @adamsilverstein

#performance, #php

WordPress 6.5 PHP Compatibility

As we explained in the previous post, for each new version of WordPress, we aim to release an article explaining the compatibility of PHPPHP PHP (PHP: Hypertext Preprocessor) is a general-purpose scripting language especially suited to web development. PHP code is usually processed on a web server by a PHP interpreter. On a web server, the result of the interpreted and executed PHP code would form the whole or part of an HTTP response. with the WordPress versions and our team’s recommendation for that specific version.

On this occasion, once again, we will explain the details of compatibility, including “betaBeta Beta is the software development phase following alpha. A Beta phase generally begins when the software is feature complete but likely to contain a number of known or unknown bugs. Software in the beta phase will generally have many more bugs in it than completed software, speed or performance issues, and may still cause crashes or data loss. The focus of beta testing is reducing impacts to users, often incorporating usability testing. compatible” or “compatible with exceptions”.

So, here you have the compatibility information, this time, for WordPress 6.5.

WordPress’ serverServer A server is a piece of computer hardware or software that provides functionality for other programs or devices. Typical servers are database servers, file servers, mail servers, print servers, web servers, game servers, and application servers. requirements

Even if there are more stable software versions, that doesn’t mean they are the ones WordPress recommends.

This makes WordPress 6.5 requirements:

  • PHP: 7.0+
  • MySQLMySQL MySQL is an open-source relational database management system (RDBMS). MySQL is free and open-source software under the terms of the GNU General Public License.: 5.5.5+
  • MariaDBMariaDB MariaDB is a fork of the MySQL relational database management system (RDBMS), intended to remain free and open-source software under the GNU General Public License. MariaDB intended to maintain high compatibility with MySQL, ensuring a drop-in replacement capability with library binary parity and exact matching with MySQL APIs and commands.: 5.5.5+

You can read more at Server requirements.

WordPress’ compatibility “at the time”

WordPress 6.5 was released on April 2, 2024, and at that time we had the following components available (stable or security-maintained versions only, and RCRelease Candidate A beta version of software with the potential to be a final product, which is ready to release unless significant bugs emerge. only for informational purposes).

  • PHP: 8.1, 8.2, and 8.3
  • MySQL: 8.0 (LTS), 8.2, and 8.3.
  • MariaDB: 10.4 (LTS), 10.5 (LTS), 10.6 (LTS), 10.11 (LTS), 11.0, 11.1, 11.2, and 11.3

You can read more at WordPress Compatibility.

WordPress and PHP

PHP is a programming language on which WordPress code is based. This language runs on the server, and it is critical to keep it up to date, both for security and functionality.

WordPress supports many versions of PHP, some even obsolete (PHP Compatibility and WordPress Versions).

WordPress 6.5 (coreCore Core is the set of software required to run WordPress. The Core Team builds WordPress.) is:

  • fully compatible with PHP 7.01, 7.11, 7.21, 7.31, and 7.41.
  • compatible with exceptions with PHP 8.01, 8.1, and 8.2.
  • beta compatible with 8.3.

1 SECURITY ALERT: These versions are not officially maintained by PHP, so they are considered insecure and obsolete versions and should not be used in production. Check with your hostingHosting A web hosting service is a type of Internet hosting service that allows individuals and organizations to make their website accessible via the World Wide Web. provider about the security maintenance they can do.

What “compatible with exceptions” mean?

PHP 8.0

  • Named parameters. WordPress does not support named parameters.
    PHP 8.0 supports optionally calling functions and class methods by specifying the parameter name, instead of calling them on the order of parameters that they are declared.
    PHP, and many other programming languages, support positional parameters: The caller passes the parameters in the same order the function/method declares its parameters.
  • Filesystem WP_Filesystem_FTPext and WP_Filesystem_SSH2 when connect fails.
    An investigation is underway as to why on some occasions the access to the files returns some type of error.

PHP 8.1

  • Not all “passing null to non-nullable” issues have been found.
    In PHP, you can tell a function exactly what type of information it should accept. If you tell a function to expect a certain type of information, and you give it nothing at all (null is like saying “nothing”), then PHP gets confused and gives an error. This problem happens when someone accidentally gives a function “nothing” when the function wasn’t designed to handle “nothing”.
  • htmlentities() et al needs the default value of the flags parameter explicitly set.
    According to htmlentities(), the default for flags for PHP 8.1 was “changed from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401”. All use cases for this functionality in WordPress Core are being investigated.
  • Replace most strip_tags() with wp_strip_tags().
    There are rare occasions when the strip_tags() function is passed a null value, which generates a warning that the string is deprecated.

PHP 8.2

What “beta” mean?

PHP 8.3

  • Deprecation notices
    A deprecation notice is not an error, but rather an indicator of where additional work is needed for compatibility before PHP 9.0. With a deprecation notice, the PHP code will continue to work and nothing is broken.

Hosting Team Recommendation

Taking all this into account, the Hosting Team’s recommendations for WordPress 6.5 are as follows (which may differ from the global ones).

  • PHP: 8.2.x
  • MySQL: 8.0.x
  • MariaDB: 10.11.x

IMPORTANT: These recommendations are intended, primarily, for new installations by hosting providers.

Props: @luciaalcantara

#core, #php

Proposal: PHPUnit Test Runner with Multi-PHP and Multi-Environment

This past weekend, the Clodfest Hackathon took place and the HostingHosting A web hosting service is a type of Internet hosting service that allows individuals and organizations to make their website accessible via the World Wide Web. team proposed a project to improve the tools.

Thanks to Pascal (@swissspidy), Cesar, and myself (@javiercasares), we have been able to make progress on some elements that had been in the backlog for over 4 years.

An important detail is that all the changes made are backward compatible so that the default configuration should not affect any of the new features, especially considering GitHubGitHub GitHub is a website that offers online implementation of git repositories that can can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the ‘pull request’ where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner. Actions.

What has been achieved?

The first step was to include support for Multi-PHPPHP PHP (PHP: Hypertext Preprocessor) is a general-purpose scripting language especially suited to web development. PHP code is usually processed on a web server by a PHP interpreter. On a web server, the result of the interpreted and executed PHP code would form the whole or part of an HTTP response.. This way, a user could submit different reports of the same commit but with different versions of PHP installed.

The second step was to create Multi-Environment. This allows a user to establish different servers with their respective configurations and PHP versions. This allows, for example, having an environment for “shared hosting”, another for “vps”, and another for “cloud”. This is in addition to the Multi-PHP from before.

The third step was to support All-Commits. The tool previously only executed the latest available commit. With this new change, a list of the 10 latest commits will be made, and all of them will be processed in case many commits are sent in a short time. Usually, the tool can take between 5 and 30 minutes per process, and sometimes commits that were never tested in all environments could be lost.

All these changes are accompanied by their respective improvements in the PHPUnit Test Reporter, the pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory or can be cost-based plugin from a third-party. that collects and displays the information.

From now on, the initial list will be a summary of the different environments and how many are working and failing. Once inside, we can see the list of all environments and PHP combinations. This is the visualization for developers: one commit, many results.

Furthermore, there is the option for different bots (i.e., different providers) to have their list and on the same screen, they can see the list of the latest tests and thus easily detect when or in what change an error occurred. This is the visualization for providers: one provider, many results.

Where can the changes be seen?

They are not yet approved because they need code review, documentation, and validation by more people. The focus of the Hackathon was to include the functionality, and it was done “too quickly,” so there is duplicated code and improvements can be made. It works, yes, but it’s not pretty.

The PRs with the changes are at:

If you want to contribute, please review and test the code to validate that everything works correctly.

Next steps

In addition to giving a code review, looking for possible errors, and proposing some improvements, we also intend to review the documentation on how to install and maintain the system automatically.

In parallel, we will review with the #core team that everything is working fine and that the GitHub Actions do not give errors, even with the possibility of running different tests depending on the PHP version.

#php, #testing, #tools

WordPress 6.4 PHP Compatibility

Looking for updated information?
Visit the Hosting Handbook Server Environment page.

As we explained in the previous post, for each new version of WordPress, we aim to release an article explaining the compatibility of PHPPHP PHP (PHP: Hypertext Preprocessor) is a general-purpose scripting language especially suited to web development. PHP code is usually processed on a web server by a PHP interpreter. On a web server, the result of the interpreted and executed PHP code would form the whole or part of an HTTP response. with the WordPress versions and our team’s recommendation for that specific version.

On this occasion, once again, we will explain the details of compatibility, including “betaBeta Beta is the software development phase following alpha. A Beta phase generally begins when the software is feature complete but likely to contain a number of known or unknown bugs. Software in the beta phase will generally have many more bugs in it than completed software, speed or performance issues, and may still cause crashes or data loss. The focus of beta testing is reducing impacts to users, often incorporating usability testing. compatible” or “compatible with exceptions”.

So, here you have the compatibility information, this time, for WordPress 6.4.

WordPress’ serverServer A server is a piece of computer hardware or software that provides functionality for other programs or devices. Typical servers are database servers, file servers, mail servers, print servers, web servers, game servers, and application servers. requirements

Even if there are more stable software versions, that doesn’t mean they are the ones WordPress recommends.

This makes WordPress 6.4 requirements:

  • PHP: 7.0+
  • MySQLMySQL MySQL is an open-source relational database management system (RDBMS). MySQL is free and open-source software under the terms of the GNU General Public License.: 5.0.15+
  • MariaDBMariaDB MariaDB is a fork of the MySQL relational database management system (RDBMS), intended to remain free and open-source software under the GNU General Public License. MariaDB intended to maintain high compatibility with MySQL, ensuring a drop-in replacement capability with library binary parity and exact matching with MySQL APIs and commands.: 5.5+

You can read more at Server requirements.

WordPress’ compatibility “at the time”

WordPress 6.4 was released on November 7, 2023, and at that time we had the following components available (stable or security-maintained versions only, and RCRelease Candidate A beta version of software with the potential to be a final product, which is ready to release unless significant bugs emerge. only for informational purposes).

  • PHP: 8.0–8.2, and 8.3-RC
  • MySQL: 5.0–8.1 (LTS versions: 8.0)
  • MariaDB: 10.4–10.6, and 10.10–11.0 (LTS versions: 10.6, and 10.11)

You can read more at WordPress Compatibility.

WordPress and PHP

PHP is a programming language on which WordPress code is based. This language runs on the server, and it is critical to keep it up to date, both for security and functionality.

WordPress supports many versions of PHP, some even obsolete (PHP Compatibility and WordPress Versions).

WordPress 6.4 (coreCore Core is the set of software required to run WordPress. The Core Team builds WordPress.) is:

  • fully compatible with PHP 7.01, 7.11, 7.21, 7.31, and 7.41.
  • compatible with exceptions with PHP 8.0, 8.1, and 8.2.
  • beta compatible with 8.32.

1 SECURITY ALERT: These versions are not officially maintained by PHP, so they are considered insecure and obsolete versions and should not be used in production. Check with your hostingHosting A web hosting service is a type of Internet hosting service that allows individuals and organizations to make their website accessible via the World Wide Web. provider about the security maintenance they can do.

2 DEVELOPMENT ALERT: These versions are in development, so it’s not recommended to use them in a production environment. PHP 8.3 release date: November 23, 2023.

What “compatible with exceptions” mean?

PHP 8.0

  • Named parameters. WordPress does not support named parameters.
    PHP 8.0 supports optionally calling functions and class methods by specifying the parameter name, instead of calling them on the order of parameters that they are declared.
    PHP, and many other programming languages, support positional parameters: The caller passes the parameters in the same order the function/method declares its parameters.
  • Filesystem WP_Filesystem_FTPext and WP_Filesystem_SSH2 when connect fails.
    An investigation is underway as to why on some occasions the access to the files returns some type of error.

PHP 8.1

  • Not all “passing null to non-nullable” issues have been found.
    In PHP, you can tell a function exactly what type of information it should accept. If you tell a function to expect a certain type of information, and you give it nothing at all (null is like saying “nothing”), then PHP gets confused and gives an error. This problem happens when someone accidentally gives a function “nothing” when the function wasn’t designed to handle “nothing”.
  • htmlentities() et al needs the default value of the flags parameter explicitly set.
    According to htmlentities(), the default for flags for PHP 8.1 was “changed from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401”. All use cases for this functionality in WordPress Core are being investigated.
  • Replace most strip_tags() with wp_strip_tags().
    There are rare occasions when the strip_tags() function is passed a null value, which generates a warning that the string is deprecated.

PHP 8.2

What “beta” mean?

PHP 8.3

  • Deprecation notices
    A deprecation notice is not an error, but rather an indicator of where additional work is needed for compatibility before PHP 9.0. With a deprecation notice, the PHP code will continue to work and nothing is broken.

Hosting Team Recommendation

Taking all this into account, the Hosting Team’s recommendations for WordPress 6.4 are as follows (which may differ from the global ones).

  • PHP: 8.1.x or 8.2.x
  • MySQL: 8.0.x
  • MariaDB: 10.11.x

IMPORTANT: These recommendations are intended, primarily, for new installations by hosting providers.

#core, #php

WordPress 6.3 PHP Compatibility

Looking for updated information?
Visit the Hosting Handbook Server Environment page.

Some time ago, we commented on the compatibility of WordPress with PHP 8. Since the release of this version of PHPPHP PHP (PHP: Hypertext Preprocessor) is a general-purpose scripting language especially suited to web development. PHP code is usually processed on a web server by a PHP interpreter. On a web server, the result of the interpreted and executed PHP code would form the whole or part of an HTTP response., and the major versions of WordPress that have appeared since then, have led to the creation of concepts unknown to the WordPress community, such as “betaBeta Beta is the software development phase following alpha. A Beta phase generally begins when the software is feature complete but likely to contain a number of known or unknown bugs. Software in the beta phase will generally have many more bugs in it than completed software, speed or performance issues, and may still cause crashes or data loss. The focus of beta testing is reducing impacts to users, often incorporating usability testing. compatible” or “compatible with exceptions”.

We’ve had WordPress 6.3 with us for a while now, and maybe it’s time to clarify a few things, which we’ll be keeping up with each major version of WordPress as it’s released.

WordPress’ serverServer A server is a piece of computer hardware or software that provides functionality for other programs or devices. Typical servers are database servers, file servers, mail servers, print servers, web servers, game servers, and application servers. requirements

Even if there are more stable software versions, that doesn’t mean they are the ones WordPress recommends.

Note that WordPress 6.3 brings an important update: Dropping support for PHP 5.

This makes WordPress 6.3 requirements:

  • PHP: 7.0+
  • MySQLMySQL MySQL is an open-source relational database management system (RDBMS). MySQL is free and open-source software under the terms of the GNU General Public License.: 5.0.15+
  • MariaDBMariaDB MariaDB is a fork of the MySQL relational database management system (RDBMS), intended to remain free and open-source software under the GNU General Public License. MariaDB intended to maintain high compatibility with MySQL, ensuring a drop-in replacement capability with library binary parity and exact matching with MySQL APIs and commands.: 5.5+

You can read more at Server requirements.

WordPress’ compatibility “at the time”

WordPress 6.3 was released on August 8, 2023, and at that time we had the following components available (stable or security-maintained versions only).

  • PHP: 8.0–8.2
  • MySQL: 5.7–8.1
  • MariaDB: 10.4–10.6 and 10.9–11.0

You can read more at WordPress Compatibility.

WordPress and PHP

PHP is a programming language on which WordPress code is based. This language runs on the server, and it is critical to keep it up to date, both for security and functionality.

WordPress supports many versions of PHP, some even obsolete (PHP Compatibility and WordPress Versions).

WordPress 6.3 (coreCore Core is the set of software required to run WordPress. The Core Team builds WordPress.) is:

  • fully compatible with PHP 7.01, 7.11, 7.21, 7.31, and 7.41.
  • compatible with exceptions with PHP 8.0, and 8.1
  • beta compatible with PHP 8.2.

1 SECURITY ALERT: These versions are not officially maintained by PHP, so they are considered insecure and obsolete versions and should not be used in production. Check with your hostingHosting A web hosting service is a type of Internet hosting service that allows individuals and organizations to make their website accessible via the World Wide Web. provider about the security maintenance they can do.

What “compatible with exceptions” mean?

PHP 8.0

  • Named parameters. WordPress does not support named parameters.
    PHP 8.0 supports optionally calling functions and class methods by specifying the parameter name, instead of calling them on the order of parameters that they are declared.
    PHP, and many other programming languages, support positional parameters: The caller passes the parameters in the same order the function/method declares its parameters.
  • Filesystem WP_Filesystem_FTPext and WP_Filesystem_SSH2 when connect fails.
    An investigation is underway as to why on some occasions the access to the files returns some type of error.

PHP 8.1

What “beta” mean?

PHP 8.2

  • Deprecation notices
    A deprecation notice is not an error, but rather an indicator of where additional work is needed for compatibility before PHP 9.0. With a deprecation notice, the PHP code will continue to work and nothing is broken.

Hosting Team Recommendation

Taking all this into account, the Hosting Team’s recommendations for WordPress 6.3 are as follows (which may differ from the global ones).

  • PHP: 8.1.x
  • MySQL: 8.0.x
  • MariaDB: 10.11.x

IMPORTANT: These recommendations are intended, primarily, for new installations by hosting providers.

#core, #php

Is WordPress compatible with PHP 8?

Looking for updated information?
Visit the Hosting Handbook Server Environment page.

TL;DR. If you are using WordPress 6.2, you should at least use PHPPHP PHP (PHP: Hypertext Preprocessor) is a general-purpose scripting language especially suited to web development. PHP code is usually processed on a web server by a PHP interpreter. On a web server, the result of the interpreted and executed PHP code would form the whole or part of an HTTP response.PHP PHP (PHP: Hypertext Preprocessor) is a general-purpose scripting language especially suited to web development. PHP code is usually processed on a web serverServer A server is a piece of computer hardware or software that provides functionality for other programs or devices. Typical servers are database servers, file servers, mail servers, print servers, web servers, game servers, and application servers. by a PHP interpreter. On a web server, the result of the interpreted and executed PHP code would form the whole or part of an HTTPHTTP The Hypertext Transfer Protocol (HTTP) is protocol for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, where hypertext documents include hyperlinks to other resources that the user can easily access, for example by a mouse click or by tapping the screen in a web browser. response. 8.1. If you keep your WordPress, plugins and themes up to date, everything should work fine.
If you are not yet using WordPress 6.2, we strongly recommend that you use this version of WordPress for maximum PHP compatibility.

PHP 8.x has been with us for a while now, so much so that even PHP 8.0 has only security support, and we should mainly use PHP 8.1 and PHP 8.2.

It mainly depends on which versions of WordPress and PHP we are talking about. There are many places to get information about WordPress and PHP compatibility:

A lot of information, plenty of versions.

The official version

WordPressPHP compatiblePHP beta compatible
WordPress 6.25.6 – 7.48.0* / 8.1* / 8.2*
WordPress 6.15.6 – 7.48.0* / 8.1* / 8.2*
WordPress 6.05.6 – 7.48.0* / 8.1*
WordPress 5.95.6 – 7.48.0* / 8.1*
WordPress 5.85.6 – 7.48.0*
WordPress 5.75.6 – 7.48.0*
WordPress 5.65.6 – 7.48.0*

What does beta mean?

Nothing. Yes, really, nothing. Forget about that!

When PHP 8.0 was released, WordPress gave some warning messages (not error messages). Most of those messages are fixed in all versions of WordPress and for all versions of PHP. Yes, there are outstanding tickets and messages, but they are few and should not affect WordPress performance.

Why put the beta label, then?

Not because of WordPress, but because of the ecosystem, i.e., plugins and themes. When PHP 8.0 appeared, block themes were not yet widespread and the Site Editor was not yet finished, which it is now. And since WordPress did not make its compatibility clear, many plugins were not adapted to PHP 8.x… because what’s the point if WordPress is non-compatible? (yes, this last question is pure sarcasm).

And, the fish that bites its tail: WordPress says it’s beta-compatible, and plugins and themes don’t adapt because WordPress isn’t… but, it’s not true. You have to read the fine print.

It’s all a matter of timing

In some cases, the release of WordPress coincides with a new major version of PHP, and that complicates everything. On the one hand, there is no time to adapt, on the other hand, everything works. And between one and the other, things are left the same.

The fact of marking WordPress as beta-compatible had a reason to be: WordPress works, but in general nobody uses WordPress without plugins. And the plugins, most of them, were not adapted to PHP 8.x.

It has been 6 months since the release of PHP 8.2 and many plugins are still not supported… although there has been time for PHP 8.0 and 8.1 to be supported.

Again, it’s a timing issue. PHP started a few years ago a cycle of annual releases of major versions that are not fully compatible with each other or generate many warnings, and reviewing all the WordPress code is complex, let alone the more than 60,000 plugins and 10,000 themes.

The Hosting vision

Security is a critical factor for hosting companies, and keeping PHP versions up to date is part of that.

That is why, every year, as the old PHP versions are no longer officially supported, the providers are activating the new ones and deactivating the old ones.

While it’s true that there are no PHP 7.4.1+ vulnerabilities reported yet (it’s a matter of time), it’s about time to use at least PHP 8.0. And, almost already, for the remaining half year of support, you should consider using at least PHP 8.1.

WordPress vs. PHP vs. Hosting companies

Undoubtedly, the decision to use one or another version of PHP for each project should be up to the users, although the hosting companies should clearly inform about the risks or not of using one or another version.

For example, someone with WordPress 5.8 cannot be recommended to activate PHP 8.1 because it probably won’t work. Nor can you push to make the change as soon as a new version of PHP is released.

What should I do?

First: the decision must always be yours. It is your project, and you have to decide what is best for it with all the information.

Second: have all the information. And this is where we can help you, a little.

Third: everything has to work. The goal is to make your site work, so you have to check, with a staging version, that everything is working properly. Ask your hosting provider for help with this.

I have WordPress 6.2

Presently, in May 2023, our recommendation is that you have at least PHP 8.1. It is a stable version, it is a secure version, and most themes and plugins work with this version.

WordPress 6.2 is compatible with 5.6.20+, PHP 7.0.x, PHP 7.1.x, PHP 7.2.x, PHP 7.3.x, PHP 7.4.x, PHP 8.0.x, PHP 8.1.x and PHP 8.2.x. BUT, older than PHP 8.0 are nor maintained, PHP 8.0 has only security maintenance and PHP 8.1 and PHP 8.2 are maintained versions. This is why PHP 8.1 is a good choice because, in general, everything should work.

What do I do if something doesn’t work? Upgrade everything to the latest versions. The latest version of WordPress 6.2 (right now WordPress 6.2.0), the latest versions of all your plugins and all your themes. If you have premium plugins, make sure you have the latest versions. Ask your hosting to help you figure out what’s wrong.

I have WordPress 6.1

When we published Server Environment for WordPress 6.1, we knew that WordPress 6.1 worked correctly with PHP 8.0 and PHP 8.1. PHP 8.2 did not, for one simple reason: it had not yet been released.

We also knew one thing: most plugins, even though PHP 8.1 had been on the market for a year, were not fully compatible. It was after PHP 7.4 stopped receiving updates that many developers started to support all available PHP 8.x versions, which are PHP 8.0, PHP 8.1 and PHP 8.2.

It has been long enough for WordPress 6.1, its plugins and themes to work properly with PHP 8.0 and PHP 8.1.

And, just as with WordPress 6.2, if you still have WordPress 6.1 everything should work correctly with PHP 8.1.

I have WordPress 5.9–6.0

You can read the same as in the two previous cases. In short, you should now be able to upgrade everything to PHP 8.1.

I have WordPress 5.6–5.9

You can read the same as in the two previous cases. In short, you should now be able to upgrade everything to PHP 8.0.

I have a version before WordPress 5.6

Surely, the best thing to do is to check out our article Upgrading (very old) WordPress.

Summary

The Core, Test, and Hosting teams actively care about the full compatibility of WordPress with all its technologies. This includes Apache HTTPD, nginx, PHP, MySQL, MariaDB, memcached or Redis.

While it is true that PHP is a critical technology, we have a project in which many hosting companies test their systems with future versions of WordPress so that, once released, its compatibility is as high as possible.

You can see the results of Host Test Results and learn how well it works and what the bugs are. Errors are good because it means that a possible incompatibility has been detected and will be corrected in the future so that WordPress remains compatible with the widest number of systems.

And if you are a hosting company, you can help WordPress stay up-to-date by testing alpha versions on your systems.

#core, #php

Server Environment for WordPress 6.1

Since the release of WordPress 6.1 the HostingHosting A web hosting service is a type of Internet hosting service that allows individuals and organizations to make their website accessible via the World Wide Web. Team has received quite a few inquiries about some of the configurations related to the ServerServer A server is a piece of computer hardware or software that provides functionality for other programs or devices. Typical servers are database servers, file servers, mail servers, print servers, web servers, game servers, and application servers. Environment.

Within the Handbook Hosting there is a page that is updated with each new major version of WordPress, or significant change, the information of the optimal and recommended configuration from the computer, in coordination with the rest of the teams.

Since last 2022-11-16 a new update of the page is available. As always, we recommend keeping the latest versions of the various services, especially for security. For example, using the latest versions of the web serverServer A server is a piece of computer hardware or software that provides functionality for other programs or devices. Typical servers are database servers, file servers, mail servers, print servers, web servers, game servers, and application servers. does not usually affect WordPress at all. In general, the same thing happens with databases, it is best to use the latest versions of MySQLMySQL MySQL is an open-source relational database management system (RDBMS). MySQL is free and open-source software under the terms of the GNU General Public License. or MariaDBMariaDB MariaDB is a fork of the MySQL relational database management system (RDBMS), intended to remain free and open-source software under the GNU General Public License. MariaDB intended to maintain high compatibility with MySQL, ensuring a drop-in replacement capability with library binary parity and exact matching with MySQL APIs and commands., taking into account their connection with PHPPHP PHP (PHP: Hypertext Preprocessor) is a general-purpose scripting language especially suited to web development. PHP code is usually processed on a web server by a PHP interpreter. On a web server, the result of the interpreted and executed PHP code would form the whole or part of an HTTP response..

And we come to PHP versions, which is usually the most delicate in each version of WordPress, whether in the coreCore Core is the set of software required to run WordPress. The Core Team builds WordPress., plugins or themes.

In this table you can find the list of available, stable versions that were at the time of the release of each WordPress version.

WordPressPHPMySQLMariaDBDate
WordPress 6.17.4 – 8.15.7 – 8.010.3 – 10.92022-11-01
WordPress 6.07.4 – 8.15.7 – 8.010.3 – 10.72022-05-24
WordPress 5.97.4 – 8.15.7 – 8.010.2 – 10.62022-01-25
WordPress 5.87.3 – 8.05.7 – 8.010.2 – 10.62021-07-20
WordPress 5.77.3 – 8.05.7 – 8.010.2 – 10.52021-03-09

But, to this table, we must add the compatibility of the WordPress Core in each version.

WordPressPHP compatiblePHP betaBeta Beta is the software development phase following alpha. A Beta phase generally begins when the software is feature complete but likely to contain a number of known or unknown bugs. Software in the beta phase will generally have many more bugs in it than completed software, speed or performance issues, and may still cause crashes or data loss. The focus of beta testing is reducing impacts to users, often incorporating usability testing. compatible
WordPress 6.15.6 – 7.48.0* / 8.1* / 8.2*
WordPress 6.05.6 – 7.48.0* / 8.1*
WordPress 5.95.6 – 7.48.0* / 8.1*
WordPress 5.85.6 – 7.48.0*
WordPress 5.75.6 – 7.48.0*

Versions with * are those with beta compatibility. To learn more about beta compatibility, you can check out WordPress and PHP 8.0 and WordPress 5.9 and PHP 8.0-8.1. WordPress 6.1’s compatibility with PHP 8.2 is pending, although it should be noted that PHP 8.2 is not yet publicly available (it is scheduled to do so in early December 2022).

How to know which is the best stable version for each version of WordPress? Use the ServeHappy API. This APIAPI An Application Programming Interface (API) is a computing interface that defines interactions between multiple software intermediaries. It defines the kinds of calls or requests that can be made, how to make them, the data formats that should be used, the conventions to follow, etc. returns the best compatibility information of WordPress with PHP.

WordPressMinimum PHPRecommended PHPAPI JSONJSON JavaScript Object Notation (JSON) is an open standard file format, and data interchange format, that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and array data types. It is a very common data format, with a diverse range of applications, such as serving as a replacement for XML in AJAX systems.
WordPress 6.15.6.207.4JSON
WordPress 6.05.6.207.4JSON
WordPress 5.95.6.207.4JSON
WordPress 5.85.6.207.4JSON
WordPress 5.75.6.207.4JSON

These values may vary depending on the different teams consider the change.

Although official support for PHP 7.4 will soon end, currently only with security support, several open sourceOpen Source Open Source denotes software for which the original source code is made freely available and may be redistributed and modified. Open Source **must be** delivered via a licensing model, see GPL. projects have requested the PHP Foundation to extend the support of this version until all of them are updated on their new compatibility, including WordPress, which could give that compatibility in WordPress 6.2 (taking into account the current tickets).

What is the Hosting team’s recommendation to Hosting companies? Maintain, for now, PHP 7.4 as the default version for all WordPress, and test and report compatibility with PHP 8.0, 8.1 and 8.2, when available.

If you want to help the Hosting, Core, and Test teams, test new versions and future WordPress, PHP and SQL compatibility, you can use the tool WordPress Distributed Hosting Tests (Test Runner).

Props to @Crixu for review the information.

#handbook, #make-wordpress-org-core, #make-wordpress-org-updates, #php

Proposal: Updating WP_MEMORY_LIMIT

During the Contributor Day at the WordCamp Europe 2022, the HostingHosting A web hosting service is a type of Internet hosting service that allows individuals and organizations to make their website accessible via the World Wide Web. Team found that WP_MEMORY_LIMIT is set as 40 MB (single site) and 64 MB (multisiteMultisite Multisite is a WordPress feature which allows users to create a network of sites on a single WordPress installation. Available since WordPress version 3.0, Multisite is a continuation of WPMU or WordPress Multiuser project. WordPress MultiUser project was discontinued and its features were included into WordPress core.https://codex.wordpress.org/Create_A_Network.). Furthermore, the WP_MAX_MEMORY_LIMIT is set as 256 MB.

WP_MEMORY_LIMIT is the value for the WordPress Memory Limit, usually referred to the frontend memory, and WP_MAX_MEMORY_LIMIT is the value for the PHPPHP PHP (PHP: Hypertext Preprocessor) is a general-purpose scripting language especially suited to web development. PHP code is usually processed on a web server by a PHP interpreter. On a web server, the result of the interpreted and executed PHP code would form the whole or part of an HTTP response. Memory Limit, usually referred to the backend memory.

History

Around September 2013, the WP_MEMORY_LIMIT value changed from 32 MB to 40 MB (32+8). Some tests done by the Hosting Team suggest that the memory used on WordPress is around 16 MB.

The PHP memory_limit sets the maximum amount of memory in bytes that a script is allowed to allocate. This helps prevent poorly written scripts for eating up all available memory on a serverServer A server is a piece of computer hardware or software that provides functionality for other programs or devices. Typical servers are database servers, file servers, mail servers, print servers, web servers, game servers, and application servers.. Note that to have no memory limit, set this directive to -1. Check the PHP page for more information.

PHP values

The first part gets the value from PHP, and if not exists, sets a default value. Thereafter, if the value is incorrect (in bytes) sets the memory limit from the constant.

This PHP value has evolved:

Some questions

Why change the WP_MEMORY_LIMIT value?

To level it to the PHP standard.

If the hoster has some kind of limitation, misconfiguration, an incorrect value or does not allow changing it, the value used is the lesser, of 40 MB, which usually produces memory errors, when it should use the PHP default value, which is generally acceptable in new installations. At this time, 20 latest versions of WordPress (since WordPress 4.1 / 2014-12-17) can use PHP 5.6.40+ so it would meet the minimums set by PHP.

Can, actually, the value be greater than the PHP value?

Yes. That’s why there is an intent to include something like:

WP_MEMORY_LIMIT <= WP_MAX_MEMORY_LIMIT <= memory_limit

Premises

We should keep in mind some basic assumptions when incorporating PHP memory limits based on what users can do.

The memory limit set by computer systems are set for a reason. And that reason should be enforced; therefore, PHP’s memory limit should not be exceeded, and in case it needs to be exceeded, it should be changed by the system administration.

Users can set the values they want from the wp-config.phpwp-config.php One of the most important files in a WordPress installation is the wp-config.php file. This file is located in the root of your WordPress file directory and contains your website’s base configuration details, such as database connection information. configuration file. Often, extremely high values are set to hide a memory consumption problem due to bad programming. With a few visits it usually works, but it is a short-term fix.

We must be realistic about the memory limits of the WordPress CoreCore Core is the set of software required to run WordPress. The Core Team builds WordPress. and the normal use of a WordPress, whether it is a simple WordPress or a WordPress Multisite. Most WordPress sites install plugins and themes that make memory spikes higher.

PHP has its baseline memory limits that should serve as a reference for its use and application.

Proposal

Considering that since 2008, and PHP >5.2.0 the memory_limit value is equal to 128 MB, should we consider an update of this value in the WordPress base configuration, or at least an update of the values?

The proposal from the WordPress Hosting team is for WP_MEMORY_LIMIT:

  • WordPress Single: define('WP_MEMORY_LIMIT', '128M');
  • WordPress Multisite: define('WP_MEMORY_LIMIT', '192M');

Another patch should be:

WP_MEMORY_LIMIT <= WP_MAX_MEMORY_LIMIT <= memory_limit

Users can modify the WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT at wp-config.php and should have some limitations in values, as far as WordPress cannot overflow PHP.

Getting the values

When doing some calls to PHP functions and values, got this:

  • php.iniphp.ini The main configuration file of PHP.: memory_limit -> value: 256M
  • function: memory_get_usage -> value: 2097152
  • updating the ini_set memory_limit to 512M -> value: memory_limit = 256M
  • function: ini_get_all[memory_limit]
Array (
  [global_value] => 256M
  [local_value] => 512M
  [access] => 7
)

So, the real values are, always, in the ini_get_all[memory_limit].

After doing some tests, maybe hard-coding the values is a bad idea, but having some “limits” is cool (like now) but reading the real values.

Ticket: 56390 Updating WP_MEMORY_LIMIT

Props: @javiercasares, @crixu, @bernardzijlstra, @mikeschroder.

#core, #performance, #php

WordPress 5.9 and PHP 8.0-8.1

#php