HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //proc/1526/cwd/linde/wp-content/plugins/better-wp-security/core/lib/tools/Config_Tool.php
<?php

namespace iThemesSecurity\Lib\Tools;

use iThemesSecurity\Module_Config;

abstract class Config_Tool implements Tool {

	/** @var string */
	private $slug;

	/** @var Module_Config */
	private $config;

	/**
	 * Config_Tool constructor.
	 *
	 * @param string        $slug
	 * @param Module_Config $config
	 */
	public function __construct( string $slug, Module_Config $config ) {
		$this->slug   = $slug;
		$this->config = $config;
	}

	public function get_slug(): string {
		return $this->slug;
	}

	public function get_module(): string {
		return $this->config->get_id();
	}

	public function is_available(): bool {
		return true;
	}

	public function get_condition(): array {
		return $this->get_config()['condition'] ?? [];
	}

	public function get_title(): string {
		return $this->get_config()['title'] ?? $this->config->translate( Module_Config::T_ABOUT )->get_title();
	}

	public function get_description(): string {
		return $this->get_config()['description'] ??
		       ( $this->config->get_type() === 'tool' ? $this->config->translate( Module_Config::T_ABOUT )->get_description() : '' );
	}

	public function get_help(): string {
		return $this->get_config()['help'] ??
		       ( $this->config->get_type() === 'tool' ? $this->config->translate( Module_Config::T_ABOUT )->get_help() : '' );
	}

	public function get_keywords(): array {
		return $this->get_config()['keywords'] ?? [];
	}

	public function is_toggleable(): bool {
		return ! empty( $this->get_config()['toggle'] );
	}

	public function get_schedule(): string {
		return $this->get_config()['schedule'] ?? '';
	}

	public function get_form(): array {
		return $this->get_config()['form'] ?? [];
	}

	private function get_config(): array {
		return $this->config->translate( Module_Config::T_TOOLS )->get_tools()[ $this->get_slug() ];
	}
}