Created
January 22, 2021 10:54
-
-
Save carl-alberto/93cd944098f5acfc75ba134f7962d650 to your computer and use it in GitHub Desktop.
pagespeed detection script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function bot_detected() { | |
$u_agent = $_SERVER['HTTP_USER_AGENT']; | |
if(strlen(strstr($u_agent,"Lighthouse")) > 0 ){ | |
return false; | |
} elseif(strlen(strstr($u_agent,"GTmetrix")) > 0 ){ | |
return false; | |
} else { | |
// var_dump( $_SERVER['HTTP_USER_AGENT'] ); | |
return true; | |
} | |
} | |
if ( bot_detected() ) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment