refactor(2meet-data-optimizer): retire the SSO AddOn recommendation

- missing_integration_addons() no longer asks for the SSO AddOn when
  2meet-hub-core / 2meet-spoke-sso are active: they register their own
  tables and the `sso` values belong in usermeta (benchmark: no
  measurable gain from the flat table for by-user-id access).
- `sso` joins the deprecated AddOns; for hub / spoke / sso the notice says
  they go without replacement and to run
  `wp tmdo bridge-restore-native user --group=sso --retire` first.
- Verify: core unit 658 / integration 479 green, phpcs clean
- PR: PR-043
This commit is contained in:
2026-09-26 04:07:40 +08:00
parent 44a188b7ee
commit ecf4ff4938
4 changed files with 13 additions and 24 deletions
+5 -3
View File
@@ -43,15 +43,17 @@ class DeprecatedAddonsNoticeTest extends TestCase {
$this->assertStringContainsString( 'PARTNER-REGISTRATION.md', $html );
}
public function test_hub_and_spoke_point_to_the_sso_addon(): void {
$GLOBALS['_wp_options']['active_plugins'] = array( '2meet-data-optimizer-spoke-addon/2meet-data-optimizer-spoke-addon.php' );
public function test_sso_hub_and_spoke_addons_are_deprecated_without_replacement(): void {
$this->activate( 'hub', 'sso' );
$this->assertSame( array( 'hub', 'sso' ), TMDO_Deprecated_Addons_Notice::active() );
ob_start();
TMDO_Deprecated_Addons_Notice::render();
$html = (string) ob_get_clean();
$this->assertStringContainsString( '2meet-data-optimizer-spoke-addon', $html );
$this->assertStringContainsString( '2meet-data-optimizer-sso-addon', $html );
$this->assertStringContainsString( '不需替代', $html );
$this->assertStringContainsString( 'bridge-restore-native user --group=sso --retire', $html );
}
public function test_no_notice_when_none_active_or_user_cannot_manage(): void {
+2 -12
View File
@@ -83,19 +83,9 @@ class MissingIntegrationAddonsTest extends TestCase {
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function test_hub_or_spoke_without_the_sso_addon_is_reported(): void {
eval( 'final class TMSO_Plugin {}' );
$this->assertSame( array( '2meet Hub / Spoke SSO' => '2meet-data-optimizer-sso-addon' ), TMDO_Compatibility::missing_integration_addons() );
}
/**
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function test_hub_with_the_sso_addon_is_fine(): void {
public function test_hub_and_spoke_need_no_addon(): void {
eval( 'final class TMHC_Plugin {}' );
eval( 'final class TMDO_SSO_Integration {}' );
eval( 'final class TMSO_Plugin {}' );
$this->assertSame( array(), TMDO_Compatibility::missing_integration_addons() );
}