Query Monitor

説明

Query Monitor は WordPress および WooCommerce 開発者向けのツールパネルです。データベースクエリー、PHP エラー、フックとアクション、ブロックエディターのブロック、読み込まれた JavaScript とスタイルシート、HTTP API 呼び出しなどがデバッグ可能になります。

高度な機能として、Ajax と REST API の呼び出しデバッグ、ユーザー権限チェックがあり、ブロックテーマとフルサイト編集にも完全対応しています。また、結果のほとんどは対象のプラグインまたはテーマを特定することもできるため、パフォーマンスの悪いプラグイン、テーマ、または関数を迅速に判断できます。

Query Monitor は役立つ情報を見せることに注力しており、たとえばデータベースクエリーはプラグイン、テーマ、関数ごとにグループ分けして表示されます。管理バーに現在のページの概要を表示し、メニュー項目を選択すれば完全なデバッグ情報が表示されます。

Query Monitor supports versions of WordPress up to three years old, and PHP version 7.4 or higher.

より詳しい情報は、Query Monitor のサイトを見てください。

それぞれのページ読み込みで表示される概要はこちらです:

  • データベースクエリー、遅いクエリー、重複クエリー、エラーのあるクエリー。クエリーの種類 (SELECT, UPDATE, DELETE など)、関連するコンポーネント (プラグイン、テーマ、WordPress コア)、呼び出している関数、そしてそれぞれを組み合わせフィルタリングも可能。
  • テンプレートのファイル名、完全なテンプレート階層、ロードされた、またはロードされなかったすべてのテンプレートパーツの名前 (ブロックテーマと従来のテーマのいずれも)。
  • PHPエラーとその関連するコンポーネント、コールスタック、警告を管理バーに表示。
  • サイト上のコードで使用されている関数の間違いや非推奨。
  • 投稿コンテンツ内およびフルサイト編集 (FSE) 内のブロックと関連プロパティ。
  • 一致するリライトルール、関連するクエリー文字列とクエリー変数。
  • 読み込まれた JavaSrcript とスタイルシート、その依存関係および壊れてしまった依存関係についての警告。
  • 言語設定とそれぞれのテキストドメインで読み込まれた翻訳ファイル (MO ファイルと JSON ファイル)。
  • レスポンスコード付きの HTTP API リクエスト、関連するコンポーネント、所要時間、失敗あるいはエラーのあるリクエストだった場合の警告。
  • ユーザーの権限チェックとその結果、権限チェックに渡されたあらゆる変数。
  • PHP、データベース、WordPress、Web サーバーに関する詳細な環境情報。
  • is_single(), is_home() のような WordPress 条件分岐関数の値。
  • 更新された Transient。
  • マルチサイトでの switch_to_blog()restore_current_blog() の使用。

おまけ:

  • リダイレクトが起きると Query Monitor はコールスタックを含んだ HTTP ヘッダーを追加するので、お好きな HTTP インスペクターやブラウザーの開発者ツールでリダイレクトを発生させたものをトレースすることができます。
  • ページ内で jQuery から実行された Ajax リクエストのレスポンスはヘッダーに様々なデバッグ情報を含んでいます。PHP エラーもデヴェロッパーコンソールに出力されます。
  • 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.

初期設定だと、Query Monitor の出力はシングルサイトで管理者、マルチサイトで特権管理者にだけ表示されます。

さらに、ログインしていないとき (もしくは管理者以外でログイン中のとき) でも Query Monitor の出力を見ることができるよう認証用の Cookie を設定することができます。詳しくは設定パネルを見てください。

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

Thanks

The time that I spend maintaining this plugin and others is in part sponsored by:

プライバシー声明

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.

スクリーンショット

  • 管理バーのメニュー
  • コンポーネントごとにデータベースクエリーを集計
  • データベースクエリー
  • Timeline
  • フックとアクション
  • HTTP API リクエスト
  • Logs

FAQ

Does this plugin work with PHP 8?

Yes, it’s actively tested and working up to PHP 8.5.

Query Monitor の出力は誰が閲覧できますか ?

初期設定だと、Query Monitor の出力はシングルサイトで管理者、マルチサイトで特権管理者にだけ表示されます。

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 when you’re logged in as a user who cannot usually see Query Monitor’s output. See the Settings panel for details.

Query Monitor 自体はページの生成時間やメモリー消費に影響を与えますか?

簡潔に言うと、そうですが、少しだけです。

Long answer: Query Monitor has a small impact on page generation time because it hooks into a few places in WordPress in the same way that other plugins do. The impact is negligible.

On pages that have an especially high number of database queries (in the hundreds), Query Monitor currently uses more memory than I would like it to. This is due to the amount of data that is captured in the stack trace for each query. I have been and will be working to continually reduce this.

Can I prevent Query Monitor from collecting data during long-running requests?

Yes, you can call do_action( 'qm/cease' ) to instruct Query Monitor to cease operating for the remainder of the page generation. It will detach itself from further data collection, discard any data it’s collected so far, and skip the output of its information.

This is useful for long-running operations that perform a very high number of database queries, consume a lot of memory, or otherwise are of no concern to Query Monitor, for example:

  • Backing up or restoring your site
  • Importing or exporting a large amount of data
  • Running security scans

Query Monitor のアドオンプラグインはありますか。

A list of add-on plugins for Query Monitor can be found here.

さらに、Query Monitor は Debug Bar プラグインのアドオンを透過的にサポートしています。Debug Bar のアドオンがインストールされている場合、Debug Bar を無効化するだけで Query Monitor のメニューにそのアドオンの情報が表示されます。

新機能の提案やバグレポートはどこで受け付けていますか。

wordpress.org のサポートフォーラムではなく、Query Monitor の GitHub リポジトリにあるイシュートラッカーを使ってください。その方がイシューの進捗を追いかけるのに適しています。

Is Query Monitor already included with my hosting?

Some web hosts bundle Query Monitor as part of their hosting platform, which means you don’t need to install it yourself. Here are some that I’m aware of:

スタックトレースをクリックして私のエディターでファイルを開くことはできますか?

Yes. You can enable this on the Settings panel.

How can I report a security bug?

You can submit a private security vulnerability report to Query Monitor via the Security tab on the GitHub repo. The GitHub Security Advisory process facilitates private collaboration on security issues. You’ll receive credit for a valid report and a CVE if necessary.

Do not report security issues on the WordPress.org support forums or via email. Thank you.

寄付を受け付けていますか。

I am accepting sponsorships via the GitHub Sponsors program. If you work at an agency that develops with WordPress, ask your company to provide sponsorship in order to invest in its supply chain. The tools that I maintain probably save your company time and money, and GitHub sponsorship can now be done at the organisation level.

また、このプラグインがお気に召したのなら、レビューを残してください。お友達にも伝えてくださいね !

評価

2026年4月20日
I’ve been using Query Monitor since 2023, and I honestly can’t imagine debugging WordPress sites without it anymore. It’s not just a plugin, it’s a complete developer toolbox that sits in the admin bar. It’s lightweight enough to keep running on production sites without noticeable overhead. John Blackbourn has built something truly special here. Five stars isn’t enough. Thank you for this masterpiece.
2026年4月8日
This plugin helped me realize a problem right in front of my eyes this whole time. A fantastic tool for troubleshooting database issues!
2026年2月5日 1 reply
Good. Shows a lot of useful stuff. Note that you will need to add /wp-content/db.php to your gitignore.
466件のレビューをすべて表示

貢献者と開発者

Query Monitor はオープンソースソフトウェアです。以下の人々がこのプラグインに貢献しています。

貢献者

“Query Monitor” は26ロケールに翻訳されています。 翻訳者のみなさん、翻訳へのご協力ありがとうございます。

“Query Monitor” をあなたの言語に翻訳しましょう。

開発に興味がありますか ?

コードを閲覧するか、SVN リポジトリをチェックするか、開発ログRSS で購読してみてください。

変更履歴

4.0.6 (11 April 2026)

Version 4 of Query Monitor adds a new timeline view, and switches from rendering its panels server-side in PHP to efficiently rendering them client-side in Preact.

Version 4.0.6 fixes a compatibility issue with the GeneratePress theme.

More information at querymonitor.com/4.

4.0.5 (10 April 2026)

Version 4 of Query Monitor adds a new timeline view, and switches from rendering its panels server-side in PHP to efficiently rendering them client-side in Preact.

Version 4.0.5 fixes the following:

  • Ensures closing script tags within data don’t break the output
  • Adds “Doing it Wrong” data to the timeline view

More information at querymonitor.com/4.

4.0.4 (10 April 2026)

Version 4 of Query Monitor adds a new timeline view, and switches from rendering its panels server-side in PHP to efficiently rendering them client-side in Preact.

Version 4.0.4 fixes the following:

  • Ensures the Scripts panel remains visible when no scripts are enqueued in the header
  • Corrects the display of number formatting in some locales

More information at querymonitor.com/4.

4.0.3 (9 April 2026)

Version 4 of Query Monitor adds a new timeline view, and switches from rendering its panels server-side in PHP to efficiently rendering them client-side in Preact.

Version 4.0.3 fixes the following:

  • Improves compatibility with plugins that perform non-UTF8 queries or make other use of non-UTF8 data
  • Avoids a PHP warning for undefined file and line number in some stack trace frames
  • Simplifies and standardises the format of names used for closure callbacks
  • Improves styling and layout of the timeline view

More information at querymonitor.com/4.

4.0.2 (9 April 2026)

Version 4 of Query Monitor adds a new timeline view, and switches from rendering its panels server-side in PHP to efficiently rendering them client-side in Preact.

Version 4.0.2 fixes the following:

  • Adds further backwards compatibility for third-party plugins that read from the QM data collectors and output their own panels
  • Adds transient updates to the timeline view

More information at querymonitor.com/4.

4.0.1 (7 April 2026)

Version 4 of Query Monitor adds a new timeline view, and switches from rendering its panels server-side in PHP to efficiently rendering them client-side in Preact.

  • Version 4.0.1 fixes a backwards compatibility issue with plugins that register their own menus or sub-menus in Query Monitor.

More information at querymonitor.com/4.

4.0.0 (7 April 2026)

Version 4 of Query Monitor adds a new timeline view, and switches from rendering its panels server-side in PHP to efficiently rendering them client-side in Preact. This new approach provides several benefits:

  • Performance is greatly increased, particularly on sites where a large number of queries are performed, a large number of PHP errors are triggered, or a large amount of data is collected in one of the other panels.
  • Further future enhancements are facilitated, such as displaying client-side metrics, lazy-loading data, showing data from different requests, and more remixing of data into different views.
  • The raw data collected by Query Monitor has been reduced in size and memory usage, and is now exposed to the page as JSON. Take a look at the QueryMonitorData object in your browser console to play around with it.

More information at querymonitor.com/4.

3.20.4 (19 March 2026)

3.20.3 (17 March 2026)

  • Clicking QM in the the admin toolbar a second time will now close the panel
  • Improvements to accessibility of the toggle buttons
  • Failed HTTP API GET requests now show a clickable link

3.20.2 (11 December 2025)

  • Prevents a PHP error being triggered under certain conditions and when no database queries are performed.

Earlier versions

For the changelog of earlier versions, refer to the releases page on GitHub.