Skip VCS-controlled plugins/themes during updates by default#513
Merged
swissspidy merged 4 commits intomainfrom Mar 16, 2026
Merged
Skip VCS-controlled plugins/themes during updates by default#513swissspidy merged 4 commits intomainfrom
swissspidy merged 4 commits intomainfrom
Conversation
…s flag Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update ignore VSC folders by default with update subcommand
Skip VCS-controlled plugins/themes during updates by default
Mar 15, 2026
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prevents wp plugin update / wp theme update from destructively updating VCS checkouts (e.g., git clones) by default, aligning update behavior with WordPress core’s VCS detection and adding an override flag when the destructive behavior is intentional.
Changes:
- Add VCS-checkout detection in
CommandWithUpgrade::update_many()and skip affected plugins/themes by default with a warning. - Introduce
--include-vcsoption to allow updating VCS-controlled plugins/themes when explicitly requested. - Add Behat coverage for skip-by-default and override behavior for both plugins and themes.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/WP_CLI/CommandWithUpgrade.php |
Filters plugin/theme update queue to skip items detected as VCS checkouts unless --include-vcs is provided. |
src/Plugin_Command.php |
Documents new --include-vcs option for wp plugin update. |
src/Theme_Command.php |
Documents new --include-vcs option for wp theme update. |
features/plugin-update.feature |
Adds scenarios for skipping VCS plugins and overriding with --include-vcs. |
features/theme-update.feature |
Adds scenarios for skipping VCS themes and overriding with --include-vcs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Running
wp plugin updateorwp theme updateon a git-cloned plugin/theme would wipe the directory contents, destroying local work. The update commands should gracefully detect and skip VCS checkouts rather than corrupting them.Changes
CommandWithUpgrade::update_many()— after existing item filtering, uses WordPress core'sWP_Automatic_Updater::is_vcs_checkout()to detect.git/.svn/.hg/.bzrin the plugin or theme directory. Matching items are removed from the update queue with a warning. Loadsclass-wp-automatic-updater.php(WP 5.3+) or falls back toclass-wp-upgrader.phpfor older versions.--include-vcsflag — added to bothwp plugin updateandwp theme updateto override the default skip behavior.--include-vcsoverride paths.Example
Original prompt
updatesubcommand #257💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.