Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/mets.corals.io/wp-content/plugins/query-monitor/output/raw/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/mets.corals.io/wp-content/plugins/query-monitor/output/raw/cache.php
<?php
/**
 * Raw cache output.
 *
 * @package query-monitor
 */

class QM_Output_Raw_Cache extends QM_Output_Raw {

	/**
	 * Collector instance.
	 *
	 * @var QM_Collector_Cache Collector.
	 */
	protected $collector;

	/**
	 * @return string
	 */
	public function name() {
		return __( 'Object Cache', 'query-monitor' );
	}

	/**
	 * @return array<string, mixed>
	 */
	public function get_output() {
		$output = array(
			'hit_percentage' => null,
			'hits' => null,
			'misses' => null,
		);
		$data = $this->collector->get_data();

		if ( isset( $data['stats'] ) && isset( $data['cache_hit_percentage'] ) ) {
			$output['hit_percentage'] = round( $data['cache_hit_percentage'], 1 );
			$output['hits'] = (int) $data['stats']['cache_hits'];
			$output['misses'] = (int) $data['stats']['cache_misses'];
		}

		return $output;
	}
}

/**
 * @param array<string, QM_Output> $output
 * @param QM_Collectors $collectors
 * @return array<string, QM_Output>
 */
function register_qm_output_raw_cache( array $output, QM_Collectors $collectors ) {
	$collector = QM_Collectors::get( 'cache' );
	if ( $collector ) {
		$output['cache'] = new QM_Output_Raw_Cache( $collector );
	}
	return $output;
}

add_filter( 'qm/outputter/raw', 'register_qm_output_raw_cache', 30, 2 );

Spamworldpro Mini