This commit removes the custom token target + custom logic from this sniff in favour of deferring to the logic in the parent sniff - as discussed in #589.
To that end, the keys which were handled in the custom process_token() logic have now been added to the getGroups() array.
As the logic for whether or not an error message should be thrown is different for each group, an extra 'name' key has been added to each group to allow the callback() function to distinguish what group the detected key came from.
It also updates the error message being used to better cover both keys being looked for, as well as mention this only applies when the array is passed to get_posts() (in an attempt to remove some of the confusion reported in #672).
Note: this is a BC-break as the error codes for the two out of the three existing checks change!
WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn is now WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in.
WordPressVIPMinimum.Performance.WPQueryParams.SuppressFiltersTrue is now WordPressVIPMinimum.Performance.WPQueryParams.SuppressFilters_suppress_filters.
The WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude error code, as introduced in #589, remains the same.
This commit removes the custom token target + custom logic from this sniff in favour of deferring to the logic in the parent sniff - as discussed in #589.
To that end, the keys which were handled in the custom
process_token()
logic have now been added to thegetGroups()
array.As the logic for whether or not an error message should be thrown is different for each group, an extra
'name'
key has been added to each group to allow thecallback()
function to distinguish what group the detected key came from.It also updates the error message being used to better cover both keys being looked for, as well as mention this only applies when the array is passed to
get_posts()
(in an attempt to remove some of the confusion reported in #672).Note: this is a BC-break as the error codes for the two out of the three existing checks change!
WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn
is nowWordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in
.WordPressVIPMinimum.Performance.WPQueryParams.SuppressFiltersTrue
is nowWordPressVIPMinimum.Performance.WPQueryParams.SuppressFilters_suppress_filters
.WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
error code, as introduced in #589, remains the same.Fixes #594