well, wp_enqueue_media adds javascript to your page (did a quick search, but couldn’t find which one). exclude that JS from optimization (adding it and any dependancies) to the comma-seperated exclusion list and it’ll work.
hope this helps,
frank
Hi Frank,
Thanks for your quick reply. For your kind reference, when we enqueue default wp-media (right now using version 4.1) its added ‘plupload.full.min.js’ file in footer which locates at : wp-includes/js/plupload/ folder.
I tried with your ‘exclude’ comma-seperated exclusion from admin settings but no luck 🙁
Would you please just add below code in functions.php file to any site and try to check console through firebug from front-side:
function add_my_scripts() {
wp_enqueue_media();
}
add_action('wp_enqueue_scripts', 'add_my_scripts');
Yesterday, i opened a ticket in stackoverflow where you can see the error i am facing: CLICK HERE
Regards,
M
So, I’ve had a first (and second) look at this.
What I learned up until now;
* wp_enqueue_media adds a huge amount of JS (and inline script of type “text/html”!) to a page.
* I have not yet been able to autoptimize a page with it, although I’m pretty sure I’ll crack that later.
* but even when succeeding in doing so, there’ll be a huge amount of JS you’ll have to exclude, which will most probably make the page perform poorly anyhow.
So my advice; don’t do wp_enqueue_media on each page, but do it on one page (or a limited number of pages) instead and exclude that/ those page(s) from being autoptimized (using the API).
I’ll look into this some more and will report back here if I have more findings to share 🙂
frank