Bug Description
When using code like get_users( [ 'exclude' => 123 ] ), you'll get a warning like
Using `exclude`, which is subsequently used by `post__not_in`, should be done with caution, see https://docs.wpvip.com/how-tos/improve-performance-by-removing-usage-of-post__not_in/ for more information.
This is wrong because this is not a WP_Query call and does not use post__not_in.
Querying that many users is still not super ideal, but I think this warrants its own sniff that is less confusing.
Minimal Code Snippet
get_users( [ 'exclude' => 123 ] )
Error Code
Environment
Use php -v and composer show to get versions.
| Question |
Answer |
| PHP version |
8.1.12 |
| PHP_CodeSniffer version |
3.7.1 |
| VIPCS version |
2.3.3 |
Additional Context (optional)
Tested Against master branch?
Bug Description
When using code like
get_users( [ 'exclude' => 123 ] ), you'll get a warning likeThis is wrong because this is not a
WP_Querycall and does not usepost__not_in.Querying that many users is still not super ideal, but I think this warrants its own sniff that is less confusing.
Minimal Code Snippet
Error Code
Environment
Use
php -vandcomposer showto get versions.Additional Context (optional)
Tested Against
masterbranch?masterbranch of VIPCS.developbranch of VIPCS.