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 db check doesn't return error if core WP tables are missing #148

Closed
2 tasks done
benlk opened this issue Sep 17, 2019 · 3 comments
Closed
2 tasks done

wp db check doesn't return error if core WP tables are missing #148

benlk opened this issue Sep 17, 2019 · 3 comments

Comments

@benlk
Copy link
Contributor

benlk commented Sep 17, 2019

Bug Report

Describe the current, buggy behavior

With a database that only contains the posts table from wordpress:

$ wp db check
example.wp_posts                          OK
Success: Database checked.

This check returns a success, despite the database missing most of WordPress' core database tables.

Steps to reproduce

This database was created by wp db importing a botched phpMyAdmin export, which contained only a single table rather than all tables.

You could also probably get similar behavior by selectively deleting tables from an install.

Describe what you would expect as the correct outcome

I would expect an error to be output if any of the tables created by WordPress Core are missing.

Let us know what environment you are running this on

$ wp cli info
OS:	Darwin 18.7.0 Darwin Kernel Version 18.7.0: Thu Jun 20 18:42:21 PDT 2019; root:xnu-4903.270.47~4/RELEASE_X86_64 x86_64
Shell:	/bin/bash
PHP binary:	/usr/local/Cellar/php/7.3.5/bin/php
PHP version:	7.3.5
php.ini used:	/usr/local/etc/php/7.3/php.ini
WP-CLI root dir:	phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:	phar://wp-cli.phar/vendor
WP_CLI phar path:	/Users/user/sites/example
WP-CLI packages dir:	/Users/user/wp-cli/packages/
WP-CLI global config:	
WP-CLI project config:	
WP-CLI version:	2.3.0
@danielbachhuber
Copy link
Member

Thanks for the report, @benlk !

wp db check 'checks the current status of the database.' Generally, wp db commands are agnostic of the WordPress install. You'll want to use wp core is-installed to verify WordPress' health.

@danielbachhuber danielbachhuber closed this as not planned Won't fix, can't repro, duplicate, stale Aug 24, 2023
@benlk
Copy link
Contributor Author

benlk commented Aug 27, 2023

@danielbachhuber I suppose that makes sense.

Could we add documentation to the following locations to direct people to wp core is-installed as an additional check, after the db health check?

@danielbachhuber
Copy link
Member

@benlk Sure! Feel free to submit a pull request with your suggested text.

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

2 participants