TinyMCE Advanced
[resolved] WordPress' TinyMCE JavaScript Fails JavaScript Minification (5 posts)

  1. shamasis
    Posted 5 years ago #

    The following JavaScript files are required to be excluded from minification when using WP Minify plugin.

    1. http://blog.fusioncharts.com/wp-includes/js/tinymce/tiny_mce.js?ver=20081129
    2. http://blog.fusioncharts.com/wp-includes/js/tinymce/langs/wp-langs-en.js?ver=20081129

    I am unsure whether to report this to WordPress as it is part of core wp-includes files. Or whether to report it to you as because the core files are not supposed to be part of front-end UI unless your plugin is used.

    Please suggest.

  2. Andrew Ozz
    WordPress Dev
    Plugin Author

    Posted 5 years ago #

    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.

  3. shamasis
    Posted 5 years ago #

    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.

  4. Andrew Ozz
    WordPress Dev
    Plugin Author

    Posted 5 years ago #

    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.

  5. shamasis
    Posted 5 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • TinyMCE Advanced
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic