Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

wp core version --extra reads database version from wp-includes/version.php, showing the expected version rather than the actual version stored in the options table. In multisite installations, subsites can have different database versions, making this particularly problematic.

Changes

  • Added --actual flag requiring --extra to query get_option('db_version') instead of reading the file
  • Delegation pattern to maintain performance: main command stays @when before_wp_load, delegates to new version_db_actual subcommand when --actual is used
  • Refactored TinyMCE version formatting into shared helper to eliminate duplication
  • Added tests for error handling, single site, and multisite scenarios

Usage

# Shows expected version from version.php (default, unchanged)
$ wp core version --extra
Database revision: 45805

# Shows actual version from options table
$ wp core version --extra --actual
Database revision: 37965

# Works with multisite subsites via --url
$ wp core version --extra --actual --url=example.com/subsite
Database revision: 37965

The flag validates that --extra is present and properly escapes arguments when delegating to the helper command.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.wordpress.org
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)
  • downloads.wordpress.org
    • Triggering command: /usr/bin/curl curl -sSfL REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>wp core version --extra misreports multisite site db version</issue_title>
<issue_description>## Bug Report

Describe the current, buggy behavior

With a multisite install I wanted to confirm the database version of a site within the network.

I expected the wp core version --extra --url-example.com/site command to achieve this accurately, it did not.

Describe how other contributors can replicate this bug

To do so I ran the command:

wp core version --extra --url-example.com/site

The results of that command were:

WordPress version: 5.3
Database revision: 45805
TinyMCE version:   4.960 (4960-20190918)
Package language:  en_US

I then examined the wp_XX_options table related to the --url site listed in the previous command, the value of the db_version option was 37965

I then ran the command:

wp core update-db --url=url-example.com/site

The results of that command were:

Success: WordPress database upgraded successfully from db version 37965 to 45805.

Re-examining the wp_XX_options table related to the --url site listed in the previous command, the value of the db_version option is now 45805

Describe what you would expect as the correct outcome

When I run the command:

wp core version --extra --url-example.com/site

The results that I expect would be:

WordPress version: 5.3
Database revision: 37965
TinyMCE version:   4.960 (4960-20190918)
Package language:  en_US

Provide a possible solution

If you happen to have a suggestion on how to fix this bug, please tell us in here.

Just leave this section out if you don't know how to fix it.

Provide additional context/Screenshots

Add any other context about the problem here.

If applicable, add screenshots to help explain (you can just drag&drop images into the Github issue).
</issue_description>

Comments on the Issue (you are @copilot in this section)

@danielbachhuber Thanks for the report, @ntwb. This would be nice to get fixed. @ernilambar @danielbachhuber Currently we are fetching details from `wp-includes...

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits February 2, 2026 01:36
… reporting

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
…bcommand

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix misreporting of multisite site db version Add --actual flag to show database version from options table in multisite Feb 2, 2026
Copilot AI requested a review from swissspidy February 2, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wp core version --extra misreports multisite site db version

2 participants