Prevent plugin installs from clearing unrelated plugins - #311
Open
chubes4 wants to merge 1 commit into
Open
Conversation
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.
Summary
Remove InstallPluginStep first-ZIP-entry slug inference and manual recursive destination deletion. Plugin_Upgrader already derives and clears the package destination when overwrite_package is enabled, while also protecting the plugins root.
A valid ZIP created from the current directory may begin with
./. The old inference treated that as slug., then deletedWP_PLUGIN_DIR/.before WordPress core could apply its protected-directory checks.Changes
Plugin_Upgrader../and assert that an existing unrelated plugin survives while the new plugin installs.Testing
vendor/bin/phpunit components/Blueprints/Tests/Unit/Steps/InstallPluginStepTest.php(6 tests, 17 assertions)vendor/bin/phpunit components/Blueprints/Tests/Unit/Steps(77 tests, 184 assertions)vendor/bin/phpcs -d memory_limit=1G components/Blueprints/Steps/class-installpluginstep.php components/Blueprints/Tests/Unit/Steps/InstallPluginStepTest.phpCloses #310
AI assistance
OpenCode with
openai/gpt-5.6-solwas used to trace the failure through PHP Toolkit and WordPress core, implement the minimal removal of redundant destination handling, and run the regression and component checks. Chris Huber reviewed and remains responsible for every line.