ryansechrest / github-updater-demo

WordPress plugin to demonstrate how `GitHubUpdater` can enable WordPress to check for and update a custom plugin that's hosted in either a public or private repository on GitHub.
1 stars 1 forks source link

Improvement: "Tested Up To" Plugin Header #2

Open BlaineMoore opened 3 weeks ago

BlaineMoore commented 3 weeks ago

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 the setTestedWpVersion 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 the setBranch function if one wanted a plugin to always use a Production branch or to easily be able to have separate branches for a plugin for Production and Staging, etc...though for my own personal use case that'd be better served with a defined constant in wp-config.php instead or by looking for a staging 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.

ryansechrest commented 2 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?

BlaineMoore commented 2 weeks ago

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/