October 10, 2014
If you’ve ever encountered this error while using NextScripts SNAP, you know that’s it’s not very simple to resolve:
WP_Error Object ( [errors] => Array ( [http_request_failed] => Array ( [0] => couldn’t connect to host ) Another possible error: Name lookup timed out Another possible error: connect() timed out! Another possible error: Couldn’t resolve host ‘graph.facebook.com’ Another possible error: Operation timed out after … Another possible error: Connection reset by peer ** Another possible error: Failed to connect to 69.171.247.20: Permission denied
The FAQ for NextScripts states that adding a timeout request to functions.php will correct this issue. I’ve had to increase the variable to see results effectively, but it certainly beats contacting your host for assistance:
add_filter('http_request_timeout', function(){return: 5;});