Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wp core version --extra misreports multisite site db version #142

Open
ntwb opened this issue Nov 21, 2019 · 4 comments
Open

wp core version --extra misreports multisite site db version #142

ntwb opened this issue Nov 21, 2019 · 4 comments

Comments

@ntwb
Copy link

ntwb commented Nov 21, 2019

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

@danielbachhuber
Copy link
Member

Thanks for the report, @ntwb. This would be nice to get fixed.

@ernilambar
Copy link
Member

@danielbachhuber Currently we are fetching details from wp-includes/version.php file. What could be the approach to show DB version of a site of multisite installation? Is it feasible to fetch db version of multisite checking global url parameter value? $config = WP_CLI::get_configurator()->to_array();

@ernilambar
Copy link
Member

Note: Another problem I found is that, we are now hooking core version to before_wp_load. If we want to have database query to wp_XX_options table then we would have to hook this command to after_wp_load.

@danielbachhuber
Copy link
Member

I wouldn't change the existing behavior. We could solve this with documentation, or some special flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants