| @@ -4,8 +4,9 @@ | ||
| 4 | 4 | |
| 5 | 5 | use SyncBasalam\Config\Endpoints; |
| 6 | 6 | use SyncBasalam\Logger\Logger; |
| 7 | 7 | use SyncBasalam\Services\ApiServiceManager; |
| 8 | +use SyncBasalam\Services\ForceUpdateGate; | |
| 8 | 9 | |
| 9 | 10 | defined('ABSPATH') || exit; |
| 10 | 11 | |
| 11 | 12 | class FetchVersionDetail |
| @@ -48,9 +49,13 @@ | ||
| 48 | 49 | if (json_last_error() !== JSON_ERROR_NONE || !is_array($data) || !array_key_exists('force_update', $data)) { |
| 49 | 50 | return false; |
| 50 | 51 | } |
| 51 | 52 | |
| 52 | - if (!empty($data['force_update'])) { | |
| 53 | + if (ForceUpdateGate::shouldHonorRemoteFlag( | |
| 54 | + $data['force_update'], | |
| 55 | + $this->version, | |
| 56 | + isset($data['latest_version']) ? (string) $data['latest_version'] : null | |
| 57 | + )) { | |
| 53 | 58 | update_option('sync_basalam_force_update', true); |
| 54 | 59 | return true; |
| 55 | 60 | } |
| 56 | 61 | |