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 don't follow your question, but TinyMCE is loaded differently depending on whether compression is enabled, see the very bottom of wp-admin/includes/post.php (gzipped copy including plugins is loaded when compression is enabled, normal JS script is included otherwise - which loads plugins via JS and is slower).
    – t31os
    Feb 16, 2011 at 12:48
  • @t31os: I know TinyMCE can be compressed or not, but both versions are already minified, so that is not what I need. I updated my question to make this clear.
    – Jan Fabry
    Feb 16, 2011 at 14:55
  • Not all scripts are minified though, if there's a specifc script that doesn't have a non-minified version it's just a case of finding where the script originates(and seeing if a pretty version is available), no? Protoype for example is a straight copy of the non-minified version available from the prototype website.
    – t31os
    Feb 16, 2011 at 15:11

3 Answers 3


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 (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).

  • I know, I can find the original versions of the files, but the problem is how to load them in WordPress so that I can debug my script in the context of the non-minified libraries.
    – Jan Fabry
    Feb 16, 2011 at 16:38
  • @Jan - Deregister the original and register the non-minified versions? Ya know, like people do with jQuery to load from the google CDN.
    – t31os
    Feb 16, 2011 at 16:43
  • The TinyMCE files are not registered like other files, they are included directly. And I know I can collect all non-minified scripts and register them, but I was hoping someone else already did that and released it as a plugin.
    – Jan Fabry
    Feb 16, 2011 at 17:38
  • @Jan - I'd be impressed if someone had, i personally don't think i've ever seen or heard of such a plugin. Honestly though, i'm struggling to find scripts in WordPress that are only in minified form, so far i've found two whilst looking (both mentioned above - tinymce and swfobject).
    – t31os
    Feb 16, 2011 at 18:02

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/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.