| Server IP : 78.24.162.143 / Your IP : 216.73.217.78 Web Server : Apache System : Linux hosting.cormo.systems 5.15.0-179-generic #189-Ubuntu SMP Tue May 5 18:20:56 UTC 2026 x86_64 User : web63 ( 5058) PHP Version : 7.4.33 Disable Function : create_functions,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_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/clients/client34/web63/web/wp-content/plugins/pods/tribe-common/src/Tribe/Promoter/ |
Upload File : |
<?php
/**
* Class Tribe__Promoter__PUE
*
* @since 4.9
*/
class Tribe__Promoter__PUE {
/**
* @var string
*/
private $slug = 'promoter';
/**
* @var Tribe__PUE__Checker
*/
private $pue_checker;
/**
* Setup the PUE Checker.
*
* @since 4.9
*/
public function load() {
$this->pue_checker = new Tribe__PUE__Checker( 'http://tri.be/', $this->slug, [
'context' => 'service',
'plugin_name' => __( 'Promoter', 'tribe-common' ),
] );
}
/**
* Get whether service has a license and if the license is activated on network.
*
* @return array|false License information or false if not set.
*
* @since 4.9
*/
public function get_license_info() {
$option_name = 'pue_install_key_' . $this->slug;
$key = get_option( $option_name );
$is_network_key = false;
if ( is_multisite() ) {
$network_key = get_network_option( null, $option_name );
if ( empty( $key ) ) {
$key = $network_key;
$is_network_key = true;
}
}
if ( empty( $key ) ) {
return false;
}
return [
'key' => $key,
'is_network_key' => $is_network_key,
];
}
/**
* Check whether service has a license key set or not.
*
* @return bool Whether service has a license key set.
*
* @since 4.9
*/
public function has_license_key() {
return ! empty( $this->get_license_info() );
}
/**
* Check whether service has a valid license key or not.
*
* @return bool Whether service has a valid license key.
*
* @since 4.9
*/
public function has_valid_license() {
$license_info = $this->get_license_info();
if ( ! $license_info ) {
return false;
}
$response = $this->pue_checker->validate_key( $license_info['key'], $license_info['is_network_key'] );
return isset( $response['status'] ) && 1 === (int) $response['status'];
}
}