HEX
Server: Apache/2.4.62 (Debian)
System: Linux wordpress-7cb4c6b6f6-hvtzc 5.15.0-101-generic #111-Ubuntu SMP Tue Mar 5 20:16:58 UTC 2024 x86_64
User: www-data (33)
PHP: 8.3.20
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/Crocoblock-wizard/includes/plugin.php
<?php
namespace Crocoblock_Wizard;

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

/**
 * Main file
 */
class Plugin {

	/**
	 * Instance.
	 *
	 * Holds the plugin instance.
	 *
	 * @since 1.0.0
	 * @access public
	 * @static
	 *
	 * @var Plugin
	 */
	public static $instance = null;

	public $dashboard;
	public $modules;
	public $skins;
	public $settings;

	/**
	 * Instance.
	 *
	 * Ensures only one instance of the plugin class is loaded or can be loaded.
	 *
	 * @since 1.0.0
	 * @access public
	 * @static
	 *
	 * @return Plugin An instance of the class.
	 */
	public static function instance() {

		if ( is_null( self::$instance ) ) {
			self::$instance = new self();
		}

		return self::$instance;

	}

	/**
	 * Register autoloader.
	 */
	private function register_autoloader() {
		require CB_WIZARD_PATH . 'includes/autoloader.php';
		Autoloader::run();
	}

	/**
	 * Returns path to view file
	 *
	 * @param  [type] $path [description]
	 * @return [type]       [description]
	 */
	public function get_view( $path ) {
		return apply_filters(
			'crocoblock-wizard/get-view',
			CB_WIZARD_PATH . 'views/' . $path . '.php'
		);
	}

	/**
	 * Initialize plugin parts
	 *
	 * @return void
	 */
	public function init_components() {
		$this->dashboard     = new Dashboard();
		$this->modules       = new Modules_Manager();
		$this->settings      = new Settings();
		$this->skins         = new Skins();
		$this->files_manager = new Tools\Files_Manager();
		$this->storage       = new Tools\Storage();
	}

	/**
	 * Plugin constructor.
	 */
	private function __construct() {

		// There is nothing to do on front-end
		if ( ! is_admin() ) {
			return;
		}

		$this->register_autoloader();
		$this->init_components();

	}

}

Plugin::instance();