<?php

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

function wnc_is_pro_active() {
    if (!function_exists('wnc_fs')) {
        return false;
    }

    return (bool) wnc_fs()->can_use_premium_code();
}

function wnc_get_upgrade_url() {
    if (!function_exists('wnc_fs')) {
        return 'https://wherenext.dev/wordpress-connector/';
    }

    return wnc_fs()->get_upgrade_url();
}

/**
 * Return the Freemius account URL with the licence activation dialog open.
 *
 * @return string
 */
function wnc_get_license_activation_url() {
    if (!function_exists('wnc_fs')) {
        return admin_url('admin.php?page=where-next');
    }

    return wnc_fs()->get_account_url(false, array(
        'activate_license' => 'true',
    ));
}
