• Resolved cjrnne

    (@cjrnne)


    Hi,

    We use the Divi theme from Elegant Themes on a site with your plugin. We noticed recently that when the Business Directory plugin is enabled, we see some strange UI behavior in some Divi panels, namely the import/export panel. The spacing/padding is off, and on some panels, is so disruptive that functions don’t even work.

    From what I can tell the jQueryUI version you’re using conflicts a bit. This is the URL I see being called: https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/redmond/jquery-ui.css?ver=4.8.1

    I found where you call this file in your plugin, it’s in /includes/utils.php on lines 710 – 714:

        wp_enqueue_style(
            'wpbdp-jquery-ui-css',
            'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $ui_version . '/themes/redmond/jquery-ui.css'
        );

    If I comment it out everything on the Divi side functions normally again, and your plugin seems to still work properly.

    Is there any danger to commenting out that line in the plugin?

    Thanks in advance for your help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Business Directory Plugin

    (@businessdirectoryplugin)

    Hi @cjrnne,

    Sorry that you ran into issues here!

    Let me check with my developer and confirm one way or the other. We should probably look to remove that altogether if we detect it in the install otherwise…

    Plugin Author Business Directory Plugin

    (@businessdirectoryplugin)

    Hi @cjrnne,

    OK–I heard back from him right away! Here’s what he said:

    We need the stylesheet for our datepickers to work properly. I assume Divi is loading their own version of the stylesheet and that one is good enough for us. However, that’s just a special case, we can’t (in general) comment out those lines of code because is not safe to assume someone else is going to load the stylesheet. But for that user’s specific case, it would be OK (noting that each release, they’ll have to RE-comment it out because it isn’t something that can be overridden)

    We do not have hardcoded version numbers of jQuery or jQuery UI. We are loading the stylesheet for jQuery UI in /includes/utils.php on lines 710 – 714. This is the full code, which tells a different story:

    if ( is_object( $wp_scripts ) && isset( $wp_scripts->registered[ 'jquery-ui-core' ] ) ) {
        $ui_version = $wp_scripts->registered['jquery-ui-core']->ver;
    } else {
        $ui_version = '1.8.21';
    }
    
    wp_enqueue_style(
        'wpbdp-jquery-ui-css',
        'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $ui_version . '/themes/redmond/jquery-ui.css'
    );

    As you can see, we use the version from the jQuery UI library registered in WordPress core. If we don’t find that one, because there are versions of WordPress that don’t include that library, we fall back to 1.8.21.

    Since the version being loaded is 1.11.4, the only explanation is that our code did find a version of jQuery UI already registered by WordPress and is using that number to load the necessary stylesheet. Based on that, it sounds like Divi is overridding WP’s version, and not registering that fact…

    The customer is right in that the stylesheet could be causing a conflict, but maybe Divi are the ones using a version of jQuery UI that is not the one available with WordPress.

    Does that make more sense?

    Thread Starter cjrnne

    (@cjrnne)

    Thanks very much for looking into this and for the thorough reply!

    His explanation makes sense. I’ll try to find out if Divi (or potentially another plugin) is loading a different version of jQuery UI and not declaring it.

    For now I think i’m just going to comment out lines 710 – 714 in /includes/utils.php and hope that it doesn’t cause any other issues.

    Thank you again!

    Plugin Author Business Directory Plugin

    (@businessdirectoryplugin)

    OK.

    If you do that, please be aware that any time you update our plugin, you’ll lose those changes and have to re-add them back.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Conflict with Divi theme?’ is closed to new replies.