<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}
if ( ! class_exists( 'Draly_Dropshipping_Starter_Plugins_Load' ) ) {
	class Draly_Dropshipping_Starter_Plugins_Load {
		public static $plugins = array();
		public static $config = array();
		/**
		 * Variable to hold the initialization state.
		 *
		 * @var  boolean
		 */
		protected static $initialized = false;

		/**
		 * Initialize pluggable functions.
		 *
		 * @return  void
		 */
		public static function initialize() {
			// Do nothing if pluggable functions already initialized.
			if ( self::$initialized ) {
				return;
			}
			self::config();
			self::plugins();

			if ( function_exists( 'tgmpa' ) ) {
				tgmpa( self::$plugins, self::$config );
			}
			self::$initialized = true;
		}

		public static function plugins() {
			$plugins_main = array(
				array(
					'name'               => 'VillaTheme Core',
					'slug'               => 'villatheme-core',
					'required'           => false,
				),
				array(
					'name'     => 'One Click Demo Import',
					'slug'     => 'one-click-demo-import',
					'required' => false,
				),
			);
			$plugins_ocdi = apply_filters( 'draly_dropshipping_starter_plugins_ocdi', array() );

			self::$plugins = array_merge( $plugins_main, $plugins_ocdi );
		}

		public static function config() {
			self::$config = array(
				'id'           => 'draly-dropshipping-starter-tgmpa',
				'default_path' => '',
				'menu'         => 'draly-dropshipping-starter-install-plugins',
				'parent_slug'  => 'themes.php',
				'capability'   => 'edit_theme_options',
				'has_notices'  => true,
				'dismissable'  => true,
				'dismiss_msg'  => '',
				'is_automatic' => true,
				'message'      => '',
			);
		}
	}
}
