[wp-trac] [WordPress Trac] #47606: Display Site Health score on Dashboard
WordPress Trac
noreply at wordpress.org
Wed Dec 25 23:18:00 UTC 2019
#47606: Display Site Health score on Dashboard
-----------------------------+-----------------------
Reporter: guddu1315 | Owner: Clorith
Type: feature request | Status: assigned
Priority: normal | Milestone: 5.4
Component: Site Health | Version: 5.2.2
Severity: normal | Resolution:
Keywords: has-patch | Focuses: ui
-----------------------------+-----------------------
Changes (by Clorith):
* keywords: needs-patch => has-patch
Comment:
[attachment:"47606.patch"] has a few pieces to it for functionality sake.
It makes sure the `WP_Site_Health` class can be instantiated once, so we
don't have to recreate it for multiple page loads, this to facilitate that
the class has to run in a few locations depending on context.
An instance is called in `wp-settings.php`, this is to make sure the
introduced WP_Cron event can be picked up and handled (much like the fatal
error handler, found right above it, is done, only without the assistance
of helper functions).
The Dashboard widget it self is for the most part a straight copy from the
plugin, as I mentioned I wanted to use that, it has a slight adjustment to
the default string, shown only when no site health checks have been
collected yet, to account for scheduled events being filterable so the
frequency may not be what was originally implemented.
This also enqueues Site Health's JavaScript and styles on the Dashboard
page, as well as the individual `site-health.php` pages.
The task of running tests was separated out to its own function,
`WP_Site_Health->perform_test( $callback )`, to prevent repeating our
selves in too many places.
And finally, a new cron schedule is added for `weekly` events (I've always
been puzzled by this not already existing, but it's not been needed, and
now it is, so makes sense to introduce it).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47606#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list