fix: enhance license validation logic in SitiWebUpdater2
All checks were successful
Build & Release Plugin / release (push) Successful in 5s

This commit is contained in:
2026-02-01 04:10:01 +00:00
parent 04a0c8be37
commit 2c749eebd5

View File

@@ -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() {