WordPress-Coding-Standards
WordPress-Coding-Standards copied to clipboard
Minimum WP version to check new functions
It would be good to check a new functions, not existing in minimum required WP version. Let say, if I set
<config name="minimum_supported_wp_version" value="5.1"/>
I should get an error for the following line
wp_ajax_health_check_dotorg_communication();
as this function was introduced in 5.2.0.
Related to #1803
I'm surprised this isn't a huge part of WPCS. This functionality would mirror the PHPCompatibility ruleset and would help prevent developers from adding in obscure functions that may not be available in their version of WP they are developing for.
@benjaminprojas The logic for checking this isn't a problem and is largely already available. The problem is the huge maintenance burden this will generate for keeping that list up to date and complete.
In PHP, there is only one minor a year and generally speaking those may introduce/deprecate somewhere between 2 to 20 functions.
In WP, there are 3 to 4 majors a year and the numbers of new functions are of a completely different magnitude.