Enable CORS in wordpress

Headers manipulation should be done before template output starts. In WordPress it is typically done in template_redirect hook, which is right before template load but after core has fully loaded.

Running index.php from command line & load balancer health checks

Since wordpress’s execution logic relies on parameters filled by the php-apache connector (mod_php) running a php command line is not guarantied to produce the same results or any at all, all depending on your local settings. In any case, you should not check if your server is functioning from the server itself as there other … Read more

using wp_remote_get to retrieve own url on local host

Ad Timeout You should be able to get around the timeout using a filter add_filter( ‘http_request_timeout’, ‘wpse35826_timeout_extd’ ); function wpse35826_timeout_extd( $time ) { // Default timeout is 5 return 10; } Choose the right protocol/scheme About your protocol/scheme problem: If it’s your local install, you can use the conditional. function wpse35826_remote_get( $args ) { $protocol … Read more

Is curl required?

For the record, I have uninstalled curl and wordpress was working on seamlessly. So I confirm that curl is not a dependency of wordpress. However, some plugins may require curl.

How do I troubleshoot responses with WP HTTP API?

We tracked it down to content-encoding’ => string ‘deflate’ (length=7) being at fault. WP_HTTP is adding in a deflate header for no reason and un gzip compressing the results. It only happens when the body of the response is under a certain string length. Very annoying when all you want isa 1 or a 0. … Read more