403Webshell
Server IP : 195.58.49.151  /  Your IP : 216.73.217.39
Web Server : Apache/2.4.67 (Debian) mod_fcgid/2.3.9 OpenSSL/3.0.20
System : Linux hs.hsdns.ru 6.1.0-48-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.172-1 (2026-05-15) x86_64
User : antilam ( 1007)
PHP Version : 8.4.22
Disable Function : system,passthru,popen
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /home/antilam/web/antilam.ru/public_html/wp-content/plugins/cyr2lat/src/php/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/antilam/web/antilam.ru/public_html/wp-content/plugins/cyr2lat/src/php//AdminNotices.php
<?php
/**
 * Admin Notices.
 *
 * @package cyr-to-lat
 */

namespace CyrToLat;

/**
 * Class AdminNotices
 *
 * @class AdminNotices
 */
class AdminNotices {

	/**
	 * Admin notices array.
	 *
	 * @var array
	 */
	private $notices = [];

	/**
	 * AdminNotices constructor.
	 */
	public function __construct() {
		add_action( 'admin_notices', [ $this, 'show_notices' ] );
	}

	/**
	 * Add admin notice.
	 *
	 * @param string $message    Message to show.
	 * @param string $class_name Message class: notice notice-success notice-error notice-warning notice-info
	 *                           is-dismissible.
	 * @param array  $options    Notice options.
	 */
	public function add_notice( string $message, string $class_name = 'notice', array $options = [] ): void {
		$this->notices[] = [
			'message' => $message,
			'class'   => $class_name,
			'options' => $options,
		];
	}

	/**
	 * Show all notices.
	 *
	 * @return void
	 */
	public function show_notices(): void {
		foreach ( $this->notices as $notice ) {
			if ( ! $this->is_screen_allowed( $notice ) ) {
				continue;
			}

			?>
			<div class="<?php echo esc_attr( $notice['class'] ); ?>">
				<p>
					<strong>
						<?php echo wp_kses_post( $notice['message'] ); ?>
					</strong>
				</p>
			</div>
			<?php
		}
	}

	/**
	 * Is current admin screen allowed to show the notice.
	 *
	 * @param array $notice Notice.
	 *
	 * @return bool
	 */
	protected function is_screen_allowed( array $notice ): bool {
		$screen_ids = isset( $notice['options']['screen_ids'] ) ? (array) $notice['options']['screen_ids'] : null;
		if ( empty( $screen_ids ) ) {
			return true;
		}

		$current_screen = get_current_screen();

		foreach ( $screen_ids as $screen_id ) {
			if ( $current_screen && $screen_id === $current_screen->id ) {
				return true;
			}
		}

		return false;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit