Open alpipego opened 7 months ago
Definitely sounds like a good improvement, although I suppose it might also cause trouble with stale but working plugins if the compatibility metadata is listed as compulsory (rather than in e.g. suggests
)?
I wasn't sure from the main docs if the fields are exposed in the API but this comment suggests they should be.
I believe there are a couple potential packages for pulling in WP core, so it may not be feasible to enforce a specific one.
@ethanclevenger91 please check the following from my proposal. wordpress/core-implementation
is not one specific implementation, but rather a meta package that is provided by other packages. If you click on the link, you can see the packages that provide wordpress/core-implementation
.
Require
wordpress/core-implementation
for WordPress core (https://packagist.org/providers/wordpress/core-implementation)
@alpipego oh sick, learned something new today!
Hello, I've long noticed a potential area for improvement concerning compatibility checks with PHP versions and specific WordPress core versions. Currently, developers need to manually ensure that their WordPress environment matches the requirements of the plugins and themes they incorporate.
Example
Let's assume my project has this composer.json:
As of writing, this will install WordPress core in version
5.4.15
and Query Monitor in version3.15.0
. However, the installed Query Monitor version requires at least WordPress 5.6 and PHP 7.4, neither of which are satisfied in the current project configuration.This is the header for the installed QM version:
Suggestion
Requires at least
field provided by the WordPress.org Plugin/Theme API for the WordPress version andRequires PHP
for the PHP version.wordpress/core-implementation
for WordPress core (https://packagist.org/providers/wordpress/core-implementation)Potential Breaking Change
While this proposal aims to improve compatibility checks, it's crucial to consider the potential for breaking changes in websites that currently do not install a WordPress core package that provides
wordpress/core-implementation
.I haven't looked into https://github.com/WordPress/wp-plugin-dependencies deeply, but I assume it's something that could/should be considered down the line.