<?php
namespace WPUltimateSecurity\UltimateSecurity\Presentation\Admin;
use WPUltimateSecurity\UltimateSecurity\Support\Helpers\PluginDetection;

class AdminNotices
{
    public static function register()
    {
        add_action('admin_notices', [self::class, 'security_plugin_conflict_notice']);
    }
    public static function security_plugin_conflict_notice()
    {
        $conflicts = PluginDetection::get_conflicting_plugins();
        if (empty($conflicts)) {
            return;
        }

        echo '<div class="notice notice-warning is-dismissible">';
        echo '<p><strong>' . esc_html__('Ultimate Security:', 'ultimate-security') . '</strong> ' . esc_html__('We detected another security plugin (', 'ultimate-security') .
            esc_html($conflicts[0]['name']) . '). ';
        echo esc_html__('Running multiple security plugins may cause conflicts.Keep only one security plugin active.', 'ultimate-security');
        echo '</div>';
    }
}