• Hi Jordy,

    Great plugin – but I was wondering if you might make an update that checks for the Mobile_Detect class before firing off a new instance? I’m using Mobble with a site and it uses the Mobile_Detect class. The combination of it plus WP Retina 2x s problematic if Mobile_Detect tries to activate.

    I think just checking for if ( class_exists( 'Mobile_Detect') ) before kicking off a new instance would work. Something like this ( lines 50 & 51 in wp-retina-2x.php ):

    if ( wr2x_getoption( "ignore_mobile", "wr2x_advanced", false ) && !class_exists( 'Mobile_Detect' ) )
        require('inc/Mobile_Detect.php');

    then again ( lines 72-75 in wp-retina-2x.php ):

    if ( wr2x_getoption( "ignore_mobile", "wr2x_advanced", false ) && !class_exists( 'Mobile_Detect' ) )
    {
    $mobileDetect = new Mobile_Detect();
    $is_retina = !$mobileDetect->isMobile();
    }

    and lastly ( lines 574 to 578 ):

    else if ( wr2x_getoption( "ignore_mobile", "wr2x_advanced", false )  && !class_exists( 'Mobile_Detect' ) )
    {
    $mobileDetect = new Mobile_Detect();
    if ( $mobileDetect->isMobile() )
        return;
    }

    http://wordpress.org/plugins/wp-retina-2x/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    I agree for the first fix but the plugin requires the next ones. Are you sure the first change is not enough?

    Thread Starter ramseyp

    (@ramseyp)

    Jordy,

    I’ll test that. I just did a quick search through the code for the class, the first time around. I’ll try to test just the first instance tomorrow & will post what I find.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Mobile Detect conflict’ is closed to new replies.