<?php
/**
 * Plugin Name:       NemynAI SEO Autopilot
 * Plugin URI:        https://nemynai.xyz/
 * Description:       Автоматична генерація SEO-статей через Claude AI з розкладом публікацій
 * Version:           2.0.9
 * Requires at least: 6.0
 * Requires PHP:      7.4
 * Author:            Nemynai Group
 * Author URI:        https://webmaster.co.ua
 * License:           GPL v2 or later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       nemynai-seo-autopilot
 */

defined( 'ABSPATH' ) || exit;

define( 'NASEO_VERSION', '2.0.9' );
define( 'NASEO_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'NASEO_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'NASEO_PLUGIN_FILE', __FILE__ );

// Підключаємо всі класи
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
foreach ( [
    'class-freemius',
    'class-license',
    'class-activator',
    'class-ai-generator',
    'class-image-fetcher',
    'class-seo-writer',
    'class-publisher',
    'class-csv-importer',
    'class-scheduler',
    'class-logger',
] as $class ) {
    require_once NASEO_PLUGIN_DIR . 'includes/' . $class . '.php';
}

require_once NASEO_PLUGIN_DIR . 'admin/class-admin.php';

register_activation_hook( __FILE__, [ 'NASEO_Activator', 'activate' ] );
register_deactivation_hook( __FILE__, [ 'NASEO_Activator', 'deactivate' ] );

add_action( 'plugins_loaded', function () {
    new NASEO_Admin();
    new NASEO_Scheduler();
} );
