Query Monitor – The developer tools panel for WordPress

説明

Query Monitor は WordPress 開発者向けのツールパネルです。データベースクエリ、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

プライバシー声明

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.

スクリーンショット

  • 管理バーのメニュー
  • コンポーネントごとにデータベースクエリーを集計
  • 権限チェック
  • データベースクエリー
  • フックとアクション
  • HTTP API リクエスト
  • 関数からの呼び出しごとにまとめられたデータベースクエリー

FAQ

Does this plugin work with PHP 8?

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

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 WordPress 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 report security bugs through the official Query Monitor Vulnerability Disclosure Program on Patchstack. The Patchstack team helps validate, triage, and handle any security vulnerabilities.

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

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.

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

評価

2025年2月4日
This plugin totally crashed the Admin area of our website. We had to contact our hosting provider and ask them to delete the plugin’s files.
Query Monitor is an incredibly useful tool for developers and site administrators. It provides detailed insights into database queries, page load times, and resource consumption, making it a must-have for debugging and performance optimization. I particularly appreciate how it highlights potential errors in the code and plugins during development, saving time and effort in troubleshooting. Its intuitive interface and in-depth reports make identifying issues straightforward. Overall, it’s a fantastic plugin that I highly recommend to anyone building or maintaining WordPress websites.
2024年11月26日
I installed it in seconds and immediately knew what was causing my backend to be so sluggish. I definitely recommend checking out their site to understand what it all means.
454件のレビューをすべて表示

貢献者と開発者

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

貢献者

“Query Monitor – The developer tools panel for WordPress” は25ロケールに翻訳されています。 翻訳者のみなさん、翻訳へのご協力ありがとうございます。

“Query Monitor – The developer tools panel for WordPress” をあなたの言語に翻訳しましょう。

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

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

変更履歴

3.17.2 (4 February 2025)

  • Reinstates the “Blocks” panel

3.17.1 (2 February 2025)

  • Prevents use of the deprecated E_STRICT constant in PHP 8.4.
  • Avoids use of the deprecated setted_transient and setted_site_transient actions in WordPress 6.8.
  • Skips showing the _load_textdomain_just_in_time notices when they’re caused by Query Monitor itself.
  • Uses more appropriate formatting for a fatal error in REST API and Ajax contexts.

3.17.0 (27 November 2024)

  • Support for WordPress 6.7.
  • Support for PHP 8.4.
  • Inline scripts are now output using wp_print_inline_script_tag() so a Content Security Policy can be fully implemented.
  • Various improvements and fixes.

3.16.4 (25 July 2024)

  • Confirms support for WordPress 6.6.

3.16.3 (22 May 2024)

  • Prevents an infinite loop when logging doing it wrong calls and deprecated calls.
  • Removes a global from query-monitor.php

3.16.2 (22 May 2024)

  • Fixes another issue with the PHP autoloader in 3.16.0 and 3.16.1 that was crashing some sites

3.16.1 (22 May 2024)

  • Fixes an issue with the PHP autoloader in 3.16.0 that was crashing some sites

3.16.0 (22 April 2024)

  • Adds full support for debugging new features in WordPress 6.5: JavaScript modules and PHP translation files

3.15.0 (10 November 2023)

3.14.1 (21 October 2023)

  • Improves compatibility with WordPress Playground

Earlier versions

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