WordPress-Coding-Standards icon indicating copy to clipboard operation
WordPress-Coding-Standards copied to clipboard

Minimum WP version to check new functions

Open kagg-design opened this issue 5 years ago • 3 comments

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.

kagg-design avatar Dec 30 '19 12:12 kagg-design

Related to #1803

jrfnl avatar Apr 29 '21 20:04 jrfnl

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 avatar Nov 19 '21 13:11 benjaminprojas

@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.

jrfnl avatar Nov 19 '21 13:11 jrfnl