Query Monitor

説明

Query Monitor は、WordPress 開発者すべてを対象にしたデバッグ用プラグインです。AJAX コール、REST API リクエスト、リダイレクトといった他のデバッグプラグインには含まれない高度な機能を持ち、プラグインやテーマによって出力を絞り込むこともできます。

詳細については、Query Monitor の GitHub レポジトリをご覧ください。

表示内容の概要は次のとおりです。

データベースクエリー

  • 現在のリクエストで実行されるすべてのデータベースクエリーを表示
  • Shows affected rows and time for all queries
  • Shows notifications for slow queries, duplicate queries, and queries with errors
  • 種類でクエリーを絞り込み (SELECTUPDATEDELETE など)
  • コンポーネントでクエリーを絞り込み (WordPress コア、プラグイン X、プラグイン Y、テーマ)
  • 呼び出し関数でクエリーを絞り込み
  • View aggregate query information grouped by component, calling function, and type
  • Super advanced: Supports multiple instances of wpdb on one page (more info in the FAQ)

Filtering queries by component or calling function makes it easy to see which plugins, themes, or functions are making the most (or the slowest) database queries.

フック

  • Shows all hooks fired on the current request, along with hooked actions, their priorities, and their components
  • 名前でフックを絞り込み
  • Filter actions by component (WordPress core, Plugin X, Plugin Y, theme)

テーマ

  • Shows the template filename for the current request
  • Shows the complete template hierarchy for the current request (WordPress 4.7+)
  • Shows all template parts used on the current request
  • Shows the available body classes for the current request
  • 現在有効化中のテーマ名を表示

PHP エラー

  • PHP errors (warnings, notices, stricts, and deprecated) are presented nicely along with their component and call stack
  • Shows an easily visible warning in the admin toolbar

リクエスト

  • Shows matched rewrite rules and associated query strings
  • Shows query vars for the current request, and highlights custom query vars
  • 照会オブジェクトの詳細を表示
  • Shows details of the current blog (multisite only) and current site (multi-network only)

リライトルール

  • Shows all matching rewrite rules for the current request

スクリプトとスタイル

  • Shows all enqueued scripts and styles on the current request, along with their URL and version
  • Shows their dependencies and dependents, and displays an alert for any broken dependencies

言語

  • Shows language settings and text domains
  • Shows the MO files for each text domain and which ones were loaded or not

HTTP リクエスト

  • Shows all HTTP requests performed on the current request (as long as they use WordPress’ HTTP API)
  • Shows the response code, call stack, component, timeout, and time taken
  • Highlights erroneous responses, such as failed requests and anything without a 200 response code

User Capability Checks

  • Shows every user capability check that is performed on the page, along with the result and any parameters passed along with the capability check.

転送ルール

  • Whenever a redirect occurs, Query Monitor adds an X-QM-Redirect HTTP header containing the call stack, so you can use your favourite HTTP inspector or browser developer tools to easily trace where a redirect has come from

AJAX

The response from any jQuery AJAX request on the page will contain various debugging information in its headers. Any errors also get output to the developer console. No hooking required.

Currently this includes PHP errors and some overview information such as memory usage, but this will be built upon in future versions.

REST API

The response from an authenticated WordPress REST API (v2 or later) request will contain various debugging information in its headers, as long as the authenticated user has permission to view Query Monitor’s output.

Currently this includes PHP errors and some overview information such as memory usage, but this will be built upon in future versions.

管理画面

  • Shows the correct names for custom column filters and actions on all admin screens that have a listing table
  • Shows the state of get_current_screen() and a few variables

環境情報

  • Shows various PHP information such as memory limit and error reporting levels
  • Highlights the fact when any of these are overridden at runtime
  • Shows various MySQL information, including caching and performance related configuration
  • Highlights the fact when any performance related configurations are not optimal
  • Shows various details about WordPress and the web server
  • すべてのもののバージョン番号を表示

その他すべて

  • Shows any transients that were set, along with their timeout, component, and call stack
  • Shows all WordPress conditionals on the current request, highlighted nicely
  • Shows an overview at the top, including page generation time and memory limit as absolute values and as % of their respective limits

認証

By default, Query Monitor’s output is only shown to Administrators on single-site installs, and Super Admins on Multisite installs.

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 bottom of Query Monitor’s output for details.

スクリーンショット

  • 概要を表示中の管理ツールバー
  • コンポーネントごとにデータベースクエリーを集計
  • User capability checks with an active filter
  • フィルターコントロールによるデータベースクエリーの完成
  • フックとアクション
  • HTTP リクエスト (HTTP エラーを表示中)
  • 呼び出し関数ごとにデータベースクエリーを集計

FAQ

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

By default, Query Monitor’s output is only shown to Administrators on single-site installs, and Super Admins on Multisite installs.

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 bottom of Query Monitor’s output for details.

Does Query Monitor itself impact the page generation time or memory usage?

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

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.

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

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

In addition, Query Monitor transparently supports add-ons for the Debug Bar plugin. If you have any Debug Bar add-ons installed, just deactivate Debug Bar and the add-ons will show up in Query Monitor’s menu.

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

Please use the issue tracker on Query Monitor’s GitHub repo as it’s easier to keep track of issues there, rather than on the wordpress.org support forums.

Is Query Monitor available on WordPress.com VIP Go?

Yep! You just need to add define( 'WPCOM_VIP_QM_ENABLE', true ); to your vip-config/vip-config.php file.

(It’s not available on standard WordPress.com VIP though.)

I’m using multiple instances of `wpdb`. How do I get my additional instances to show up in Query Monitor?

You’ll need to hook into the qm/collect/db_objects filter and add an item to the array with your connection name as the key and the wpdb instance as the value. Your wpdb instance will then show up as a separate panel, and the query time and query count will show up separately in the admin toolbar menu. Aggregate information (queries by caller and component) will not be separated.

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

No, I do not accept donations. If you like the plugin, I’d love for you to leave a review. Tell all your friends about the plugin too!

評価

ditto to the other 5 star reviews

This is super handy for finding bottlenecks (so much better than trying to just optimize everything… I’ve usually found fixing the top 3 SQL queries speeds up pagelyoads by like 40%)

Jaw-dropping plugin!

I created a WP account just so I can leave a 5-star review for this beast.
Amazing work! 12/10 would recommend.

234件のレビューをすべて表示

貢献者と開発者

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

貢献者

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

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

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

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

変更履歴

Query Monitor の変更履歴は、GitHub のリリースページをご覧ください。