<?php
/**
 * FacebookAds – LicenseGuard (v2)
 * يعيد التوجيه إلى PluginLicenseGuard المشترك
 */
if (!class_exists('PluginLicenseGuard')) {
    require_once __DIR__ . '/PluginLicenseGuard.php';
}

class FbAdsLicenseGuard
{
    private const SLUG = 'facebook-ads';

    public static function check(): void
    {
        try {
            $key = db()->query("SELECT license_key FROM fb_settings LIMIT 1")->fetchColumn();
        } catch (\Throwable $e) { return; }
        PluginLicenseGuard::check(self::SLUG, (string)$key);
    }

    public static function currentDomain(): string
    {
        return PluginLicenseGuard::currentDomain();
    }

    public static function clearCache(string $key): void
    {
        PluginLicenseGuard::clearCache(self::SLUG, $key);
    }

    /** للتوافق مع الكود القديم */
    public static function bind(string $domain): void {}
}
