Support » Alpha/Beta/RC » 3.5 RC3 New media uploader doesn't work with Google mod_pagespeed

  • Resolved Tunghsiao Liu


    I enable Google mod_pagespped ( stable version on my server with default configuration. but the new media uploader doesn’t work with it. The following error showing up in Console:

    Uncaught SyntaxError: Unexpected token ILLEGAL load-scripts.php,qc=0,aload,5B,5D=admin-bar,,hoverIntent,,common,,jquery-ui-widget,,jquery-ui-position,,wp-pointer,,wp-ajax-response,,jquery-color,,wp-lists,,quicktags,,jqu,aload,5B,5D=ery-query,,admin-comments,,jquery-ui-core,,jquery-ui-mouse,,jquery-ui-sortable,,postbox,,dashboard,,customize-base,,customize-loader,,thi,aload,5B,5D=ckbox,,plugin-install,,underscore,,shortcode,,media-upload,,backbone,,media-models,,plupload,,plupload-html5,,plupload-flash,,plupload-sil,aload,5B,5D=verlight,,plupload-html4,,wp-plupload,,media-views,,media-editor,,word-count,,jquery-ui-resizable,,jquery-ui-draggable,,jquery-ui-button,aload,5B,5D=,,jquery-ui-dialog,,wpdialogs,,wplink,,wpdialogs-popup,
Viewing 11 replies - 16 through 26 (of 26 total)
  • The work-around “ModPagespeedDisallow */wp-admin/*” worked for me.

    Moderator Ipstenu (Mika Epstein)


    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    FWIW, it’s Google at fault here, and not WP :/ They’re compressing compressed files.

    @mika – This may be a mod_pagespeed issue but it is strange that it only happens on /wp-admin. In any case we would love to get to the bottom of this.

    When you say “compressed” you are talking about minifying JavaScript, is that right? It should not be a functional problem if that occurs twice. The second time might not do much shrinking, but it shouldn’t break anything.

    Or are you really talking about gzip compression. In that case, mod_pagespeed isn’t doing anything at all, except for enabling mod_deflate.

    BTW we have a fix for Issue 582 described above in trunk (not in a binary release yet). That is related to a 403 problem.

    Another possibility is that there is some JavaScript in WordPress /wp-admin/ stack that is scanning URLs in the DOM looking for certain patterns. mod_pagespeed changes URLs, and that can break JavaScript that is looking for specific URLs.

    The work-around “ModPagespeedDisallow */wp-admin/*” worked for me, too.

    Hi, I’m here with an update from the mod_pagespeed perspective.

    1. In mod_pagespeed 1.4 (beta) we put “disallow */wp-admin/*” in our
    base configuration so no one should see this anymore or have to do
    it in their own configs. Note this has not made the mod_pagespeed
    stable channel yet.

    2. We launched a deeper investigation about the incompatibility here: and will
    be fixing the root problem. It appears that there are two issues:
    a) UTF-8 BOM in jquery.query.js which some wordpress plugin
    will concatenate and leave in the middle of the file
    b) The way mod_pagespeed minifies that file doesn’t handle the embedded
    UTF-8 BOM. We should be able to make mod_pagespeed resilient to this.

    Stay tuned.

    @Tunghsiao Liu: The problem may be fixed in the latest beta of mod_pagespeed, which your site appears to be running already. Can you try adding:

    ModPagespeed on
    ModPagespeedAllow */wp-admin/*

    to either your pagespeed.conf or .htaccess in your wordpress root directory and see if the wp-admin pages:
    1) do have pagespeed applied to them (look for .pagespeed. resources in the source)
    2) work correctly?



    Hi @j_marantz and @j_karlin:

    Thanks for your effort but unfortunately it still doen’t work for me 🙁

    1) .pagespeed. seems applied to scripts correctly.
    2) I doesn’t work: I still got this error: Uncaught SyntaxError: Unexpected token ILLEGAL,
    3) I got another error in console: GET, 403 (Forbidden), but after some page refreshes, this error is gone.

    The version of mod_pagespeed installed on my server is beta.

    Here’s a dumped script and Console screenshot, I hope they may help.


    Thanks for trying it out, Tunghsiao.

    Unfortunately we weren’t clear: the bug has been fixed in our trunk code, but has not been released in binary form yet. We’ll update this thread again.

    Sorry about the confusion.

    @j_marantz: Cool, can’t wait to try it out!

    The fix for rewrite_javascript was released with mod_pagespeed 1.5.!topic/mod-pagespeed-announce/ukxbNyLTu00

    Although we somehow omitted this bug-fix from the release notes, it is indeed fixed for that release:

    As posted earlier, you’ll have to add:
    ModPagespeedAllow */wp-admin/*

    to see this bug-fix in action, as we left the by-default blacklist of wp-admin compiled into the code. We’d love to see if this gets past the problem for you and then we can remove the default blacklist.

    @j_marantz great, it works!

Viewing 11 replies - 16 through 26 (of 26 total)
  • The topic ‘3.5 RC3 New media uploader doesn't work with Google mod_pagespeed’ is closed to new replies.