Immutable
release. Only release title and notes can be modified.
We're happy to welcome @rodrigoprimo as co-maintainer of WordPressCS as of this release.
Added
WordPress.Arrays.ArrayDeclarationSpacing: newallow_single_item_single_line_explicit_key_arraysproperty to replace the, now deprecated,allow_single_item_single_line_associative_arraysproperty. #2696- End-user documentation to the following existing sniffs:
WordPress.Arrays.ArrayDeclarationSpacing(props @RafaelFunchal, @mattgaldino and @rodrigoprimo, #2489, #2593, #2682),WordPress.CodeAnalysis.AssignmentInTernaryCondition(props @Nic-Sevic and @rodrigoprimo, #2488, #2678),WordPress.DB.RestrictedClasses(props @paulgibbs and @rodrigoprimo, #2455, #2689),WordPress.DB.DirectDatabaseQuery(props @jaymcp and @rodrigoprimo, #2458, #2697),WordPress.DB.RestrictedFunctions(props @paulgibbs and @rodrigoprimo, #2453, #2676),WordPress.DB.SlowDBQuery(props @petitphp and @rodrigoprimo, #2464, #2699),WordPress.PHP.DevelopmentFunctions(props @gogdzl and @rodrigoprimo, #2490, #2690),WordPress.PHP.NoSilencedErrors(props @gogdzl and @rodrigoprimo, #2495, #2694),WordPress.PHP.PregQuoteDelimiter(props @tikifez and @rodrigoprimo, #2487, #2677),WordPress.PHP.RestrictedPHPFunctions(props @gogdzl and @rodrigoprimo, #2491, #2693),WordPress.Security.PluginMenuSlug(props @jasonkenison, #2592),WordPress.WP.AlternativeFunctions(props @pamprn09, @bhubbard and @rodrigoprimo, #2496, #2588, #2687),WordPress.WP.DiscouragedConstants(props @RafaelFunchal, @paulopmt1 and @rodrigoprimo, #2493, #2589, #2680),WordPress.WP.GlobalVariablesOverride(props @paulopmt1 and @rodrigoprimo, #2586, #2679).
This documentation can be exposed via thePHP_CodeSniffer--generator=...command-line argument.
Changed
- The minimum required
PHP_CodeSnifferversion to 3.13.5 (was 3.13.4). #2761 - The minimum required
PHPCSUtilsversion to 1.2.2 (was 1.1.0). #2761 - The default value for
minimum_wp_version, as used by a number of sniffs detecting usage of deprecated WP features, has been updated to6.7. #2757 WordPress.NamingConventions.PrefixAllGlobalshas been updated to recognize pluggable functions introduced in WP up to WP 7.0.0. #2747WordPress.WP.ClassNameCasehas been updated to recognize classes introduced in WP up to WP 7.0.0. #2747WordPress.WP.DeprecatedFunctionsnow detects functions deprecated in WordPress up to WP 7.0.0. #2747- The
ConstantsHelper::is_use_of_global_constant()method will no longer flag a constant alias created via an importusestatement as it were the use of a global constant. #2579 - The
ConstantsHelper::is_in_function_call()method will now act fully case-agnostic for the function names being checked. #2706
Previously, the$valid_functionsparameter would need to be passed with the function names as keys in lowercase. WordPress.PHP.NoSilencedErrors: error silencing is no longer accepted for theparse_url()function. #2701- Improved the wording of the error message for
WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound. #2688 - Improved the wording of the error message for
WordPress.PHP.RestrictedPHPFunctions. #2702 - Various housekeeping, including documentation and test improvements. Includes a contribution by @dd32.
Deprecated
WordPress.Arrays.ArrayDeclarationSpacing: theallow_single_item_single_line_associative_arraysproperty has been deprecated in favor of the newallow_single_item_single_line_explicit_key_arraysproperty. #2696
This is a name change only. The functionality of these properties is the same.
Fixed
WordPress.DB.PreparedSQLandWordPress.DB.PreparedSQLPlaceholders: false positive for static method calls to a non-global class namedwpdb. #2753WordPress.Security.EscapeOutput: false positive forget_search_query()when the$escapedparameter was passed as fully qualified or non-lowercasetrue. #2618WordPress.Security.EscapeOutput: false negative for_deprecated_file()calls when thebasename( __FILE__ )pattern used non-standard casing for eitherbasename()and/or__FILE__. #2729WordPress.WP.AlternativeFunctions: false negative when class functions/constants/properties use the same name as select global WP constants/functions. #2617WordPress.WP.AlternativeFunctions: false positive for fully qualified references to the global PHP stream constants \STDIN, \STDOUT, and \STDERR. #2617WordPress.WP.CronInterval: false positive when the callback function reference used a different case than the function declaration, even though they are in the same file. #2730