HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/studis.kauko.lt/wp-content/plugins/wp-statistics/src/Components/SystemCleaner.php
<?php
namespace WP_Statistics\Components;

use WP_Statistics\Utils\Query;
use WP_Statistics\Service\Admin\LicenseManagement\ApiEndpoints;

class SystemCleaner
{
    /**
     * Clears a specific cache.
     *
     * @param string $cacheId
     */
    public static function clearTransientById($cacheId)
    {
        return delete_transient("wp_statistics_cache_$cacheId");
    }

    /**
     * Clears all caches.
     */
    public static function clearAllTransients()
    {
        return Query::delete('options')
            ->where('option_name', 'LIKE', '%wp_statistics_cache%')
            ->execute();
    }

    /**
     * Clears remote add-ons list cache.
     */
    public static function clearAddonsListCache()
    {
        $request = new RemoteRequest(ApiEndpoints::PRODUCT_LIST, 'GET');
        $request->clearCache();
    }
}