feat: update version to 1.9.4 and enhance license validation handling
All checks were successful
Build & Release Plugin / release (push) Successful in 20s
All checks were successful
Build & Release Plugin / release (push) Successful in 20s
This commit is contained in:
@@ -273,14 +273,26 @@ class SitiWebUpdater2 {
|
||||
return new WP_Error( 'verification_failed', 'Onverwacht antwoord van licentieserver.' );
|
||||
}
|
||||
|
||||
$has_license_payload = isset( $body['license'] ) || isset( $body['pluginVersion'] ) || isset( $body['version'] );
|
||||
|
||||
if ( 200 !== $code ) {
|
||||
if ( $has_license_payload ) {
|
||||
$this->store_license_data( $body );
|
||||
} else {
|
||||
$this->clear_cached_license_data();
|
||||
}
|
||||
|
||||
$error_message = isset( $body['error'] ) ? $body['error'] : 'Licentie verificatie mislukt.';
|
||||
$this->clear_cached_license_data();
|
||||
return new WP_Error( 'verification_failed', $error_message );
|
||||
}
|
||||
|
||||
if ( empty( $body['valid'] ) ) {
|
||||
$this->clear_cached_license_data();
|
||||
if ( $has_license_payload ) {
|
||||
$this->store_license_data( $body );
|
||||
} else {
|
||||
$this->clear_cached_license_data();
|
||||
}
|
||||
|
||||
return new WP_Error( 'invalid_license', 'Licentie is ongeldig.' );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user