Query Monitor - Version 2.5.5

Version Description

  • Better layout for the Hooks panel
  • Fix some AJAX issues
  • Fix some output buffer compatibility issues which were causing fatal errors
Download this release

Release Info

Developer johnbillion
Plugin Icon 128x128 Query Monitor
Version 2.5.5
Comparing to
See all releases

Code changes from version 2.5.4 to 2.5.5

Files changed (4) hide show
  1. Util.php +0 -2
  2. components/hooks.php +2 -4
  3. query-monitor.php +8 -15
  4. readme.txt +6 -1
Util.php CHANGED
@@ -204,8 +204,6 @@ class QM_Util {
204
  public static function is_ajax() {
205
  if ( defined( 'DOING_AJAX' ) and DOING_AJAX )
206
  return true;
207
- if ( isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) and 'xmlhttprequest' == strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) )
208
- return true;
209
  return false;
210
  }
211
 
204
  public static function is_ajax() {
205
  if ( defined( 'DOING_AJAX' ) and DOING_AJAX )
206
  return true;
 
 
207
  return false;
208
  }
209
 
components/hooks.php CHANGED
@@ -104,8 +104,7 @@ class QM_Component_Hooks extends QM_Component {
104
  echo '<thead>';
105
  echo '<tr>';
106
  echo '<th>' . __( 'Hook', 'query-monitor' ) . $this->build_filter( 'name', $data['parts'] ) . '</th>';
107
- echo '<th colspan="2">' . __( 'Actions', 'query-monitor' ) . '</th>';
108
- echo '<th>' . __( 'Action Component', 'query-monitor' ) . $this->build_filter( 'component', $data['components'] ) . '</th>';
109
  echo '</tr>';
110
  echo '</thead>';
111
  echo '<tbody>';
@@ -170,8 +169,7 @@ class QM_Component_Hooks extends QM_Component {
170
  }
171
 
172
  } else {
173
- echo '<td colspan="2">&nbsp;</td>';
174
- echo '<td>&nbsp;</td>';
175
  }
176
  echo '</tr>';
177
  }
104
  echo '<thead>';
105
  echo '<tr>';
106
  echo '<th>' . __( 'Hook', 'query-monitor' ) . $this->build_filter( 'name', $data['parts'] ) . '</th>';
107
+ echo '<th colspan="3">' . __( 'Actions', 'query-monitor' ) . $this->build_filter( 'component', $data['components'] ) . '</th>';
 
108
  echo '</tr>';
109
  echo '</thead>';
110
  echo '<tbody>';
169
  }
170
 
171
  } else {
172
+ echo '<td colspan="3">&nbsp;</td>';
 
173
  }
174
  echo '</tr>';
175
  }
query-monitor.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Query Monitor
4
  Description: Monitoring of database queries, hooks, conditionals and more.
5
- Version: 2.5.4
6
  Plugin URI: https://github.com/johnbillion/QueryMonitor
7
  Author: John Blackbourn
8
  Author URI: https://johnblackbourn.com/
@@ -80,23 +80,16 @@ class QueryMonitor extends QM_Plugin {
80
 
81
  public function activate( $sitewide = false ) {
82
 
83
- if ( ! extension_loaded( 'spl' ) ) {
84
- die( sprintf( 'This plugin requires the <a href="%s">%s</a> extension, which is not installed on your server.',
85
- 'http://php.net/manual/book.spl.php',
86
- 'Standard PHP Library (SPL)'
87
- ) );
88
- }
89
-
90
  if ( $admins = QM_Util::get_admins() )
91
  $admins->add_cap( 'view_query_monitor' );
92
 
93
- if ( !file_exists( $db = WP_CONTENT_DIR . '/db.php' ) and function_exists( 'symlink' ) )
94
  @symlink( $this->plugin_path( 'wp-content/db.php' ), $db );
95
 
96
  if ( $sitewide )
97
- update_site_option( 'active_sitewide_plugins', $this->filter_active_sitewide_plugins( get_site_option( 'active_sitewide_plugins' ) ) );
98
  else
99
- update_option( 'active_plugins', $this->filter_active_plugins( get_option( 'active_plugins' ) ) );
100
 
101
  }
102
 
@@ -242,11 +235,11 @@ class QueryMonitor extends QM_Plugin {
242
 
243
  public function output_footer() {
244
 
245
-
246
  # Flush the output buffer to avoid crashes
247
  if ( !is_feed() ) {
248
  while ( ob_get_length() )
249
- ob_flush();
250
  }
251
 
252
  foreach ( $this->get_components() as $component )
@@ -304,7 +297,7 @@ class QueryMonitor extends QM_Plugin {
304
 
305
  public function filter_active_plugins( array $plugins ) {
306
 
307
- $f = preg_quote( basename( __FILE__ ) );
308
 
309
  return array_merge(
310
  preg_grep( '/' . $f . '$/', $plugins ),
@@ -315,7 +308,7 @@ class QueryMonitor extends QM_Plugin {
315
 
316
  public function filter_active_sitewide_plugins( array $plugins ) {
317
 
318
- $f = plugin_basename( __FILE__ );
319
 
320
  if ( isset( $plugins[$f] ) ) {
321
 
2
  /*
3
  Plugin Name: Query Monitor
4
  Description: Monitoring of database queries, hooks, conditionals and more.
5
+ Version: 2.5.5
6
  Plugin URI: https://github.com/johnbillion/QueryMonitor
7
  Author: John Blackbourn
8
  Author URI: https://johnblackbourn.com/
80
 
81
  public function activate( $sitewide = false ) {
82
 
 
 
 
 
 
 
 
83
  if ( $admins = QM_Util::get_admins() )
84
  $admins->add_cap( 'view_query_monitor' );
85
 
86
+ if ( ! file_exists( $db = WP_CONTENT_DIR . '/db.php' ) )
87
  @symlink( $this->plugin_path( 'wp-content/db.php' ), $db );
88
 
89
  if ( $sitewide )
90
+ update_site_option( 'active_sitewide_plugins', get_site_option( 'active_sitewide_plugins' ) );
91
  else
92
+ update_option( 'active_plugins', get_option( 'active_plugins' ) );
93
 
94
  }
95
 
235
 
236
  public function output_footer() {
237
 
238
+ # @TODO document why this is needed
239
  # Flush the output buffer to avoid crashes
240
  if ( !is_feed() ) {
241
  while ( ob_get_length() )
242
+ ob_end_flush();
243
  }
244
 
245
  foreach ( $this->get_components() as $component )
297
 
298
  public function filter_active_plugins( array $plugins ) {
299
 
300
+ $f = preg_quote( basename( $this->plugin_base() ) );
301
 
302
  return array_merge(
303
  preg_grep( '/' . $f . '$/', $plugins ),
308
 
309
  public function filter_active_sitewide_plugins( array $plugins ) {
310
 
311
+ $f = $this->plugin_base();
312
 
313
  if ( isset( $plugins[$f] ) ) {
314
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: johnbillion
3
  Tags: debug, debugging, development, developer, performance, profiler, profiling, queries
4
  Requires at least: 3.5
5
  Tested up to: 3.8
6
- Stable tag: 2.5.4
7
  License: GPLv2 or later
8
 
9
  View debugging and performance information on database queries, hooks, conditionals, HTTP requests, redirects and more.
@@ -110,6 +110,11 @@ I know!
110
 
111
  == Changelog ==
112
 
 
 
 
 
 
113
  = 2.5.4 =
114
  * Avoid a fatal error when strict errors are triggered at compile time
115
  * Avoid a warning when PDO or Mysqli is in use
3
  Tags: debug, debugging, development, developer, performance, profiler, profiling, queries
4
  Requires at least: 3.5
5
  Tested up to: 3.8
6
+ Stable tag: 2.5.5
7
  License: GPLv2 or later
8
 
9
  View debugging and performance information on database queries, hooks, conditionals, HTTP requests, redirects and more.
110
 
111
  == Changelog ==
112
 
113
+ = 2.5.5 =
114
+ * Better layout for the Hooks panel
115
+ * Fix some AJAX issues
116
+ * Fix some output buffer compatibility issues which were causing fatal errors
117
+
118
  = 2.5.4 =
119
  * Avoid a fatal error when strict errors are triggered at compile time
120
  * Avoid a warning when PDO or Mysqli is in use