Closed ernilambar closed 3 months ago
@foosantos Please provide confirmation on this one also.
Some context:
Since WordPress 5.8, plugin readme files are not parsed for requirements. This means that, in core, Requires PHP
and Requires at least
are always parsed from plugin’s main PHP file. The place for the Tested up to
header remains in readme.txt
for the time being, as it's not used by WordPress core.
IMHO these headers are not mandatory and should never trigger an error. Not sure they should even trigger a warning, after all they are optional.
What could be useful to check is that Requires PHP
and Requires at least
(if present) follow the right format. These should be numbers only, so 7.0
and not PHP 7.0
. Or 6.5
and not WP 6.5
.
In the readme validator, message is shown in Notes like:
The Requires at least field is missing. It should be defined here, or in your main plugin file.
The Requires PHP field is missing. It should be defined here, or in your main plugin file.
There is should in the message. So I assumed it is required. May be it is required in the directory?
There is should in the message. So I assumed it is required. May be it is required in the directory?
I think this is just outdated. Again, all the data is parsed from the main plugin file.
Closing this for now. We can reopen in the future if needed.
Related: https://github.com/WordPress/plugin-check/issues/198
For following two headers, we accept fields either in readme file or main plugin file.
Requires at least
Requires PHP
We could raise ERROR or WARNING if those fields are missing from both files.
It seems preference is given to plugin file header. May be we could create separate Check instead of keeping inside
plugin_readme
check.