VIP-Coding-Standards
VIP-Coding-Standards copied to clipboard
Add RestrictedCacheGroupSniff to restrict wp-memcached global cache groups
Fixes #260
Also:
Just noticed that the list in your comment in the originating issue also includes:
{$taxonomy}_relationships
{$meta_type}_meta
{$taxonomy}_relationships
Those can be handled too (with less precision, but still), but that would require my remarks above to be addressed in full and then some special handling to be added for double quoted strings/heredocs.
Oh cricky - still forgot to mention one more thing in my review: should a test for this new sniff be added to the ruleset-test.inc file ?
For:
{$taxonomy}_relationships
{$meta_type}_meta
What about having a public property that users can set to potentially add custom taxonomies and meta?
Or would you rather have something less precise that just looks for the _relationships and _meta at the end with a manual inspection error message?
So is this sniff only about WP Memcache ? or is the sniff really about the cache groups being used by Core, which are optimized via WP Memcache ?
This sniff is focusing on the global cache groups already used by core that wp-memcached persists — so it would seem the latter.
@rebeccahum Maybe there's some use of PHPCSUtils (https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-PassedParameters.html ?) to be had here now?
@GaryJones As #260 has now been closed, should this PR be closed too ?