Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #53252, comment 3


Ignore:
Timestamp:
05/21/2021 07:40:19 PM (3 years ago)
Author:
wpscholar
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #53252, comment 3

    v1 v2  
    66Well, first thing to note is that the `debug_information` hook is only run when the Site Health info tab is loaded. If WP-CLI hooked in, it wouldn't have any impact since those are two separate runtimes.
    77
    8 While I suppose that it is possible for WP-CLI to store the data, the assumption there is that WP-CLI would actually have to be used in order to get the version of WP-CLI stored in the WordPress database. It is also possible that a site's host doesn't allow `shell_exec` which would prevent the method I've used here. Maybe the better option is to do both? If `shell_exec` is enabled and WP-CLI is present, log the version. Or, if WP-CLI has been used and stored a version in the WP database, then we could pull that value instead.
     8While I suppose that it is possible for WP-CLI to store the data, the assumption there is that WP-CLI would actually have to be used in order to store the version of WP-CLI in the WordPress database. It is also possible that a site's host doesn't allow `shell_exec` which would prevent the method I've used here. Maybe the better option is to do both? If `shell_exec` is enabled and WP-CLI is present, log the version. Or, if WP-CLI has been used and stored a version in the WP database, then we could pull that value instead.
    99
    1010A few downsides of doing it on the WP-CLI side though are that some commands don't load up WordPress and, when they do, we may not want to attempt a database write on every command.