Open BlaineMoore opened 3 weeks ago
I definitely like this approach, and actually wanted to place the tested up to version in the header, but couldn't find a corresponding plugin header documented, which led me to creating a method instead.
Do you know if this is an official header field, but the documentation is out of date, or would this be a custom header field?
I think that it's a custom header field but not 100% certain; I have seen it used in multiple plugins, though, so it seemed like a good option.
However, it is an official part of the readme.txt for repository plugins: https://developer.wordpress.org/plugins/wordpress-org/how-your-readme-txt-works/
A potential improvement would be to allow a
Tested Up To
header in the primary plugin file to denote what version of WordPress the latest updates have been tested on. It would not replace thesetTestedWpVersion
function but would rather provide an alternative method for setting it upon loading the updater class that's already supported in WordPress. By having it in the header of the plugin file, it'd provide a consistent place to specify that information across different plugins without having to search for the function and would be quicker to update when making edits to the plugin. Basically, a quality of life update for developers.(I do not personally have a need for it, but the same functionality could easily be added for an
Update Branch
header to augment thesetBranch
function if one wanted a plugin to always use aProduction
branch or to easily be able to have separate branches for a plugin forProduction
andStaging
, etc...though for my own personal use case that'd be better served with a defined constant inwp-config.php
instead or by looking for astaging
subdomain etc.)I have a branch here that implements the
Tested Up To
header that I can send a pull request for depending on the questions that you have.