<?php
/**
 * Warranty Cart
 *
 * @package           WarrantyCart
 * @author            Al Amin Ahamed
 * @copyright         2025 Al Amin Ahamed
 * @license           GPL-2.0-or-later
 *
 * @wordpress-plugin
 * Plugin Name:       Warranty Cart
 * Plugin URI:        https://github.com/mralaminahamed/warranty-cart
 * Description:       Sell extended warranties on WooCommerce, then run the claims, renewals and expiry reminders that follow. Works with any payment gateway.
 * Version:           2.1.0
 * Requires at least: 6.0
 * Requires PHP:      7.4
 * Author:            Al Amin Ahamed
 * Author URI:        https://alaminahamed.com
 * Text Domain:       warranty-cart
 * License:           GPL v2 or later
 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
 * Requires Plugins:  woocommerce
 *
 * WC requires at least: 8.0
 * WC tested up to:     11.0
 *
 * @phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.ShortPrefixPassed
 */

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

define( 'WARRANTY_CART_VERSION', '2.1.0' );
define( 'WARRANTY_CART_FILE', __FILE__ );
define( 'WARRANTY_CART_URL', plugin_dir_url( __FILE__ ) );
define( 'WARRANTY_CART_PATH', plugin_dir_path( __FILE__ ) );

// Load Composer autoloader for PSR-4 classes
if ( ! file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
	return;
}

require_once __DIR__ . '/vendor/autoload.php';

/**
 * Get main plugin instance
 *
 * @since 1.0.0
 * @return Warranty_Cart Plugin instance.
 */
function warranty_cart(): Warranty_Cart {
	return Warranty_Cart::get_instance();
}

// Initialize plugin
warranty_cart()->init();
