Skip to main content

benecaster_is_upgrade_required()

Returns true when the site is on the Launch plan and has reached the 10-subscriber cap.

Access: Free (can be called from any context)
Since: feature/launch-tier-cleanup


Signature

benecaster_is_upgrade_required(): bool

Return Value

true when the last /validate response returned upgrade_required: true — that is, the site is on the Launch plan and its paying subscriber count is at or above 10. false in all other cases: paid plans, Launch plans below the cap, and free (WordPress.org) installs.

This function reads from the locally cached benecaster_license_upgrade_required option. It does not make an HTTP call to the license server and is safe to call on every request.

The value is refreshed during each daily validation run. It is cleared on plugin deactivation and on a failed or invalid validation response.


Usage

// Show a custom notice in your add-on when the podcaster is at the cap
add_action( 'admin_notices', function(): void {
    if ( ! benecaster_is_upgrade_required() ) {
        return;
    }
    echo '<div class="notice notice-warning"><p>'
        . 'Your Benecaster Launch plan has reached 10 paying subscribers. '
        . 'Upgrade to continue accepting new paid subscribers.'
        . '</p></div>';
} );
// Prevent add-on features from registering when an upgrade is required
add_action( 'benecaster_boot', function(): void {
    if ( ! benecaster_is_premium() || benecaster_is_upgrade_required() ) {
        return;
    }
    // Register premium add-on services here
} );

Notes

  • The upgrade-required state applies only to the Launch plan. Paid plans never return upgrade_required: true from the license server.
  • The Benecaster core plugin already displays a non-dismissible admin notice when upgrade_required is true. Use this function to integrate the cap state into add-on logic or external monitoring — not to duplicate the built-in notice.
  • Do not read benecaster_license_upgrade_required directly from add-on code — use this function. The internal option name may change; this function is the stable contract.

  • benecaster_is_premium() — returns whether any paid plan is active
  • benecaster_get_license_plan() — returns the current plan slug
  • Launch Plan Subscriber Limit — explains the cap, cap-mode behavior, and how to upgrade