-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add/sitehealth enqueued assets #1
Conversation
…blob/master/site-health-audit-enqueued-assets.php imported as a module and some little refactoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests look really good well done
Most of the comments are around the invaliding the cache
This is the WP issue: WordPress#25 |
@pbearne ready for the second code review, I added everything we talked about. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like leaving a query string with an action in the URL as it reruns the action on a page reload
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this 😄 I believe this is still WIP although the this PR is not appearing as a "Draft". Nonetheless I left a few early comments without doing a detailed review yet. The approach to trigger an asset warning is quite weak at the moment and need some more work.
By the way, why opening a PR agains this fork rather than on the https://github.com/WordPress/performance repo, that makes it hard for others to follow along with the review. Could we continue the conversation on the main repo please?
'test' => 'enqueued_css_assets', | ||
); | ||
|
||
if ( $enqueued_styles > 10 ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This signal needs to be more robust. The number of stylesheets is somehow a week signal, what really matter is the totally size. We need to grab and sum the size of all stylesheets and define a threshold for the warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ThierryA I've opened the PR in WP WordPress#54 we can follow up in there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @manuelRod, much appreciated. Left the same comments on the new PR to continue the conversation there.
'test' => 'enqueued_js_assets', | ||
); | ||
|
||
if ( $enqueued_scripts > 10 ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as for the stylesheet, we need to grab and sum the total size of assets loaded.
…s and unit test reordering.
- renaming transients - view_site_health_checks capability check to avoid non logged and non view_site_health_checks users to trigger checks - is_front_page check to avoid creating warnings in any random page.
…_url. Changing hooks to capture enqueued scripts/styles and inlines.
This was the original plugin to be moved to modules:
https://github.com/audrasjb/site-health-audit-enqueued-assets/blob/master/site-health-audit-enqueued-assets.php