Render Blocking Javascript and CSS

Posted in: Newspaper
Post count: 66

Help is requested regarding how to get rid of render blocking Javascript and CSS. I have gone through the pagespeed guide and all 14 pages of sticky post titled Pagespeed but could not figure out how to achieve this.I have speed booster plugin installed and have retrieved registered scripts and styles using the code provided in pagespeed guide.

Render blocking scripts and styles are different than registered scripts. so,

1. How can I register unregistered scripts
2. Where to place ID’s on speedbooster plugin

I need little bit of guidance.

Kind Regards
Azhar Nadeem
sportscourant.com

Post count: 66

$this->move_style_to_footer(‘woocommerce_frontend_styles’);

//jetpack lost styles
$this->move_style_to_footer(‘jetpack-subscriptions’);
$this->move_style_to_footer(‘jetpack-widgets’);
$this->move_style_to_footer(‘thickbox’);
$this->move_style_to_footer(‘devicepx’);
$this->move_style_to_footer(‘contact-form-7’);

/**
* move javascript to footer
*/
$this->move_js_to_footer(‘themepunchtools’);
$this->move_js_to_footer(‘revmin’);
$this->move_js_to_footer(‘contact-form-7’);
$this->move_js_to_footer(‘thickbox’);
$this->move_js_to_footer(‘devicepx’);
$this->move_js_to_footer(‘image-widgets’);

This is how I tried to move them to footer

Post count: 85

I too am interested in this topic.

Post count: 6600

Hi,

All used scripts are registered and the td_inspect_scripts() function returns a list of registered css and js from your site however some plugins may load after it and that’s why it doesn’t return all js.

You could try to play with the priority, if it doesn’t return all js – http://screencast.com/t/7fhfjttAT8

http://codex.wordpress.org/Function_Reference/add_action

This is recommended for advanced users only so if you don’t have php knowledge I suggest you get someone to help you with this.

Place the functions which move the scripts and styles sheets here: http://screencast.com/t/QfpUo10r

Thanks

Post count: 66

Dear Lucian
Thanks for your response. but it sounds like an auto response sent to everyone with this query. Render blocking Javascripts include

1. contact-form-7/includes/js/jquery.form.min.js (should not be there as it is part of theme package)
2. contact-form-7/includes/js/scripts.js (should not be there as it is part of theme package)
3. http://s0.wp.com/wp-content/js/devicepx-jetpack.js
4. /wp-content/themes/Newspaper/js/td_external.js (should not be there as it is part of theme package)
5. /wp-content/themes/Newspaper/min/site.min.js (should not be there as it is part of theme package)
6. /wp-includes/js/thickbox/thickbox.js
7. /wp-content/plugins/Js_composer/assets/js/js_composer_front.js (should not be there as it is part of theme package)
8. /wp-includes/js/comment-reply.min.js

You might have noticed above that I have in fact added ID’s of blocking styles and Js at the appropriate place in speedbooster plugin but these are still appearing in Pagespeed insights results.

Can you please guide to resolve the matter as suggested solution is assumingly not working

Post count: 555

I don’t have these issues,it’s how you set your site up it’s not the theme fault are the speedbooster..

Here is my site link with pagespeed https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fjahliveradio.com%2F

Post count: 66

Dear Steven
Thanks for your response.Your scores are amazing.Can you help me in this regard?

Post count: 9544

@Steven

fyi, check out some of my updated info on my optimization sticky regarding adding TTL for the .woff fonts to remove that “error” item from pagespeed insights 🙂

Note the added font related elements in my htaccess file version in the dedicated sticky topic!

Chris

Post count: 66

@Chris I have gone through whole of your tutorial and fetched some very useful information from there especially optimization through functions.php. However,in one of your post you mentioned that no more pagespeed support (My understanding)so I deliberately avoided requesting you.

I am little stuck with Javascript and CSS error. I have tested it with and without speedbooster plugin and result almost remains the same with no difference in score with almost same number of items appearing in Pagespeed insights.

Cloudflare resolves the JS issue but menu typography does’nt work well in FF and IE when served through CDN.

Can you help me in this regard?

Post count: 9544

No way to fully remove the “render blocking” issue unless you custom engineer your website from scratch to load pages in “chunks” — which is virtually impossible with off the shelf product like this; so technically you will almost ALWAYS get that warning. So, the “goal” would be to address everything ELSE, and “tune” your site without any external elements being loaded, then switch back on the external stuff (e.g., adverts, etc.).

I don’t use Cloudflare, so not much help there.

The reason I don’t provide “support” anymore is I don’t work here; and every server and setup has different issues which are unrelated to how “I do it.” So, not much help for some things like CLoudflare — I stopped using our Amazon CDN for just such issues like IE randomly not loading font awesome, and Firefox just is a P.O.S. with a whole slew of java issues (e.g., our old ecom system won’t load via mod_SPDY with FIrefox, but works with every other browser known to man — forced me to turn off mod_SPDY and having to migrate our ecom to woocommerce … !). Stupid FF.

Thanks for not bugging me …
The other reason I stopped answering some questions is people would not bother to actually READ my help post and ask if their htaccess file was okay. 😉

I have not bothered putting anything in the speedbooster plugin as not a huge help with most stuff; and many plugins that I use actually have option to load JS in footer anyway, so no need to hack that into the plugin.

Upshot — I have not used the plugin beyond its default settings, since mod_pagespeed takes care of a lot of things (except the latest update which was being overloaded by a legacy site with a loop of doom with timthumb…. but woo taking care of that finally..)

blah blah. Anyway… sorry no magic answers today !

Post count: 555

@Chris S thanks for the tip,i used it and your right it did removed that font issue…


@AzharNadeem
i don’t have time to keep helping people with the same thing,they some topics of mine about helping you with the issue you facing that i posted last year,plus i don’t work here so i try not to give any more support.

Post count: 66

@Steven…Thanks for such a rude response.You actually replied to the post first, so I made a request.

Viewing 12 posts - 1 through 12 (of 12 total)
The forum ‘Newspaper’ is closed to new topics and replies.