Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for WPVIP: create wrapper for user meta data #7697

Open
moorscode opened this issue Aug 16, 2017 · 0 comments
Open

Prepare for WPVIP: create wrapper for user meta data #7697

moorscode opened this issue Aug 16, 2017 · 0 comments

Comments

@moorscode
Copy link
Contributor

moorscode commented Aug 16, 2017

On VIP we cannot call the default user_meta functions directly, but we must use the user_attribute variation, see https://vip.wordpress.com/documentation/user_meta-vs-user_attributes/

Thus we need to create a wrapper which will allow to call the user_attribute version when available, otherwise use the user_meta as default.

The scope of the usages is the following (at the time of creating this issue):

FILE: ...gins/wordpress-seo/admin/ajax/class-yoast-dismissable-notice.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 67 | ERROR | update_user_meta() usage is highly discouraged, check VIP
    |       | documentation on "Working with wp_users"
    |       | (WordPress.VIP.RestrictedFunctions.user_meta_update_user_meta)
----------------------------------------------------------------------


FILE: ...ent/plugins/wordpress-seo/admin/ajax/class-yoast-onpage-ajax.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 36 | ERROR | update_user_meta() usage is highly discouraged, check VIP
    |       | documentation on "Working with wp_users"
    |       | (WordPress.VIP.RestrictedFunctions.user_meta_update_user_meta)
----------------------------------------------------------------------


FILE: ...ns/wordpress-seo/admin/ajax/class-yoast-plugin-conflict-ajax.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
 51 | ERROR | get_user_meta() usage is highly discouraged, check VIP
    |       | documentation on "Working with wp_users"
    |       | (WordPress.VIP.RestrictedFunctions.user_meta_get_user_meta)
 81 | ERROR | update_user_meta() usage is highly discouraged, check VIP
    |       | documentation on "Working with wp_users"
    |       | (WordPress.VIP.RestrictedFunctions.user_meta_update_user_meta)
----------------------------------------------------------------------


FILE: /Users/jip/Yoast/wp-content/plugins/wordpress-seo/admin/ajax.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 83 | ERROR | update_user_meta() usage is highly discouraged, check VIP
    |       | documentation on "Working with wp_users"
    |       | (WordPress.VIP.RestrictedFunctions.user_meta_update_user_meta)
----------------------------------------------------------------------


FILE: ...oast/wp-content/plugins/wordpress-seo/admin/class-admin-init.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 125 | ERROR | get_user_meta() usage is highly discouraged, check VIP
     |       | documentation on "Working with wp_users"
     |       | (WordPress.VIP.RestrictedFunctions.user_meta_get_user_meta)
----------------------------------------------------------------------


FILE: ...content/plugins/wordpress-seo/admin/class-admin-user-profile.php
----------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 7 LINES
----------------------------------------------------------------------
 59 | ERROR | update_user_meta() usage is highly discouraged, check VIP
    |       | documentation on "Working with wp_users"
    |       | (WordPress.VIP.RestrictedFunctions.user_meta_update_user_meta)
 69 | ERROR | update_user_meta() usage is highly discouraged, check VIP
    |       | documentation on "Working with wp_users"
    |       | (WordPress.VIP.RestrictedFunctions.user_meta_update_user_meta)
 70 | ERROR | update_user_meta() usage is highly discouraged, check VIP
    |       | documentation on "Working with wp_users"
    |       | (WordPress.VIP.RestrictedFunctions.user_meta_update_user_meta)
 71 | ERROR | update_user_meta() usage is highly discouraged, check VIP
    |       | documentation on "Working with wp_users"
    |       | (WordPress.VIP.RestrictedFunctions.user_meta_update_user_meta)
 72 | ERROR | update_user_meta() usage is highly discouraged, check VIP
    |       | documentation on "Working with wp_users"
    |       | (WordPress.VIP.RestrictedFunctions.user_meta_update_user_meta)
 73 | ERROR | update_user_meta() usage is highly discouraged, check VIP
    |       | documentation on "Working with wp_users"
    |       | (WordPress.VIP.RestrictedFunctions.user_meta_update_user_meta)
 74 | ERROR | update_user_meta() usage is highly discouraged, check VIP
    |       | documentation on "Working with wp_users"
    |       | (WordPress.VIP.RestrictedFunctions.user_meta_update_user_meta)
----------------------------------------------------------------------


FILE: ...jip/Yoast/wp-content/plugins/wordpress-seo/admin/class-admin.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 652 | ERROR | update_user_meta() usage is highly discouraged, check VIP
     |       | documentation on "Working with wp_users"
     |       | (WordPress.VIP.RestrictedFunctions.user_meta_update_user_meta)
----------------------------------------------------------------------


FILE: ...tent/plugins/wordpress-seo/admin/class-product-upsell-notice.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
 176 | ERROR | get_user_meta() usage is highly discouraged, check VIP
     |       | documentation on "Working with wp_users"
     |       | (WordPress.VIP.RestrictedFunctions.user_meta_get_user_meta)
 183 | ERROR | update_user_meta() usage is highly discouraged, check VIP
     |       | documentation on "Working with wp_users"
     |       | (WordPress.VIP.RestrictedFunctions.user_meta_update_user_meta)
----------------------------------------------------------------------


FILE: ...st/wp-content/plugins/wordpress-seo/admin/class-yoast-alerts.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 88 | ERROR | delete_user_meta() usage is highly discouraged, check VIP
    |       | documentation on "Working with wp_users"
    |       | (WordPress.VIP.RestrictedFunctions.user_meta_delete_user_meta)
----------------------------------------------------------------------


FILE: .../plugins/wordpress-seo/admin/class-yoast-notification-center.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
  97 | ERROR | get_user_meta() usage is highly discouraged, check VIP
     |       | documentation on "Working with wp_users"
     |       | (WordPress.VIP.RestrictedFunctions.user_meta_get_user_meta)
 479 | ERROR | update_user_meta() usage is highly discouraged, check VIP
     |       | documentation on "Working with wp_users"
     |       | (WordPress.VIP.RestrictedFunctions.user_meta_update_user_meta)
----------------------------------------------------------------------


FILE: .../admin/config-ui/components/class-component-mailchimp-signup.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
 56 | ERROR | update_user_meta() usage is highly discouraged, check VIP
    |       | documentation on "Working with wp_users"
    |       | (WordPress.VIP.RestrictedFunctions.user_meta_update_user_meta)
 75 | ERROR | get_user_meta() usage is highly discouraged, check VIP
    |       | documentation on "Working with wp_users"
    |       | (WordPress.VIP.RestrictedFunctions.user_meta_get_user_meta)
----------------------------------------------------------------------


FILE: ...ress-seo/admin/config-ui/fields/class-field-mailchimp-signup.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 55 | ERROR | get_user_meta() usage is highly discouraged, check VIP
    |       | documentation on "Working with wp_users"
    |       | (WordPress.VIP.RestrictedFunctions.user_meta_get_user_meta)
----------------------------------------------------------------------


FILE: ...ins/wordpress-seo/admin/google_search_console/class-gsc-ajax.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 43 | ERROR | update_user_meta() usage is highly discouraged, check VIP
    |       | documentation on "Working with wp_users"
    |       | (WordPress.VIP.RestrictedFunctions.user_meta_update_user_meta)
----------------------------------------------------------------------


FILE: ...Yoast/wp-content/plugins/wordpress-seo/admin/pages/dashboard.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 14 | ERROR | update_user_meta() usage is highly discouraged, check VIP
    |       | documentation on "Working with wp_users"
    |       | (WordPress.VIP.RestrictedFunctions.user_meta_update_user_meta)
----------------------------------------------------------------------


FILE: ...ins/wordpress-seo/inc/sitemaps/class-author-sitemap-provider.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 253 | ERROR | update_user_meta() usage is highly discouraged, check VIP
     |       | documentation on "Working with wp_users"
     |       | (WordPress.VIP.RestrictedFunctions.user_meta_update_user_meta)
----------------------------------------------------------------------


FILE: ...tent/plugins/wordpress-seo/inc/sitemaps/class-sitemaps-cache.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 198 | ERROR | update_user_meta() usage is highly discouraged, check VIP
     |       | documentation on "Working with wp_users"
     |       | (WordPress.VIP.RestrictedFunctions.user_meta_update_user_meta)
----------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants