<?php
/**
 * Brainwerk Security Suite — Privacy-first WordPress Security
 *
 * @package           Brainwerk Security Suite
 * @author            Stefan Kogelgruber
 * @copyright         2026 Stefan Kogelgruber
 * @license           GPL-2.0-or-later
 *
 * @wordpress-plugin
 * Plugin Name:       Brainwerk Security Suite
 * Description:       Privacy-first WordPress security suite, designed for EU compliance and Multisite installations. Lightweight, transparent, GDPR-ready.
 * Version:           0.18.0
 * Requires at least: 5.8
 * Requires PHP:      7.4
 * Author:            Stefan Kogelgruber
 * Author URI:        https://brainwerk.at
 * License:           GPL v2 or later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       brainwerk-security-suite
 * Domain Path:       /languages
 * Network:           true
 */

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

define( 'SHIELDFORGE_VERSION', '0.18.0' );
define( 'SHIELDFORGE_DB_VERSION', '4' );
define( 'SHIELDFORGE_FILE', __FILE__ );
define( 'SHIELDFORGE_PATH', plugin_dir_path( __FILE__ ) );
define( 'SHIELDFORGE_URL', plugin_dir_url( __FILE__ ) );
define( 'SHIELDFORGE_BASENAME', plugin_basename( __FILE__ ) );
define( 'SHIELDFORGE_OPTIONS_KEY', 'shieldforge_settings' );
define( 'SHIELDFORGE_DB_VERSION_KEY', 'shieldforge_db_version' );

require_once SHIELDFORGE_PATH . 'includes/class-shieldforge-activator.php';
require_once SHIELDFORGE_PATH . 'includes/class-shieldforge-deactivator.php';
require_once SHIELDFORGE_PATH . 'includes/class-shieldforge-loader.php';
require_once SHIELDFORGE_PATH . 'includes/class-shieldforge.php';

register_activation_hook( __FILE__, array( 'Shieldforge_Activator', 'activate' ) );
register_deactivation_hook( __FILE__, array( 'Shieldforge_Deactivator', 'deactivate' ) );

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

/**
 * Public helper — `true` if the current install has an active Pro license
 * (or the SHIELDFORGE_FORCE_PRO override). Wraps the `shieldforge_is_pro`
 * filter so callers don't need to remember the filter name.
 */
function shieldforge_is_pro() {
    if ( class_exists( 'Shieldforge_Pro' ) ) {
        return Shieldforge_Pro::is_pro();
    }
    return (bool) apply_filters( 'shieldforge_is_pro', false );
}
