Coder Social home page Coder Social logo

johnbillion / query-monitor Goto Github PK

View Code? Open in Web Editor NEW
1.6K 45.0 201.0 12.88 MB

The developer tools panel for WordPress

Home Page: https://querymonitor.com

License: GNU General Public License v2.0

JavaScript 3.71% PHP 89.09% SCSS 7.20%
wordpress-plugin wordpress performance query-monitor debugging dev-tools

query-monitor's Introduction

WordPress Plugin Version License WordPress Tested Build Status

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. Here's an example showing aggregate database queries grouped by the components responsible for them:

Aggregate Database Queries by Component


Features

Database Queries

  • Shows all database queries performed during the current request
  • Shows affected rows and time taken for all queries
  • Shows notifications for slow queries, duplicate queries, and queries with errors
  • Shows aggregate query information grouped by type, component, or calling function
  • Queries can be filtered by query type, component, or calling function

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

Hooks & Actions

  • Shows all hooks fired during the current request, along with action callbacks, priorities, and components
  • Actions can be filtered by component or name

Theme

  • Shows the template filename and complete template hierarchy
  • Shows all template parts that were requested, and whether they were loaded or not
  • Shows the available body classes
  • Fully supports block themes and full site editing (FSE)

PHP Errors

  • Shows PHP warnings, notices, stricts, and deprecated errors, formatted nicely along with their component and call stack
  • Shows a visible warning in the admin toolbar when necessary

Doing it Wrong

  • Shows usage of "Doing it Wrong" or "Deprecated" functionality in the code on your site

Block Content

  • Shows blocks and associated information from post content and full site editing

Request

  • Shows information about matched URL rewrite rules for the request and corresponding query parameters
  • Shows query variables and highlights any that are custom

Scripts & Styles

  • Shows all enqueued scripts and styles along with their handle, URL, and version
  • Shows their dependencies and dependents
  • Alerts you to any broken or missing dependencies
  • Supports the script modules feature added in WordPress 6.5

Languages

  • Shows you language settings and loaded text domains
  • Shows you the requested MO, JSON, and PHP translation files for each text domain and which ones were loaded

HTTP API Requests

  • Shows all server-side HTTP requests (as long as they use the WordPress HTTP API)
  • Shows the response code, call stack, component, timeout, response size, time taken, and other meta data
  • Alerts you to erroneous responses, such as failed requests and anything without a 200 response code

User Capability Checks

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

Multisite

  • Shows all calls to switch_to_blog() and restore_current_blog() on Multisite installations

Redirects

  • Whenever a server-side 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 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 request will contain various debugging information in its headers, as long as the authenticated user has permission to view Query Monitor's output.

Read more about debugging REST API requests with Query Monitor.

Admin Screen

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

Environment Information

  • Shows PHP information such as memory limit, error reporting levels, and values of various constants
  • Shows MySQL or MariaDB information, including caching and performance related configuration
  • Shows information about WordPress and the web server
  • Shows version numbers for all the things

Logging

Debugging messages can be sent to the Logs panel using actions. This works as a good replacement for var_dump():

do_action( 'qm/debug', 'This happened!' );

The logger is PSR-3 compatible, so you can use any of the following actions which correspond to PSR-3 log levels:

  • qm/debug
  • qm/info
  • qm/notice
  • qm/warning
  • qm/error
  • qm/critical
  • qm/alert
  • qm/emergency

A log level of warning or higher will trigger a notification in Query Monitor's admin toolbar.

Read more about profiling and logging in Query Monitor.

Profiling

Basic performance profiling can be displayed in the Timings panel using actions in your code:

// Start the 'foo' timer:
do_action( 'qm/start', 'foo' );

// Run some code
my_potentially_slow_function();

// Stop the 'foo' timer:
do_action( 'qm/stop', 'foo' );

Read more about profiling and logging in Query Monitor.

Everything Else

  • Shows any transients that were set, along with their timeout, component, and call stack
  • Shows all WordPress conditionals during 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

Authentication

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

Notes

A Note on Query Monitor's Implementation

In order to do a few clever things, Query Monitor symlinks a custom db.php into your WP_CONTENT_DIR which means it loads very early. This file gets included before the database driver is loaded, meaning this portion of Query Monitor loads before WordPress even engages its brain.

In this file is Query Monitor's extension to the wpdb class which:

  • Allows it to log details about all database queries (including ones that happen before plugins are loaded)
  • Logs the full stack trace for each query, which allows it to determine the component that's responsible for the query
  • Logs the query result, which allows it to display the affected rows or error message if applicable

If your WP_CONTENT_DIR isn't writable and therefore the symlink for db.php can't be put in place, Query Monitor still functions, but this extended functionality won't be available. You can manually create the db.php symlink if you have permission.

Screenshots

Admin Toolbar Menu

Admin Toolbar Menu

Database Queries

Database Queries

Capability Checks

Capability Checks

Aggregate Database Queries by Component

Aggregate Database Queries by Component

Aggregate Database Queries by Calling Function

Aggregate Database Queries by Calling Function

Hooks and Actions

Hooks and Actions

HTTP API Requests

HTTP API Requests

Frequently Asked Questions

Does this plugin work with PHP 8?

Yes, it's actively tested and working up to PHP 8.2.

Who can see Query Monitor's output?

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

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

Short answer: Yes, but only a little.

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

Are there any add-on plugins for 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, deactivate Debug Bar and the add-ons will show up in Query Monitor's menu.

Where can I suggest a new feature or report a bug?

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 Altis?

Yes, the Altis Developer Tools are built on top of Query Monitor.

Is Query Monitor available on WordPress VIP?

Yes, but a user needs to be granted the view_query_monitor capability to see Query Monitor even if they're an administrator. See the WordPress VIP documentation for more details.

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

This feature was removed in version 3.12 as it was rarely used and considerably increased the maintenance burden of Query Monitor itself. Feel free to continue using version 3.11 if you need to make use of this feature.

Can I click on stack traces to open the file in my editor?

Yes. You can enable this on the Settings panel.

How can I report a security bug?

You can report security bugs through the Patchstack Vulnerability Disclosure Program. The Patchstack team helps validate, triage, and handle any security vulnerabilities. Report a security vulnerability here.

Do you accept donations?

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.

In addition, if you like the plugin then I'd love for you to leave a review. Tell all your friends about it too!

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. It implements best practices for web accessibility, outputs semantic and structured markup, uses the accessibility APIs provided by WordPress and web browsers where appropriate, and is fully accessible via keyboard.

That said, Query Monitor does not conform to the Web Content Accessibility Guidelines (WCAG) 2.0 at level AA like WordPress itself does. The main issue is that the user interface uses small font sizes to maintain a high information density for sighted users. Users with poor vision or poor motor skills may struggle to view or interact with some areas of Query Monitor because of this. This is something which I'm acutely aware of and which I work to gradually improve, but the underlying issue of small font sizes remains.

If you've experienced or identified another accessibility issue in Query Monitor, please open a thread in the Query Monitor plugin support forum and I'll try my best to address it swiftly.

Related Tools

Debugging is rarely done with just one tool. Along with Query Monitor you should be aware of other plugins and tools for debugging and profiling your website. Here are some recommendations:

WordPress Plugins

Query Monitor also has several add-on plugins which extend its functionality, and transparently supports add-ons for the Debug Bar plugin (see the FAQ for more info).

See also my list of WordPress Developer Plugins.

Other tools

Hosted services

Contributing

Code contributions, feedback, and feature suggestions are very welcome. See CONTRIBUTING.md for more details.

Icon

Query Monitor's icon was designed by Tubagus Didin Asrori.

License: GPLv2

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

query-monitor's People

Contributors

abuyoyo avatar barryceelen avatar crstauf avatar crxgames avatar dsawardekar avatar evanherman avatar garyjones avatar gmazzap avatar iandelmar avatar jocastaneda avatar joedolson avatar joehoyle avatar johnbillion avatar kevinlearynet avatar misenhower avatar morganestes avatar mte90 avatar nickdaugherty avatar ocean90 avatar originalexe avatar paulschreiber avatar pborreli avatar pschoffer avatar rmccue avatar simonwheatley avatar szepeviktor avatar tillkruss avatar timiwahalahti avatar tomjn avatar westonruter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

query-monitor's Issues

Profiling

Query Monitor does not currently provide a profiling mechanism. Not sure how I want to do this yet. Suggestions/discussion welcome.

See also:

is_a() Errors and strstr() Warning

After installing Query Monitor (which I love btw), there are about 10 errors displayed from the plugin itself. Could you resolve these?

Warning Wrong parameter count for strstr()
wp-content/plugins/query-monitor/components/db_queries.php:301
strstr()
do_action('shutdown')
shutdown_action_hook()

is_a(): Deprecated. Please use the instanceof operator
wp-includes/functions.wp-styles.php:157
is_a()
wp_enqueue_style()
do_action('init')

is_a(): Deprecated. Please use the instanceof operator
wp-includes/functions.wp-scripts.php:192
is_a()
wp_enqueue_script()
do_action('init')

is_a(): Deprecated. Please use the instanceof operator
wp-includes/functions.wp-scripts.php:110
is_a()
wp_localize_script()
do_action('init')

is_a(): Deprecated. Please use the instanceof operator
wp-includes/script-loader.php:827
is_a()
print_admin_styles()
do_action('admin_print_styles')

is_a(): Deprecated. Please use the instanceof operator
wp-includes/script-loader.php:701
is_a()
print_head_scripts()
do_action('admin_print_scripts')

is_a(): Deprecated. Please use the instanceof operator
wp-includes/script-loader.php:853
is_a()
print_late_styles()
_wp_footer_scripts()
do_action('admin_print_footer_scripts')

is_a(): Deprecated. Please use the instanceof operator
wp-includes/script-loader.php:723
is_a()
print_footer_scripts()
_wp_footer_scripts()
do_action('admin_print_footer_scripts')

is_a(): Deprecated. Please use the instanceof operator
wp-content/plugins/query-monitor/components/db_queries.php:130
is_a()
do_action('shutdown')
shutdown_action_hook()

is_a(): Deprecated. Please use the instanceof operator
wp-content/plugins/query-monitor/components/environment.php:112
is_a()
do_action('shutdown')
shutdown_action_hook()

Broken when BuddyPress is Active

While testing this plugin I've found that it doesn't seem to work if BuddyPress is active on a WordPress site. Otherwise it's awesome. :)

Other Plugin, maybe same idea

HI John,
Currently I have test your plugin, only a fast read about the repo via mobile. At first, nice to see, that you open sourced this plugin. Other topic is the hint to my plugin https://github.com/bueltge/Debug-Objects with the goal to help on development and debugging on customer installs. Maybe you see a benefit for your plugin or a merge, that I have less work, support and todos on my plugin.
Thanks for your time.

Breaks AJAX

I've been having problems with anything ajax on the site I'm working on recently, with no response (that includes ajax behaviour on the WP admin pages, for example.)

In the browser dev tools I'm seeing "failed to load resource : ....../wp-admin/admin-ajax.php" with a not-entirely helpful 500 error.

After experimenting uninstalling all non-essential plug-ins I've narrowed the problem down to Query Monitor (which was pretty much the last one I tried as I'd been using it to help debug the problem).

Disabling the plug-in restores ajax functionality, enabling the plug-in breaks it.

I've confirmed it on my localhost and on my dev server.

Let me know if there is anything I can supply you with to help identify the problem (I'd really like to be able to use the plug-in!)

issues with disabled memory_get_peak_usage();

First thanks for your great plugin - use it on all my dev sites! I just have an issue as my provider has disabled memory_get_peak_usage();
resulting in me having to change /collectors/overview.php and replace memory_get_peak_usage() with 1 in order to not get an error on each page call.
Is there an way to check in a later release if this function is supported on the host?
best,
Robert

PHP Warning sometimes ends on WSD

I have my PHP error log filled with this statements:

PHP Warning: json_encode() [function.json-encode]: recursion detected in C:\wamp\www\wpmudev2\wp-content\plugins\QueryMonitor-master\components\php_errors.php on line 82

Sometimes execution ends on a white screen of death even on localhost.

Cheers!

Calculate component without needing db.php in place

It is possible to calculate the component responsible for a query without needing Query Monitor's db.php file in place. It's just a bit crappy because it involves exploding the default call stack by function and then doing some reflection.

A compatibility function should be added which takes a default call stack from $wpdb and returns the responsible component. QM_Util::populate_callback() could probably be refactored to help with this.

An Error occurred with media upload

Very awesome and helpful plugin. thanks.

After i install/activate query-monitor plugin and then I upload an image file to my post/page an error occurred(below is the error message):

An error occurred in the upload. Please try again later.

But when I looked uploads folder, the upload image was there successfully.

When I removed(disabled) query-monitor, then upload works collectly again.
I think some problem of ajax functionality with this plugin.

Any idea??

Unable to activate

Just came across the plug-in via twitter and went to install on my development server, and received this message upon activation:

The plugin does not have a valid header.

Tried installing it on my local server and got the same result.

Running current WP 3.7.1

AJAX debugging enhancements

These are the enhancements I want to make to the AJAX debugging in Query Monitor.

Short term:

  • Use more appropriate console methods, such as console.warn() for warnings and notices, and console.group() for grouping by request
  • Avoid duplicating up on the AJAX notifications that get added to the admin toolbar
  • When an AJAX error occurs, insert a menu item with instructions on how to view the AJAX debugging info in the console

Medium term:

  • Display database query information
  • Display HTTP API requests
  • Display memory usage
  • Display generation time

Longer term:

  • Scrap outputting to the browser console altogether and implement some form of tabs on the whole of QM's output which appears once an AJAX request has completed, allowing you to see data in a tabular layout just like the main request

The maximum allowed size of all HTTP response headers appears to be 250kb (Chrome). Firefox allows more but we need to go with the lowest. Realistically we have a limit of 200kb (allowing for other headers). We'll need to bear this in mind when adding extra data to the AJAX response headers.

WordPress 3.8 visual refresh (MP6)

The visual refresh in WordPress 3.8 means Query Monitor's admin menu needs a little tweak (mainly the hover state).

Dependant on a resolution to Core Trac #25906 so we know how we can target pre/post-3.8 reliably.

Only get "Query Monitor" in admin menu, no other output

I've installed QM on two sites. It works great on my local dev site running under MAMP. I get numbers in the admin menu and all of the expected output. So far so good.

However, I also installed it on a remote testing site where all I get are the words "Query Monitor" in admin menu and no other output.

I'm happy to do some debugging if you could point me in the right direction.

Thanks for all your good work!

Clickable stack traces

With reflection in place we have enough information to make the various stack traces and calling functions clickable in order to open the relevant file in the user's editor.

My local dev version of Query Monitor has had this for a while but it needs tweaking and needs a filter in place to control the link scheme if necessary.

Expandable stack traces

The calling function for each database query has a title attribute which displays the complete call stack when you hover your mouse over it. This is not very discoverable and doesn't work for touch devices.

Displaying the complete call stack for every query isn't a good idea because it get noisy and some call stacks can be quite long.

A better solution would be an open/close button for each query which expands the row to show the complete stack trace.

PHP Fatal error: Class 'QM_Backtrace' not found

I've seen this issue quite a few times, and am still trying to figure out what exactly causes it. So when we migrate a customer to new hardware, and this plugin is active, it'll cause these two fatal errors:

Dec 18 15:57:48 123.123.123.123 account_apache_error: [Wed Dec 18 15:57:48 2013] [error] [client 66.162.212.19] PHP Fatal error:  Class 'QM_Backtrace' not found in /nas/wp/www/sites/account/wp-content/plugins/buddypress/bp-groups/bp-groups-widgets.php on line 40
Dec 18 15:57:48 123.123.123.123 account_apache_error: [Wed Dec 18 15:57:48 2013] [error] [client 66.162.212.19] PHP Fatal error:  Call to a member function get_queried_object() on a non-object in /nas/wp/www/sites/account/wp-includes/query.php on line 42

QM stuck on plugin activation

Hello,

Not really sure on how to best explain or debug this, but when running WordPress trunk and QM (master) on Windows 7 the plugin gets stuck on plugin activation.

In short WP's plugins.php and every other admin page keeps refreshing without the plugin being activated. Also wp-content\db.php isn't being generated as it was before.

Ability to sort $wpdb time

I've been on the hunt for a WordPress Debugging tool such as this one, and am super excited to start using it on a daily basis (fellow WP Engine employee here). One of the things that bothers me is that I can't sort the right-hand column for "Time". I want to know which queries took the longest, and present them to our clients. :)

using `get_current_screen` on front-end

in the collectors\admin.php file, the user of get_current_screen() fails when processing a front-end AJAX call, since this function is only available in the admin back end.

here's a quick fix I did, not sure if this will affect anything else or if it's the best method.

public function process() {

        global $pagenow;

        if ( isset( $_GET['page'] ) && function_exists( 'get_current_screen' ) )
            $this->data['base'] = get_current_screen()->base;
        else
            $this->data['base'] = $pagenow;

        if ( !isset( $this->data['admin'] ) )
            $this->data['admin'] = __( 'n/a', 'query-monitor' );

        $this->data['pagenow'] = $pagenow;
        $this->data['current_screen'] = function_exists( 'get_current_screen' ) ? get_current_screen() : '';

    }

Can we have a "How to utilize Query Monitor on your development environment" blog post?

Query Monitor is a great plugin. But in some instances, as I'm not from PHP background, I feel that, if we can have a blog with detail explanation and direction on how to utilize Query Monitor on a site development and get a better result from WP - then it'd be much better using the plugin for a developer like us.

If possible, can we have such a blog post?

Sortable table columns

Follow up to #34.

It makes sense to allow various columns in our panels to be sorted using a JavaScript table sorter. I've been hesitant to add this thus far because it means enqueueing an extra JavaScript library. The value of this probably outweighs concerns over extra JS being loaded.

Fatal error on upgrade

Hi,
just updated my wp multisite from 2.6.3 to 2.6.6 and got the following error on network dashboard:

Fatal error: Class QM_Output_Html contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (QM_Output::get_type) in /wp-content/plugins/query-monitor/output/Html.php on line 183

seems to work normally afterwards though...
best,
Robert

Complete the Caching component

I have a Caching component in the works which shows details about the cache controller and cache activity. Needs completing and pushing.

Fatal when other plugins use old-style constructors

If a plugin uses the old-style constructor then Query Monitor fails with a PHP fatal error on WPEngine:

Fatal error: Class 'QM_Util' not found in /nas/wp/www/staging/pencil/wp-content/plugins/co-authors-plus/co-authors-plus.php on line 112

If the old style constructor method is commented out, leaving the proper __construct, then the fatal goes away.

List enqueued scripts and styles

I've had a need for this a few times recently. A new panel should be introduced which lists the current page's enqueued scripts and styles and related dependencies.

Debug Bar has an add-on which does this. Output would probably be similar. There aren't any actions or filters in place which will allow us to determine which component has enqueued which asset.

Do not enqueue scripts in an AJAX context

In a plugin I had to call print_footer_scripts() in my AJAX callback. Unfortunately, Query Monitor registers its scripts in that context too, so I got the script and the localizations two times.

Solution: check for DOING_AJAX and do not enqueue the scripts if it is defined and true.

De-couple the output

One of the end goals of Query Monitor is to enable (but not necessarily provide) other methods of output, such as persistent logging.

The QM_Component class currently separates the data collection and processing from the HTML output, but this should be separated even further into separate classes.

The HTML output is also coupled to the main QueryMonitor class which enqueues the CSS/JS and outputs the admin toolbar menu code.

A new class (or classes) should be implemented which provides a basis for all output. QM would use this for its HTML output and its HTTP header output. Another plugin could then use this for outputting to a persistent log of its choosing.

Automatically check for symlink

As stated in the comment header of ~/wp-content/db.php, there should be a symlink. Else the plugin can't do a lot. So ideally the plugin would check is_link() if it actually is a link and readlink() if it points to the plugins extension. The plugin could even hit symlink() on its extension file (well... depending on the hosts/users settings and what it's allowed to do). All mentioned functions exist since PHP4, so they're "safe" to use.

Note, that I so far haven't used the plugin. Just my two cents as I got it on my list and was just reviewing the source code.

Display message when db.php isn't symlinked

In order to show extended information about DB queries, wp-content/db.php gets symlinked into the wp-content directory. If the plugin can't create this symlink it should display a message telling the user to do it manually in order to see the extended query information.

Complete the Queried Object component

I have a Queried Object component in the works which shows details of the current queried object (get_queried_object()). It needs finishing and pushing into the repo.

Page Generation Time

This is in reference to my screenshot: http://cl.ly/image/3c0A0L1n3S42

I'm curious as to how total page generation time is calculated. If the "database query time" is only 4 seconds, is the rest PHP? I've even ran the page through xdebug:

http://cl.ly/image/1I2F2M2f3k3k

And as you can see, most of the time was taken up by curl_exec, but it doesn't show up in the plugin as taking up any time. Thanks, John!

Uncaught exception 'ReflectionException' with message 'Function c_ws_plugin__qcache_admin_css_js::menu_pages_css() does not exist'

Bound to be a few compatibility issues, what with all the poor coding out there. ;-) Luckily this isn't mine. Though I guess if it was I could fix it. ;-)

[18-Nov-2013 16:20:08 UTC] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Function c_ws_plugin__qcache_admin_css_js::menu_pages_css() does not exist' in /export/www/wpadm/wordpress/wp-content/plugins/QueryMonitor/components/hooks.php:62
Stack trace:
#0 /export/www/wpadm/wordpress/wp-content/plugins/QueryMonitor/components/hooks.php(62): ReflectionFunction->__construct('c_ws_plugin__qc...')
#1 /export/www/wpadm/wordpress/wp-content/plugins/QueryMonitor/query-monitor.php(266): QM_Component_Hooks->process()
#2 /export/www/wpadm/wordpress/wp-content/plugins/QueryMonitor/query-monitor.php(214): QueryMonitor->output_footer()
#3 [internal function]: QueryMonitor->action_shutdown('')
#4 /export/www/wpadm/wordpress/wp-includes/plugin.php(429): call_user_func_array(Array, Array)
#5 /export/www/wpadm/wordpress/wp-includes/load.php(580): do_action('shutdown')
#6 [internal function]: shutdown_action_hook()
#7 {main}
  thrown in /export/www/wpadm/wordpress/wp-content/plugins/QueryMonitor/components/hooks.php on line 62

Strict Standards: Only variables should be passed by reference

Hi, I wanted to report issue I get when making AJAX request to admin-ajax.php

Strict Standards: Only variables should be passed by reference in /var/www/kodo/wordpress/wp-content/plugins/query-monitor/components/php_errors.php on line 196

I am running latest WordPress, WP_DEBUG is on and php version is 5.5

Error during install on PHP 5.4

Fatal error: Cannot override final method QM_Plugin::plugin_url() in my-local-path/plugins/query-monitor/query-monitor.php on line 31

Maybe a better warning if user is on 5.4?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.