WordPress.org

Support

Support » Plugins and Hacks » TinyMCE Advanced » [Resolved] [Plugin: TinyMCE Advanced] WordPress' TinyMCE JavaScript Fails JavaScript Minification

[Resolved] [Plugin: TinyMCE Advanced] WordPress' TinyMCE JavaScript Fails JavaScript Minification

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Andrew Ozz

    @azaozz

    WordPress Dev

    I’m not sure exactly what you’re trying to accomplish but all JS in WordPress is already minified. Trying to minify it second time won’t work right.

    My bad for not being able to convey myself last time.

    I am using the WP-Minify plugin that attempts to increase oload time by concatenating and minifying all JS and CSS files.

    Ideally this should work fine. A minified JS (or any other language) can be minified any number of times unless any of the minified JS itself has a syntax error. Try it out at javascriptcompressor.com

    Furthermore, with that plugin, the already minified jQuery and other JS files work fine. It is only the TinyMCE codes that cause error.

    A possible reason (other than syntax error on minified code) could be that there are code-blocks within that JS that has tightly-coupled modules that use global variables.

    Plugin Author Andrew Ozz

    @azaozz

    WordPress Dev

    In principle a minified JS could be minified again and work fine, however different minifiers mangle the code differently and you may end up with a larger file. Also big and complex JS files like Prototype.js, jQuery, TinyMCE, etc. may trigger errors when minifying (that’s mostly caused by the minifier not handling regexp strings properly).

    In these cases a pre-minified and tested version should be used, that’s why WP includes the “official” minified files.

    Also all JS and CSS in WP is already minified and re-minifying it is just a waste of server resources as you might gain a very small size reduction but also you may end up with larger files.

    In my opinion best would be to turn off script minification and use only the concatenation part of that plugin.

    Thanks for your inputs. 🙂
    Hope this conversation helps everyone using WordPress.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] [Plugin: TinyMCE Advanced] WordPress' TinyMCE JavaScript Fails JavaScript Minification’ is closed to new replies.
Skip to toolbar