PluginProbe
ووسلام – همگام سازی ووکامرس و باسلام / 1.10.12
ووسلام – همگام سازی ووکامرس و باسلام v1.10.12
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 1.8.7 1.8.4 1.7.6 All 50 releases
sync-basalam / sync-basalam.php

sync-basalam.php in ووسلام – همگام سازی ووکامرس و باسلام 1.10.12, at sync-basalam.php

102 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use SyncBasalam\Plugin;
4 use SyncBasalam\Admin\Settings\SettingsContainer;
5 use SyncBasalam\Activator;
6 use SyncBasalam\JobsRunner;
7 use SyncBasalam\Infrastructure\Container\AppServiceProvider;
8 use SyncBasalam\Infrastructure\Container\Container;
9 use SyncBasalam\Services\VendorSyncPolicy;
10
11 defined('ABSPATH') || exit;
12
13 /**
14 * Plugin Name: sync basalam | ووسلا�
15
16 * Description: با استفاده از پلاگین ووسلا�
17
18 یتوایند ت�
19 ا�
20 ی �
21 حصولات ووکا�
22 رس را با یک کلیک به غرفه باسلا�
23 ی خود اضافه کنید‌، ه�
24 چنین ت�
25 ا�
26 ی سفارش باسلا�
27 ی ش�
28 ا به سایت ش�
29 ا اضافه �
30 یگردد.
31 * Version: 1.10.12
32 * Author: Woosalam Dev
33 * Author URI: https://wp.hamsalam.ir/
34 * Plugin URI: https://wp.hamsalam.ir
35 * Text Domain: sync-basalam
36 * WC requires at least: 10.0.0
37 * WC tested up to: 9.9.5
38 * Requires Plugins: woocommerce
39 * License: GPL-2.0-or-later
40 * License URI: https://www.gnu.org/licenses/gpl-2.0.html.
41 */
42
43 require_once __DIR__ . '/vendor/autoload.php';
44
45 register_activation_hook(__FILE__, 'syncBasalamActivatePlugin');
46 register_deactivation_hook(__FILE__, 'syncBasalamDeactivatePlugin');
47
48 add_action('before_woocommerce_init', function () {
49 if (class_exists(\Automattic\WooCommerce\Utilities\FeaturesUtil::class)) {
50 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true);
51 }
52 });
53
54 if (get_option('sync_basalam_force_update')) {
55 add_action('admin_notices', function () {
56 $template = __DIR__ . '/templates/notifications/ForceUpdateAlert.php';
57 require_once $template;
58 });
59 return;
60 }
61
62 add_action('init', 'syncBasalamPlugin');
63
64 function syncBasalamContainer()
65 {
66 static $container = null;
67
68 if ($container === null) {
69 $container = new Container();
70 $container->provider(new AppServiceProvider());
71 }
72
73 return $container;
74 }
75
76 // Singleton instance of the main plugin class.
77 function syncBasalamPlugin()
78 {
79 return syncBasalamContainer()->get(Plugin::class);
80 }
81
82 // Singleton instance of the woosalam Settings container.
83 function syncBasalamSettings()
84 {
85 return syncBasalamContainer()->get(SettingsContainer::class);
86 }
87
88 function syncBasalamActivatePlugin()
89 {
90 Activator::activate();
91 syncBasalamContainer()->get(VendorSyncPolicy::class)->ensureScheduled();
92 set_transient('sync_basalam_just_activated', true, 10);
93 }
94
95 function syncBasalamDeactivatePlugin()
96 {
97 VendorSyncPolicy::unschedule();
98 }
99
100 syncBasalamContainer()->get(JobsRunner::class);
101 syncBasalamContainer()->get(VendorSyncPolicy::class)->registerHooks();
102