The Theme is mostly fast but a few places that could be improved according to GTMetrix
RECOMMENDATION GRADE TYPE PRIORITY
Serve scaled images
F (3)
83%
Images High
Remove query strings from static resources
F (44)
88%
Content High
Defer parsing of JavaScript
D (67)
62%
JS High
Specify a cache validator
B (80)
94%
Server High
Avoid CSS @import
B (85)
96%
CSS Medium
Inline small JavaScript
B (86)
97%
JS High
Minify JavaScript
B (87)
91%
JS High
You can avoid CSS import by not using a child theme.
You can remove query strings by using the functions I have previously recommended for adding to your functions.php file. You can also optimize your thumbnails by editing your functions.php file to set higher compression level for WP, and then run the “Regenerate Thumbnails” plugin.
Add these to bottom of your functions.php file, for one example:
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'jpeg_quality', create_function( '', 'return 50;' ) );
add_action('init', 'myoverride', 100);
function myoverride() {
remove_action('wp_head', array(visual_composer(), 'addMetaData'));
}
You can optimize your site following the documentation for this theme:
https://forum.tagdiv.com/page-speed-guide/
I’m looking for a way to compress each thumbnail to a different quality size, that would help a lot, thou I’, not good at coding. :p
What does this part of code do?
add_action('init', 'myoverride', 100);
function myoverride() {
remove_action('wp_head', array(visual_composer(), 'addMetaData'));
}
Note the “remove_action” section is always useful… note it refers to “visual composer” and “meta data” … this removes the comment printed in the rendered page where it shows “created with visual composer 4.3” or whatever. Annoying.
So, basically that code I posted has (3) sections
1) remove general versioning from normal version strings; might not work on all the tagdiv speedbooster enqued stuff
2) change default thumbnail compression level (default in WP is 90, which is for quality, not speed or best practices, which is the WP mindset — better vs fast …. where 70 would be better default, frankly). 50 works. I think we ended up with 60 on some sites for some odd reason (I think ’60’ worked better with mod_pagespeed on our server for WebP conversion or something). Anything is better than 90!
3) hide the visual composer comment string.
You can actually find all my various pagespeed rantings from the past year on the Newspaper forum in the pagespeed sticky post if you want the whole shebang of stuff I do. Luckily TagDiv put a bunch of that into the standard theme docs now, and they already knew most of that from optimizing the demo sites anyway.
If you want an extra little boost you can also locally host gravatars and also optimize your wp-config file; see the Newspaper forum sticky topic, and simply start at end and work backwards to see all my special tweeks, if curious. I think later in the hundreds of posts I would often “resummarize” things, as well as add tweaks for the gravatars, and such. No point in repeating all of that here again. 🙂
-
This reply was modified 11 years by
simchris.
