Title: [Plugin: W3 Total Cache] JavaScript auto minify wp_localize_script()
Last modified: August 20, 2016

---

# [Plugin: W3 Total Cache] JavaScript auto minify wp_localize_script()

 *  Resolved [Remco Tolsma](https://wordpress.org/support/users/remcotolsma/)
 * (@remcotolsma)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-javascript-auto-minify-wp_localize_script/)
 * It looks like JavaScript minifying is not working with themes / plugins that 
   use the wp_localize_script() function.
 * [http://codex.wordpress.org/Function_Reference/wp_localize_script](http://codex.wordpress.org/Function_Reference/wp_localize_script)
 * Minify mode: Auto
 * The inline localized JavaScript data is echo’d after the minified JavaScript,
   it should be echo’d before the minified JavaScript.
 * It would be very nice if this could be fixed in the next release.
 * [http://wordpress.org/extend/plugins/w3-total-cache/](http://wordpress.org/extend/plugins/w3-total-cache/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Marko Heijnen](https://wordpress.org/support/users/markoheijnen/)
 * (@markoheijnen)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-javascript-auto-minify-wp_localize_script/#post-2420895)
 * This don’t have to be an issue. You only need to wait when the DOM is fully loaded.
 *  Thread Starter [Remco Tolsma](https://wordpress.org/support/users/remcotolsma/)
 * (@remcotolsma)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-javascript-auto-minify-wp_localize_script/#post-2420896)
 * Not all WordPress plugins do that and I think that should not be necessary. The
   wp_localize_script() function ensures that the localization data is loaded before
   the script. It would be nice if the W3 Total Cache did the same.
 *  [Andreas](https://wordpress.org/support/users/andreasnrb/)
 * (@andreasnrb)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-javascript-auto-minify-wp_localize_script/#post-2420988)
 * If you setup using Manual is this still an issue? Kind of hard to move scripttags
   around that is not identifiable in the HTML code i.e they are not surrounded 
   by a HTML comment or something.
 *  Thread Starter [Remco Tolsma](https://wordpress.org/support/users/remcotolsma/)
 * (@remcotolsma)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-javascript-auto-minify-wp_localize_script/#post-2420989)
 * [@andreasnrb](https://wordpress.org/support/users/andreasnrb/) This is probably
   still in issue with an manual minify setup. Unless we offcourse don’t minify 
   the scripts from plugin / thems that use the wp_localize_script() function.
 * I think the auto minify should work correct with the wp_localize_script() function.
   There must be an way to place the JavaScripts in the correct order.
    - [http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/functions.wp-scripts.php#L66](http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/functions.wp-scripts.php#L66)
    - [http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/class.wp-scripts.php](http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/class.wp-scripts.php)
    - [http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/class.wp-dependencies.php](http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/class.wp-dependencies.php)
 *  Plugin Contributor [Frederick Townes](https://wordpress.org/support/users/fredericktownes/)
 * (@fredericktownes)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-javascript-auto-minify-wp_localize_script/#post-2420996)
 * [@remco](https://wordpress.org/support/users/remco/) Tolsma – will investigate.
 *  Plugin Contributor [Frederick Townes](https://wordpress.org/support/users/fredericktownes/)
 * (@fredericktownes)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-javascript-auto-minify-wp_localize_script/#post-2421006)
 * Duplicated, thanks. This will be addressed in the next release.
 *  Thread Starter [Remco Tolsma](https://wordpress.org/support/users/remcotolsma/)
 * (@remcotolsma)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-javascript-auto-minify-wp_localize_script/#post-2421007)
 * [@frederick](https://wordpress.org/support/users/frederick/) Super, thanks, marked
   the topic as resolved :-).

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘[Plugin: W3 Total Cache] JavaScript auto minify wp_localize_script()’
is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

 * 7 replies
 * 4 participants
 * Last reply from: [Remco Tolsma](https://wordpress.org/support/users/remcotolsma/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-javascript-auto-minify-wp_localize_script/#post-2421007)
 * Status: resolved