What causes an Unexpected HTTP Error within install plugins?

Within “install plugins” I’m receiving an error stating “An Unexpected HTTP Error occurred during the API request.” When I do a plugin search it throws me back to my site’s 404 page. Any idea what would prevent my site from syncing properly with WordPress’s servers?

enter image description here

Read More

I added Hameedullah’s code to functions.php and recevied this returned
object(WP_Error)#21 (2) { ["errors"]=> array(1) { ["http_request_failed"]=> array(1) { [0]=> string(75) "Could not resolve host: api.wordpress.org; No data record of requested type" } } ["error_data"]=> array(0) { } }

Is this a curl transport issue?

Related posts

Leave a Reply

1 comment

  1. You can use the following code to dump the HTTP Api response, will help you figure out the cause of error.

    function dump_http_api_response($response, $type="", $transport=null ) {
        if ( $type == "response" )
            var_dump ( $response );
    }
    add_action('http_api_debug', 'dump_http_api_response', 1, 3);
    

    Example Output:

    object(WP_Error)#15 (2) { ["errors"]=> array(1) { ["http_request_failed"]=> array(1) { [0]=> string(41) "Couldn't resolve host 'api.wordpress.org'" } } ["error_data"]=> array(0) { } }