Error causing server to overload and kill WordPress
-
Hi,
We are using this plugin All in One SEO Pack but we encountered an issue with our tiny server where some of the request somehow reached a function called “isYandexUserAgent” which uses the variable $_SERVER[‘HTTP_USER_AGENT’], somehow the variable is not provided and is causing an error on the server, and with enough overload of the error, the server just turned off the WordPress server process, although the server ssh itself is still running, restarting the server or the WordPress process could fix the issue, but if continuous requests are made with the same pattern, the website could be down multiple times.
Thus for the code in /app/Common/Traits/Helpers/ThirdParty.php
I would like to suggest a revision frompublic function isYandexUserAgent() { return preg_match( '#.*Yandex.*#', $_SERVER['HTTP_USER_AGENT'] ); }
to
public function isYandexUserAgent() { if(!isset($_SERVER['HTTP_USER_AGENT'])) return false; return preg_match( '#.*Yandex.*#', $_SERVER['HTTP_USER_AGENT'] ); }
- The topic ‘Error causing server to overload and kill WordPress’ is closed to new replies.