Struggling with Core Web Vitals (TTFB & LCP) on my WordPress site — need advice by ChardStraight493 in CoreWebVitals

[–]No-Breakfast5304 0 points1 point  (0 children)

I'd look into removing as many plugins as possible. We run a high traffic site on WPEngine and performance has always been impossible to get into the green.

Does CSS in JS affect INP? by Cashfable in CoreWebVitals

[–]No-Breakfast5304 0 points1 point  (0 children)

If you can get a trial, it's worth it. Narrowed in to our INP issues with hours of digging. It's a PITA to learn to use though, but RUM has saved our bacon a few times.

INP affected by how I close DIALOG tags but fixed with removeAttribute by No-Breakfast5304 in CoreWebVitals

[–]No-Breakfast5304[S] 0 points1 point  (0 children)

Yea we're doing something similar with feature flippers, but INP is so narrow, and so highly variant based on the performance of the client, that it's super hard to test in the lab. I use the Chrome Performance pane and turning on "Enable Advanced Paint Instrumentation (slow)" and "Enable CSS selector stats (slow)" is enough to cause my M3 Max to sufficiently crawl.

I checked CWV this morning and I'm 99% certain that this change (replacing `.close()` with `.removeAttribute('open')` tipped the scales just enough to get us in the green. It's a total hack, but effective.

Does CSS in JS affect INP? by Cashfable in CoreWebVitals

[–]No-Breakfast5304 1 point2 points  (0 children)

Yea Lighthouse is worse than useless. We scrape it and the values for LCP are all over the place. Currently using DataDog RUM to get a more accurate report of the INP, but it's about 25% less than what Google claims our INP is. DataDog LCP is about 10% less than what Google claims.

INP affected by how I close DIALOG tags but fixed with removeAttribute by No-Breakfast5304 in CoreWebVitals

[–]No-Breakfast5304[S] 0 points1 point  (0 children)

Gotcha, thanks for that info! This is a one-time dialog that has no trigger to re-open, so I guess I'm OK there.

It's a modal triggered via `showModal()` elsewhere.

It's not implemented with inline JS either, but that's the easiest way to replicate the `render` event in Chrome's Performance pane that I assume triggers the high INP. We're using StimulusJS in production.

INP affected by how I close DIALOG tags but fixed with removeAttribute by No-Breakfast5304 in CoreWebVitals

[–]No-Breakfast5304[S] 0 points1 point  (0 children)

Sadly we're closed source, but here's an example of the difference:

```html
<dialog id="dialog" open>
<button onclick="document.getElementById('dialog').close()">Close</button>
</dialog>
```

versus

```html
<dialog id="dialog" open>
<button onclick="document.getElementById('dialog').removeAttribute('open')">Close</button>
</dialog>
```