cURL vs WP_Http for safety?

The WP_Http class is essentially a wrapper for cURL in the same way that wpdb is essentially a wrapper for mysqli. As such, implemented properly, using cURL directly is exactly as safe as using WP_Http (since WP_Http uses cURL to make the requests). That said, implementing cURL functions optimally isn’t the easiest thing in the … Read more

Difference between wp_remote_post and wp_safe_remote_post

[*][**] So is there ever any other situation in which I would want to use wp_remote_post or should I always stick with wp_safe_remote_post? The two functions are exactly the same, except wp_safe_remote_post() sets the reject_unsafe_urls argument to true. That argument causes the URL to be passed through wp_http_validate_url() in WP_Http::request(). From that function, we see … Read more

Error timed out with succesfull wp_remote_post

After quite some time letting the error message bugging my screen, I figured out a way to solve this. Yes, it’s a timeout issue, and the codex didn’t help me much. So I tried another approach, by setting a filter; add_filter( ‘http_request_timeout’, ‘wp9838c_timeout_extend’ ); function wp9838c_timeout_extend( $time ) { // Default timeout is 5 return … Read more

Mutual Authentiction on HTTPS with WordPress HTTP API?

Re the WP HTTP API look for the sslverify and sslcertificates args in this docs page: https://developer.wordpress.org/reference/classes/wp_http/request/. sslverify defaults to true and sslcertificates accepts an absolute path to a certificate file. If you’re going to be doing a lot of lifting with this API (sounds like it for a real estate site), I would suggest … Read more