<?php
/**
 * Plugin Name:       Agenistrator
 * Plugin URI:        https://agenistrator.com/
 * Description:       Agentic AI assistant for WordPress admin dashboard. Chat naturally to manage your website, search and edit content, analyze data and complete tasks.
 * Version:           1.0.1
 * Requires at least: 5.3
 * Requires PHP:      7.4
 * Author:            Maximum.Software
 * Author URI:        https://maximum.software/
 * Text Domain:       agenistrator
 * Domain Path:       /languages
 * License:           GPL-3.0-only
 * License URI:       https://www.gnu.org/licenses/gpl-3.0.html
 *
 * @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
 */

// Direct access prevention
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

// Plugin constants
define( 'AGENISTRATOR_VERSION', '1.0.1' );
define( 'AGENISTRATOR_PLUGIN_FILE', __FILE__ );

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

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

// Initialize request start time for execution time tracking
\Agenistrator\PHP_Utils::init_request_start_time();

// Initialize the plugin and register hooks
\Agenistrator\Main::get_instance()->register_hooks();

if ( class_exists( '\YahnisElsts\PluginUpdateChecker\v5\PucFactory' ) ) {
	\YahnisElsts\PluginUpdateChecker\v5\PucFactory::buildUpdateChecker(
		'https://wp-updates.maximum.software/?action=get_metadata&slug=agenistrator',
		AGENISTRATOR_PLUGIN_FILE,
		'agenistrator'
	);
}
