WordPress Error During the API Request
The following error may occur when attempting to view plugins or themes in WordPress:
If this occurs, you can try editing the http.php file within the wp-includes folder of your WordPress installation. While editing the http.php file is a common fix for this issue, it is not a guaranteed fix as various issues can be the cause of this specific timeout error.
How to Edit the http.php FileTo edit the http.php file:
- Log into cPanel.
- In the Files section, select the File Manager icon.
- Navigate to your WordPress installation.
- Open the wp-includes folder.
- Locate the http.php file and right-click on it.
- In the pop-up menu that appears, select the Edit option.
- In the next pop-up that appears, click Edit to open the Text Editor.
- Scroll down to find the following line:
'timeout' => apply_filters( 'http_request_timeout', 5),
- Update the line to the following:
'timeout' => apply_filters( 'http_request_timeout', 30),
- Click Save Changes in the top-right corner.
Once these steps are complete, refresh the WordPress page to see if the error has been resolved.