Sometimes in WordPress you may face an error message “An Unexpected HTTP Error occurred during the API request” when requesting a page from Admin Dashboard. It may happen for few minutes and after the panel starts behaving in a normal way. If you are getting this error frequently from your dashboard, then follow this simple steps to rid of this kind of situation.
WordPress gives 5 seconds time limit to request a plugin by default. If within 5 seconds it does not get a replay, the process will come to an halt and display an error “An Unexpected HTTP error occurred during the API request.” To resolve this issue, you have to increase the time limit to a higher value. Just follow the steps:
STEP-1: Browse WP-INCLUDE folder from root
class-http.php (latest wp versions) OR
http.php (older wp-versions) file through notepad or available editor.
STEP-3: Find the below line :
[ HINTS: line number 96 from
class-http.php file & line number 223 from
'timeout' => apply_filters( 'http_request_timeout', 5)
STEP-4: Changed the line & make the timeout ’30’ seconds
'timeout' => apply_filters( 'http_request_timeout', 30)
STEP-5: Save & update the file.
This post has already been read 2633 times!