<?php
/**
 * Pro-detection layer for the free plugin. The actual Pro features live in
 * a separate plugin (shieldforge-pro) which is distributed via Freemius and
 * hooks into the `shieldforge_is_pro` filter when its license is active.
 *
 * This class also honours the SHIELDFORGE_FORCE_PRO wp-config override so
 * developers can flip on Pro UI for local testing without a license.
 *
 * @package Brainwerk Security Suite
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

class Shieldforge_Pro {

    public static function register( Shieldforge_Loader $loader ) {
        $loader->add_filter( 'shieldforge_is_pro', __CLASS__, 'filter_is_pro' );
    }

    public static function filter_is_pro( $current ) {
        if ( $current ) {
            return $current;
        }
        if ( defined( 'SHIELDFORGE_FORCE_PRO' ) && SHIELDFORGE_FORCE_PRO ) {
            return true;
        }
        return false;
    }

    public static function is_pro() {
        return (bool) apply_filters( 'shieldforge_is_pro', false );
    }
}
