Mobile_Detect needs class wrapper
-
I have another plugin which uses Mobile_Detect.php. When running your plugin with any others that use Mobile_Detect.php we get:
Fatal error: require_once(): Cannot redeclare class mobile_detect …
Please wrap your Mobile_Detect.php include like this (or similar):
if(!class_exists('Mobile_Detect')){ require_once( plugin_dir_path(__FILE__) . '/lib/Mobile_Detect.php' ); }
This fixes the problem. I had another plugin developer do this with theirs and it fixed the problem. I always ask plugin authors to make such updates to their plugins, because I can’t continue to use plugins that I have to apply a patch like this to on every install, if that makes sense.
Otherwise, good plugin! Thanks!
- The topic ‘Mobile_Detect needs class wrapper’ is closed to new replies.