SimplePie Error – Curl Timeout on WordPress

Solution:

I was able to increase the Curl Timeout by using the following code:

//Set HTTP Request Timeout
add_filter('http_request_args', 'my_http_request_args', 100, 1);
function my_http_request_args( $r ) {
    $r['timeout'] = 30;
    return $r;
}

//Setting WP HTTP API Timeout
add_action('http_api_curl', 'my_http_api_curl', 100, 1);
function my_http_api_curl( $handle ) {
    curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, 30);
    curl_setopt( $handle, CURLOPT_TIMEOUT, 30 );
}

// Setting custom timeout for the HTTP request
add_filter('http_request_timeout', 'my_custom_http_request_timeout', 101 );
function my_custom_http_request_timeout( $timeLimit ) {
    return 30;
}