Skip to content
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

using curl should suggest using vip_safe_wp_remote_get instead of wp_remote_get #754

Open
katag9k opened this issue Apr 17, 2023 · 3 comments

Comments

@katag9k
Copy link

katag9k commented Apr 17, 2023

What problem would the enhancement address for VIP?

When using curl the suggested fix is to use wp_remote_get, however, wp_remote_get is discouraged and vip_safe_wp_remote_get is suggested instead.

Describe the solution you'd like

Suggest the use of vip_safe_wp_remote_get when using curl to avoid a secondary violation for using wp_remote_get

@GaryJones
Copy link
Contributor

@katag9k Can you please provide some code, the exact command you ran, and the output where it's suggesting that wp_remote_get() is used?

The master branch of VIPCS has these lines in the WordPressVIPMinimum ruleset, which override the default messages for WordPress.WP.AlternativeFunctions.curl_* codes to point to the VIP docs. There's nothing in the WordPress-VIP-Go ruleset that changes this further.

What I do see, in that WordPress.WP.AlternativeFunctions sniff (in WPCS), is a message that mentions wp_remote_get(). Did you perhaps run --standard=WordPress (or --standard=WordPress-Core or --standard=WordPress-Extra), rather than --standard=WordPress-VIP-Go, where the VIPCS-specific overriding messages wouldn't have kicked in?

@katag9k
Copy link
Author

katag9k commented Apr 18, 2023

@GaryJones Yes, I have multiple default standards specified:

default_standard: WordPress-VIP-Go,WordPress-Core,WordPress-Extra

I haven't been able to get any results by running WordPress-VIP-Go standard without additional standards specified.

@GaryJones
Copy link
Contributor

WordPress-Extra already includes WordPress-Core, so that can be simplified (requiring it twice can affect which overrides are treated as the final ones).

I haven't been able to get any results by running WordPress-VIP-Go standard without additional standards specified.

I'm happy to help debug with you on this outside of this thread.

If you use the --standard= argument, to override your default_standard, and you use just WordPress-VIP-Go, does the curl / wp_remote_get() message issue get resolved?

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

No branches or pull requests

2 participants