<?php

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

/** @var bool $wc_active */
/** @var string $min_php */
/** @var string $cur_php */

?>

<?php if (!$wc_active) : ?>

    <div class="notice notice-error">
        <p>
            <strong><?php esc_html_e('Simple AJAX Product Search for WooCommerce', 'simple-ajax-product-search-for-woocommerce'); ?></strong>
            <?php
            /* translators: %s: WooCommerce plugin URL */
            printf(
                    wp_kses(
                            __('requires <a href="%s">WooCommerce</a> to be installed and active.', 'simple-ajax-product-search-for-woocommerce'),
                            ['a' => ['href' => []]]
                    ),
                    esc_url('https://wordpress.org/plugins/woocommerce/')
            );
            ?>
        </p>
    </div>

<?php endif; ?>

<?php if (version_compare($cur_php, $min_php, '<')) : ?>

    <div class="notice notice-error">
        <p>
            <strong><?php esc_html_e('Simple AJAX Product Search for WooCommerce', 'simple-ajax-product-search-for-woocommerce'); ?></strong>
            <?php
            /* translators: 1: Required PHP version, 2: Current PHP version */
            printf(
                    esc_html__('This plugin requires PHP version %1$s or higher. You are using %2$s.', 'simple-ajax-product-search-for-woocommerce'),
                    esc_html($min_php),
                    esc_html($cur_php)
            );
            ?>
        </p>
    </div>

<?php endif; ?>