- This topic has 9 replies, 3 voices, and was last updated 4 years, 4 months ago by
David.
-
AuthorPosts
-
April 29, 2021 at 9:46 am #1755997
Mark
Hi There,
I’m having a CLS issue with my theme:
“Image elements do not have explicit width and height”
There was a recent article on this, but I don’t understanding everything in it:
https://generatepress.com/forums/topic/how-to-set-height-and-width-for-the-logo-image/
CLS is the only thing I’m failing on core vitals. I have pages that load in under half a second, but CLS is killing me. It’s all because of this error. I’ve been told I need to make a CSS customization and have no clue where to do that.
Also, I cannot get GP Premium to update. The update keeps failing. I think I have the same issue with updating my GP Theme since it’s a child theme. I’m using Nitropak. There isn’t an option to quickly fix this like WP Rocket has btw. I tried switching to WP Rocket, but my speed scores are horrible with it.
Thanks,
April 29, 2021 at 3:27 pm #1756474Elvin
StaffCustomer SupportHi there,
Can you set up a live link for your site so we can check w/ image is getting this flag and the CLS?
If it’s the logo. I believe there’s a fix applied for this on GP Premium 2.0.
Also, I cannot get GP Premium to update. The update keeps failing. I think I have the same issue with updating my GP Theme since it’s a child theme. I’m using Nitropak. There isn’t an option to quickly fix this like WP Rocket has btw. I tried switching to WP Rocket, but my speed scores are horrible with it.
Try downloading the plugin file and upload it manually. 🙂
April 30, 2021 at 7:15 am #1757715Mark
See this report:
I just got GP Premium 2.0 updated — it did not fix the issue.
CLS is 0.18 — it’s close – but fails due to the explicit W/H issue — looks like it is the logo
May 1, 2021 at 4:46 am #1758804David
StaffCustomer SupportHi there,
GPP 2.0 should fix the missing width/height attributes – you can try disabling the cache/optimization plugin. Remove the mobile header logo, publish, the re-add the logo. This should ensure that any cached HTML gets updated… however that isn’t the cause of the CLS.
If you:
1. open the site in Chrome Incognito (no caching)
2. open the Developers Tools ( Right Click > Inspect )
3. Select the Mobile responsive view ( set that to Moto 4G as that what PSI uses).
4. Open the Performance Tab, and set the Network to Slow 3g – then hit the reload button in the Performance tab.Whilst its reloading you will see the site loading slowly thanks the network – and you can see which elements are shifting.
Once the performance profile is completed it will provide you timeline film strip of the site as it loads.
It also marks out where the Layout Shift is occurring.The issue i see is the nitro cached CSS files being loaded in an incorrect order as you will see the text loads, with the correct style, then it shifts to a different style and then reverts back again… all of those changes align with the loading pattern of the nitro CSS files.
May 1, 2021 at 9:15 am #1759357Mark
Hi David,
I just did steps 1-4 and still have the explicit width and height error — and fail CLS because of it. The logo is still showing as an example of one of the images with this issue.
I’m not sure what you mean by the nitro cached CSS being loaded in the incorrect order. How do I fix this?
May 2, 2021 at 3:22 am #1760074David
StaffCustomer SupportI am not seeing the logo displayed in the PSI report as a CLS contributing Element:
https://www.screencast.com/t/WrOdPXuJ3a
If you ran the performance test you should have seen the shift in layout being caused by the text styling changing twice which in turn is what causes the above elements being moved.
Nitro is changing the loading order of CSS – its generally becuase of a Critical CSS or Optimized CSS option in the plugin – i am not familiar with that particular plugin. But what i can see is:
a. Some styles are being loaded in the head – which are applied before the page is rendererd.
b. Some styles are being combined and loaded inline in the Footer – which are applied after the page is rendered.This is the main cause of CLS issues – as the browser is not getting the right CSS styles on first load.
You would need to speak to Nitros support on how to fix that.May 2, 2021 at 6:55 am #1760511Mark
Thanks David,
I’ll check with them. Are you fimiliar with other speed optimization tools that work with GeneratePress? The only one I can think of is WP Rocket. I haven’t been able to achieve the speed scores in lab like I have right now unless I’ve been running nitropack.
May 2, 2021 at 10:25 am #1760742David
StaffCustomer SupportPersonally we only use Autoptimize on our sites with server side Page Caching Enabled.
On some builds i have used PerfMatters for disabling global running scripts on pages that are not required.We see similar issues as this on WP Rocket and Litespeed Cache Plugin as well.
The majority of them are caused by those plugins automatically creating Critical CSS or Optimizing CSS delivery.May 2, 2021 at 11:04 am #1760774Mark
Thanks David,
I have CloudFare – I heard the premium subscription has a few optimization pieces. That might help too.
CLS is killing me. It’s the only thing I fail now, even with pages that load under a second :’-(
May 2, 2021 at 11:57 am #1760825David
StaffCustomer SupportWhen i last checked your site the FCP and LCP times were around 1.2seconds which is ridiculously fast. Sometimes a small sacrifice to those times to eliminate another issue such as CLS is worth taking. I would work through the Nitro plugins options, disabling one at a time to see which is causing the CLS. The retest the site without that option enabled. You may find its a small increase in FCP/LCP times and zero CLS.
Problem with a lot of the additional features with optimization plugins is they only increase the perceived performance of the site – which is great if you just care about the initial load time – but the code they defer loading to achieve those times still has to be loaded – if like in this case its in the incorrect order you get CLS.
-
AuthorPosts
- You must be logged in to reply to this topic.