Brainstorming over blind includes from plugins

In a previous article about mistakes people do when writing plugin I said one of them was to input css/javascript even on pages where they are not needed.

This started a quick discussion on the comments about the possibility of intercepting plugins wp_head call to remove unnecessary inclusion of stuff in the header.

The first solution should be to contact the plugin creator and ask him to make his plugin. This is open source after all and contributions should drive fix and innovation.

But when you don’t get any reply?

I’ve looked at a few possibilities and the easiest seems to use the remove_filter function to manually remove each hooks one by one. The down side is that you need to know the name of the hook to remove which will have you opening the plugin and looking for the it in the code.

function removePluginHooks(){
	remove_filter('wp_head', 'cforms_style');
}
add_action('init','removePluginHooks');

Not ideal for people who don’t know anything about code.

Then you would have to manually call the hook on the needed page/post, which again is not easy.

I thought about making a plugin with all the major plugins hook in it and make an admin page to choose where you want to include each hook back. But it is a lot of work and there might be a way to do this more efficiently.

So what do you guys think of this? Anyone has got a better idea?

Related Items and Services:
Blinds for your home at cheap prices
do you require removable braces

Leave a Reply

Theme Forest ad
Wordpress Themes Collection ad
Woothemes

Poll

How do you start your WordPress plugins development projects?

View Results

Loading ... Loading ...