[wp-hackers] Force plugin to add code only where really needed

Martin Widmann widmann.martin at gmail.com
Tue Feb 22 15:23:06 UTC 2011


It's written in many places what a plugin SHOULD look like and where and how it should enqueue scripts or css or output stuff. In the end it's in the plugin developer's responsibility to make sure that his/her plugin causes as little trouble as possible. I don't think that this enforcement could be implemented in core. How should WordPress know when a plugin is supposed to be used?

A way to make this situation better would be that YOU as the user tell the plugin author to fix it, or fix it on your own and share the patch with the plugin author. The other solution would be not to use that plugin. 

- Martin

On Feb 22, 2011, at 16:08 , mailapera wrote:

> Hi,
> is there a way to do it? Almost all plugins add a bunch of css,
> jquery, JS, php, ajax, meta tags all over the places in the code, even
> if you need a plugin only on one single post or page. This slows down
> performance and dirties the code quite a lot. Is there a way to force
> a plugin, use a simple "if" statement, to detect where it is
> absolutely needed and only output code on that page? I see that some
> plugin developers do it, could this be implemente in the core? Thanks
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list