User meta is easily accessible on VIP Go, no reason to have the user_meta grouping in the RestrictedFunctions sniff:
|
'user_meta' => [ |
|
'type' => 'error', |
|
'message' => '%s() usage is highly discouraged on WordPress.com VIP due to it being a multisite, please see https://lobby.vip.wordpress.com/wordpress-com-documentation/code-review-what-we-look-for/#wp_users-and-user_meta.', |
|
'functions' => [ |
|
'get_user_meta', |
|
'update_user_meta', |
|
'delete_user_meta', |
|
'add_user_meta', |
|
], |
|
], |
We silence it anyways on the WordPress-VIP-Go ruleset:
|
<rule ref="WordPressVIPMinimum.Functions.RestrictedFunctions.user_meta_add_user_meta"> |
|
<severity>0</severity> |
|
</rule> |
|
<rule ref="WordPressVIPMinimum.Functions.RestrictedFunctions.user_meta_delete_user_meta"> |
|
<severity>0</severity> |
|
</rule> |
|
<rule ref="WordPressVIPMinimum.Functions.RestrictedFunctions.user_meta_get_user_meta"> |
|
<severity>0</severity> |
|
</rule> |
|
<rule ref="WordPressVIPMinimum.Functions.RestrictedFunctions.user_meta_update_user_meta"> |
The same could be said for the RestrictedVariables sniff:
|
'user_meta' => [ |
|
'type' => 'error', |
|
'message' => 'Usage of users/usermeta tables is highly discouraged in VIP context, For storing user additional user metadata, you should look at User Attributes.', |
|
'object_vars' => [ |
|
'$wpdb->users', |
|
'$wpdb->usermeta', |
|
], |
Silenced on the same ruleset:
|
<rule ref="WordPressVIPMinimum.Variables.RestrictedVariables.user_meta__wpdb__usermeta"> |
|
<severity>0</severity> |
|
</rule> |
User meta is easily accessible on VIP Go, no reason to have the user_meta grouping in the RestrictedFunctions sniff:
VIP-Coding-Standards/WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php
Lines 132 to 141 in 6d3f526
We silence it anyways on the WordPress-VIP-Go ruleset:
VIP-Coding-Standards/WordPress-VIP-Go/ruleset.xml
Lines 281 to 290 in 6d3f526
The same could be said for the RestrictedVariables sniff:
VIP-Coding-Standards/WordPressVIPMinimum/Sniffs/Variables/RestrictedVariablesSniff.php
Lines 41 to 47 in 6d3f526
Silenced on the same ruleset:
VIP-Coding-Standards/WordPress-VIP-Go/ruleset.xml
Lines 293 to 295 in 6d3f526