Page Speed Not Budging

Posted in: Newspaper
Post count: 240

Following here:
https://forum.tagdiv.com/how-to-make-the-site-faster/

Have moved lots of CSS to footer in td-speed-booster.php

Examples:

/**
* here we move the css
*/
function css_mover() {
if ($this->td_theme_name == 'Newspaper') {
// wp 011 - Newspaper 6

$this->move_style_to_footer_queue('google_font_open_sans');
$this->move_style_to_footer_queue('google_font_roboto');
$this->move_style_to_footer_queue('bbp-default-bbpress'); //bbpress old
$this->move_style_to_footer_queue('bbp-default'); // bbpress
$this->move_style_to_footer_queue('contact-form-7'); // end of initial list, rest custom
$this->move_style_to_footer_queue('gd-captcha-style');
$this->move_style_to_footer_queue('geodir-core-scss');
$this->move_style_to_footer_queue('font-awesome');
$this->move_style_to_footer_queue('geodir-event-frontend-style');
$this->move_style_to_footer_queue('location_manager_css');
$this->move_style_to_footer_queue('social-widget');
$this->move_style_to_footer_queue('woocommerce-layout');
$this->move_style_to_footer_queue('woocommerce-general');
$this->move_style_to_footer_queue('td-theme');

But Google is still listing all these resources under the Page Speed error (Eliminate render-blocking JavaScript and CSS in above-the-fold content).

I’ve cleared the cache and checked several times. Nothing. What am I doing wrong?

Post count: 240

Following…

Post count: 9544

Fact is, in WordPress you need to move all CSS and JS to footer, and then have the critical CSS loaded from the header file to fully eliminate that error message.

There is no ‘one click’ way to do it.

Check your page source and see what css and js are there.

but, the ‘gotcha’ is that most WP posts cannot render anything at all without certain code, and so putting it at bottom can help it load, but without the initial “critical” CSS actually loaded inline at top, the page still needs to get to the code to load anything at all (often giving a flash of unstyled text – aka FOUT).

I think I cover this somewhere in my epic poem on TagDiv theme optimization in the tutorials > best of forum.

🙂

Post count: 240

Your answer doesn’t explain why Google PS and the errors havent moved after doing what the instructions say.

Post count: 9544

I don’t work here; take it or leave it.

I thought I did answer it. To remove the ‘render blocking,’ you have to embed all the ‘critical’ css in your header.php file manually.

Perhaps TagDiv will have better answer when back in the office. Sorry that didn’t help. 🙂

Post count: 240

I’m just trying to follow their guidelines per the link I put above…I haven’t made it to your post yet, this isn’t my speciality but it is near impossible to hire anyone b/c they never realize that when they fix one thing, they screw up something else, and then I have to clean up after them. So now I’m trying to learn and understand…I wouldn’t know what “critical” css is.

Post count: 15

I have this same problem. Did the same moving and get the same problem with page speed. Still shows us as not moved.

Post count: 9544

Hi, sorry if my reply sounded mean 🙂

Critical CSS is the “needed CSS” to render the above the fold content. Which might only be 20% of the CSS loaded for entire page, but when loaded inline with every page the page itself is a little bigger, but the browser doesn’t need to wait for ANY of the css and js files. This is the only way I’ve found to fully eliminate the “render blocking” message from Pagespeed Insights.

While the SpeedBooster plugin does pretty good job of moving stuff to footer (and I presume you know how to look at your page source to see if that actually happened, and WHAT is being loaded in the header), as I stated in many cases with WP, you cannot just move everything to the footer as then nothing actually loads until you get there.

TagDiv are doing a “sort of” version of this by front loading some of the CSS, and then moving the stuff to footer; but if you still get the message then it means this “scheme” didn’t quite work, and not really their fault — it will NOT work for everyone; even if they can do it with some (ahem, not all) of their demos.

Go test their demo post for example, see what happens 😉

So, the trick is to use a custom css “critical css generator” that scans your post and then figure out WHAT needs to load first “critical” in the sense it’s needed to load the page BEFORE all the css/js crap in the footer.

For this example “critical” would be defined as :

critical
· adj.
having a decisive importance in the success or failure of something.

So … TagDiv might want to — and will — weigh in as part of their lovely support effort, but you should concentrate on ALL OTHER pagespeed elements, and leave that one thing for last. Or it will drive you insane until you just learn how to get the “critical CSS’ added to the header.php file right above the body tag. Seriously. Been there. 🙂

Post count: 22421

Hello,

Just a tip on speed booster. lots of people do not know about the speed booster compatibility function. Speed booster is not able to move everything to footer. Plugins in special. Some plugins actually break if you move the styles to footer. Please check the system status here to make sure speed booster is actually active and has not disabled itself: http://screencast.com/t/lVnKysYnA
You can trick it though at your own risk by removing the compatibility function from within it’s code:
https://forum.tagdiv.com/topic/tinymce-advanced-and-other-various-disabling-speed-boster/

Thank you!

Post count: 240

Bogden – that is it! Booster is not enabled. Conflict with adrotate. You should add that little bit to your page on how to speed up your site I linked to above – because that could save someone else the 6 hours I totally wasted!

Post count: 22421

Hi,
I will add this to the documentation page
Thank you!

Post count: 240

Exactly how do you comment out code? Is this it? Please don’t screenshot – send me something I can copy and paste. Thanks.

<?php // the_content(Continue Reading…); ?>
private $allowed_plugins = array(
‘bbpress/bbpress.php’,
‘contact-form-7/wp-contact-form-7.php’,
‘jetpack/jetpack.php’,
‘js_composer/js_composer.php’,
‘td-speed-booster/td-speed-booster.php’,
‘font-awesome-4-menus/n9m-font-awesome-4.php’,
‘wordpress-seo/wp-seo.php’,
‘wp-user-avatar/wp-user-avatar.php’,
‘td-social-counter/td-social-counter.php’,
‘wp-super-cache/wp-cache.php’,
‘woocommerce/woocommerce.php’,

‘td-mobile-plugin/td-mobile-plugin.php’,

);

Post count: 22421

Google is your friend: http://www.w3schools.com/php/php_syntax.asp
🙂
(that is the list of compatible plugins)
Thank you!

Post count: 240

Nevermind. I took out this:
// disable the plugins if there are incompatible plugins
$active_plugins = get_option(‘active_plugins’);
//print_r($active_plugins);
//die;
foreach ($active_plugins as $active_plugin) {
if (!in_array($active_plugin, $this->allowed_plugins)) {
define(‘TD_SPEED_BOOSTER_INCOMPATIBLE’ , $active_plugin);
return;
}
}

And it completely ruined my CSS and site format. So I guess I can’t use the booster.

Post count: 9544

You can alternately use the “Scripts to Footer” plugin (works with Newsmag 3.1), which I use on some sites not running the speed booster plugin. It works pretty well, also. Won’t move the main style.css to footer, but again — I won’t repeat my mantra on “critical CSS loaded in head, then de-enqueue main style.css from head, and put in footer.php file” (which is how I do it … ).

Post count: 240

Please explain how to do this:

You can trick it though at your own risk by removing the compatibility function from within it’s code:
https://forum.tagdiv.com/topic/tinymce-advanced-and-other-various-disabling-speed-boster/

Either explain how to comment it out or how delete it all together. Precisely – including semi colons, etc.

You Booster isn’t even compatible with the Envato Theme updater – so clearly, everyone is going to need to know how to do this.

Post count: 9544

The example they linked to worked for me:

ref
http://screencast.com/t/RZLIOPUNdqh

but as also clearly stated in the linked thread, it may not work if certain plugins conflict and break the plugin entirely and what it tries to do — no way to make compatible with 1,000+ WP plugins out there.

So,

option
a) comment our or remove the section as previously indicated;
b) if does not work; then don’t use plugin
c) if you don’t use plugin, use my alternate suggestion

———
also as a tip from many users on themeforest and various theme support forums, avoid using the envato theme updater as more likely to break your site by doing partial or incomplete update of your theme. Best to always use FTP so you know 100% it is done properly every time for both theme and updated theme plugins.

  • This reply was modified 9 years by simchris.
  • This reply was modified 9 years by simchris.
Post count: 240

Thank you. I had to remove the tagdiv speed booster because it eliminated my Child CSS. I finally got it to work after a lot of trial and error – since no one here would provide any more instructions than “comment it out,” which I couldn’t figure out.

I don’t think it helped my page speed score either. Removing it actually improved my mobile page speed score by 20 points.

Post count: 22421

Hello,

This is how that part looks commented: http://screencast.com/t/pitB5GxR1h or you can simply delete that part starting from under function __construct() { all the way down to the second secolon but do not delete the add_action below.
After this you can use it with your own plugins and you can use this guide to find the ID’s for the css and js and add them to the proper code inside the speedbooster plugin: https://forum.tagdiv.com/how-to-make-the-site-faster/
However this is for advanced users so you have to be carefu lwith the code where you place it and how. Please do it exactly as the guide suggests.

Thank you!

Post count: 240

Yeah – I’ll stay away from the advanced part and just try different plugins. I still have the CSS issues with google, but the speed booster didn’t make an impact on speed – at all – and killed my child css.

Do you know how to set an exp for .woff? Google is giving me this error:

Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network.

http://www.domain.org/wp-content/themes/Newspaper/images/icons/newspaper.woff?9

If you could tell me exactly what to put in .htaccess that would be great.

Post count: 9544

Examples of adding woff and webp are in my optimization thread in this forum from the docs menu > tutorials > best of forum

Post count: 240

So I dug around for 15 minutes to find your post.

I’ve added both these to my .htaccess

ExpiresByType application/x-font-woff A31536000
ExpiresByType application/x-font-woff “access plus 2500000 seconds”

and google still has it as an issue.

Post count: 9544

AddType application/x-font-woff .woff
ExpiresByType application/x-font-woff "access plus 2500000 seconds"

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