PluginProbe
ووسلام – همگام سازی ووکامرس و باسلام / 1.10.19
ووسلام – همگام سازی ووکامرس و باسلام v1.10.19
1.10.19 1.10.20 1.10.18 1.10.17 1.10.15 1.10.14 1.10.13 1.10.12 1.10.10 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.2 1.9.1 1.9.0 1.8.8 1.8.5 1.8.6 All 53 releases
← All changes | includes/Services/FetchVersionDetail.php +11 -1 1.9.11.10.19 View file →
@@ -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
@@ -32,8 +33,13 @@
32 33 }
33 34
34 35 public function checkForceUpdate()
35 36 {
37 + if (wp_get_environment_type() === 'local') {
38 + delete_option('sync_basalam_force_update');
39 + return false;
40 + }
41 +
36 42 try {
37 43 $response = $this->Fetch();
38 44
39 45 if (!is_array($response) || !isset($response['body'])) return false;
@@ -43,9 +49,13 @@
43 49 if (json_last_error() !== JSON_ERROR_NONE || !is_array($data) || !array_key_exists('force_update', $data)) {
44 50 return false;
45 51 }
46 52
47 - 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 + )) {
48 58 update_option('sync_basalam_force_update', true);
49 59 return true;
50 60 }
51 61