Fix: Replace automatic plugin deactivation with admin notice#129
Conversation
…ead of automatic deactivation
There was a problem hiding this comment.
Pull request overview
This PR updates the plugin’s legacy-plugin handling to comply with WP.org review requirements by removing programmatic deactivation of the old “Carousel Kit” plugin and replacing it with an admin-facing prompt.
Changes:
- Removed the automatic legacy plugin deactivation flow and replaced it with an admin notice + deactivation link.
- Added a new
legacy_plugin_notice()hooked into the admin notice system. - Updated the readme FAQ to reflect the new manual deactivation step.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
inc/Plugin.php |
Replaces silent legacy plugin deactivation with an admin notice containing a deactivation link. |
readme.txt |
Updates upgrade instructions to match the new notice-driven/manual deactivation flow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <copilot@github.com>
…bilities Co-authored-by: Copilot <copilot@github.com>
milindmore22
left a comment
There was a problem hiding this comment.
Please check with plugin-checker
|
|
||
| if ( is_plugin_active( $old_plugin ) ) { | ||
| return; | ||
| if ( $network_wide ) { |
There was a problem hiding this comment.
additionally use is_network_admin() to check if users is no network admin site
Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ve URL encoding Co-authored-by: Copilot <copilot@github.com>
…tests for order independence Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
tests/php/Unit/PluginTest.php:209
test_register_blocks_handles_missing_build_path()currently expectsregister_block_type()to be called 6 times, so it doesn’t exercise the branch whereRT_CAROUSEL_BUILD_PATHis undefined (and block registration is skipped). Consider adding coverage for the undefined-constant path (e.g., a separate-process test without defining the constant that assertsregister_block_type()is never called), and renaming this test if it’s meant to cover the defined-constant case instead.
public function test_register_blocks_handles_missing_build_path(): void {
// The actual behavior check: register_block_type should be called
// for each block when the constant is defined (as it is in our tests).
Functions\expect( 'register_block_type' )->times( 6 );
$instance = $this->getPluginInstance();
$this->invokeMethod( $instance, 'register_blocks' );
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ld plugin Co-authored-by: Copilot <copilot@github.com>

Summary
Addresses WP.org plugin review feedback — plugins must not change the activation status of other plugins programmatically.
Type of change
Related issue(s)
Closes #
Relates to # (if applicable)
What changed
deactivate_plugins()call that automatically deactivated the legacy "Carousel Kit" pluginlegacy_plugin_notice()— displays a dismissible admin warning with a one-click deactivation link when Carousel Kit is still activeBreaking changes
Does this introduce a breaking change? If yes, describe the impact and migration path below.
Testing
Describe how this was tested.
Test details:
Screenshots / recordings
Checklist