<?php
/**
 * Plugin Name:       Cash to Cash Payments for WooCommerce
 * Plugin URI:        https://tillpaid.com/
 * Description:       Acceptez les paiements MTN Mobile Money sur WooCommerce.
 * Version:           4.0.2
 * Author:            TillPaid
 * Author URI:        https://tillpaid.com
 * License:           GPL-2.0+
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: cash-to-cash-payments-for-woocommerce
 * Requires Plugins: woocommerce
 * Domain Path:       /languages
 * Requires at least: 7.0
 * Requires PHP:      7.4
 * WC requires at least: 7.0
 * WC tested up to:   10.0
 */

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

/**
 * Plugin constants.
 */
define( 'CASH_TO_CASH_PAYMENTS_FOR_WOOCOMMERCE_VERSION', '4.0.2' );
define( 'CASH_TO_CASH_PAYMENTS_FOR_WOOCOMMERCE_DIR', plugin_dir_path( __FILE__ ) );
define( 'CASH_TO_CASH_PAYMENTS_FOR_WOOCOMMERCE_URL', plugin_dir_url( __FILE__ ) );

/**
 * Declare WooCommerce HPOS compatibility.
 */
add_action( 'before_woocommerce_init', function () {

	if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {

		\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility(
			'custom_order_tables',
			__FILE__,
			true
		);

	}

} );

/**
 * Plugin activation.
 */
function tillpaid_activate_cash_to_cash_payments_for_woocommerce() {

	require_once CASH_TO_CASH_PAYMENTS_FOR_WOOCOMMERCE_DIR . 'includes/class-cash-to-cash-payments-for-woocommerce-activator.php';

	cash_to_cash_payments_for_woocommerce_activator::activate();

}

/**
 * Plugin deactivation.
 */
function tillpaid_deactivate_cash_to_cash_payments_for_woocommerce() {

	require_once CASH_TO_CASH_PAYMENTS_FOR_WOOCOMMERCE_DIR . 'includes/class-cash-to-cash-payments-for-woocommerce-deactivator.php';

	cash_to_cash_payments_for_woocommerce_deactivator::deactivate();

}

register_activation_hook( __FILE__, 'tillpaid_activate_cash_to_cash_payments_for_woocommerce' );
register_deactivation_hook( __FILE__, 'tillpaid_deactivate_cash_to_cash_payments_for_woocommerce' );

/**
 * Load core plugin.
 */
require_once CASH_TO_CASH_PAYMENTS_FOR_WOOCOMMERCE_DIR . 'includes/class-cash-to-cash-payments-for-woocommerce.php';

/**
 * Run plugin.
 */
function tillpaid_run_cash_to_cash_payments_for_woocommerce() {

	$plugin = new cash_to_cash_payments_for_woocommerce();

	$plugin->run();

}

tillpaid_run_cash_to_cash_payments_for_woocommerce();
