Server IP : 172.67.158.161 / Your IP : 18.222.179.204 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/giankuin/dietcontrungnhanh.com/wp-content/plugins/ithemes-security-pro/core/modules/firewall/ |
Upload File : |
<?php namespace iThemesSecurity\Modules\Firewall; use iThemesSecurity\Contracts\Runnable; class Firewall implements Runnable { /** @var Processor_Factory */ private $processor_factory; /** @var Runnable[] */ private $runnable; public function __construct( Processor_Factory $processor_factory, Runnable ...$runnable ) { $this->processor_factory = $processor_factory; $this->runnable = $runnable; } public function run() { array_walk( $this->runnable, function ( Runnable $runnable ) { $runnable->run(); } ); add_filter( 'itsec_lockout_modules', [ $this, 'register_module' ] ); if ( defined( 'WP_CLI' ) && WP_CLI ) { return; } add_action( 'init', [ $this, 'launch_firewall' ], PHP_INT_MIN ); if ( \ITSEC_Core::is_loading_early() ) { $this->processor_factory->make( true )->launch(); define( 'PS_FW_MU_RAN', true ); } } public function launch_firewall() { $this->processor_factory->make( false )->launch(); } public function register_module( $modules ) { $modules['firewall'] = [ 'type' => 'firewall', 'reason' => __( 'Triggered too many firewall rules', 'it-l10n-ithemes-security-pro' ), 'label' => __( 'Firewall Rule', 'it-l10n-ithemes-security-pro' ), 'host' => \ITSEC_Modules::get_setting( 'firewall', 'max_attempts_host' ), 'period' => \ITSEC_Modules::get_setting( 'firewall', 'check_period' ), ]; return $modules; } }