<?php

namespace VulnTitan\SpamProtection\Providers;

use VulnTitan\Services\ContactFormSpamService;
use VulnTitan\SpamProtection\FormProviderAdapterInterface;

class ContactForm7ProviderAdapter implements FormProviderAdapterInterface
{
    public function getKey(): string
    {
        return 'contact_form_7';
    }

    public function getLabel(): string
    {
        return 'Contact Form 7';
    }

    public function isAvailable(): bool
    {
        return class_exists('\WPCF7_Submission') && class_exists('\WPCF7_ContactForm');
    }

    public function isEnabled(array $settings): bool
    {
        return !empty($settings['form_shield_enabled']) && !empty($settings['form_provider_cf7_enabled']);
    }

    public function boot(): void
    {
        ContactFormSpamService::boot();
    }
}
