Defeating the error “An unexpected error occurred during HTTP API requests” WordPress

Sometimes you encounter the following error “An unexpected error occurred during the HTTP request API” when requesting a page (such as upgrading the plugin, search plugins, etc.) via the admin panel roll dress.

Maybe the problem occurs during the 2 -3 minutes and then after that your WordPress admin panel back to normal. If you regularly get this error on your dashboard page, here we sulosi and how to overcome them.

WordPress set a timeout limit for each question / request. If it crosses a particular request, in which case you get an error message. If you have this problem, this can be done by increasing the “time limit” to the value / higher value.

To increase the ‘timeout limit applications’, enter the directory “wp-includes ‘your WordPress installation and edit the file’ http.php ‘or’ class-http.php.

Here is a screenshot of the snippet of code you need to make changes.

timeout

Perubahannnya details as follows:

for a change

  1. ‘timeout’ => apply_filters( ‘http_request_timeout’, 5),

after the change

  1. ‘timeout’ => apply_filters( ‘http_request_timeout’, 30),

Modifications to the time limit to 5 seconds to increase to 30 seconds, now you do not return an error in your wordpress dashboard pages. You can set the timeout value by the number of your choice.

As we let you know in advance that this error because the demand exceeds the page limit. This can occur because of the plug-ins are used or using too many plugins are less than optimal.

Be the first to like.

Did you like this? Share it:

Leave a Reply