| Server IP : 185.216.8.13 / Your IP : 216.73.217.9 Web Server : Apache System : Linux webhost-vie2.sitetide.com 4.18.0-553.156.1.el8_10.x86_64 #1 SMP Mon Aug 17 17:52:57 UTC 2026 x86_64 User : medicalkn ( 9986) PHP Version : 8.2.33 Disable Function : syslog MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/html/wp-content/plugins/webp-converter-for-media/src/Notice/ |
Upload File : |
<?php
namespace WebpConverter\Notice;
use WebpConverter\Service\OptionsAccessManager;
use WebpConverter\Settings\Page\PageIntegrator;
/**
* Supports notice displayed after plugin installation.
*/
class WelcomeNotice extends NoticeAbstract implements NoticeInterface {
const NOTICE_OPTION = 'webpc_is_new_installation';
const NOTICE_VIEW_PATH = 'components/notices/welcome.php';
/**
* {@inheritdoc}
*/
public function get_option_name(): string {
return self::NOTICE_OPTION;
}
/**
* {@inheritdoc}
*/
public static function get_default_value(): string {
return '1';
}
/**
* {@inheritdoc}
*/
public function is_available(): bool {
return ( ! isset( $_GET['page'] ) || ( $_GET['page'] !== PageIntegrator::SETTINGS_MENU_PAGE ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
}
/**
* {@inheritdoc}
*/
public function is_active(): bool {
return ( OptionsAccessManager::get_option( $this->get_option_name() ) === $this->get_default_value() );
}
/**
* {@inheritdoc}
*/
public function get_disable_value(): string {
return '0';
}
/**
* {@inheritdoc}
*/
public function get_output_path(): string {
return self::NOTICE_VIEW_PATH;
}
/**
* {@inheritdoc}
*
* @return mixed[]
*/
public function get_vars_for_view(): array {
return [
'ajax_url' => admin_url( 'admin-ajax.php' ),
'close_action' => self::NOTICE_OPTION,
'settings_url' => PageIntegrator::get_settings_page_url(),
];
}
/**
* {@inheritdoc}
*/
public function get_ajax_action_to_disable(): string {
return self::NOTICE_OPTION;
}
}