performance icon indicating copy to clipboard operation
performance copied to clipboard

Improve Enqueued Assets report in Site Health

Open mxbclang opened this issue 3 years ago • 6 comments

The current Site Health reports for the Enqueued Assets module, introduced in #25, do not include actionable information for users about how to address a site loading too many enqueued assets. As noted by @felixarntz here:

We also need to think about how to make this warning more actionable, e.g. at a minimum tell users which plugins or themes are responsible for enqueuing the majority of assets etc.

Suggestions for changes (in progress) are below.

Enqueued scripts

If acceptable

image

Current description: The amount of [#] enqueued scripts (size: [size]) is acceptable.

New description:

If not acceptable

image

Current description: Your website enqueues [#] scripts (size: [size]). Try to reduce the number or to concatenate them.

More info about performance optimization

Clean Test Cache

New description:

Enqueued styles

If acceptable

image

Current description: The amount of [#] enqueued styles (size: [size]) is acceptable.

New description:

If not acceptable

image

Current description: Your website enqueues [#] styles (size: [size]). Try to reduce the number or to concatenate them.

More info about performance optimization

Clean Test Cache

mxbclang avatar Mar 28 '22 11:03 mxbclang

@bethanylang The recommendation "Try to reduce the number or to concatenate them." would only address the number of files problem, not the overall amount of JS/CSS problem. So I think that would only be the first half of the solution. We also need some at least high-level advice for when it's overall too much JS/CSS - which is obviously harder to resolve because concatenating won't reduce that, you would actually need to optimize the code as a developer, or identify which parts of the JS/CSS is maybe not critical (or from a non-critical plugin) so that you can remove it.

I think we should also show only the advice that applies, based on whether the amount of JS/CSS exceeds the threshold or whether the number of files of JS/CSS exceeds the threshold. Or if both, we would show both. But the main point here would be to also provide a recommendation for the first scenario.

felixarntz avatar Mar 28 '22 17:03 felixarntz

For the enqueued scripts the following can be the detailed message.

Image

@felixarntz can this message be improved by adding more links to resources?

b1ink0 avatar Dec 15 '24 08:12 b1ink0

I would like to work on this.

dilipom13 avatar Jun 02 '25 17:06 dilipom13

@dilipom13 I don't think there's enough definition to work on this yet.

westonruter avatar Jun 02 '25 19:06 westonruter

Thank you for the update, @westonruter! I understand. I'll wait for further definition or discussion before proceeding. Please feel free to tag me once it's ready—I’d still love to contribute when the time is right.

dilipom13 avatar Jun 03 '25 03:06 dilipom13

I’d like to work on this issue. I plan to enhance the Enqueued Assets test in Site Health to include counts and file sizes of CSS/JS assets for better diagnostics.

krishnachandak-2004 avatar Jul 19 '25 18:07 krishnachandak-2004