WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
*Important* parsing found with automatic minify (12 posts)

  1. scottdaris
    Member
    Posted 2 years ago #

    I thought I would let you know that I found a javascript parsing error when automatic minify was selected. In one of the files that was generated from my particular set of .js, I saw that the following code was broken because at some point it turned into a comment (/*) because of the syntax. Here's what I mean:

    return target;},ajaxSettings:{url:ajaxLocation,isLocal:rlocalProtocol.test(ajaxLocParts[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"}

    At the ending part "*/*" (and onwards past the characters /*) it turned into a comment all the way to the end of the code, resulting in breaking the first part too because it never completed without having a closing tag or statement.

    I've already seen peoples' comments about turning automatic minify off, which is a shame since that helps reduce load automatically, but maybe you could include a little bug fix in the future where any occurrence of */* or /* could be replaced by the html entity for the forward slash character (ampersand hash 47 semicolon).

    Thanks for such an amazing plugin otherwise!

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. scottdaris
    Member
    Posted 2 years ago #

    Headline typed wrong! Meant to write:
    *Important* parsing error found with automatic minify

  3. javierrebelde
    Member
    Posted 2 years ago #

    Hi,

    I think you forgot to tell where? in what file and line.

  4. scottdaris
    Member
    Posted 2 years ago #

    No, I didn't forget to tell where in the code it occurred because it will be different for each person. Mine is just a sample. It all depends on what javascript and CSS you have on your website. For me, it just happened to have shown up somewhere in the javascript of one of my forms plugins. So, when my particular .js was minified, it concatenated (ie, was joined with) the next piece of code and then was parsed as a "comment", like this: /* THIS IS A COMMENT */
    Then all the code after that point broke – and probably some before that point, too!

    Just open up your minified .js file(s) and search for */* or /*, or even just look at it in a good text program (not Notepad or TextEdit - those are too simple) that displays code syntax. I love Coda which shows every way possible of displaying color-coded code. Without it i would be lost :) Good luck.

  5. javierrebelde
    Member
    Posted 2 years ago #

    Hi,

    Is wired, If I turn on the minify works in chrome and firefox but not in IE. In IE some js dont work.

  6. Frederick Townes
    Member
    Plugin Author

    Posted 2 years ago #

    This is a known issue with the minifier library that W3TC (and others use), what were your settings?

  7. javierrebelde
    Member
    Posted 2 years ago #

    the problem starts when I trun on this settings:

    JS minify settings:
    Enable
    Preserved comment removal (not applied when combine only is active)
    Line break removal (not safe, not applied when combine only is active)

    CSS minify settings:
    Enable
    Preserved comment removal (not applied when combine only is active)
    Line break removal (not applied when combine only is active)

  8. javierrebelde
    Member
    Posted 2 years ago #

    Also I just try:

    JS minify settings:
    Enable

    CSS minify settings:
    Enable

    and I have problems with fonts, cufon fonts

  9. Frederick Townes
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks, taking a look.

  10. Frederick Townes
    Member
    Plugin Author

    Posted 2 years ago #

    I can't duplicate this error, I believe it's been fixed in the development version (not yet released).

  11. javierrebelde
    Member
    Posted 2 years ago #

    Hi,

    Ok will see, but did you test it with Internet explorer? because there is where the cufon fonts problem happens not in firefox.

    I am telling you so far I am using the plugin without a minify and help me a lot but I wish I can make it all work will rock.

  12. Frederick Townes
    Member
    Plugin Author

    Posted 2 years ago #

    Support for cufon is tricky, you will need to work with a developer to find the remedy for minifying and then let me know what you learn.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic