query-monitor icon indicating copy to clipboard operation
query-monitor copied to clipboard

AJAX debugging enhancements

Open johnbillion opened this issue 11 years ago • 6 comments

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:

  • [x] Display database query information
  • [ ] Display HTTP API requests
  • [x] Display memory usage
  • [x] 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.

johnbillion avatar Dec 13 '13 02:12 johnbillion

definitely would like to see Query Monitor update the relevant information with each AJAX request; at least query information (the query itself, time, where the request was made and/or handled, etc). would be phenomenal info to have on developing sites that use lots of AJAX requests.

crstauf avatar Jul 25 '14 19:07 crstauf

When uploaded a image to the media library a plugin was causing PHP notices which I only saw when Query Monitor was disabled. It would be nice to be able to see the errors when Query Monitor is enabled.

grappler avatar Dec 12 '16 16:12 grappler

Is there a QM_DISABLE_AJAX_ERROR_NOTICES configuration? On every heartbeat (and every ajax request I make) I get the same messages in the console: "Function create_function() is deprecated", file: "wp-content/plugins/debug-bar-extender/debug-bar-extender.php" (oh, the irony) and another plugin throws an "Undefined index: some_plugin_setting" notice that fires if the setting is set to false (The plugin doesn't bother to test isset - no biggie)

I like getting this info from QM. Except when I'm using the console to debug javascript/ajax I'm working on. Then it's a real pain to scroll through all that red just to find that one console.log I actually care about.

abuyoyo avatar Dec 19 '18 23:12 abuyoyo

@abuyoyo No there isn't, but this is a good idea. I'll bear it in mind.

You can mute the errors from those specific plugins though: https://querymonitor.com/blog/2018/07/silencing-errors-from-plugins-and-themes/

johnbillion avatar Dec 20 '18 06:12 johnbillion

I had a quick look into this.

I wonder if we add a filter to wp_send_json function and then just add a key of qm, how the REST API implementation works. What do you think?

spacedmonkey avatar Apr 22 '22 11:04 spacedmonkey

And there I was, looking why I'm getting 502 from time to time... with X-QM-php_errors-error-count:71 it was no brainer.

The ability to turn off error injecting in header would be really good thing ;-)

bigretromike avatar Mar 07 '24 16:03 bigretromike