代码部署
打开:/wp-content/themes/zibll/functions.php文件,在最下面添加以下代码。
//WordPress 站点显示页面加载时间、数据库查询次数及内存占用function performance( $visible = false ) { $stat = sprintf( '本页生成数据库 %d 次查询,耗时 %.3f 秒,使用 %.2fMB 内存', get_num_queries(), timer_stop( 0, 3 ), memory_get_peak_usage() / 1024 / 1024 ); echo $visible ? $stat : "<!-- {$stat} -->" ;}
再打开:/wp-content/themes/zibll/footer.php文件,在最下面添加以下代码。
<center><?php if(function_exists('performance')) performance(true) ;?></center>
© 版权声明
THE END
暂无评论内容