Yoast / wordpress-seo

Yoast SEO for WordPress
https://yoast.com/wordpress/plugins/seo/
Other
1.76k stars 891 forks source link

Prepare for WPVIP: wrap `get_term_by` and `get_term_link` functions #7698

Closed moorscode closed 6 years ago

moorscode commented 7 years ago

To comply to VIP standards we need to use the wpvip_com_ prefixed functions instead of the default WordPress ones.

Functions:

Thus we need to create a wrapper which will allow to call the prefixed versions when available, otherwise use the default.


FILE: ...-content/plugins/wordpress-seo/admin/taxonomy/class-taxonomy.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
 218 | ERROR | get_term_by() is prohibited, please use
     |       | wpcom_vip_get_term_by() instead.
     |       | (WordPress.VIP.RestrictedFunctions.get_term_by_get_term_by)
 306 | ERROR | get_term_by() is prohibited, please use
     |       | wpcom_vip_get_term_by() instead.
     |       | (WordPress.VIP.RestrictedFunctions.get_term_by_get_term_by)
----------------------------------------------------------------------

FILE: .../wp-content/plugins/wordpress-seo/frontend/class-breadcrumbs.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 695 | ERROR | get_term_link() is prohibited, please use
     |       | wpcom_vip_get_term_link() instead.
     |       | (WordPress.VIP.RestrictedFunctions.get_term_link_get_term_link)
----------------------------------------------------------------------

FILE: ...ast/wp-content/plugins/wordpress-seo/frontend/class-frontend.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
  931 | ERROR | get_term_link() is prohibited, please use
      |       | wpcom_vip_get_term_link() instead.
      |       | (WordPress.VIP.RestrictedFunctions.get_term_link_get_term_link)
 1598 | ERROR | get_term_link() is prohibited, please use
      |       | wpcom_vip_get_term_link() instead.
      |       | (WordPress.VIP.RestrictedFunctions.get_term_link_get_term_link)
----------------------------------------------------------------------

FILE: .../plugins/wordpress-seo/inc/options/class-wpseo-taxonomy-meta.php
----------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------
 220 | ERROR | get_term_by() is prohibited, please use
     |       | wpcom_vip_get_term_by() instead.
     |       | (WordPress.VIP.RestrictedFunctions.get_term_by_get_term_by)
 433 | ERROR | get_term_by() is prohibited, please use
     |       | wpcom_vip_get_term_by() instead.
     |       | (WordPress.VIP.RestrictedFunctions.get_term_by_get_term_by)
 436 | ERROR | get_term_by() is prohibited, please use
     |       | wpcom_vip_get_term_by() instead.
     |       | (WordPress.VIP.RestrictedFunctions.get_term_by_get_term_by)
----------------------------------------------------------------------

FILE: ...s/wordpress-seo/inc/sitemaps/class-taxonomy-sitemap-provider.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 216 | ERROR | get_term_link() is prohibited, please use
     |       | wpcom_vip_get_term_link() instead.
     |       | (WordPress.VIP.RestrictedFunctions.get_term_link_get_term_link)
----------------------------------------------------------------------
tomjn commented 6 years ago

@moorscode You can close this out, caching was added in WP 4.8 so we deprecated these functions:

We also updated the coding standards so you'll need to re-run that

moorscode commented 6 years ago

Thanks for the comment Tom!