Skip to content

Commit df92456

Browse files
adekbadekclaude
andauthored
feat(cli): teams-for-memberships diagnostics command (#4662)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ea672fd commit df92456

2 files changed

Lines changed: 668 additions & 0 deletions

File tree

includes/cli/class-initializer.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public static function init() {
3030
include_once NEWSPACK_ABSPATH . 'includes/cli/class-optional-modules.php';
3131
include_once NEWSPACK_ABSPATH . 'includes/cli/class-woocommerce-subscriptions.php';
3232
include_once NEWSPACK_ABSPATH . 'includes/cli/class-ga4-dimensions.php';
33+
include_once NEWSPACK_ABSPATH . 'includes/cli/class-teams-for-memberships-diagnostics.php';
3334
}
3435

3536
/**
@@ -81,6 +82,15 @@ public static function register_comands() {
8182
WP_CLI::add_command( 'newspack migrate-expired-subscriptions', [ 'Newspack\CLI\WooCommerce_Subscriptions', 'migrate_expired_subscriptions' ] );
8283
WP_CLI::add_command( 'newspack ga4-dimensions', 'Newspack\CLI\GA4_Dimensions' );
8384

85+
// Only register the Teams for Memberships diagnostics command on sites where the
86+
// SkyVerge plugin is active. No reason to surface it in `wp help` otherwise.
87+
if ( class_exists( 'WC_Memberships_For_Teams_Loader' ) ) {
88+
WP_CLI::add_command(
89+
'newspack teams-for-memberships diagnostics',
90+
[ 'Newspack\CLI\Teams_For_Memberships_Diagnostics', 'diagnostics' ]
91+
);
92+
}
93+
8494
Optional_Modules::register_commands();
8595
}
8696
}

0 commit comments

Comments
 (0)