Where Did That JS/CSS Come From?
wp_enqueue_* family of functions. If a plugin or theme outputs some JS/CSS directly, it won’t be included in the log.
- Requires PHP 5
- Tested on WordPress 3.0+
Warning: This plugin modifies WP core files! Use at your own risk.
The more technically inclined readers might now be wondering – why do you need a plugin when you can just open up the HTML and see all the JS and CSS files clear as day? Or, if that’s too inconvenient, why not use Firebug? The answer is that while source inspection and Firebug will both reveal what files were loaded, neither will tell you why.
In most cases the reason why the file is there will be obvious from the context. For example, you may recognize it as part of your theme, or a vital component of an active plugin. But sometimes there’ll be the odd script or style sheet that you’re absolutely sure shouldn’t be loaded on that page, and that’s where this plugin will come in handy. In a way, it is a debugging tool.
In my case, it was jquery.js that, for some inexplicable reason, was being loaded on every page of my blog. I couldn’t figure out what could possibly be using it, and I didn’t like the idea of checking every one of my 30+ active plugins by hand, so I wrote this plugin.
Related posts :
What a novel idea for a plugin. I’ve been taking a look at getting all the code for my blog better arranged for quicker performance and I’ve realized more and more that it’s just a huge undertaking. But it looks like this plugin will make it a whole lot easier. I’ll take a look into this one.