Make WordPress Core

Opened 3 years ago

Last modified 21 months ago

#53252 assigned enhancement

Track WP-CLI version in Site Health

Reported by: wpscholar's profile wpscholar Owned by: wpscholar's profile wpscholar
Milestone: Awaiting Review Priority: normal
Severity: trivial Version: 5.8
Component: Site Health Keywords: 2nd-opinion has-patch
Focuses: Cc:

Description

Currently, there is no data about WP-CLI in Site Health. Assuming that WP-CLI is present, we should display the version number in the Site Health info tab.

Change History (4)

This ticket was mentioned in PR #1278 on WordPress/wordpress-develop by wpscholar.


3 years ago
#1

  • Keywords has-patch added

If WP-CLI is available, track the version in the Site Health info tab.

Trac ticket: https://core.trac.wordpress.org/ticket/53252

#2 follow-up: @pbiron
3 years ago

I like the thought, but wouldn't it be cleaner if WP_CLI, itself, hooked into debug_information and added the information?

That is, I think this ticket should be closed and an issue opened at https://github.com/wp-cli/wp-cli.

#3 in reply to: ↑ 2 @wpscholar
3 years ago

Replying to pbiron:

I like the thought, but wouldn't it be cleaner if WP_CLI, itself, hooked into debug_information and added the information?

That is, I think this ticket should be closed and an issue opened at https://github.com/wp-cli/wp-cli.

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.

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 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.

A 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.

Last edited 3 years ago by wpscholar (previous) (diff)

#4 @Clorith
21 months ago

I'm curious what information this provides to the end user. The presumption being that they can't use WP-CLI without accessing the commandline in the first place, and at that point they could very easily grab the version themselves.

I'm being a bit restrictive in jumping on this possibility because of the conditionals that need to be met in the hosting environment for this to even be possible to add. (I am aware that the GhostScript check also uses exec to grab the version, but this isn't something we'd want a pattern of adding if it can be avoided)

Note: See TracTickets for help on using tickets.