Skip to main content

benecaster_get_license_plan()

Returns the current license plan slug.

Access: Free (can be called from any context)
Since: Batch 2


Signature

benecaster_get_license_plan(): string|null

Return Value

The current plan slug as a string, or null when no license is active.

Plan slugs:

Slug Plan
'launch' Launch (free tier — card required, up to 10 subscribers)
'starter' Starter
'growth' Growth
'pro' Pro
'multi-show' Multi-Show
'studio' Studio
null No active license

Usage

// Enable a feature only on Growth or higher
$plan = benecaster_get_license_plan();
$high_tier_plans = [ 'growth', 'pro', 'multi-show', 'studio' ];

if ( in_array( $plan, $high_tier_plans, true ) ) {
    // Register growth-tier feature
}
// Display a plan badge in a custom admin widget
add_action( 'benecaster_dashboard_cards', function( array $cards ): array {
    $plan = benecaster_get_license_plan();
    $cards[] = [
        'id'    => 'my_addon_plan_card',
        'title' => 'Current Plan',
        'value' => $plan ? ucfirst( $plan ) : 'None',
    ];
    return $cards;
} );

Notes

  • Reads from the locally cached benecaster_license_plan option — no HTTP call. Safe to call on every request.
  • Returns 'launch' (not null) when the free Launch plan is active with a valid license key.
  • Returns null when benecaster_license_status is 'none' or when no key has been entered.

  • benecaster_is_premium() — quick boolean check (returns false for 'launch' and null)
  • benecaster_addon_is_active() — checks whether a specific add-on is available