Title: Mobile_Detect needs class wrapper
Last modified: August 21, 2016

---

# Mobile_Detect needs class wrapper

 *  Resolved [Joe Rhoney](https://wordpress.org/support/users/joerhoney/)
 * (@joerhoney)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/mobile_detect-needs-class-wrapper/)
 * Hi Konstantinos,
 * 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’ve tested it. 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. Hope I can continue to use it. Thanks!
 * [https://wordpress.org/plugins/smooth-scroll-up/](https://wordpress.org/plugins/smooth-scroll-up/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Konstantinos Kouratoras](https://wordpress.org/support/users/kouratoras/)
 * (@kouratoras)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/mobile_detect-needs-class-wrapper/#post-5047078)
 * Hi joerhoney. Thank you for your feedback. You are right, i should have checked
   if Mobile Detect is already loaded.
 * I’ve just released an update, in which i include this check. Update to 0.7.2 
   and enjoy!
 * A reating would be really appreciated!
 *  Thread Starter [Joe Rhoney](https://wordpress.org/support/users/joerhoney/)
 * (@joerhoney)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/mobile_detect-needs-class-wrapper/#post-5047196)
 * Indeed you handled it. Thanks so much!
 *  Plugin Author [Konstantinos Kouratoras](https://wordpress.org/support/users/kouratoras/)
 * (@kouratoras)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/mobile_detect-needs-class-wrapper/#post-5047207)
 * Glad to help you! A review would be really appreciated! Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Mobile_Detect needs class wrapper’ is closed to new replies.

 * ![](https://ps.w.org/smooth-scroll-up/assets/icon-256x256.png?rev=974000)
 * [Smooth Scroll Up](https://wordpress.org/plugins/smooth-scroll-up/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/smooth-scroll-up/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/smooth-scroll-up/)
 * [Active Topics](https://wordpress.org/support/plugin/smooth-scroll-up/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/smooth-scroll-up/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/smooth-scroll-up/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Konstantinos Kouratoras](https://wordpress.org/support/users/kouratoras/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/mobile_detect-needs-class-wrapper/#post-5047207)
 * Status: resolved