We're using wordpress on a publishing website and I have a situation where I need to use server-side mobile detection in order to deliver some ad scripts. Javascript is not a solution since the scripts from the ad server are pretty complex.
The problem is that the condition simply doesn't work. Desktop is delivered to mobile instead.
I tried 2 solutions so far:
wp_is_mobile() Mobile_Detect.php
Both of them are working locally - true on mobile, false on Desktop (using Mamp), but none works in the production server.
I tried enabling the Mobile Cache from the Litespeed Cache plugin, tried other recommended rewrite conditions from their documentation. Nothing Works.
We also tried a simple implementation of mobile_detect outside WordPress, same issue: desktop is delivered to mobile.
Our server is a VPS with WHM, so we have root access.
Any recommendation is welcomed!
Thanks!