<?php
/**
 * Plugin Name:       Pixalia Image Assistant
 * Description:       Manages featured images and generates high-quality AI images directly within WordPress using the Pixalia API.
 * Version:           1.0.3
 * Requires at least: 6.2
 * Requires PHP:      8.2
 * Author:            pixalia_team
 * Author URI:        https://pixalia.me/
 * License:           GPLv2 or later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       pixalia-image-assistant
 * Domain Path:       /languages
 */

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

// 定数を定義
define( 'PXBX_PLUGIN_FILE', __FILE__ );
define( 'PXBX_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
define( 'PXBX_PLUGIN_URL', plugin_dir_url( __FILE__ ) );

require_once PXBX_PLUGIN_PATH . 'vendor/autoload.php';

use Pixalia\ImageAssistant\Core\Activator;
use Pixalia\ImageAssistant\Core\Deactivator;
use Pixalia\ImageAssistant\Core\Initiator;

// 有効化・無効化フックを登録
register_activation_hook( PXBX_PLUGIN_FILE, [ Activator::class, 'activate' ] );
register_deactivation_hook( PXBX_PLUGIN_FILE, [ Deactivator::class, 'deactivate' ] );

/**
 * プラグインのメイン処理を開始する関数
 *
 * @return void
 */
function pixalia_image_assistant_run() {
	new Initiator();
}
// 関数を直接呼び出してプラグインを開始
pixalia_image_assistant_run();