From 2c749eebd5733a4d54f5e3d27a17874c6956506e Mon Sep 17 00:00:00 2001 From: Roberto Guagliardo Date: Sun, 1 Feb 2026 04:10:01 +0000 Subject: [PATCH] fix: enhance license validation logic in SitiWebUpdater2 --- includes/SitiWebUpdater2.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/includes/SitiWebUpdater2.php b/includes/SitiWebUpdater2.php index b9cb708..d2b6f53 100644 --- a/includes/SitiWebUpdater2.php +++ b/includes/SitiWebUpdater2.php @@ -131,6 +131,8 @@ class SitiWebUpdater2 { $license_data['key'] = $this->get_license_key(); } + $license_data['licenseValid'] = ! empty( $body['valid'] ); + $version = null; if ( isset( $body['pluginVersion'] ) && $body['pluginVersion'] ) { $version = $body['pluginVersion']; @@ -303,7 +305,15 @@ class SitiWebUpdater2 { public function is_license_valid() { $data = $this->get_license_data(); - return ! empty( $data ) && ! empty( $data['key'] ); + if ( empty( $data ) || empty( $data['key'] ) ) { + return false; + } + + if ( isset( $data['licenseValid'] ) ) { + return (bool) $data['licenseValid']; + } + + return true; } public function get_latest_known_version() {