Forums

W3 Total Cache
[resolved] JavaScript auto minify wp_localize_script() (8 posts)

  1. Remco Tolsma
    Member
    Posted 6 months ago #

    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

    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/

  2. Marko Heijnen
    Member
    Posted 6 months ago #

    This don't have to be an issue. You only need to wait when the DOM is fully loaded.

  3. Remco Tolsma
    Member
    Posted 6 months ago #

    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.

  4. cyonite
    Member
    Posted 3 months ago #

    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.

  5. Remco Tolsma
    Member
    Posted 3 months ago #

    @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.

  6. Frederick Townes
    Member
    Posted 3 months ago #

    @Remco Tolsma - will investigate.

  7. Frederick Townes
    Member
    Posted 2 months ago #

    Duplicated, thanks. This will be addressed in the next release.

  8. Remco Tolsma
    Member
    Posted 2 months ago #

    @Frederick Super, thanks, marked the topic as resolved :-).

Reply

You must log in to post.

About this Plugin

About this Topic