WordPress.org

Ideas

Require plugins to offer script loading options

  1. samjco
    Member

    12345

    It would be nice if every plugin would allow users to disable loading of scripts automatically by way of a check box thus exposing the dependent scripts needed to work.

    Due to the increasing amount of scripts loaded from plugins, having a toggle will allow developers to decide how to load the plugin scripts manually. Globally or on specific pages.

    This will cut down on how many scripts get loaded on the home page of any WordPress site thus speeding up the site load and performance. Hence, Google site ranks would approve!

    Posted: 1 year ago #
  2. Ipstenu (Mika Epstein)
    Half-Elf; Volunteer Forum Mod & Plugin Referee

    The plugin devs should only be calling the scripts on pages that actually need the scripts, in order to keep down load. If they're not, please suggest that to them directly so they can improve their code :)

    Posted: 1 year ago #
  3. samjco
    Member

    12345

    Some dev do, some go all global. This can be tricky, because if a user uses a widget, which can be part of the plugin, it will be called global is some cases.

    Posted: 1 year ago #
  4. Ipstenu (Mika Epstein)
    Half-Elf; Volunteer Forum Mod & Plugin Referee

    Yes, but in that case the code must be called on every page load or it won't work :)

    Posted: 1 year ago #
  5. samjco
    Member

    12345

    Yes, so having this requested option will allow developers to:

    1. Know what js files are being used.

    2. The option of disabling them from being registered with WordPress and allow them to manually call them.

    I can only tell you how many conflicts I run into with plugins. And trying to contact the plugin developers to let me know what js are being used for what. I even paid for premium plugin just to be let down. Having this as a norm for plugin developers will allow us devs to really fixed conflicts that may occur. Especially when using AJAx for page loading.

    Posted: 1 year ago #
  6. Ipstenu (Mika Epstein)
    Half-Elf; Volunteer Forum Mod & Plugin Referee

    Which 'devs' are you talking about?

    1) Plugin authors know what THEY are including.

    2) You should always register your JS with WP so that if one plugin registers, you only have to load it once. That's the whole idea of enqueuing the code in the first place, to make sure it only gets called once.

    For most users, disabling auto-loading of scripts is something they should never consider. People who are debugging conflicts would want this, but that's something else. it's why, as a plugin dev, when someone says code isn't working, I ask "What plugins are you using?" It's so I can recreate the problem and find the conflicts and do my best to fix them.

    But the devs already have the ability to load on separate pages. We don't do it right all the time, but that's your real fix :) Enqueue properly.

    Posted: 1 year ago #
  7. johnburns87
    Member

    I believe this plugin will solve your question
    http://wordpress.org/plugins/wp-asset-manager/

    + activate/deactivate plugin scripts/styles per page

    + activate/deactivate theme scripts/styles per page

    + re-order scripts/styles per page

    I hope this helps :)

    Posted: 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    1 Vote
  • Status

    Sorry, not right now