I'm trying to integrate the PHP version of the mobile detection script from http://mobiledetect.net/ into my Wordpress installation.
I've used the following code to call and detect mobile usage
<?php
include 'includes/Mobile_Detect.php';
$detect = new Mobile_Detect;
$isMobile = $detect->isMobile();
if($isMobile) {
//Do a thing;
};
?>
While the code does work, I've found that the loading time of the page has risen by 1-2 seconds on a consistent basis. I've run some tests and just the include statement itself is causing a major slowdown.
Is this normal when using this script or is there supposed to be a better way to implement it?