PluginProbe
ووسلام – همگام سازی ووکامرس و باسلام / 1.10.21
ووسلام – همگام سازی ووکامرس و باسلام v1.10.21
1.10.21 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 All 54 releases
← All changes | sync-basalam.php +31 -23 1.10.101.10.21 View file →
@@ -3,11 +3,12 @@
3 3 use SyncBasalam\Plugin;
4 4 use SyncBasalam\Admin\Settings\SettingsContainer;
5 5 use SyncBasalam\Activator;
6 6 use SyncBasalam\JobsRunner;
7 -use SyncBasalam\Infrastructure\Container\AppServiceProvider;
8 -use SyncBasalam\Infrastructure\Container\Container;
9 -use SyncBasalam\Services\VendorSyncPolicy;
7 +use SyncBasalam\Infrastructure\Container\AppServiceProvider;
8 +use SyncBasalam\Infrastructure\Container\Container;
9 +use SyncBasalam\Services\ForceUpdateGate;
10 +use SyncBasalam\Services\VendorSyncPolicy;
10 11
11 12 defined('ABSPATH') || exit;
12 13
13 14 /**
@@ -12,12 +13,12 @@
12 13
13 14 /**
14 15 * Plugin Name: sync basalam | ووسلام
15 16 * Description: با استفاده از پلاگین ووسلام میتوایند تمامی محصولات ووکامرس را با یک کلیک به غرفه باسلامی خود اضافه کنید‌، همچنین تمامی سفارش باسلامی شما به سایت شما اضافه میگردد.
16 - * Version: 1.10.10
17 + * Version: 1.10.21
17 18 * Author: Woosalam Dev
18 - * Author URI: https://wp.hamsalam.ir/
19 - * Plugin URI: https://wp.hamsalam.ir
19 + * Author URI: https://hamsalam.ir/wp
20 + * Plugin URI: https://hamsalam.ir/wp
20 21 * Text Domain: sync-basalam
21 22 * WC requires at least: 10.0.0
22 23 * WC tested up to: 9.9.5
23 24 * Requires Plugins: woocommerce
@@ -26,10 +27,10 @@
26 27 */
27 28
28 29 require_once __DIR__ . '/vendor/autoload.php';
29 30
30 -register_activation_hook(__FILE__, 'syncBasalamActivatePlugin');
31 -register_deactivation_hook(__FILE__, 'syncBasalamDeactivatePlugin');
31 +register_activation_hook(__FILE__, 'syncBasalamActivatePlugin');
32 +register_deactivation_hook(__FILE__, 'syncBasalamDeactivatePlugin');
32 33
33 34 add_action('before_woocommerce_init', function () {
34 35 if (class_exists(\Automattic\WooCommerce\Utilities\FeaturesUtil::class)) {
35 36 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true);
@@ -35,9 +36,12 @@
35 36 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true);
36 37 }
37 38 });
38 39
39 -if (get_option('sync_basalam_force_update')) {
40 +$forceUpdate = get_option('sync_basalam_force_update');
41 +$installedVersion = (string) (get_option('sync_basalam_version') ?: '0.0.0');
42 +
43 +if (ForceUpdateGate::shouldBlock($forceUpdate, $installedVersion, Plugin::VERSION)) {
40 44 add_action('admin_notices', function () {
41 45 $template = __DIR__ . '/templates/notifications/ForceUpdateAlert.php';
42 46 require_once $template;
43 47 });
@@ -43,8 +47,12 @@
43 47 });
44 48 return;
45 49 }
46 50
51 +if ($forceUpdate) {
52 + delete_option('sync_basalam_force_update');
53 +}
54 +
47 55 add_action('init', 'syncBasalamPlugin');
48 56
49 57 function syncBasalamContainer()
50 58 {
@@ -69,18 +77,18 @@
69 77 {
70 78 return syncBasalamContainer()->get(SettingsContainer::class);
71 79 }
72 80
73 -function syncBasalamActivatePlugin()
74 -{
75 - Activator::activate();
76 - syncBasalamContainer()->get(VendorSyncPolicy::class)->ensureScheduled();
77 - set_transient('sync_basalam_just_activated', true, 10);
78 -}
79 -
80 -function syncBasalamDeactivatePlugin()
81 -{
82 - VendorSyncPolicy::unschedule();
83 -}
84 -
85 -syncBasalamContainer()->get(JobsRunner::class);
86 -syncBasalamContainer()->get(VendorSyncPolicy::class)->registerHooks();
81 +function syncBasalamActivatePlugin()
82 +{
83 + Activator::activate();
84 + syncBasalamContainer()->get(VendorSyncPolicy::class)->ensureScheduled();
85 + set_transient('sync_basalam_just_activated', true, 10);
86 +}
87 +
88 +function syncBasalamDeactivatePlugin()
89 +{
90 + VendorSyncPolicy::unschedule();
91 +}
92 +
93 +syncBasalamContainer()->get(JobsRunner::class);
94 +syncBasalamContainer()->get(VendorSyncPolicy::class)->registerHooks();