Support » Plugin: Amazon Associates Link Builder » jQuery UI (JS and CSS) in the Dashboard breaks other plugins

  • Resolved David Aguilera

    (@davilera)


    Hi guys!

    I’m the developer of another plugin (https://wordpress.org/plugins/nelio-content/) and one of our users contacted us because the dialogs in our plugin look “weird.” Apparently, that’s because this plugin is adding its own jQuery UI CSS and JavaScript files (even though WordPress already has some built-in styles and scripts for that). Can you please address this? At the very least, you should NOT include the scripts in all admin pages — only in those that are yours.

    Thank you very much.

    Regards,
    David

Viewing 8 replies - 1 through 8 (of 8 total)
  • chinnynfdjshvbu32z87z3487

    (@chinnynfdjshvbu32z87z3487)

    Maybe the reason why I am not able to access my other buttons in my dashboard and can’t access the visual builder anymore. I need to deactivate the plugin first to write an article as intented.

    I can report a conflict between the Amazon Associates Link Builder and another plugin (https://wordpress.org/plugins/advanced-ads) too, which semm to be caused through this JQuery injection as well. The plugin crashes the layout of Advanced Ads and make some plugin options unuseable.

    I would really appreciate if you could try to fix this bug. I love the Amazon Associates Link Builder and would be happy if I would not need to switch to an alternative plugin solution for my Amazon ads. Thanks in advance!

    Plugin Author Amazon Associates Link Builder

    (@amazonlinkbuilder)

    Dear @davilera,

    Thanks a lot for pointing this out and sincere apologies for this. We did the changes for jquery-ui.js and will push them in next plugin release.

    Regarding jQuery-ui.css, there doesn’t seem to be any style sheets provided by WordPress and we are supposed to render them by uploading to our plugin or via CDN. Is that’s acceptable or is there any other alternative for that as we can’t restrict our style sheet to only admin pages. The reason for the same is that our plugin is being used in editors that are not on admin pages.

    Hi,

    Thanks for looking into this. I appreciate it 🙂

    Regarding jQuery-ui.csss, there doesn’t seem to be any style sheets provided by WordPress and we are supposed to render them by uploading to our plugin or via CDN. Is that’s acceptable or is there any other alternative for that as we can’t restrict our style sheet to only admin pages. The reason for the same is that our plugin is being used in editors that are not on admin pages.

    You’re right, WordPress doesn’t include a jQuery UI stylesheet. However, it does have a stylesheet for rendering some jQuery UI elements, such as a Dialog. In any case, I’d recommend you only include that stylesheet and script in the admin pages in which your editor might be used, and nowhere else.

    Plugin Author Amazon Associates Link Builder

    (@amazonlinkbuilder)

    Dear @davilera,

    Thanks for the quick reply. In our case, we need jQuery-ui.css for rendering jQuery-tabs for which CSS is not provided by WordPress. Regarding restricting our CSS to only admin pages, our customers also use our plugin in editors that are not on admin pages. And this binds us to use the CSS on all pages. Any thoughts to solve this?

    we need jQuery-ui.css for rendering jQuery-tabs for which CSS is not provided by WordPress

    I see. In this case, I’d edit the jQuery-ui.css you’re using so that only the rules that apply to jQuery tabs are included. This way, there wouldn’t be any rules overwriting default WordPress styles (for instance, WordPress can style jQuery dialogs, but a jQuery-ui.css file like yours overwrites WordPress’ rules and “breaks” how they look).

    Regarding restricting our CSS to only admin pages, our customers also use our plugin in editors that are not on admin pages

    You’re right, sorry. You can, of course, add those scripts and styles in all the pages you need, but restrict to those. So, for example, if my plugin adds a new page in the Dashboard and your editor is not included and can’t be used in my plugin’s page, why do you need to include your scripts and styles there? You need to restrict your files to those pages (admin or public) that might need them.

    The issue seems to be resolved with the last update. Thanks for your work!

    Great, thanks! I’ll mark the topic as resolved.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘jQuery UI (JS and CSS) in the Dashboard breaks other plugins’ is closed to new replies.