<?php
/**
 * Brainwerk SEO Suite — Privacy-first WordPress SEO & Analytics
 *
 * @package           Brainwerk SEO Suite
 * @author            Stefan Kogelgruber
 * @copyright         2026 Stefan Kogelgruber
 * @license           GPL-2.0-or-later
 *
 * @wordpress-plugin
 * Plugin Name:       Brainwerk SEO Suite
 * Plugin URI:        https://seoforge.brainwerk.at
 * Description:       Privacy-first WordPress SEO suite with built-in visitor analytics, source tracking, on-page analyzer, sitemap, redirects, 404-logger and Schema.org. Multisite-ready and privacy-focused.
 * Version:           1.10.3
 * Requires at least: 6.2
 * Requires PHP:      7.4
 * Author:            Stefan Kogelgruber
 * License:           GPL v2 or later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       brainwerk-seo-suite
 * Domain Path:       /languages
 * Network:           true
 */

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

define( 'SEOFORGE_VERSION', '1.10.3' );
define( 'SEOFORGE_DB_VERSION', '8' );
define( 'SEOFORGE_FILE', __FILE__ );
define( 'SEOFORGE_PATH', plugin_dir_path( __FILE__ ) );
define( 'SEOFORGE_URL', plugin_dir_url( __FILE__ ) );
define( 'SEOFORGE_BASENAME', plugin_basename( __FILE__ ) );
define( 'SEOFORGE_OPTIONS_KEY', 'seoforge_settings' );
define( 'SEOFORGE_DB_VERSION_KEY', 'seoforge_db_version' );

// Shipped default for the SEO benchmark network's self-service registration
// token. Split into its own file so PHPUnit can load exactly this constant
// without the rest of the plugin bootstrap — see tests/bootstrap.php.
require_once __DIR__ . '/includes/intel-app-token.php';

require_once SEOFORGE_PATH . 'includes/class-seoforge-cron-hooks.php';

// Freemius must boot BEFORE anything else so its hooks register first.
require_once SEOFORGE_PATH . 'includes/class-seoforge-freemius.php';

require_once SEOFORGE_PATH . 'includes/class-seoforge-activator.php';
require_once SEOFORGE_PATH . 'includes/class-seoforge-deactivator.php';
require_once SEOFORGE_PATH . 'includes/class-seoforge-loader.php';
require_once SEOFORGE_PATH . 'includes/class-seoforge.php';

register_activation_hook( __FILE__, array( 'Seoforge_Activator', 'activate' ) );
register_deactivation_hook( __FILE__, array( 'Seoforge_Deactivator', 'deactivate' ) );

add_action( 'plugins_loaded', function () {
    Seoforge::instance()->run();
} );
