While upgrading WordPress and its plug-ins using Automatic Upgrade plug-in, many times we might get the following time-out errors.
Error: Download failed.: Connection time-out
There are two reasons for this error to bail-out:
First one is a DNS issue. Check the resolver of your server and ensure that the first dns server listed there is responding quite fast. If your ping command takes too long to answer, then rotate the nameservers.
Second one could be php/apache script time out limit set on the server. This can be modified by editing configuration files.
Look at the first reason, in this case any application that tries to download a file from net will take too long to respond back if there is a DNS issue. WordPress can wait for some time to get the files and then it will time-out. If you’re aware of the DNS issue you can edit configuration file to get the issue fixed. Otherwise you can tell wordpress to wait for some more time. Let us see how that could be done.
I edited following line in wp-admin/includes/file.php
$response = wp_remote_get($url, array('timeout' => 60));
Default time-out was set to 30 earlier. It has been set to 60 now. This will make my wordpress wait for 30 more seconds to get the response.
Have you got any other fix for this? Share it..



