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. |
| 6 | Well, 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 | |
| 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. |