Skip to content

Fix: Replace automatic plugin deactivation with admin notice#129

Merged
theMasudRana merged 7 commits into
developfrom
fix/wp-org-feedback
May 4, 2026
Merged

Fix: Replace automatic plugin deactivation with admin notice#129
theMasudRana merged 7 commits into
developfrom
fix/wp-org-feedback

Conversation

@theMasudRana
Copy link
Copy Markdown
Collaborator

@theMasudRana theMasudRana commented Apr 30, 2026

Summary

Addresses WP.org plugin review feedback — plugins must not change the activation status of other plugins programmatically.

Type of change

  • Bug fix
  • New feature
  • Enhancement/refactor
  • Documentation update
  • Test update
  • Build/CI/tooling

Related issue(s)

Closes #
Relates to # (if applicable)

What changed

  • Removed deactivate_plugins() call that automatically deactivated the legacy "Carousel Kit" plugin
  • Added legacy_plugin_notice() — displays a dismissible admin warning with a one-click deactivation link when Carousel Kit is still active
  • Updated FAQ in readme.txt to reflect the new manual deactivation flow

Breaking changes

Does this introduce a breaking change? If yes, describe the impact and migration path below.

  • Yes — migration path:
  • No

Testing

Describe how this was tested.

  • Unit tests
  • Manual testing
  • Cross-browser testing (if UI changes)

Test details:

Screenshots / recordings

image

Checklist

  • I have self-reviewed this PR
  • I have added/updated tests where needed
  • I have updated docs where needed
  • I have checked for breaking changes

Copilot AI review requested due to automatic review settings April 30, 2026 04:16
@theMasudRana theMasudRana self-assigned this Apr 30, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread inc/Plugin.php
Comment thread inc/Plugin.php
Comment thread inc/Plugin.php Outdated
Comment thread inc/Plugin.php Outdated
theMasudRana and others added 2 commits April 30, 2026 10:35
…bilities

Co-authored-by: Copilot <copilot@github.com>
Copy link
Copy Markdown

@milindmore22 milindmore22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check with plugin-checker

Comment thread inc/Plugin.php

if ( is_plugin_active( $old_plugin ) ) {
return;
if ( $network_wide ) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

additionally use is_network_admin() to check if users is no network admin site

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in this commit. 1f0c258

image

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings April 30, 2026 13:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread inc/Plugin.php Outdated
Comment thread tests/php/Unit/PluginTest.php Outdated
theMasudRana and others added 2 commits April 30, 2026 19:33
…ve URL encoding

Co-authored-by: Copilot <copilot@github.com>
…tests for order independence

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings April 30, 2026 13:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 expects register_block_type() to be called 6 times, so it doesn’t exercise the branch where RT_CAROUSEL_BUILD_PATH is 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 asserts register_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.

Comment thread readme.txt
Comment thread tests/php/Unit/PluginTest.php Outdated
…ld plugin

Co-authored-by: Copilot <copilot@github.com>
Copy link
Copy Markdown

@milindmore22 milindmore22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@theMasudRana theMasudRana merged commit 279a464 into develop May 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants