WordPress.org

Ready to get started?Download WordPress

Forums

A way to limit plugin resource calls (4 posts)

  1. jshare
    Member
    Posted 3 years ago #

    As I look for ways to optimize my WordPress installs, I've noticed that many plugins include their js/swf/css calls in every post/page regardless of whether the plugin is called on that post/page or not.

    I complained about it and you can see that others are feeling the same frustration:

    http://wordpress.org/support/topic/plugin-audio-player-only-load-javascript-swf-when-needed?replies=3#post-1923058

    It would be great to have an elegant way of limiting this kind of behavior, like this:

    1) In the Plugins page, every active plugin should be enabled cross-site by default, but there should a settings panel where you could make it disabled cross-site by default, and pick and choose if it should only be enabled on all posts/pages/archive/search (I could this being done with checkboxes).

    2) In Page/Post Editor, you can override the global setting to enable/disable any plugin for that page/post only.

    Does this exist as a plugin already? If not, any takers?

    Jacob

  2. modus
    Member
    Posted 3 years ago #

    I strongly second this request.

    At the moment every author of a plug-in needs to do this himselves. I do not know enough about the architecture of the backend, so if this would not be possible to implement via a plug-in (as I guess), it would be good to have a template or generator for plugin-authors, showing how to write / generating the necessary functions for the plugin.

    That way we could get rid of plugin authors unnecessarily using duplicates of js-libraries, too. Too many do not know about the libs shipped with WP and the conflicts adding duplicates can result in, if not enqueued properly.

  3. valpocreative
    Member
    Posted 3 years ago #

    I strongly third this request. For now all we can do is add conditional tags, there are several explanations on how to do this if you google "load javascript only on certain pages" ...

  4. This one is on the shoulders of the plugin devs, sadly. A well written plugin should handle that, and as right now there's no plugin oversight (that is anyone can make a plugin, and they're only removed from the repo for GPL vio or obvious hack/security issues), there's no monitoring. Best you can do is tell the plugin dev directly.

Topic Closed

This topic has been closed to new replies.

About this Topic