Query Monitor

説明

Query Monitor is the developer tools panel for WordPress. It includes some advanced features such as Ajax and REST API debugging, and the ability to narrow down its output by plugin or theme.

Query Monitor focuses heavily on presenting its information in a useful manner. For example, aggregate database query information is made available, allowing you to quickly determine poorly performing plugins, themes, or functions. It adds an admin toolbar menu showing an overview of the current page, with complete data shown in a panel once you select a menu item.

For complete information, please see the Query Monitor website.

Here’s an overview of some of what’s shown:

データベースクエリー

  • 現在のリクエストで実行されるすべてのデータベースクエリーを表示
  • 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

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 query vars for the current request, and highlights custom query vars
  • Shows all matched rewrite rules and associated query strings

スクリプトとスタイル

  • 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.

認証

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.

Privacy Statement

Query Monitor 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.

スクリーンショット

  • 概要を表示中の管理ツールバー
  • コンポーネントごとにデータベースクエリーを集計
  • 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 WordPress in the same way that other plugins do. The impact is low; typically between 10ms and 100ms depending on the complexity of your site.

Query Monitor’s memory usage typically accounts for around 10% of the total memory used to generate the page.

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!

評価

Awesome – great for debugging

Still wearing training wheels but I love the improved interface and operation.

Great for revealing info you can report to plugin developers; thus speeding up fixes and everyone wins 😉

one of the best in its field

if you are developing a plugin or theme, Query Monitor is a must to have if you care about performance. I consider it one of the most useful plugins for development

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

貢献者と開発者

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

貢献者

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

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

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

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

変更履歴

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