WordPress.org

Make WordPress Core

Opened 5 months ago

Last modified 5 months ago

#53252 assigned enhancement

Track WP-CLI version in Site Health

Reported by: wpscholar Owned by: 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 (3)

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


5 months ago

  • 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
5 months 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
5 months 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 5 months ago by wpscholar (previous) (diff)
Note: See TracTickets for help on using tickets.