<?php
/**
 * Plugin Name: Stintlief WebP Converter
 * Plugin URI: https://wordpress.org/plugins/stintlief-webp-converter/
 * Description: Automatically converts uploaded images to optimized WebP format with safe fallbacks, optional original backups, and easy restoration tools.
 * Version: 1.1.0
 * Requires at least: 5.8
 * Requires PHP: 7.4
 * Author: Stintlief Technologies
 * Author URI: https://stintlief.com/
 * License: GPLv2 or later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: stintlief-webp-converter
 * Domain Path: /languages
 *
 * @package STWP
 * @version 1.0.0
 */

// If this file is called directly, abort.
if ( ! defined( 'ABSPATH' ) ) {
	die( 'Direct access not allowed.' );
}

// Define plugin constants.
define( 'STWP_VERSION', '1.0.0' );
define( 'STWP_PLUGIN_FILE', __FILE__ );
define( 'STWP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'STWP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'STWP_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );

// Load core classes.
require_once STWP_PLUGIN_DIR . 'includes/class-stwp-utils.php';
require_once STWP_PLUGIN_DIR . 'includes/class-stwp-converter.php';
require_once STWP_PLUGIN_DIR . 'includes/class-stwp-progress.php';
require_once STWP_PLUGIN_DIR . 'includes/class-stwp-bulk-queue.php';
require_once STWP_PLUGIN_DIR . 'includes/class-stwp-job-runner.php';
require_once STWP_PLUGIN_DIR . 'admin/class-stwp-admin.php';

/**
 * Initialize plugin functionality.
 *
 * @since 1.0.0
 */
function stwp_init() {
	\STWP\Admin::init();
	\STWP\Converter::init();
	\STWP\Job_Runner::init();
}
add_action( 'plugins_loaded', 'stwp_init', 10 );
