| Server IP : 145.239.37.162 / Your IP : 216.73.217.74 Web Server : Apache System : Linux webm003.cluster130.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : verseaa ( 38250) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/v/e/r/verseaa/www/wp-content/plugins/query-monitor/output/raw/ |
Upload File : |
<?php declare(strict_types = 1);
/**
* Raw transients output.
*
* @package query-monitor
*/
class QM_Output_Raw_Transients extends QM_Output_Raw {
/**
* Collector instance.
*
* @var QM_Collector_Transients Collector.
*/
protected $collector;
/**
* @return string
*/
public function name() {
return __( 'Transients', 'query-monitor' );
}
/**
* @return array<string, mixed>
*/
public function get_output() {
$output = array();
$data = $this->collector->get_data();
if ( empty( $data->trans ) ) {
return $output;
}
$transients = array();
foreach ( $data->trans as $transient ) {
$transients[] = array(
'name' => $transient['name'],
'type' => $transient['type'],
'size' => $transient['size'],
'expiration' => $transient['expiration'],
'stack' => $transient['trace']->get_stack(),
);
}
$output['total'] = count( $transients );
$output['transients'] = $transients;
return $output;
}
}
/**
* @param array<string, QM_Output> $output
* @param QM_Collectors $collectors
* @return array<string, QM_Output>
*/
function register_qm_output_raw_transients( array $output, QM_Collectors $collectors ) {
$collector = QM_Collectors::get( 'transients' );
if ( $collector ) {
$output['transients'] = new QM_Output_Raw_Transients( $collector );
}
return $output;
}
add_filter( 'qm/outputter/raw', 'register_qm_output_raw_transients', 30, 2 );