I have Google Bot in my stats. The past version 4.7 have the file:
config/config.exclude.bot.php
In the latest version 4.7 this feature is miss. So I have add the code:
Code (PHP): ### os and browser detection ###
//------------------------------------------------------------------
include ( "func/func_browser.php" ); // include browser detection
include ( "func/func_operating_system.php" ); // include operating detection
//------------------------------------------------------------------
$browser = strip_tags ( browser_detection ( $_SERVER [ "HTTP_USER_AGENT" ] ) ); // get browser
$browser_name = strtolower($browser);
// browser name for exlude bot
$operating_system = strip_tags ( operating_system_detection ( $_SERVER [ "HTTP_USER_AGENT" ] ) ); // get operating system
$browser = pattern_matching ( "browser" , $browser ); // check pattern browser
$operating_system = pattern_matching ( "operating_system" , $operating_system ); // check pattern operating system
$resolution = pattern_matching ( "resolution" , $js_resolution ); // check pattern resolution
//------------------------------------------------------------------
// check if the call comes from within
$write_logfile_entry = 0;
foreach ( $exception_domain as $value )
{
if ( strpos ( $js_url , $value ) > 0 ) { $write_logfile_entry = 1; }
if ( substr ( $value , 0 , 4 ) == "xn--" ) { $write_logfile_entry = 1; }
}
//------------------------------------------------------------------
//Add the old feature of PHP web Stat 4.7 track.php
//------------------------------------------------------------------
// exclude bot (browser)
include ( "config/config.exclude.bot.php" ); //array with list of bot name
foreach ( $exception_bot as $value )
{
if ( strpos ( $browser_name , strtolower($value) ) !== false ) {
$write_logfile_entry = 0;
file_put_contents("browser.txt", "**$browser_name**");
}
}
//------------------------------------------------------------------
in the track.php
Is it correct? (it works)