內容簡介
MySQL Profiler 顯示關於 SQL 查詢的調試信息給 WordPress 的管理員用戶看。對於每個查詢,該插件顯示了時間、語法高亮的 SQL 以及調用的函數跟蹤(包括調用函數的文件和行號)。
可以按任何列排序列表,例如:
按 ID 排序以按時間軸順序查看查詢
按時間排序以查看最慢的查詢
按查詢排序分組查詢類型(SELECT、UPDATE 等)
按跟蹤排序將查詢分組為類似的來源
可以通過在搜索框中輸入進行篩選,例如:
查看使用 wp_posts 表的所有查詢
查看所有與 taxonomy.php 中函數的使用有關的查詢
查看所有與特定函數或類有關的查詢
查看調用特定 MySQL 函數的所有查詢
要關閉語法高亮,請在 wp-config.php 中添加以下代碼:
define('MP_HIGHLIGHT_SYNTAX', false);
要在函數跟蹤中省略文件和行號並將函數顯示為逗號分隔的列表(以節省垂直空間),請在 wp-config.php 中定義以下內容:
define('MP_DISPLAY_FILES', false);
該插件的編寫部分基於 Frank Bueltge 的 Debug Queries 插件,因此要感謝他為該插件的發展做出的貢獻。
如果您想獲取開發版、查看正在添加的新功能或瀏覽源代碼,請訪問/關注GitHub 資料夾。
外掛標籤
開發者團隊
原文外掛簡介
MySQL Profiler displays debugging information about SQL queries to admin WordPress users. For each query, the profiler displays the time, syntax-highlighted SQL, and a trace of the functions (as well as the file and line number that the functions were called from) that were called.
The list can be sorted by any of its columns, so you can, for example:
Order the list by ID to see the chronological order of the queries
Order the list by time to see the slowest queries
Order the list by query to group the queries by type (SELECT, UPDATE, etc)
Order the list by trace to group the queries by similar origins
The list can also filtered by typing in the search box, so you can, for example:
View all queries that use the wp_posts table
View all queries that are related to the use of a function in taxonomy.php
View all queries that are related to the use of a specific function or class
View all queries that call a specific MySQL function
To turn off syntax highlighting, put the following in wp-config.php:
define('MP_HIGHLIGHT_SYNTAX', false);
To omit the file and line number from the function trace and display the functions as a comma-separated list (to save vertical space), define the following in wp-config.php:
define('MP_DISPLAY_FILES', false);
This plugin was loosely based on Frank Bueltge‘s Debug Queries plugin, so a hearty thanks to him for the development of that.
If you’d like to grab development releases, see what new features are being added, or browse the source code please visit/follow the GitHub repo.
