HEX
Server: Apache
System: Linux cpanelx.inxs.ro 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: crowdandsafety (1041)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/self/root/proc/self/cwd/wp-content/plugins/wp-smushit/core/modules/class-abstract-module.php
<?php
/**
 * Abstract module class: Abstract_Module
 *
 * @since 3.0
 * @package Smush\Core\Modules
 */

namespace Smush\Core\Modules;

use Smush\Core\Settings;
use WP_Smush;

if ( ! defined( 'WPINC' ) ) {
	die;
}

/**
 * Class Abstract_Module
 *
 * @since 3.0
 */
abstract class Abstract_Module {

	/**
	 * Module slug.
	 *
	 * @var string
	 */
	protected $slug;

	/**
	 * Whether module is pro or not.
	 *
	 * @var string
	 */
	protected $is_pro = false;

	/**
	 * Settings instance.
	 *
	 * @since 3.0
	 * @var Settings
	 */
	protected $settings;

	/**
	 * Abstract_Module constructor.
	 *
	 * @since 3.0
	 */
	public function __construct() {
		$this->settings = Settings::get_instance();

		$this->init();
	}

	/**
	 * Initialize the module.
	 *
	 * Do not use __construct in modules, instead use init().
	 *
	 * @since 3.0
	 */
	protected function init() {}

	/**
	 * Return true if the module is activated.
	 *
	 * @return boolean
	 */
	public function is_active() {
		if ( $this->slug ) {
			return $this->settings->is_module_active( $this->slug );
		}
		return true;
	}

	/**
	 * Return module slug.
	 *
	 * @return string.
	 */
	public function get_slug() {
		return $this->slug;
	}

}