Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Anand Kumar

    (@anand_kumar)

    No, They are different.

    Thread Starter Steven Gliebe

    (@stevengliebe)

    Hi Anand,

    Thank you for confirming that.

    Is there any chance you could change the enqueue handle from jquery-smooth-scroll to jss-script? Other themes and plugins enqueue the jQuery plugin by that handle (as expected) so using that same handle creates a conflict. I believe jss-script would be more appropriate for jss-script.js.

    What do you think?

    Plugin Author Anand Kumar

    (@anand_kumar)

    As far as I know the handle is pretty unique and matches exactly to the plugin name. Since there is no other plugin with same name or text domain. I don’t think it will create any conflict.

    Do you know any plugin or theme that conflicts with it? Also why anybody will even install this plugin if the feature is already built in their theme?

    Thread Starter Steven Gliebe

    (@stevengliebe)

    Thank you for the response. My themes enqueue the jQuery Smooth Scroll script: https://github.com/kswedberg/jquery-smooth-scroll. Naturally I use the handle jquery-smooth-scroll and to do otherwise would be unconventional so my hands are tied.

    The problem is that since your plugin also uses that handle (for enqueuing) (https://plugins.trac.www.ads-software.com/browser/jquery-smooth-scroll/tags/1.4.1/jquery-smooth-scroll.php#L83), my theme is not able to enqueue the script that it needs to. Any theme that uses that script will not be able to enqueue it while your plugin is active. I expect that the problem would be similar for plugins that are loaded after yours.

    The handle should match the particular script being enqueued, which is not necessarily the plugin name. Since your script is jss-script.js, the handle of jss-script makes more sense from my perspective and would prevent issues with the very popular jQuery Smooth Scroll script.

    https://developer.www.ads-software.com/reference/functions/wp_enqueue_script/#parameters

    $handle
    (string) (Required) Name of the script. Should be unique.

    It shouldn’t be assumed that a theme or other plugin will enqueue the jQuery Smooth Scroll script in order to provide the same functionality as your plugin. Both should be able to work independently and they can if you change your handle to the name of your script rather than the name of your plugin, which is where the problem lies.

    I’ve only had one users report this as being an issue but they have a point and I thought I’d share it in case you would see it as a quick improvement for compatibility. Whatever you decide, thank you for hearing me.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Does this plugin use jQuery Smooth Scroll?’ is closed to new replies.