Make WordPress Core

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


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

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #53252, comment 3

    initial v1  
    44> That is, I think this ticket should be closed and an issue opened at https://github.com/wp-cli/wp-cli.
    55
    6 I suppose that is possible, but 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.
     6Well, 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.
     7
     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 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.
    79
    810A 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.