<?php
/**
 * Free edition sidebar footer — static “Get Pro” link (no license checks).
 *
 * When ZERTI Pro is active, Pro replaces this footer via zerti_admin_edition_footer.
 */

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

add_action('zerti_admin_edition_footer', 'zerti_render_free_static_get_pro_footer', 10);

/**
 * Static shop CTA shown when the Pro add-on is not installed.
 */
function zerti_render_free_static_get_pro_footer(): void
{
    if (defined('ZERTI_PRO_VERSION')) {
        return;
    }

    $shop_url = 'https://zerti.shop';
    ?>
    <div
        class="zerti-sidebar-edition-footer"
        data-zerti-edition-footer="1"
        data-zerti-edition-state="shop"
    >
        <a
            class="zerti-get-pro-btn"
            href="<?php echo esc_url($shop_url); ?>"
            target="_blank"
            rel="noopener noreferrer"
            data-zerti-get-pro-action="shop"
        >
            <i class="fa-solid fa-crown zerti-get-pro-btn__icon" aria-hidden="true"></i>
            <span class="zerti-get-pro-btn__label"><?php esc_html_e('Get Pro Version', 'zerti'); ?></span>
        </a>
    </div>
    <?php
}
