mirror of
https://github.com/proelements/proelements.git
synced 2026-05-25 10:04:42 +00:00
v4.0.4
This commit is contained in:
@@ -76,6 +76,17 @@ class Admin {
|
||||
}
|
||||
|
||||
|
||||
public function handle_check_license() {
|
||||
if ( '1' !== Utils::get_super_global_value( $_GET, 'check-license' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
API::get_license_data( true );
|
||||
|
||||
wp_safe_redirect( remove_query_arg( 'check-license' ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
public function register_actions() {
|
||||
add_filter( 'http_response', [ $this, 'http_remove_pro_templates'], 10, 3 );
|
||||
|
||||
|
||||
+4
-6
@@ -81,10 +81,8 @@ class API {
|
||||
'value' => json_encode( $value ),
|
||||
];
|
||||
|
||||
$updated = update_option( $cache_key, $data, false );
|
||||
if ( false === $updated ) {
|
||||
self::$transient_data[ $cache_key ] = $data;
|
||||
}
|
||||
self::$transient_data[ $cache_key ] = $data;
|
||||
update_option( $cache_key, $data, false );
|
||||
}
|
||||
|
||||
private static function get_transient( $cache_key ) {
|
||||
@@ -106,7 +104,7 @@ class API {
|
||||
public static function get_license_data( $force_request = false ) {
|
||||
$license_data['success'] = true;
|
||||
$license_data['expires'] = 'lifetime';
|
||||
$license_data['features'] = [
|
||||
$license_data['features'] = [
|
||||
'custom-attributes',
|
||||
'custom_code',
|
||||
'custom-css',
|
||||
@@ -172,7 +170,7 @@ class API {
|
||||
public static function is_license_active() {
|
||||
$license_data = self::get_license_data();
|
||||
|
||||
return (bool) $license_data['success'];
|
||||
return (bool) ( $license_data['success'] ?? false );
|
||||
}
|
||||
|
||||
public static function is_license_expired() {
|
||||
|
||||
Reference in New Issue
Block a user