# sync-basalam/1.10.14/sync-basalam.php

ووسلام – همگام سازی ووکامرس و باسلام, version 1.10.14. 87 lines.

- Page: https://pluginprobe.com/plugins/sync-basalam/1.10.14/code/sync-basalam.php
- Raw: https://pluginprobe.com/plugins/sync-basalam/1.10.14/raw/sync-basalam.php
- Modified: 2026-09-08T09:08:34+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/sync-basalam/1.10.14/code/sync-basalam.php#L10-L20`.

```php
<?php

use SyncBasalam\Plugin;
use SyncBasalam\Admin\Settings\SettingsContainer;
use SyncBasalam\Activator;
use SyncBasalam\JobsRunner;
use SyncBasalam\Infrastructure\Container\AppServiceProvider;
use SyncBasalam\Infrastructure\Container\Container;
use SyncBasalam\Services\VendorSyncPolicy;

defined('ABSPATH') || exit;

/**
 * Plugin Name: sync basalam | ووسلام
 * Description: با استفاده از پلاگین ووسلام  میتوایند تمامی محصولات ووکامرس را با یک کلیک به غرفه باسلامی خود اضافه کنید‌، همچنین تمامی سفارش باسلامی شما به سایت شما اضافه میگردد.
 * Version: 1.10.14
 * Author: Woosalam Dev
 * Author URI: https://wp.hamsalam.ir/
 * Plugin URI: https://wp.hamsalam.ir
 * Text Domain: sync-basalam
 * WC requires at least: 10.0.0
 * WC tested up to: 9.9.5
 * Requires Plugins: woocommerce
 * License: GPL-2.0-or-later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html.
 */

require_once __DIR__ . '/vendor/autoload.php';

register_activation_hook(__FILE__, 'syncBasalamActivatePlugin');
register_deactivation_hook(__FILE__, 'syncBasalamDeactivatePlugin');

add_action('before_woocommerce_init', function () {
    if (class_exists(\Automattic\WooCommerce\Utilities\FeaturesUtil::class)) {
        \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true);
    }
});

if (get_option('sync_basalam_force_update')) {
    add_action('admin_notices', function () {
        $template = __DIR__ . '/templates/notifications/ForceUpdateAlert.php';
        require_once $template;
     });
    return;
}

add_action('init', 'syncBasalamPlugin');

function syncBasalamContainer()
{
    static $container = null;

    if ($container === null) {
        $container = new Container();
        $container->provider(new AppServiceProvider());
    }

    return $container;
}

//  Singleton instance of the main plugin class.
function syncBasalamPlugin()
{
    return syncBasalamContainer()->get(Plugin::class);
}

// Singleton instance of the woosalam Settings container.
function syncBasalamSettings()
{
    return syncBasalamContainer()->get(SettingsContainer::class);
}

function syncBasalamActivatePlugin()
{
    Activator::activate();
    syncBasalamContainer()->get(VendorSyncPolicy::class)->ensureScheduled();
    set_transient('sync_basalam_just_activated', true, 10);
}

function syncBasalamDeactivatePlugin()
{
    VendorSyncPolicy::unschedule();
}

syncBasalamContainer()->get(JobsRunner::class);
syncBasalamContainer()->get(VendorSyncPolicy::class)->registerHooks();

```
