內容簡介
僅列出管理員的查詢操作,以進行偵錯。在博客前端看到所有的查詢,找出最慢的部分。
新發佈,新外掛
請使用外掛Debug Objects,提供更多資訊和更清晰的查詢視圖,與這個較舊的外掛相比。
新方案在不同的視圖中列出插件和核心查詢。
從版本 1.0.0 開始,該外掛會禁用當前連接會話的 MySQL 查詢高速緩存。這樣就可以顯示查詢的實際執行時間。要停用此行為,請將常數QUERY_CACHE_TYPE_OFF設置為FALSE。
該外掛非常適合 WordPress 開發人員,外掛和佈景主題開發人員以及正在嘗試找出博客為何變慢的站點管理員。
參數
自版本 1.0.0 起,該外掛擁有一個常數以禁用 mySQL 會話高速緩存。預設值為 true,以便更好地分析時關閉緩存!要更改此設定,請將常數QUERY_CACHE_TYPE_OFF設置為FALSE。
範例
這是一個評估範例。
# 時間:0.00198888778687
查詢:SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes'
呼叫自:require, require_once, require_once, require_once, is_blog_installed, wp_load_alloptions
# 時間:0.000695943832397
查詢:UPDATE 'wp_options' SET 'option_value' = 'a:3:{i:0;b:0;s:25:\"adminimize/adminimize.php\";a:2:{i:0;O:10:\"adminimize\":1:{s:12:\"wp_filter_id\";i:0;}i:1;s:12:\"on_deinstall\";}s:31:\"debug_queries/debug_queries.php\";a:2:{i:0;O:12:\"DebugQueries\":1:{s:12:\"wp_filter_id\";i:0;}i:1;s:10:\"deactivate\";}}' WHERE 'option_name' = 'uninstall_plugins'
呼叫自:require, require_once, require_once, require_once, include_once, adminimize->adminimize, register_uninstall_hook, update_option
. . .
23 個查詢的總計查詢時間:0.0155501365662。
23 個 num_queries 的總計時間:0.392。
致謝
感謝 Joost de Valk 在 yoast.com 對插件進行小修改以提供一些額外資訊。
許可證
好消息,這個外掛是免費的!因為它是根據 GPL 發布的,您可以在個人或商業博客上免費使用它。但是如果您喜歡這個外掛,可以感謝我並留下小小的捐款宣揚這個外掛。我真的不想知道這個外掛已經花去了我多少時間😉
外掛標籤
開發者團隊
原文外掛簡介
List query-actions only for admins; for debug purposes. See all queries on the frontend of the blog and find the slowest part.
New release, new Plugin
Please use the plugin Debug Objects, provides more information and a cleaner query view as this older plugin.
The new solution list also the plugin and core queries in different views.
Since version 1.0.0 the plugin disable the MySQL query cache for the current connected session. That will show you the real execution time for a query. To disable this behavior set the constant QUERY_CACHE_TYPE_OFF to FALSE.
The plugin is perfect for WordPress developers, plugin and theme developers and site administrators who are trying to find out why the blog is too slow.
Params
The plugin has since version 1.0.0 a constant to disable the mySQL Session cache. On defoult is the value on true and the cache is off for an better analyse! For change this, set the constant QUERY_CACHE_TYPE_OFF to FALSE.
Example
This is a example for evaluation.
# Time: 0.00198888778687
Query: SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes'
Call from: require, require_once, require_once, require_once, is_blog_installed, wp_load_alloptions
# Time: 0.000695943832397
Query: UPDATE 'wp_options' SET 'option_value' = 'a:3:{i:0;b:0;s:25:\"adminimize/adminimize.php\";a:2:{i:0;O:10:\"adminimize\":1:{s:12:\"wp_filter_id\";i:0;}i:1;s:12:\"on_deinstall\";}s:31:\"debug_queries/debug_queries.php\";a:2:{i:0;O:12:\"DebugQueries\":1:{s:12:\"wp_filter_id\";i:0;}i:1;s:10:\"deactivate\";}}' WHERE 'option_name' = 'uninstall_plugins'
Call from: require, require_once, require_once, require_once, include_once, adminimize->adminimize, register_uninstall_hook, update_option
. . .
Total query time: 0.0155501365662 for 23 queries.
Total num_query time: 0.392 for 23 num_queries.
Acknowledgements
Thanks to Joost de Valk on yoast.com for small modifed on the plugin for some extra info.
Licence
Good news, this plugin is free for everyone! Since it’s released under the GPL, you can use it free of charge on your personal or commercial blog. But if you enjoy this plugin, you can thank me and leave a small donation for the time I’ve spent writing and supporting this plugin. And I really don’t want to know how many hours of my life this plugin has already eaten 😉
