# sync-basalam/1.10.19/includes/Services/ForceUpdateGate.php

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

- Page: https://pluginprobe.com/plugins/sync-basalam/1.10.19/code/includes/Services/ForceUpdateGate.php
- Raw: https://pluginprobe.com/plugins/sync-basalam/1.10.19/raw/includes/Services/ForceUpdateGate.php
- Modified: 2026-09-17T09:40:56+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.19/code/includes/Services/ForceUpdateGate.php#L10-L20`.

```php
<?php

namespace SyncBasalam\Services;

defined('ABSPATH') || exit;

class ForceUpdateGate
{
    public static function shouldBlock($forceUpdate, string $installedVersion, string $runningVersion): bool
    {
        if (!$forceUpdate) return false;

        // A newer plugin package must be allowed to boot so it can re-check
        // the remote force-update status and run its migrations. Otherwise the
        // flag set by the old version permanently prevents the update from
        // taking effect even though WordPress reports the plugin as active.
        return version_compare($installedVersion ?: '0.0.0', $runningVersion, '>=');
    }

    public static function shouldHonorRemoteFlag(
        $forceUpdate,
        string $runningVersion,
        ?string $latestPublishedVersion
    ): bool {
        if (!$forceUpdate) return false;

        // The version API currently treats versions it does not know about as
        // forced updates. A hotfix newer than the latest published package is
        // not outdated and must not disable itself because it has no download
        // record yet.
        if ($latestPublishedVersion && version_compare($runningVersion, $latestPublishedVersion, '>')) {
            return false;
        }

        return true;
    }
}

```
