Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Prevent `` requests timeouts: "Warning: An unexpected error occurred. Something may be wrong with or this server's configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to"
// increase `timeout` for `` requests
add_filter( 'http_request_args', function( $request, $url ) {
if ( strpos( $url, '://' ) !== false ) {
$request[ 'timeout' ] = 15;
return $request;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment