<?php
/**
 * Plugin Name: DonorCore - Donations for WooCommerce
 * Description: Professional donation management for WooCommerce with campaign tracking, analytics, and automated receipts.
 * Version: 1.3.1
 * Author: Lalit RajPurohit
 * Author URI: https://github.com/lalitraj881
 * License: GPL-2.0+
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: donorcore-donations
 * Domain Path: /languages
 * Requires at least: 6.5
 * Tested up to: 7.0
 * Requires PHP: 7.4
 * Requires Plugins: woocommerce
 * WC requires at least: 8.0
 * WC tested up to: 8.5
 */

defined( 'ABSPATH' ) || exit;

// Define plugin constants
define( 'DONOR_CORE_VERSION', '1.3.1' );
define( 'DONOR_CORE_PLUGIN_FILE', __FILE__ );
define( 'DONOR_CORE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'DONOR_CORE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'DONOR_CORE_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );

/**
 * Check for required PHP extensions
 */
if ( ! extension_loaded( 'mbstring' ) ) {
	add_action( 'admin_notices', function() {
		require_once DONOR_CORE_PLUGIN_DIR . 'includes/bootstrap.php';
		donor_core_mbstring_missing_notice();
	} );
	return;
}

/**
 * Load Composer autoloader
 */
require_once DONOR_CORE_PLUGIN_DIR . 'vendor/autoload.php';

/**
 * Load bootstrap file (handles all class loading and initialization)
 */
require_once DONOR_CORE_PLUGIN_DIR . 'includes/bootstrap.php';

/**
 * Load early classes (needed before plugin activation)
 */
donor_core_load_early_classes();

/**
 * Register activation and deactivation hooks
 */
register_activation_hook( __FILE__, 'donor_core_activate' );
register_deactivation_hook( __FILE__, 'donor_core_deactivate' );
