Skip to content

Deprecate suggesting VIP-equivalent cached functions: wpcom_vip_get_page_by_path(), wpcom_vip_term_exists() and wpcom_vip_get_page_by_title() #801

@rebeccahum

Description

@rebeccahum

What code should not be reported as a violation?

Since the introduction of WP 6.0+, some functions (namely wpcom_vip_get_page_by_path(), wpcom_vip_term_exists() and wpcom_vip_get_page_by_title()) we previously suggested using the VIP-equivalent are now cached:
https://docs.wpvip.com/technical-references/caching/uncached-functions/#h-previously-uncached-wordpress-core-functions.

We should deprecate suggesting the below since it's no longer accurate:

'get_page_by_path' => [
'type' => 'warning',
'message' => '%s() is highly discouraged due to not being cached; please use wpcom_vip_get_page_by_path() instead.',
'functions' => [
'get_page_by_path',
],

'get_page_by_title' => [
'type' => 'error',
'message' => '%s() is prohibited, please use wpcom_vip_get_page_by_title() instead.',
'functions' => [
'get_page_by_title',
],

'term_exists' => [
'type' => 'error',
'message' => '%s() is highly discouraged due to not being cached; please use wpcom_vip_term_exists() instead.',
'functions' => [
'term_exists',
],
],

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions