Last Updated: 20th Sep 2017
WPTavern: WordPress.org Now Allows Plugin Authors to Specify a Minimum PHP Version Requirement
Although WordPress core currently maintains backwards compatibility with PHP 5.2.4+, plugin and theme authors are not required to do so. When developers include features that require more recent versions of PHP, it can break sites or cause otherwise unexpected behavior. As part of a larger effort to encourage users to upgrade their PHP versions, WordPress.org now allows plugin authors to specify a minimum PHP version requirement in the
readme.txt file with a new Requires PHP header. It is displayed to users in the sidebar of the pluginâ€™s description:
This addition to the readme.txt file has been well-received by developers who are already updating their plugins in the directory with minimum PHP version requirements. It also complements WordPressâ€™ Core PHP teamâ€™s recent efforts to educate users about the benefits of upgrading PHP, as the minimum supported version was released 10 years ago and hasnâ€™t received security patches for nearly seven years.
â€śAs a plugin developer (who maintains my plugins in my spare time), it is becoming increasingly difficult to build new functionality that works in older versions of PHP,â€ť Paul Gilzow commented on the announcement. â€śThere are some things that simply cannot be done in the older versions, and in those cases, I have to build out functionality to check PHP versions and disable those features. That takes time and energy away from building out other new features.â€ť
WordPress Core Committer Sergey Biryukov said the next step is exploring the possibility of displaying a notice to users when they cannot install a theme or plugin due to their installations not meeting the required criteria. Ideally, these notices would include host-specific instructions to assist users in getting their sites upgraded to a newer PHP version. This particular move could make a significant impact on the wider WordPress community, if popular plugins start triggering notices requiring newer versions of PHP.