Overview
Now that WordPress 4.6 has been released, they have included the Requests library as part of the changes to the HTTP API. This is a good thing in the fact that it brings greater flexibility and simplicity to external HTTP calls, however if a 3rd party plugin has bundled the library itself then upgrading your site to WordPress 4.6 may cause 500 errors for your site.
Based on the sites we've seen, the number of plugins with a conflict remains very, very low.
Instructions
- To avoid this issue, you can audit your plugins to determine if any have used the Requests library. Where possible, update these plugins to the latest version to ensure they're compatible. Most plugin vendors will should be updating their plugin shortly, if they haven't done so already.
- If you have already updated and your site is displaying a 500 error, you can use Plesk to display the Error Logs, then search for:
PHP Fatal error: Cannot declare class Requests, because the name is already in use
- This should also give you the full path to the file where this is occurring. For example:
[Tue Aug 16 23:23:52.290949 2016] [fcgid:warn] [pid 23093:tid 140327513982720] [client 192.168.0.100:35925] mod_fcgid: stderr: PHP Fatal error: Cannot declare class Requests, because the name is already in use in /var/www/vhosts/<SITENAMEHERE>/httpdocs/wp-content/plugins/<PLUGINNAMEHERE>/libs/Requests/Requests.php on line 21
- You will either need to disable the plugin (by moving it out of the plugins directory) or manually commenting out where the library is called (not the file above).
- If you had an up-to-date plugin and the issue still occurred, we recommend contacting your plugin vendor in regards to a patch or fix.