Fragen\GitHub_Updater\Base::can_update PHP Méthode

can_update() public méthode

Function to check if plugin or theme object is able to be updated.
public can_update ( $type ) : boolean
$type
Résultat boolean
    public function can_update($type)
    {
        global $wp_version;
        $remote_is_newer = version_compare($type->remote_version, $type->local_version, '>');
        $wp_version_ok = version_compare($wp_version, $type->requires_wp_version, '>=');
        $php_version_ok = version_compare(PHP_VERSION, $type->requires_php_version, '>=');
        if (isset($this->tag) && $this->tag && (isset($_GET['plugin']) && $type->slug === $_GET['plugin'])) {
            $remote_is_newer = true;
        }
        return $remote_is_newer && $wp_version_ok && $php_version_ok;
    }