| Server IP : 185.238.73.232 / Your IP : 216.73.216.218 Web Server : Apache/2.4.58 (Ubuntu) OpenSSL/3.0.13 System : Linux srv.gornicki-invest.pl 6.8.0-137-generic #137-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 17 20:28:23 UTC 2026 x86_64 User : strzepo ( 1014) PHP Version : 8.2.33 Disable Function : 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_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,shell_exec,proc_open,popen MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /home/strzepo/web/ps1271.com/public_html/wp-content/plugins1/meta-box/src/Updater/ |
Upload File : |
<?php
namespace MetaBox\Updater;
/**
* This class handles getting and saving the updater option.
*/
class Option {
/**
* Option name.
*
* @var string
*/
private $option = 'meta_box_updater';
/**
* Get an option.
*
* @param ?string $name Option name. Pass null to return the option array.
* @param mixed $default Default value.
*
* @return mixed Option value or option array.
*/
public function get( $name = null, $default = null ) {
$option = $this->is_network_activated() ? get_site_option( $this->option, [] ) : get_option( $this->option, [] );
return null === $name ? $option : ( $option[ $name ] ?? $default );
}
public function get_api_key() : string {
return defined( 'META_BOX_KEY' ) ? META_BOX_KEY : $this->get( 'api_key', '' );
}
public function get_license_status() : string {
return $this->get_api_key() ? $this->get( 'status', 'active' ) : 'no_key';
}
/**
* Update the option array.
*
* @param array $option Option value.
*/
public function update( $option ) {
$old_option = (array) $this->get();
$option = array_merge( $old_option, $option );
if ( $this->is_network_activated() ) {
update_site_option( $this->option, $option );
} else {
update_option( $this->option, $option );
}
}
public function is_network_activated() : bool {
if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
require_once ABSPATH . '/wp-admin/includes/plugin.php';
}
return is_multisite() && is_plugin_active_for_network( 'meta-box/meta-box.php' );
}
}