<?php
// phpcs:ignoreFile
namespace WooSwatches;

use function WooSwatchesPro\is_license_valid;

class Plugin {

	public static $_instance = null;
	public $admin;
	public $ajax;
	public $modules;
	public $assets;
	public $attributes;
	public $helpers;
	public $hooks;
	public $product_swatches;
	public $term_meta;

	public static function instance() {
		if ( self::$_instance === null ) {
			self::$_instance = new self();
		}
		return self::$_instance;
	}

	public function __construct() {

		$this->admin   			= new Admin();
		$this->modules 			= new Modules();
		$this->assets           = new Assets();
		$this->helpers          = new Helpers();
		$this->hooks            = new Hooks();
		$this->product_swatches = new Product_Swatches();
		
		if ( ! is_pro_active() || ! is_license_valid() ) {
			$this->attributes       = new Attributes();
			$this->ajax    			= new Ajax();
		}

		require_once GS_WOO_SWATCHES_PLUGIN_DIR . 'includes/gs-common-pages/gs-variation-common-pages.php';

	}

}

function plugin() {
	return Plugin::instance();
}
plugin();
