<?php
/**
 * AIIO_License — Freemius wrapper. See docs/FREEMIUS_SETUP.md.
 */
if (!defined('ABSPATH')) exit;

class AIIO_License {

    public static function is_pro(): bool {
        $fs = function_exists('aiio_freemius') ? aiio_freemius() : null;
        return $fs ? (bool) $fs->is_paying() : false;
    }

    public static function plan_label(): string {
        $fs = function_exists('aiio_freemius') ? aiio_freemius() : null;
        if (!$fs) return 'Free';
        if ($fs->is_plan('agency', true)) return 'Agency';
        if ($fs->is_paying()) return 'Pro';
        if (method_exists($fs, 'is_trial') && $fs->is_trial()) return 'Trial';
        return 'Free';
    }

    /** @see aiio_can_automate() */
    public static function can_automate(): bool {
        return aiio_can_automate();
    }
}
