Open shawn-digitalpoint opened 4 months ago
Unfortunately the WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
is not very smart, so false positives are common. We've had to add one ourselves too:
Suggestions for improving this sniff would need to be opened at https://github.com/Automattic/VIP-Coding-Standards.
Of course questions can be raised whether this check should be updated/disabled/documented better in Plugin Check. However, given that it's only a warning, there's probably no need for action and we can instead use this energy to improve the sniff upstream.
Ran into it again with a different plugin:
$policies = [
[
'decision' => 'allow',
'exclude' => [],
'include' => $emails,
'name' => $this->phrase('allow'),
'precedence' => 1,
'require' => [],
'uid' => ''
]
];
Ya, it's not a huge deal... in the case of the second example, it's coming from a library that isn't WordPress specific, so adding the ignore tag isn't an option. But like you said, it's just a warning, not something catastrophic, so it is what it is unless something upstream changes.
This is new in 1.0... An array with a key of "exclude" will trigger:
WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
The code that triggers it does not have anything to do with excluding posts (or anything else coming from the database). The code is this: