<?php
/**
 * Plugin Name: VulnTitan - Malware Scanner, Vulnerability Scanner & Security
 * Plugin URI: https://vulntitan.com/vulntitan/
 * Description: VulnTitan is a WordPress security plugin with vulnerability scanning, malware detection, file integrity monitoring, comment and form anti-spam protection, and a built-in firewall with WAF payload rules and login protection.
 * Version: 2.1.20
 * Author: Jaroslav Svetlik
 * Author URI: https://vulntitan.com
 * License: GPLv2 or later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: vulntitan
 * Domain Path: /languages
 * Requires PHP: 7.4
 * Tested up to: 7.0
 */

defined('ABSPATH') || exit;

// Use Composer autoload
$autoload = __DIR__ . '/vendor/autoload.php';
if (file_exists($autoload)) {
    require_once $autoload;
} else {
    wp_die('Autoload file missing.');
}

use VulnTitan\Plugin;

// Development mode to bust caching
define('VULNTITAN_DEVELOPMENT', false);

// Define plugin constants
define('VULNTITAN_PLUGIN_VERSION', VULNTITAN_DEVELOPMENT ? uniqid() : '2.1.20');
define('VULNTITAN_PLUGIN_BASENAME', plugin_basename(__FILE__));
define('VULNTITAN_PLUGIN_DIR', untrailingslashit(plugin_dir_path(__FILE__)));
define('VULNTITAN_PLUGIN_URL', untrailingslashit(plugins_url('', __FILE__)));
define('VULNTITAN_BASELINE_FILE', VULNTITAN_PLUGIN_DIR . '/storage/vulntitan_baseline.json');

register_activation_hook(__FILE__, [Plugin::class, 'activate']);
register_deactivation_hook(__FILE__, [Plugin::class, 'deactivate']);

// Bootstrap plugin
add_action('plugins_loaded', function () {
    (new Plugin())->init();
});
