# force-refresh/3.2.0/includes/services/classes/class-refresh-service.php

Force Refresh, version 3.2.0. 55 lines.

- Page: https://pluginprobe.com/plugins/force-refresh/3.2.0/code/includes/services/classes/class-refresh-service.php
- Raw: https://pluginprobe.com/plugins/force-refresh/3.2.0/raw/includes/services/classes/class-refresh-service.php
- Modified: 2026-05-16T15:47:08+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/force-refresh/3.2.0/code/includes/services/classes/class-refresh-service.php#L10-L20`.

```php
<?php
/**
 * Our class responsible for coordinating site and page refreshes.
 *
 * @package ForceRefresh
 */

namespace JordanLeven\Plugins\ForceRefresh\Services;

use JordanLeven\Plugins\ForceRefresh\Services\Refresh_Counter_Service;
use JordanLeven\Plugins\ForceRefresh\Services\Versions_Storage_Service;

/**
 * Class for refresh operations.
 */
class Refresh_Service {

    /**
     * Generate a new version, persist it as the site version, increment the
     * site refresh counter, and return the new version.
     *
     * @return string The new site version.
     */
    public static function update_version_site(): string {
        $version = self::get_new_version();
        Versions_Storage_Service::set_site_version( $version );
        Refresh_Counter_Service::increment_site_refresh_count();
        return $version;
    }

    /**
     * Generate a new version, persist it as the page version, increment the
     * page refresh counter, and return the new version.
     *
     * @param int $page_id The post ID to refresh.
     *
     * @return string The new page version.
     */
    public static function update_version_page( int $page_id ): string {
        $version = self::get_new_version();
        Versions_Storage_Service::set_page_version( $page_id, $version );
        Refresh_Counter_Service::increment_page_refresh_count( $page_id );
        return $version;
    }

    /**
     * Generate a new unique version string.
     *
     * @return string
     */
    private static function get_new_version(): string {
        return Versions_Storage_Service::get_new_version();
    }
}

```
