<?php
/**
 * Plugin Name: Integrate Amazon for WooCommerce
 * Plugin URI: https://plugins.miniorange.com
 * Description: Connect your WooCommerce store to multiple channels easily, enabling you to manage products, and orders across multiple platforms.
 * Version: 2.1.0
 * Author: miniOrange
 * Author URI: https://www.miniorange.com
 * License: Expat
 * License URI: https://plugins.miniorange.com/mit-license
 * Requires Plugins: woocommerce
 * @package MOMCS_Sync
 */

// If this file is called directly, abort.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

define( 'MOMCS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'MOMCS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'MOMCS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );

// Include autoloader.
require_once MOMCS_PLUGIN_DIR . 'includes' . DIRECTORY_SEPARATOR . 'autoloader.php';
// Include loader.
require_once MOMCS_PLUGIN_DIR . 'includes' . DIRECTORY_SEPARATOR . 'common' . DIRECTORY_SEPARATOR . 'class-loader.php';
// Installer.
require_once MOMCS_PLUGIN_DIR . 'includes' . DIRECTORY_SEPARATOR . 'common' . DIRECTORY_SEPARATOR . 'class-installer.php';

require_once MOMCS_PLUGIN_DIR . 'includes' . DIRECTORY_SEPARATOR . 'common' . DIRECTORY_SEPARATOR . 'utils' . DIRECTORY_SEPARATOR . 'class-utils.php';

define( 'MOMCS_VERSION', \MOMCS_Sync\Includes\Common\Utils\Utils::get_plugin_version() );

// Run on plugin activation.
register_activation_hook(
	__FILE__,
	function () {
		\MOMCS_Sync\Includes\Common\Installer::install();
	}
);

// Run on plugin deactivation - clean up user and license data.
register_deactivation_hook(
	__FILE__,
	function () {
		\MOMCS_Sync\Includes\Common\Installer::uninstall();
	}
);

// Include scripts and styles.
require_once MOMCS_PLUGIN_DIR . 'class-enqueue-scripts.php';

/**
 * Begins execution of the plugin.
 */
function run_momcs_sync() {
	// Initialize the loader.
	$loader = new MOMCS_Sync\Includes\Common\Loader();
	$loader->init();
}

run_momcs_sync();
