[Defender Pro] Plugin Conflict Defender Pro and WP Property Importer

Hello all,

I discovered a conflict with the above mentioned plugins that seems to only affect Defender Pro. Please login and navigate to the Defender dashboard, you will see its not loading properly. When the Importer plugin is deactivated Defender works fine. Would you mind helping me find out what exactly is creating the conflict so I can get it fixed? Access Granted.

  • Ash
    • WordPress Hacker

    Hello Mike D

    It seems the WP Property Importer is using admin_body_class filter in a wrong way. We can try to overwrite, please try the following code:

    add_filter( 'admin_body_class', function( $classes ) {
    $classes .= ' sui-2-3-20 ';
    
    return $classes;
    }, 9999 );

    You can use this code in your child theme's functions.php if the theme is not changed. Otherwise mu-plugin is the best option. To create a mu-plugin, go to wp-content/mu-plugins folder. If there is no mu-plugins folder then, create one. Now, inside the mu-plugins folder create file with name anything.php (make sure file extension is .php). Now start with a <?php tag and then put the above code.

    Hope it helps! Please feel free to ask more questions if you have any.

    Have a nice day!

    Cheers,
    Ash

      • Ash
        • WordPress Hacker

        Well, there was no "error" actually, but I found that the required class from defender plugin is missing. And as you mentioned the conflict with another plugin, so it's obvious that the plugin using the body class filder in a wrong way.

        My code is overwriting again and adding the required class for defender :slight_smile:

        Hope it helps! Please feel free to ask more questions if you have any.

        Have a nice day!

        Cheers,
        Ash

  • Ash
    • WordPress Hacker

    Hi there

    The class name is changed. Replace my previous code with the following:

    add_filter( 'admin_body_class', function( $classes ) {
    $classes .= ' sui-2-3-22 ';
    
    return $classes;
    }, 9999 );

    Let us know if that works for you. Have a nice day!

    Cheers,
    Ash

  • Ash
    • WordPress Hacker

    Hello Mike D

    You're welcome :slight_smile:

    What I do is, activate defender on my test site. And then compare the class names for body tag of my test site with the class names for body tag of your site and find the missing class on your site. Then programmatically I add the class name.

    To find the class name I use browser inspector which comes with google chrome and firefox.

    Hope it helps! Please feel free to ask more questions if you have any.

    Have a nice day!

    Cheers,
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.