<?php

/**
 * Plugin Name:         __PLUGIN_TITLE__
 * Plugin URI:          https://wordpress.org/plugins/__PLUGIN_NAME__
 * Description:         __PLUGIN_TITLE__ — built on the WPSuitePress framework.
 * Version:             1.0.0
 * Requires at least:   5.2
 * Requires PHP:        7.4
 * Author:              Plugin_Author
 * Author URI:          https://suitepress.org/__PLUGIN_NAME__
 * License:             GPL v2 or later
 * License URI:         https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:         __PLUGIN_NAME__
 * Domain Path:         /language
 */

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

if (! defined('__CONST_PREFIX___VERSION')) {
    define('__CONST_PREFIX___VERSION', '1.0.0');
    define('__CONST_PREFIX___DB_VERSION', '1.0.0');
    define('__CONST_PREFIX___FILE', __FILE__);
    define('__CONST_PREFIX___PATH', plugin_dir_path(__FILE__));
    define('__CONST_PREFIX___URL', plugin_dir_url(__FILE__));
    define('__CONST_PREFIX___BUILD_PATH', __CONST_PREFIX___PATH . 'public/assets');
    define('__CONST_PREFIX___BUILD_URL', __CONST_PREFIX___URL . 'public/assets');
}

$autoload = __DIR__ . '/vendor/autoload.php';

if (! file_exists($autoload)) {
    add_action('admin_notices', function () {
        echo '<div class="notice notice-error"><p>';
        echo esc_html__('__PLUGIN_TITLE__ is missing its Composer dependencies. Run "composer install" in the plugin directory.', '__PLUGIN_NAME__');
        echo '</p></div>';
    });
    return;
}

require_once $autoload;

/*
 * Boot the application. boot/app.php returns a closure that
 * receives the main plugin file and returns the Application.
 */
$bootstrap = require __DIR__ . '/boot/app.php';

return $bootstrap(__FILE__);
