Server IP : 192.64.118.117 / Your IP : 3.15.195.46 Web Server : LiteSpeed System : Linux premium56.web-hosting.com 4.18.0-513.24.1.lve.1.el8.x86_64 #1 SMP Thu May 9 15:10:09 UTC 2024 x86_64 User : thecgapy ( 1160) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/thecgapy/tcrgfinancesuite.com/wp-content/plugins/w3-total-cache/ |
Upload File : |
<?php namespace W3TC; class DbCache_Plugin_Admin { function run() { $config_labels = new DbCache_ConfigLabels(); add_filter( 'w3tc_config_labels', array( $config_labels, 'config_labels' ) ); $c = Dispatcher::config(); if ( $c->get_boolean( 'dbcache.enabled' ) ) { add_filter( 'w3tc_usage_statistics_summary_from_history', array( $this, 'w3tc_usage_statistics_summary_from_history' ), 10, 2 ); add_filter( 'w3tc_errors', array( $this, 'w3tc_errors' ) ); } } public function w3tc_usage_statistics_summary_from_history( $summary, $history ) { // memcached servers $c = Dispatcher::config(); if ( $c->get_string( 'dbcache.engine' ) == 'memcached' ) { $summary['memcached_servers']['dbcache'] = array( 'servers' => $c->get_array( 'dbcache.memcached.servers' ), 'username' => $c->get_string( 'dbcache.memcached.username' ), 'password' => $c->get_string( 'dbcache.memcached.password' ), 'name' => __( 'Database Cache', 'w3-total-cache' ) ); } elseif ( $c->get_string( 'dbcache.engine' ) == 'redis' ) { $summary['redis_servers']['dbcache'] = array( 'servers' => $c->get_array( 'dbcache.redis.servers' ), 'username' => $c->get_boolean( 'dbcache.redis.username' ), 'dbid' => $c->get_integer( 'dbcache.redis.dbid' ), 'password' => $c->get_string( 'dbcache.redis.password' ), 'name' => __( 'Database Cache', 'w3-total-cache' ) ); } // counters $dbcache_calls_total = Util_UsageStatistics::sum( $history, 'dbcache_calls_total' ); $dbcache_calls_hits = Util_UsageStatistics::sum( $history, 'dbcache_calls_hits' ); $summary['dbcache'] = array( 'calls_total' => Util_UsageStatistics::integer( $dbcache_calls_total ), 'calls_per_second' => Util_UsageStatistics::value_per_period_seconds( $dbcache_calls_total, $summary ), 'hit_rate' => Util_UsageStatistics::percent( $dbcache_calls_total, $dbcache_calls_total ) ); return $summary; } public function w3tc_errors( $errors ) { $c = Dispatcher::config(); if ( $c->get_string( 'dbcache.engine' ) == 'memcached' ) { $memcached_servers = $c->get_array( 'dbcache.memcached.servers' ); if ( !Util_Installed::is_memcache_available( $memcached_servers ) ) { if ( !isset( $errors['memcache_not_responding.details'] ) ) $errors['memcache_not_responding.details'] = array(); $errors['memcache_not_responding.details'][] = sprintf( __( 'Database Cache: %s.', 'w3-total-cache' ), implode( ', ', $memcached_servers ) ); } } return $errors; } }