<?php

namespace WPUltimateSecurity\UltimateSecurity\Support\Validation;

class ProValidation
{
    public static function ultimate_security_is_pro()
    {
        return self::ultimate_security_validate_pro_access();
    }
    private static function ultimate_security_validate_pro_access()
    {
        // Check if pro constant is defined
        if (!defined('ULTIMATE_SECURITY_PRO') || ULTIMATE_SECURITY_PRO !== true) {
            return false;
        }

        // Check if pro files exist (basic integrity check)
        return self::ultimate_security_verify_pro_files_exist();
    }
    public static function ultimate_security_verify_pro_files_exist()
    {
        // 1. Ensure the class exists → Pro plugin is installed & autoloader loaded
        if (!class_exists(\WPUltimateSecurity\UltimateSecurityPro\Bootstrap\Lifecycle\ProManagement::class)) {
            return false;
        }

        // 2. Ensure required method exists
        if (!method_exists(\WPUltimateSecurity\UltimateSecurityPro\Bootstrap\Lifecycle\ProManagement::class, 'check_pro_activation')) {
            return false;
        }

        // 3. ensure check_pro_activation() returns true
        if (\WPUltimateSecurity\UltimateSecurityPro\Bootstrap\Lifecycle\ProManagement::check_pro_activation() !== true) {
            return false;
        }

        // 4. Ensure constant exists
        if (!defined('ULTIMATE_SECURITY_PRO_VERSION')) {
            return false;
        }

        // Everything is OK
        return true;
    }



}
