[wp-trac] [WordPress Trac] #58584: Telemetry / Stats: Send the raw DB version identifier, and/or server type.

WordPress Trac noreply at wordpress.org
Wed Jun 21 04:20:46 UTC 2023


#58584: Telemetry / Stats: Send the raw DB version identifier, and/or server type.
-----------------------------------------+------------------------------
 Reporter:  dd32                         |       Owner:  (none)
     Type:  enhancement                  |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Upgrade/Install              |     Version:
 Severity:  normal                       |  Resolution:
 Keywords:  reporter-feedback has-patch  |     Focuses:
-----------------------------------------+------------------------------

Comment (by dd32):

 Replying to [comment:2 costdev]:
 > if you install WordPress Beta Tester and click the ''Report a Bug''
 adminbar link, does the database string in the "Environment" section
 reflect any of your preferred data

 Yes, it (and Site Health) list the data I proposed above.

 The main difference is that Site Health (And I assume the Beta Tester)
 don't use the WPDB methods, I guess as it's unreliable?

 Instead of `$wpdb->db_version()` it returns something similar to
 `$wpdb->db_server_info()` but via a SQL query of `SELECT VERSION();` to
 workaround the above `5.5.5-10.2.44-MariaDB-log` "bug":

 {{{
 wp> $wpdb->db_server_info();
 string(25) "5.5.5-10.2.44-MariaDB"

 wp> $wpdb->get_var( "SELECT VERSION();" );
 string(19) "10.2.44-MariaDB"
 }}}

 Site Health does prefix it with the connection type, mostly through
 `get_class( $wpdb->dbh )` which might work, but I'm not sure what that
 would return for all dropins.

 Changing the reported value from `$wpdb->db_version()` to
 `$wpdb->db_server_info()`, and using the [https://github.com/WordPress
 /wordpress-develop/blob/0b6911113b42652ca6a1631448a0e0ae313d13e1/src/wp-
 admin/includes/class-wp-debug-data.php#L842-L854 extension usage] would
 probably suffice.

 I've submitted a PR for that: https://github.com/WordPress/wordpress-
 develop/pull/4653

 Notably, I don't really see the point in using `SELECT VERSION()` here,
 but I wouldn't be against seeing the customisations made in Site Health
 being merged with WPDB..

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


More information about the wp-trac mailing list