[WordPress] 外掛分享: Query Monitor – The developer tools panel for WordPress

WordPress 外掛 Query Monitor – The developer tools panel for WordPress 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Query Monitor – The developer tools panel for WordPress」是 2013-11-18 上架。
  • 目前有 200000 個安裝啟用數。
  • 上一次更新是 2025-02-04,距離現在已有 87 天。
  • 外掛最低要求 WordPress 5.9 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 7.4 以上。
  • 有 454 人給過評分。
  • 論壇上目前有 9 個提問,問題解答率 22%

外掛協作開發者

johnbillion |

外掛標籤

debug | debug bar | development | performance | query monitor |

內容簡介

ministrator user). This cookie can be set by defining QM_AUTH_KEY in your wp-config.php file.

To learn more about how to use Query Monitor, please see the documentation.

Query Monitor是WordPress的開發者工具面板。它可以調試資料庫查詢、PHP錯誤、鉤子和操作、區塊編輯器塊、佇列的腳本和樣式表、HTTP API調用等等。

它還包括一些高級功能,例如Ajax調用、REST API調用和用戶能力檢查的調試。它包括了按插件或佈景主題縮小其輸出範圍的能力,讓您能夠快速確定表現不佳的插件、佈景主題或功能。

Query Monitor非常注重以有用的方式呈現其資訊,例如通過顯示按插件、佈景主題或負責它們的功能組織的聚合資料庫查詢。一旦選擇菜單項目,它會添加一個管理員工具欄菜單,顯示當前頁面的概覽,其完整的調試資訊在面板中顯示。

有關完整資訊,請參閱 Query Monitor網站。

以下是每個頁面加載時顯示的概述:

包括通知慢、重複或錯誤查詢的資料庫查詢。可按查詢類型(例如SELECT、UPDATE、DELETE等)、負責組件(插件、佈景主題、WordPress核心)和調用函數進行篩選,並為每個查詢提供單獨的聚合視圖。
顯示模板檔名、完整的模板層次結構以及已載入或未載入的所有模板部分的名稱。
PHP錯誤與其負責的組件和呼叫堆棧一起漂亮地呈現,管理員工具欄中會出現一個可見的警告。
使用WordPress 5.0+或Gutenberg插件時在文章內容中顯示的區塊及其相關屬性。
匹配的重寫規則,關聯的查詢字串和查詢變數。
佇列的腳本和樣式表,以及它們的依賴關係、從屬物和關於失敗依賴的警告。
用於每個文本域的語言設置和已載入的翻譯檔案(MO檔案)。
HTTP API請求,包括響應代碼、負責的組件和所需要的時間,對於失敗或錯誤的請求給出警告。
用戶能力檢查,以及結果和傳遞給能力檢查的任何參數。
環境信息,包括有關PHP、資料庫、WordPress和Web服務器的詳細信息。
所有WordPress條件函數(例如is_single()、is_home()等)的值。
已更新的短暫性資料。

此外:

每當發生重定向時,Query Monitor都會新增一個包含呼叫堆棧的HTTP標頭,因此您可以使用您喜愛的HTTP檢查工具或瀏覽器開發者工具來追踪觸發重定向的原因。
頁面上任何由jQuery發起的Ajax請求的響應都會在其標頭中包含各種調試資訊。PHP錯誤也會輸出到瀏覽器的開發者控制台中。
如果已驗證的WordPress REST API請求的用戶有權查看Query Monitor的輸出,則其響應將包含總體性能資訊和PHP錯誤的概述。包含更多調試資訊的 封裝REST API請求 將在響應的qm屬性中包含這些資訊。

默認情況下,QueryMonitor的輸出僅顯示給單站點安裝的管理員,以及多站點安裝的超級管理員。

除此之外,您可以設置一個驗證cookie,允許您在未登錄時(或者如果您已經登錄為非管理員用戶)查看Query Monitor輸出。這可以通過在 wp-config.php 文件中定義 QM_AUTH_KEY 實現。

要了解有關如何使用Query Monitor的更多資訊,請參閱 文檔 。

原文外掛簡介

Query Monitor is the developer tools panel for WordPress. It enables debugging of database queries, PHP errors, hooks and actions, block editor blocks, enqueued scripts and stylesheets, HTTP API calls, and more.
It includes some advanced features such as debugging of Ajax calls, REST API calls, user capability checks, and full support for block themes and full site editing. It includes the ability to narrow down much of its output by plugin or theme, allowing you to quickly determine poorly performing plugins, themes, or functions.
Query Monitor focuses heavily on presenting its information in a useful manner, for example by showing aggregate database queries grouped by the plugins, themes, or functions that are responsible for them. It adds an admin toolbar menu showing an overview of the current page, with complete debugging information shown in panels once you select a menu item.
Query Monitor supports versions of WordPress up to three years old, and PHP version 7.4 or higher.
For complete information, please see the Query Monitor website.
Here’s an overview of what’s shown for each page load:

Database queries, including notifications for slow, duplicate, or erroneous queries. Allows filtering by query type (SELECT, UPDATE, DELETE, etc), responsible component (plugin, theme, WordPress core), and calling function, and provides separate aggregate views for each.
The template filename, the complete template hierarchy, and names of all template parts that were loaded or not loaded (for block themes and classic themes).
PHP errors presented nicely along with their responsible component and call stack, and a visible warning in the admin toolbar.
Usage of “Doing it Wrong” or “Deprecated” functionality in the code on your site.
Blocks and associated properties within post content and within full site editing (FSE).
Matched rewrite rules, associated query strings, and query vars.
Enqueued scripts and stylesheets, along with their dependencies, dependents, and alerts for broken dependencies.
Language settings and loaded translation files (MO files and JSON files) for each text domain.
HTTP API requests, with response code, responsible component, and time taken, with alerts for failed or erroneous requests.
User capability checks, along with the result and any parameters passed to the capability check.
Environment information, including detailed information about PHP, the database, WordPress, and the web server.
The values of all WordPress conditional functions such as is_single(), is_home(), etc.
Transients that were updated.
Usage of switch_to_blog() and restore_current_blog() on Multisite installations.

In addition:

Whenever a redirect occurs, Query Monitor adds an HTTP header containing the call stack, so you can use your favourite HTTP inspector or browser developer tools to trace what triggered the redirect.
The response from any jQuery-initiated Ajax request on the page will contain various debugging information in its headers. PHP errors also get output to the browser’s developer console.
The response from an authenticated WordPress REST API request will contain an overview of performance information and PHP errors in its headers, as long as the authenticated user has permission to view Query Monitor’s output. An an enveloped REST API request will include even more debugging information in the qm property of the response.

By default, Query Monitor’s output is only shown to Administrators on single-site installations, and Super Admins on Multisite installations.
In addition to this, you can set an authentication cookie which allows you to view Query Monitor output when you’re not logged in (or if you’re logged in as a non-Administrator). See the Settings panel for details.
Other Plugins
I maintain several other plugins for developers. Check them out:

User Switching provides instant switching between user accounts in WordPress.
WP Crontrol lets you view and control what’s happening in the WP-Cron system

Privacy Statement
Query Monitor is private by default and always will be. It does not persistently store any of the data that it collects. It does not send data to any third party, nor does it include any third party resources. Query Monitor’s full privacy statement can be found here.
Accessibility Statement
Query Monitor aims to be fully accessible to all of its users. Query Monitor’s full accessibility statement can be found here.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Query Monitor – The developer tools panel for WordPress」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


2.6 | 2.5.2 | 2.5.3 | 2.5.4 | 2.5.5 | 2.5.6 | 2.6.1 | 2.6.2 | 2.6.3 | 2.6.4 | 2.6.5 | 2.6.6 | 2.6.7 | 2.6.8 | 2.6.9 | 2.7.0 | 2.7.1 | 2.7.2 | 2.7.3 | 2.7.4 | 2.8.0 | 2.8.1 | 2.9.0 | 2.9.1 | 3.0.0 | 3.0.1 | 3.1.0 | 3.1.1 | 3.2.0 | 3.2.1 | 3.2.2 | 3.3.0 | 3.3.1 | 3.3.2 | 3.3.3 | 3.3.4 | 3.3.5 | 3.3.6 | 3.3.7 | 3.4.0 | 3.5.0 | 3.5.1 | 3.5.2 | 3.6.0 | 3.6.1 | 3.6.2 | 3.6.3 | 3.6.4 | 3.6.5 | 3.6.6 | 3.6.7 | 3.6.8 | 3.7.0 | 3.7.1 | 3.8.0 | 3.8.1 | 3.8.2 | 3.9.0 | trunk | 2.10.0 | 2.11.0 | 2.11.1 | 2.11.2 | 2.11.3 | 2.11.4 | 2.12.0 | 2.13.0 | 2.13.1 | 2.13.2 | 2.13.3 | 2.13.4 | 2.14.0 | 2.15.0 | 2.16.1 | 2.16.2 | 2.17.0 | 2.6.10 | 3.10.0 | 3.10.1 | 3.11.0 | 3.11.1 | 3.11.2 | 3.12.0 | 3.12.1 | 3.12.2 | 3.12.3 | 3.13.0 | 3.13.1 | 3.14.0 | 3.14.1 | 3.15.0 | 3.16.0 | 3.16.1 | 3.16.2 | 3.16.3 | 3.16.4 | 3.17.0 | 3.17.1 | 3.17.2 |

延伸相關外掛(你可能也想知道)

  • LiteSpeed Cache 》LiteSpeed Cache for WordPress(LSCWP)是一種全方位的網站加速外掛,包括獨家的伺服器層快取和一系列的優化功能。, LSCWP 支援 WordPress Multisite 及大多...。
  • Jetpack – WP Security, Backup, Speed, & Growth 》search engines, and grow your traffic with Jetpack. It’s the ultimate toolkit for WordPress professionals and beginners alike., , Customize and des...。
  • Image Optimizer – Optimize Images and Convert to WebP or AVIF 》外掛總結:, , - Image Optimizer 是一個易於使用的 WordPress 外掛,透過壓縮和調整大小的技術來減少圖像大小,同時保留最高的圖像品質。, - Image Optimize...。
  • WP Super Cache 》本外掛可以從您的動態 WordPress 部落格生成靜態 HTML 檔案。在產生 HTML 檔案後,您的網頁伺服器會傳送該檔案,而不是處理比較沉重、耗費更多資源的 WordPre...。
  • WP Fastest Cache 》han PNG or JPEG, which means faster downloads and less data consumption for your visitors, Database Cleanup – Detect and delete unnecessary d...。
  • ManageWP Worker 》, Want to clone or migrate your WordPress website to a new host or domain? No problem! With ManageWP, you can easily clone or migrate your website ...。
  • W3 Total Cache 》W3 Total Cache (W3TC) 透過整合內容傳遞網絡 (CDN) 和最新最佳實踐等功能,提高網站性能、減少加載時間,增進 SEO、核心 Web 主要指標和整體用戶體驗。W3TC ...。
  • Speed Optimizer – The All-In-One Performance-Boosting Plugin 》SiteGround Optimizer 插件是由 SiteGround 開發的,可以大幅提高任何托管環境下的 WordPress 網站性能。, 最初設計用於 SiteGround 的服務器,現在已經有近 ...。
  • Autoptimize 》Autoptimize 能夠輕鬆優化您的網站。它可以整合、縮小和快取腳本和樣式表,在默認情況下向頁面 head 中注入 CSS,但也可以內嵌關鍵 CSS 並延遲整合的完整 CSS...。
  • AMP 》「Page Experience」(PX)是一組排名訊號,包括「核心網頁素質」(Core Web Vitals,CWV),用來測量使用者與網頁互動的使用體驗。AMP 是一個強大的工具,能...。
  • WebP Express 》ch means less bandwidth usage and faster page load times., Easy to use - with little effort, WordPress site admins can have their site serving auto...。
  • Breeze – WordPress Cache Plugin 》Breeze是由Cloudways團隊開發的一款免費、簡單(卻功能強大)且使用者友好的WordPress快取外掛。它提供不同層級的WordPress效能優化選項,在WordPress、搭配W...。
  • Jetpack Boost – Website Speed, Performance and Critical CSS 》使用 Jetpack Boost 優化網頁性能加速你的 WordPress 網站。輕鬆啟用一鍵優化,提升核心 Web 重要指標。, 你是否知道,更快的網站可以:, , 在 Google 搜尋排...。
  • Custom Fonts – Host Your Fonts Locally 》此外掛能協助您輕鬆地在 WordPress 網站中嵌入自定義字型檔案 (woff2、woff、ttf、svg、eot、otf)。, 目前能與以下主題和外掛一起使用:, , Astra 主題, Beav...。
  • Redis Object Cache 》一個由 Redis 提供支援的持久化物件快取後端。支援 Predis、PhpRedis (PECL)、Relay、複寫、哨兵、叢集化和 WP-CLI。, 若要調整連線參數、前綴的快取鍵或設定...。

文章
Filter
Apply Filters
Mastodon