You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code in the vip-go-mu-plugins repo has deprecated the use of wpcom_vip_get_page_by_path which throws a deprecated error via the WP core _deprecated_function callback. Automattic/vip-go-mu-plugins@213d797
The WordPressVIPMinimum.Functions.RestrictedFunctions sniff provides a warning which states you should use wpcom_vip_get_page_by_path in place of get_page_by_path
'message' => '%s() is highly discouraged due to not being cached; please use wpcom_vip_get_page_by_path() instead.',
'functions' => [
'get_page_by_path',
],
],
];
I see there was an issue [#801] started and closed for this which suggests a trac ticket will be switching the function to WP_Query but the sniff was left in place although the function was deprecated.
145 | WARNING | get_page_by_path() is highly discouraged due to not being cached; please
| | use wpcom_vip_get_page_by_path() instead.
| | (WordPressVIPMinimum.Functions.RestrictedFunctions.get_page_by_path_get_pa
ge_by_path)
Environment
Use php -v and composer show to get versions.
Question
Answer
PHP version
8.1.27
PHP_CodeSniffer version
3.9.0
VIPCS version
3.0.0
WordPressCS version
3.0.1
Tested Against main branch?
[ x ] I have verified the issue still exists in the main branch of VIPCS.
[ x ] I have verified the issue still exists in the develop branch of VIPCS.
The text was updated successfully, but these errors were encountered:
Bug Description
The code in the
vip-go-mu-plugins
repo has deprecated the use ofwpcom_vip_get_page_by_path
which throws a deprecated error via the WP core_deprecated_function
callback.Automattic/vip-go-mu-plugins@213d797
The
WordPressVIPMinimum.Functions.RestrictedFunctions
sniff provides a warning which states you should usewpcom_vip_get_page_by_path
in place ofget_page_by_path
VIP-Coding-Standards/WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php
Lines 272 to 279 in 8687674
I see there was an issue [#801] started and closed for this which suggests a trac ticket will be switching the function to WP_Query but the sniff was left in place although the function was deprecated.
Within the vip-go-mu-plugins repo the sniff is ignored and the deprecated function is still being called.
https://github.com/Automattic/vip-go-mu-plugins/blob/495b22d3965a6173fb6c83c703ea15e1cd0f81fc/search/es-wp-query/class-es-wp-query-wrapper.php#L550-L553
This can be confusing:
It would simplify/streamline things to remove the sniff.
Minimal Code Snippet
Error Code
145 | WARNING | get_page_by_path() is highly discouraged due to not being cached; please
| | use wpcom_vip_get_page_by_path() instead.
| | (WordPressVIPMinimum.Functions.RestrictedFunctions.get_page_by_path_get_pa
ge_by_path)
Environment
Use
php -v
andcomposer show
to get versions.Tested Against
main
branch?main
branch of VIPCS.develop
branch of VIPCS.The text was updated successfully, but these errors were encountered: