Skip to content

FunctionRestricted ignores warning in some cases. #1049

Closed
@emgk

Description

In WordPress-VIP there are many WordPress functions which are restricted to use due to not caching the data, slow performance and other various reasons.

WordPress_Sniffs_VIP_RestrictedFunctionsSniff sniff works great when I call the function in the normal way. for Eg. wp_remote_get( 'http://example.com' ); it will throw the WARNING.

wp_remote_get() is highly discouraged, please use vip_safe_wp_remote_get() instead.

But it may be the case that these functions are calling using call_user_func(), call_user_func_array().

for Eg. call_user_func( 'wp_remote_get', 'http://example.com' );

In this case, PHPCS showing no warning when calling the restricted function call_user_func(), call_user_func_array().

Environment:
phpcs : v2.9 ,
wpcs: develop branch

Let me know any further info needed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions