• Resolved Joe Rhoney

    (@joerhoney)


    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://www.ads-software.com/plugins/smooth-scroll-up/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Mobile_Detect needs class wrapper’ is closed to new replies.