Is there a plugin or another easy way to get debug versions of the external Javascript libraries? (“External” because they were not written by the WordPress team, not because they come from Google or another CDN).
If I define the SCRIPT_DEBUG
constant to true
, I get debug (non-minified) versions of most Javascript files in WordPress. However, some external libraries are still using the minified versions (check wp_default_scripts()
for the scripts that don’t have the $suffix
part in their URL). I am creating a TinyMCE plugin and thus it would be handy to have the full TinyMCE source code when stepping up and down the call stack while debugging. (I know TinyMCE is loaded in an even more special way, but I’m also thinking of the jQuery library, which uses the standard wp_register_script()
method.)
I know that TinyMCE can be loaded as a compressed or a non-compressed Javascript, but both of these versions have been minified first, so that is not what I want. I want to load a non-minified version of TinyMCE, and possibly also the non-minified versions of the plugins.
I created a version for TinyMCE, it was not too hard. The trick was to hijack
includes_url
, this was the only way to change the path to the TinyMCE script.I created a plugin that has non-minified versions of TinyMCE 3.2.7 (WP 2.9 and 3.0) and 3.3.9.3 (WP 3.1). You can download it via Dropbox, let me know what you think!
Following on from the comments(because i’m posting too much into the comments, it’s starting to look a mess)…
Most scripts(if not all) in WP include the originating URL of the script at the very top of the file, you can track down non-minified versions pretty easy once you know the original source, swfobject.js for example can be found here(non-minified):
..am i not following you on something, isn’t this just a case of sourcing the original scripts in a non-minified form?
TinyMCE offer a developer version, maybe that will provide a non-minified version?
http://tinymce.moxiecode.com/download/download.php
I know i’m making general comments and not necessarily answering, but rather then further pollute the comments with my ramblings i’ll just add additional comments here.
EDIT:
You could use a method like this for doing it.
Is it worth updating WP admin to jQuery 1.5?
NOTE: The issues i saw were a result of a compatability issue with jQuery 1.5, i’m quite confident it will be fine with scripts known to work(and quicker/easier to write, than the de-register / re-register method).
To answer your question, no, I don’t think there’s a plugin for that, but whoever needs it most badly will end up writing it sooner or later. 😉
As a sort of related note, see the excellent Debug Bar plugin developed recently by the core team: http://wordpress.org/extend/plugins/debug-bar/