Open emerson-oliveira opened 11 months ago
Thanks for the suggestion, @emerson-oliveira
I moved this idea to our wp-cli/ideas
repo. I think it would be best implemented as a community command first.
If you'd like to try your hand at writing such a command, here's a guide to get started: https://make.wordpress.org/cli/handbook/guides/commands-cookbook/
Feature Request
Use Case and Problem Faced
I'm currently using a series of commands to clean and reinstall WordPress, plugins and themes when necessary. However, this process is manual and can be error-prone. Furthermore, there is no easy way to automate this process using WP-CLI.
Proposed solution
I wish WP-CLI included a command to clean and reinstall WordPress, plugins and themes. This command could be something like wp --allow-root core clean --force, which would remove the wp-admin and wp-includes directories, download the latest version of WordPress, reinstall all plugins and themes, and check the integrity of all the files.
This command would help simplify and automate the cleaning and reinstallation process, making it more efficient and less prone to errors.
Possible Disadvantages
A potential disadvantage of this functionality is that it can be dangerous if used incorrectly, as it could result in data loss. Therefore, it would be important to include appropriate safeguards such as clear warnings and the need for user confirmation before proceeding.
Current Usage Example
Here's an example of how I'm currently doing the cleanup and reinstallation: