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

  • Resolved Tunghsiao Liu

    (@sparanoid)


    I enable Google mod_pagespped (https://developers.google.com/speed/pagespeed/mod) 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,aver=3.5-RC4-23115.pagespeed.jm.cCB9FUYs4G.js:32
Viewing 15 replies - 1 through 15 (of 26 total)
  • George Stephanis

    (@georgestephanis)

    Code Monkey

    Please add

    define('SCRIPT_DEBUG', true);

    to your wp-config.php file and try again. That should help in tracking down which of the combined scripts is causing the issue.

    Drew Jaynes

    (@drewapicture)

    Docs Czar

    Hi Tunghsiao,

    Are you still having issues with mod_pagespeed on a fresh copy of 3.5?

    Hi Drew,

    Sorry for my late reply. I upgraded to 3.5 release and added define('SCRIPT_DEBUG', true); to my wp-config.php, the media uploader works as expected. But when I commented out the debug code. I got the same error again.

    Same here. I am using mod_pagespeed and WordPress 3.5, but can’t use the media uploader without define('SCRIPT_DEBUG', true); in my wp-config.php.

    What host are you guys on, and did you install Google Pagespeed on your own, or did they do it?

    @ipstenu, this looks like a known issue that you are aware of.

    I’m on a dedicated server running CentOS 6.3 64-bit. I installed mod_pagespeed using the yum package manager, following the instructions provided by Google, with a largely unchanged configuration file.

    I was able to modify my configuration to exclude anything with wp-admin in it, and this fixed the problem without having to modify each of my blog’s wp-config.php files. I just had to add this line to my pagespeed.conf, then restart Apache: ModPagespeedDisallow */wp-admin/*

    It’d be great if this configuration change wasn’t necessary. Please let me know if there is anything I can do to help test/troubleshoot this issue.

    Well you sure made one of my coworkers feel a lot less crazy 🙂 (That list is actually curated by all the forum mods, I just posted it, so I didn’t know we added that. I wasn’t 100% sure this wasn’t just the company I work for having a problem!)

    Hello from the mod_pagespeed team.

    The workaround of ‘disallow */wp-admin/*’ is a fine one. We’ve seen this before. We’d love to understand better what the problem is with mod_pagespeed’s optimizations in the /wp-admin/ page and figure out how to resolve them.

    Would it be possible to tell us the full URL from the original comment? The one that begins with “load-scripts.php,qc=0,alo” and ends with “5-RC4-23115.pagespeed.jm.cCB9FUYs4G.js”?

    Hopefully this is something we can resolve in mod_pagespeed itself.

    Thanks!
    -Josh

    Thanks for all your replies.

    @j_marantz Yes, here’s the full URL in console:

    load-scripts.php,qc=1,aload,5B,5D=admin-bar,,hoverIntent,,common,,wp-ajax-response,,jquery-color,,wp-lists,,quicktags,,jquery-query,,admin-comments,,jquery-ui-core,,jquery-,aload,5B,5D=ui-widget,,jquery-ui-mouse,,jquery-ui-sortable,,postbox,,dashboard,,customize-base,,customize-loader,,thickbox,,plugin-install,,underscor,aload,5B,5D=e,,shortcode,,media-upload,,backbone,,media-models,,plupload,,plupload-html5,,plupload-flash,,plupload-silverlight,,plupload-html4,,wp-plu,aload,5B,5D=pload,,media-views,,media-editor,,word-count,,jquery-ui-resizable,,jquery-ui-draggable,,jquery-ui-button,,jquery-ui-position,,jquery-ui-,aload,5B,5D=dialog,,wpdialogs,,wplink,,wpdialogs-popup,aver=3.5.pagespeed.jm.s7BQkxZ53Z.js:32

    And I also got a workaround solution by disable rewrite_javascript in pagespeed.conf:

    ModPagespeedDisableFilters rewrite_javascript
    

    I know it’s one of the core functions but this works for me.

    Thanks Tunghsaio.

    Can you provide the entire URL including the domain and path?

    I did not think we had a bug in our JS minifier but it seems likely, based on your experience, that we do. With a testcase of JS text we can find it & fix it.

    Thanks!
    -Josh

    @j_marantz

    Here it is:

    http://postholic.com/wp-admin/load-scripts.php,qc=1,aload,5B,5D=admin-bar,,hoverIntent,,common,,wp-ajax-response,,jquery-color,,wp-lists,,quicktags,,jquery-query,,admin-comments,,jquery-ui-core,,jquery-,aload,5B,5D=ui-widget,,jquery-ui-mouse,,jquery-ui-sortable,,postbox,,dashboard,,customize-base,,customize-loader,,thickbox,,plugin-install,,underscor,aload,5B,5D=e,,shortcode,,media-upload,,backbone,,media-models,,plupload,,plupload-html5,,plupload-flash,,plupload-silverlight,,plupload-html4,,wp-plu,aload,5B,5D=pload,,media-views,,media-editor,,word-count,,jquery-ui-resizable,,jquery-ui-draggable,,jquery-ui-button,,jquery-ui-position,,jquery-ui-,aload,5B,5D=dialog,,wpdialogs,,wplink,,wpdialogs-popup,aver=3.5.pagespeed.jm.s7BQkxZ53Z.js

    Thanks again! Sorry to bother you. I probably need the HTML file that loads that script.

    That script by itself (I hand-decoded the .pagespeed. url) without mod_pagespeed gets an undefined reference (Uncaught ReferenceError: jQuery is not defined load-scripts.php:2). I reproduced using this HTML:

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    <script src="http://postholic.com/wp-admin/load-scripts.php?c=1&load[]=admin-bar,hoverIntent,common,wp-ajax-response,jquery-color,wp-lists,quicktags,jquery-query,admin-comments,jquery-ui-core,jquery-&load[]=ui-widget,jquery-ui-mouse,jquery-ui-sortable,postbox,dashboard,customize-base,customize-loader,thickbox,plugin-install,underscor&load[]=e,shortcode,media-upload,backbone,media-models,plupload,plupload-html5,plupload-flash,plupload-silverlight,plupload-html4,wp-plu&load[]=pload,media-views,media-editor,word-count,jquery-ui-resizable,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-&load[]=dialog,wpdialogs,wplink,wpdialogs-popup&ver=3.5"></script>

    Probably that’s a red herring and you have that jQuery defined by some earlier scripts (I can guess which one, I know). But I want to make sure I reproduce your testcase.

    @j_marantz

    HTML output (will expire in 24 hrs):

    http://pastebin.com/jN2qbDhg

    mod_pagespeed enabled with default settings. WP_DEBUG is off.

    If it’s necessary to login to the backend Dashboard, I can create a temporary account for you 🙂

    I had two problems writing the HTML from your pastebin into a file and loading that into Chrome. They were related to CSS & JS from ‘akismet’. Those resources were returning 403 (not authorized). This was showing up in Firebug for me. I am wondering if this is related to mod_pagespeed issue 582.

    Are you running Apache as a reverse proxy?

    I resolved those issues by editing those two ‘akismet’ URLs to strip out the .pagespeed. syntax and fetch instead the origin resources. Then the HTML loads with errors in Chrome.

    @j_marantz: I think this issue is not related with the media manager. After commenting out Akismet css and js files. I still got the same error when I click “Add media” button, In my case, this button: https://files.sparanoid.com/image-ZfGbf4UzOp.png

    However, yes, the problem you described is another one, I’m running Apache as a backend and I put nginx as a reserve proxy in front of it. Thanks for the hint.

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