[wp-trac] [WordPress Trac] #47606: Display Site Health score on Dashboard
WordPress Trac
noreply at wordpress.org
Mon Jan 13 13:56:29 UTC 2020
#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
-----------------------------+-----------------------
Comment (by dlh):
A `stdClass` isn't considered `empty`, so the `empty( $issue_counts )`
check in `wp_dashboard_site_health()` fails when `$issue_counts` is still
in its initialized state as a `new stdClass()`. This generates `Undefined
property` notices in the widget when the transient doesn't exist because
the defaults aren't set.
The attached patch would switch the check to `get_object_vars()`, which
returns an empty array for a `new stdClass()`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47606#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list