| Server IP : 89.108.64.180 / Your IP : 216.73.217.95 Web Server : Apache/2.4.41 (Ubuntu) System : Linux 89-108-64-180.cloudvps.regruhosting.ru 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : www-root ( 1010) PHP Version : 8.0.30 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/hotel1.agast.ru/wp-content/plugins/hostinger/includes/ |
Upload File : |
<?php
namespace Hostinger;
use Hostinger\Admin\Options\PluginOptions;
use Hostinger\Helper;
defined( 'ABSPATH' ) || exit;
class DefaultOptions {
/**
* @return void
*/
public function add_options(): void {
$this->install_bypass_code();
foreach ( $this->options() as $key => $option ) {
update_option( $key, $option );
}
}
/**
* @return void
*/
public function install_bypass_code(): void {
// Generate initial bypass code when plugin is first installed.
$hostinger_plugin_settings = get_option( HOSTINGER_PLUGIN_SETTINGS_OPTION, false );
if ( $hostinger_plugin_settings === false ) {
$options = array(
'bypass_code' => Helper::generate_bypass_code( 16 ),
);
$plugin_options = new PluginOptions( $options );
update_option( HOSTINGER_PLUGIN_SETTINGS_OPTION, $plugin_options->to_array(), false );
}
}
/**
* @return string[]
*/
private function options(): array {
$options = array(
'optin_monster_api_activation_redirect_disabled' => 'true',
'wpforms_activation_redirect' => 'true',
'aioseo_activation_redirect' => 'false',
);
if ( Helper::is_plugin_active( 'astra-sites' ) ) {
$options = array_merge( $options, $this->get_astra_options() );
}
return $options;
}
/**
* @return string[]
*/
private function get_astra_options(): array {
return array(
'astra_sites_settings' => 'gutenberg',
);
}
}