[wp-trac] [WordPress Trac] #47606: Display Site Health score on Dashboard

WordPress Trac noreply at wordpress.org
Wed Feb 5 18:24:58 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 dev-feedback  |     Focuses:  ui
------------------------------------+-----------------------

Comment (by Otto42):

 This early initialization is also causing an issue on w.org because of the
 need for $wpdb-dbh to be defined.

 The w.org systems use hyperdb, which delays connecting the dbh to a
 connection until an actual query is called. So when you call _construct
 and it calls prepare_sql_data, at this point, $wpdb->dbh is set to null,
 which causes `Warning: mysqli_get_server_info() expects parameter 1 to be
 mysqli, null given in /wp-admin/includes/class-wp-site-health.php on line
 191`.

 This is currently happening on pretty much every dynamic page on w.org,
 although the warning is suppressed at present.

 Seems like the actual functionality for this db versioning check needs to
 be moved out of the constructor or the initialization of the class needs
 to happen later in the cycle.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47606#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list