function __construct($oProp, $oMsg) { if (is_network_admin() && defined('WP_DEBUG') && WP_DEBUG) { add_action('in_admin_footer', array($this, '_replyToSetPageLoadInfoInFooter'), 999); } parent::__construct($oProp, $oMsg); }
public function _replyToGetPageLoadInfo($sFooterHTML) { if (self::$_bLoadedPageLoadInfo) { return; } self::$_bLoadedPageLoadInfo = true; $_nSeconds = timer_stop(0); $_nQueryCount = get_num_queries(); $_nMemoryUsage = round($this->_convertBytesToHR(memory_get_usage()), 2); $_nMemoryPeakUsage = round($this->_convertBytesToHR(memory_get_peak_usage()), 2); $_nMemoryLimit = round($this->_convertBytesToHR($this->_convertToNumber(WP_MEMORY_LIMIT)), 2); $_sInitialMemoryUsage = round($this->_convertBytesToHR($this->_nInitialMemoryUsage), 2); return $sFooterHTML . "<div id='admin-page-framework-page-load-stats'>" . "<ul>" . "<li>" . sprintf($this->oMsg->get('queries_in_seconds'), $_nQueryCount, $_nSeconds) . "</li>" . "<li>" . sprintf($this->oMsg->get('out_of_x_memory_used'), $_nMemoryUsage, $_nMemoryLimit, round($_nMemoryUsage / $_nMemoryLimit, 2) * 100 . '%') . "</li>" . "<li>" . sprintf($this->oMsg->get('peak_memory_usage'), $_nMemoryPeakUsage) . "</li>" . "<li>" . sprintf($this->oMsg->get('initial_memory_usage'), $_sInitialMemoryUsage) . "</li>" . "</ul>" . "</div>"; }