<?php

/**
 * Plugin Name: 	LinkFiliate
 * Description: 	Create branded short links, track clicks, and manage all your affiliate URLs.
 * Requires at least: 6.2
 * Requires PHP:      7.4
 * Author:          Schorpy
 * Author URI:      https://schorpy.github.io
 * License:         GPLv2 or later
 * License URI:     http://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: linkfiliate
 * Version:         1.0.1
 *
 * @package LinkFiliate
 */



defined('ABSPATH') || exit;
// Minimum required WP version
global $wp_version;
if (version_compare($wp_version, '6.2', '<')) {
	wp_die(
		'This plugin requires WordPress version 6.2 or higher.',
		'Plugin Requirements Not Met',
		['back_link' => true]
	);
}


define('LINKFILIATE_PLUGIN_NAME', 'LinkFiliate Plugin');
define('LINKFILIATE_PLUGIN_VERSION', '1.0.0');
define('LINKFILIATE_PLUGIN_FILE', __FILE__);
define('LINKFILIATE_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('LINKFILIATE_PLUGIN_URL', plugin_dir_url(__FILE__));
define('LINKFILIATE_ASSETS_URL', LINKFILIATE_PLUGIN_URL . '/assets');
define('LINKFILIATE_ROUTE_PREFIX', 'linkfiliate/v1');
define('LINKFILIATE_DB_BASE', 'linkfiliate');

// load composer
require_once __DIR__ . '/vendor/autoload.php';

/**
 * Initializes the plugin when plugins are loaded.
 *
 * @since 1.0.0
 * @return void
 */
function LINKFILIATE_init()
{
	\LinkFiliate\Core\Plugin::getInstance()->init();
}

// Hook for plugin initialization.
add_action('plugins_loaded', 'LINKFILIATE_init');

// Hook for plugin activation.
register_activation_hook(__FILE__, [\LinkFiliate\Core\Plugin::class, 'activate']);
register_deactivation_hook(__FILE__, [\LinkFiliate\Core\Plugin::class, 'deactivate']);
