HEX
Server: Apache
System: Linux efa57bbe-abb1-400d-2985-3b056fbc2701.secureserver.net 6.1.147-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jul 24 12:33:32 EDT 2025 x86_64
User: root (0)
PHP: 8.0.30.4
Disabled: NONE
Upload Files
File: //var/chroot/var/www/wp-content/mu-plugins/object-cache-pro/src/Extensions/Debugbar/Insights.php
<?php

declare(strict_types=1);

use RedisCachePro\ObjectCaches\ObjectCache;

class RedisCachePro_DebugBar_Insights extends RedisCachePro_DebugBar_Panel
{
    /**
     * The object cache.
     *
     * @var \RedisCachePro\ObjectCaches\ObjectCache
     */
    protected $cache;

    /**
     * Create a new insights panel instance.
     *
     * @param  \RedisCachePro\ObjectCaches\ObjectCache  $cache
     */
    public function __construct(ObjectCache $cache)
    {
        $this->cache = $cache;
    }

    /**
     * The title of the panel.
     *
     * @return string
     */
    public function title()
    {
        return 'Object Cache';
    }

    /**
     * Whether the panel is visible.
     *
     * @return bool
     */
    public function is_visible()
    {
        return method_exists($this->cache, 'metrics');
    }

    /**
     * Render the panel.
     *
     * @return void
     */
    public function render()
    {
        $metrics = $this->cache->metrics();

        require __DIR__ . '/templates/insights.phtml';
    }
}