<?php
/**
 * Fired when the plugin is uninstalled.
 *
 * Handles cleanup of all plugin data including database tables,
 * options, scheduled tasks, and cached data.
 *
 * @package   Agenistrator
 * @since     1.0.0
 * @author    Alex Ruban <alex@maximum.guru>
 * @author    Maximum Software Inc <contact@maximum.software>
 * @license   GPL-3.0-only
 * @link      https://agenistrator.com/
 *
 * SPDX-FileCopyrightText: 2025-2026 Alex Ruban <alex@maximum.guru>
 * SPDX-FileCopyrightText: 2025-2026 Maximum Software Inc <contact@maximum.software>
 * SPDX-License-Identifier: GPL-3.0-only
 */

// If uninstall not called from WordPress, then exit.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
	exit;
}

// Load Composer autoloader
require_once __DIR__ . '/vendor/autoload.php';

// Load plugin autoloader
require_once __DIR__ . '/includes/class-autoloader.php';
\Agenistrator\Autoloader::get_instance()->register();

// Call Main's uninstall_plugin method which will handle all components
\Agenistrator\Main::get_instance()->uninstall_plugin();
