Issue with google speed scores
-
Great plugin and works straight away. However its negatively impacted our google speed scores because of ‘Media element lacking an explicit size’. I manually edited the plugin as a temp fix to add in a default size to where the tp-images are added to the page. I also enabled loading=lazy on the rollover image too to improve speeds. Are you able to add height and width into those images and lazy loading options so we can have this playing much nicer with google page speed scores?
Eg what I edited and understand this will be replaced when the plugin updates.
$output .= '<img class="tp-image" width="320" height="457" src="'.esc_url($image_url_top).'" srcset="'.esc_attr( $image_url_top_srcset ).'" sizes="'.$image_srcset_sizes.'" alt="'.$image_top_alt.'">'; $output .= '<img class="tp-image-hover" width="320" height="457" loading="lazy" src="'.esc_url($image_url_bottom).'" srcset="'.esc_attr( $image_url_bottom_srcset ).'" sizes="'.$image_srcset_sizes.'" alt="'.$image_bottom_alt.'">';
The topic ‘Issue with google speed scores’ is closed to new replies.