<?php
/**
 * Postomatic Plugin.
 *
 * A powerful plugin for creating multiple
 * high-quality blog posts with SEO-optimized content.
 *
 * PHP Version 5.6
 *
 * @package          Postomatic
 * @category         Plugin
 * @copyright        2024 Buildomatics
 * @license          GPL-2.0-or-later https://www.gnu.org/licenses/gpl-2.0.html
 * @link             https://buildomatics.com/postomatic
 * @since            1.0.0
 * @php              8.0
 * @wordpress-plugin
 * Plugin Name: Postomatic
 * Plugin URI:  https://buildomatics.com/postomatics
 * Description: Postomatic allows you to quickly create multiple blog posts with
 *              just a few clicks. It suggests SEO-friendly blog titles, and
 *              automatically generates relevant keywords, categories, and tags
 *              for each post.
 * Version:     1.2.54
 * Author:      Buildomatics
 * Author URI:  https://buildomatics.com
 * License:     GPL2
 * Version: 5.6
 * Requires at least: 5.8
 */

namespace Postomatic;

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

if ( version_compare( PHP_VERSION, '5.6', '<' ) ) {
	// We'll handle this notice in the Admin_Hooks class.
	return;
}

/**
 * Plugin Core Constants.
 *
 * Define essential constants for the Postomatic plugin.
 */
// Plugin version and basic information.
define( 'POSTOMATIC_VERSION', '1.2.54' );
define( 'POSTOMATIC_PLUGIN_NAME', 'postomatic' );

// Plugin paths and URLs.
define( 'POSTOMATIC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'POSTOMATIC_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'POSTOMATIC_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );

/**
 * AJAX callback to get attachment image HTML using WordPress standards.
 *
 * This section handles the AJAX functionality for retrieving and formatting
 * attachment images according to WordPress coding standards.
 */

// Autoload Plugin Classes.
require_once POSTOMATIC_PLUGIN_DIR . 'includes/autoloader.php';

// Include essential plugin components.
require_once POSTOMATIC_PLUGIN_DIR . 'includes/class-constants.php';

// Register lifecycle hooks.
Core\Lifecycle_Manager::register_hooks();

// Load core functionality.
$postomatic_core = new Core\Core();
$postomatic_core->run();


// Load API Endpoints.
require_once POSTOMATIC_PLUGIN_DIR . 'includes/class-api-loader.php';

// Load API endpoints.
Core\API_Loader::load_api_endpoints();

// Load internationalization (i18n).
require_once POSTOMATIC_PLUGIN_DIR . 'includes/i18n.php';
