-
Notifications
You must be signed in to change notification settings - Fork 40
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
Deprecate suggesting VIP-equivalent cached functions: wpcom_vip_get_page_by_path(), wpcom_vip_term_exists() and wpcom_vip_get_page_by_title() #801
Comments
|
In https://core.trac.wordpress.org/ticket/36905 it was switched to use However, as of https://core.trac.wordpress.org/ticket/57041 and WP 6.2, this change was reverted, and the function became deprecated in favour of WP_Query. This function deprecation is included in WPCS. So now, the question becomes - should we:
|
In WP 6.1.0, `get_page_by_title()` was changed to use `WP_Query` internally`. See core.trac.wordpress.org/ticket/36905. This means that reporting this function as not being cached is not true anymore. Note that since WP 6.2.0, the function was reverted from using `WP_Query` but was deprecated in favour of using `WP_Query` directly. WordPress Coding Standards highlights this deprecation already. See #801.
In WP 6.1.0, `get_page_by_title()` was changed to use `WP_Query` internally`. See core.trac.wordpress.org/ticket/36905. This means that reporting this function as not being cached is not true anymore. Note that since WP 6.2.0, the function was reverted from using `WP_Query` but was deprecated in favour of using `WP_Query` directly. WordPress Coding Standards highlights this deprecation already. See #801.
|
As the three functions have been addressed one way or another, this can be closed. |
In WP 6.1.0, `get_page_by_title()` was changed to use `WP_Query` internally`. See core.trac.wordpress.org/ticket/36905. This means that reporting this function as not being cached is not true anymore. Note that since WP 6.2.0, the function was reverted from using `WP_Query` but was deprecated in favour of using `WP_Query` directly. WordPress Coding Standards highlights this deprecation already. See #801.
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:
VIP-Coding-Standards/WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php
Lines 286 to 291 in fbcc951
VIP-Coding-Standards/WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php
Lines 83 to 88 in fbcc951
VIP-Coding-Standards/WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php
Lines 105 to 111 in fbcc951
The text was updated successfully, but these errors were encountered: