<?php
/**
 * Plugin Name: YITH Cost of Goods for WooCommerce
 * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-cost-of-goods/
 * Description: <code><strong>YITH Cost of Goods for WooCommerce</strong></code> lets you know the profits of your sales by subtracting the costs from your revenue. You can check a detailed report to know the different amounts that are handled in your sales.   <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>
 * Version: 2.22.0
 * Author: YITH
 * Author URI: https://yithemes.com/
 * Text Domain: yith-cost-of-goods-for-woocommerce
 * Domain Path: /languages/
 * WC requires at least: 10.1
 * WC tested up to: 10.3
 * Requires Plugins: woocommerce
 *
 * @author  YITH <plugins@yithemes.com>
 * @package YITH\LivePushNotifications
 **/

/*
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
} // Exit if accessed directly

/* === DEFINE === */
! defined( 'YITH_COG' ) && define( 'YITH_COG', true );
! defined( 'YITH_COG_VERSION' ) && define( 'YITH_COG_VERSION', '2.22.0' );
! defined( 'YITH_COG_ENQUEUE_VERSION' ) && define( 'YITH_COG_ENQUEUE_VERSION', '2.13.0' );
! defined( 'YITH_COG_INIT' ) && define( 'YITH_COG_INIT', plugin_basename( __FILE__ ) );
! defined( 'YITH_COG_SLUG' ) && define( 'YITH_COG_SLUG', 'yith-cost-of-goods-for-woocommerce' );
! defined( 'YITH_COG_FILE' ) && define( 'YITH_COG_FILE', __FILE__ );
! defined( 'YITH_COG_PATH' ) && define( 'YITH_COG_PATH', plugin_dir_path( __FILE__ ) );
! defined( 'YITH_COG_URL' ) && define( 'YITH_COG_URL', plugins_url( '/', __FILE__ ) );
! defined( 'YITH_COG_ASSETS_URL' ) && define( 'YITH_COG_ASSETS_URL', YITH_COG_URL . 'assets/' );
! defined( 'YITH_COG_INC' ) && define( 'YITH_COG_INC', YITH_COG_PATH . 'includes/' );
! defined( 'YITH_COG_VIEWS' ) && define( 'YITH_COG_VIEWS', YITH_COG_PATH . 'views/' );
! defined( 'YITH_COG_TEMPLATE_PATH' ) && define( 'YITH_COG_TEMPLATE_PATH', YITH_COG_PATH . '/templates/' );
! defined( 'YITH_COG_OPTIONS_PATH' ) && define( 'YITH_COG_OPTIONS_PATH', YITH_COG_PATH . 'panel' );
! defined( 'YITH_COG_SECRETKEY' ) && define( 'YITH_COG_SECRETKEY', '' );


// Plugin Framework Loader.
if ( file_exists( plugin_dir_path( __FILE__ ) . 'plugin-fw/init.php' ) ) {
	require_once plugin_dir_path( __FILE__ ) . 'plugin-fw/init.php';
}

if ( ! function_exists( 'yith_plugin_onboarding_registration_hook' ) ) {
	include_once 'plugin-upgrade/functions-yith-licence.php';
}
	register_activation_hook( __FILE__, 'yith_plugin_onboarding_registration_hook' );

if ( ! function_exists( 'yith_cog' ) ) {
	/**
	 * Unique access to instance of YITH_COG class
	 *
	 * @return YITH_COG | YITH_COG_Premium
	 * @since 1.0.0
	 */
	function yith_cog() {
		if ( function_exists( 'yith_plugin_fw_load_plugin_textdomain' ) ) {
			yith_plugin_fw_load_plugin_textdomain( 'yith-cost-of-goods-for-woocommerce', basename( dirname( __FILE__ ) ) . '/languages' );
		}

		// Load required classes and functions.
		require_once YITH_COG_PATH . 'includes/class.yith-cog.php';

		return YITH_COG::instance();
	}
}

/**
 * Instance main plugin class
 */

add_action( 'plugins_loaded', 'yith_cog', 11 );
