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/Plugin.php +19 -2 1.8.51.10.19 View file →
@@ -7,8 +7,9 @@
7 7 use SyncBasalam\Registrar\ListenerRegistrar;
8 8 use SyncBasalam\Registrar\OrderRegistrar;
9 9 use SyncBasalam\Registrar\ProductRegistrar;
10 10 use SyncBasalam\Registrar\QueueRegistrar;
11 +use SyncBasalam\Services\Api\CircuitBreaker;
11 12 use SyncBasalam\Services\FetchVersionDetail;
12 13
13 14 defined('ABSPATH') || exit;
14 15
@@ -13,9 +14,9 @@
13 14 defined('ABSPATH') || exit;
14 15
15 16 class Plugin
16 17 {
17 - public const VERSION = '1.8.5';
18 + public const VERSION = '1.10.19';
18 19
19 20 public function __construct()
20 21 {
21 22 $this->onboarding();
@@ -28,9 +29,9 @@
28 29 {
29 30 if (get_transient('sync_basalam_just_activated')) {
30 31 delete_transient('sync_basalam_just_activated');
31 32 if (!syncBasalamSettings()->hasToken()) {
32 - wp_redirect(admin_url('admin.php?page=basalam-onboarding'));
33 + wp_safe_redirect(admin_url('admin.php?page=basalam-onboarding'));
33 34 exit();
34 35 }
35 36 }
36 37 }
@@ -51,8 +52,10 @@
51 52 private function notices()
52 53 {
53 54 if (!get_option('sync_basalam_review_never_remind')) {
54 55 add_action('admin_notices', function () {
56 + if (!AdminRegistrar::isWoosalamRelatedAdminScreen()) return;
57 +
55 58 $template = syncBasalamPlugin()->templatePath("notifications/LikeAlert.php");
56 59 require_once $template;
57 60 });
58 61 }
@@ -58,15 +61,29 @@
58 61 }
59 62
60 63 if (!syncBasalamSettings()->hasToken()) {
61 64 add_action('admin_notices', function () {
65 + if (!AdminRegistrar::isWoosalamRelatedAdminScreen()) return;
66 +
62 67 $template = syncBasalamPlugin()->templatePath("notifications/AccessAlert.php");
63 68 require_once($template);
64 69 });
65 70 }
66 71 add_action('admin_notices', function () {
72 + if (!AdminRegistrar::isWoosalamRelatedAdminScreen()) return;
73 +
67 74 $template = syncBasalamPlugin()->templatePath("notifications/HttpBlock.php");
68 75 require_once($template);
76 + });
77 + add_action('admin_notices', function () {
78 + if (!AdminRegistrar::isWoosalamRelatedAdminScreen()) return;
79 +
80 + $circuitBreaker = new CircuitBreaker();
81 +
82 + if ($circuitBreaker->getState() === CircuitBreaker::STATE_CLOSED) return;
83 +
84 + $template = syncBasalamPlugin()->templatePath("notifications/CircuitBreakerAlert.php");
85 + require $template;
69 86 });
70 87 }
71 88
72 89 private function registrars()