Slow loading page

Hi,

I have created a simple website with a Wordpress template because I’m not an expert like most of the forum members, I have no idea of code and no budget.

I supposed that, being so simple, it wouldn’t be difficult to achieve a reasonable page speed… I was wrong. I have adopted measures to improve the web (images size, Cloudflare CDN, W3 Total Cache plugin), but I don’t see relevant and consistent results:

http://www.webpagetest.org/result/160520_B8_12QR/

I have reviewed the test details and I have the impression that I can’t solve the problems because they depend on the template or on the hosting. Am I right or did I arrive to that conclusion because of my ignorance about programming?

Any suggestion?

Thanks.

There’s no way to improve your results without coding.

Getting that render blocking CSS and JavaScript out of the way would probably shave a second – or more – off of Start Render/First Paint/Visually Complete times.

Be well,
AJ
Managing Partner
WpFASTER

Thanks for your advice.

I’ll look it up on the internet. I hope to find code examples to defer the JavaScript loading.

In your child theme’s functions.php or with a plugin like Code Snippets:

[code]## function to add async to all scripts ##
function js_async_attr($tag){

Do not add async to these scripts

$scripts_to_exclude = array(‘script-name1.js’, ‘script-name2.js’, ‘script-name3.js’);

foreach($scripts_to_exclude as $exclude_script){
if(true == strpos($tag, $exclude_script ) )
return $tag;
}

Add async to all remaining scripts

return str_replace( ’ src’, ’ async=“async” src’, $tag );
}
add_filter( ‘script_loader_tag’, ‘js_async_attr’, 10 );[/code]

Replace, async=“async” with defer=“defer” if you would like to use defer instead.

:slight_smile:

Be well,
AJ
Managing Partner
WpFASTER

grupoalianzaempresarial is exactly wrong - recoding will attempt to improve an already good time to first byte of 0.3ish seconds.

I recommend that you look at using W3TC to combine your CSS and JS files. This will reduce the file count, and so the latency associated with each one.

I’d also look at tidying up the raw and www urls - just stick to one ( unless there’s a resaon for that of course! ).

And ( at least while you’re testing performance ), ditch cloudflare as all you’re testing is their infrastructure, not yours.

Hi everyone! Great helpful comments.

  • I have added the code (thanks ajm_76) to the functions.php of my child theme but I receive an error message because of the sign just before the line “add_filter( ‘script_loader_tag’, ‘js_async_attr’, 10 );”

Parse error: syntax error, unexpected ‘}’ in /…/functions.php on line 27.

  • Thanks, GreenGecko. I already had installed W3TC but I couldn’t enable Minify because Cloudflare says: “Do not use more than one caching plugin on your site (don’t use Super Cache and W3TC at the same time, for example). A conflict will eventually arise”. I’ll try to configure W3TC Minify instead of Cloudflare Minify.

  •   Regarding the urls, I informed Google that my preferred domain is with www and there is a redirection from raw to www urls. I thought it was everything I had to do.
    

Argh! Sorry ajm_76, code error solved. My mistake!

Hi Coyem, Before time, i have a problem as you. But i fix OK ! My site speed been improve very good ,
you can test speed my web: http://fitnessmotivationtv.com/ ,
result page: http://www.webpagetest.org/result/160614_5W_F4E/ with 3 rate A-A-A-C-F…
I recommend you :

  1. Re-Test your web host. You should choose speed faster, You’re running Wordpress, so you should check your plugins and theme to make sure that none of them are slowing things down.
  2. You should install W3 Total Cache plugin since you’re using Wordpress, and see how that helps.
  3. You should press all file: css, javascripts and Images, Press Images is very important, you can search soft : optimize images soft, I recommend use caesium , you can download at softonic : http://caesium.en.softonic.com/

That is all !
Hope helpful for you ! Good luck !

Thanks for your suggestions, stevejohn

I already had installed W3 Total Cache plugin to compress files.
I load optimized my images although according to the tests I could save some more kb, but very very few