<?php

/**
 * Plugin Name: Bato Cookie Consent
 * Description: WordPress integration for the Bato Cookie Consent JavaScript library.
 * Version: 1.1.0
 * Author: Bato Web Agency
 * Author URI: https://profiles.wordpress.org/batowebagency/
 * License: GPLv3 or later
 * License URI: https://www.gnu.org/licenses/gpl-3.0.html
 * Text Domain: bato-cookie-consent
 * Domain Path: /languages
 *
 * @package BatoCookieConsent
 */

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

define('BATO_COOKIE_CONSENT_VERSION', '1.1.0');
define('BATO_COOKIE_CONSENT_FILE', __FILE__);
define('BATO_COOKIE_CONSENT_PATH', plugin_dir_path(__FILE__));
define('BATO_COOKIE_CONSENT_URL', plugin_dir_url(__FILE__));

require_once BATO_COOKIE_CONSENT_PATH . 'includes/settings/class-settings-languages.php';
require_once BATO_COOKIE_CONSENT_PATH . 'includes/settings/class-settings-defaults.php';
require_once BATO_COOKIE_CONSENT_PATH . 'includes/settings/class-settings-sanitizer.php';
require_once BATO_COOKIE_CONSENT_PATH . 'includes/settings/class-settings-metadata.php';
require_once BATO_COOKIE_CONSENT_PATH . 'includes/settings/class-settings-frontend-config.php';
require_once BATO_COOKIE_CONSENT_PATH . 'includes/class-settings.php';
require_once BATO_COOKIE_CONSENT_PATH . 'includes/class-rest-controller.php';
require_once BATO_COOKIE_CONSENT_PATH . 'includes/class-admin.php';
require_once BATO_COOKIE_CONSENT_PATH . 'includes/class-frontend.php';
require_once BATO_COOKIE_CONSENT_PATH . 'includes/class-plugin.php';

register_activation_hook(
    __FILE__,
    static function () {
        Bato_Cookie_Consent_Settings::install_defaults();
    }
);

add_action(
    'plugins_loaded',
    static function () {
        Bato_Cookie_Consent_Plugin::instance()->init();
    }
);
