| @@ -2,11 +2,12 @@ | ||
| 2 | 2 | |
| 3 | 3 | use SyncBasalam\Plugin; |
| 4 | 4 | use SyncBasalam\Admin\Settings\SettingsContainer; |
| 5 | 5 | use SyncBasalam\Activator; |
| 6 | -use SyncBasalam\JobsRunner; | |
| 6 | +use SyncBasalam\JobsRunner; | |
| 7 | 7 | use SyncBasalam\Infrastructure\Container\AppServiceProvider; |
| 8 | 8 | use SyncBasalam\Infrastructure\Container\Container; |
| 9 | +use SyncBasalam\Services\ForceUpdateGate; | |
| 9 | 10 | use SyncBasalam\Services\VendorSyncPolicy; |
| 10 | 11 | |
| 11 | 12 | defined('ABSPATH') || exit; |
| 12 | 13 | |
| @@ -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.20 | |
| 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 |
| @@ -35,15 +36,22 @@ | ||
| 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 | - add_action('admin_notices', function () { | |
| 41 | - $template = __DIR__ . '/templates/notifications/ForceUpdateAlert.php'; | |
| 42 | - require_once $template; | |
| 43 | - }); | |
| 44 | - return; | |
| 45 | -} | |
| 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)) { | |
| 44 | + add_action('admin_notices', function () { | |
| 45 | + $template = __DIR__ . '/templates/notifications/ForceUpdateAlert.php'; | |
| 46 | + require_once $template; | |
| 47 | + }); | |
| 48 | + return; | |
| 49 | +} | |
| 50 | + | |
| 51 | +if ($forceUpdate) { | |
| 52 | + delete_option('sync_basalam_force_update'); | |
| 53 | +} | |
| 46 | 54 | |
| 47 | 55 | add_action('init', 'syncBasalamPlugin'); |
| 48 | 56 | |
| 49 | 57 | function syncBasalamContainer() |