' . QueryMonitor::icon( 'warning' );
- if ( file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
- /* translators: %s: File name */
- $message = __( 'Extended query information such as the component and affected rows is not available. A conflicting %s file is present.', 'query-monitor' );
- } elseif ( defined( 'QM_DB_SYMLINK' ) && ! QM_DB_SYMLINK ) {
- /* translators: 1: File name, 2: Configuration constant name */
- $message = __( 'Extended query information such as the component and affected rows is not available. Query Monitor was prevented from symlinking its %1$s file into place by the %2$s constant.', 'query-monitor' );
- } else {
- /* translators: %s: File name */
- $message = __( 'Extended query information such as the component and affected rows is not available. Query Monitor was unable to symlink its %s file into place.', 'query-monitor' );
- }
- printf(
- esc_html( $message ),
- 'db.php',
- 'QM_DB_SYMLINK'
- );
+ /**
+ * Filter whether to show the QM extended query information prompt.
+ *
+ * By default QM shows a prompt to install the QM db.php drop-in,
+ * this filter allows a dev to choose not to show the prompt.
+ *
+ * @since 2.9.0
+ *
+ * @param bool $show_prompt Whether to show the prompt.
+ */
+ if ( apply_filters( 'qm/show_extended_query_prompt', true ) && ! $db->has_trace ) {
+ echo '
' . QueryMonitor::icon( 'warning' );
+ if ( file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
+ /* translators: %s: File name */
+ $message = __( 'Extended query information such as the component and affected rows is not available. A conflicting %s file is present.', 'query-monitor' );
+ } elseif ( defined( 'QM_DB_SYMLINK' ) && ! QM_DB_SYMLINK ) {
+ /* translators: 1: File name, 2: Configuration constant name */
+ $message = __( 'Extended query information such as the component and affected rows is not available. Query Monitor was prevented from symlinking its %1$s file into place by the %2$s constant.', 'query-monitor' );
+ } else {
+ /* translators: %s: File name */
+ $message = __( 'Extended query information such as the component and affected rows is not available. Query Monitor was unable to symlink its %s file into place.', 'query-monitor' );
+ }
+ printf(
+ esc_html( $message ),
+ 'db.php',
+ 'QM_DB_SYMLINK'
+ );
- printf(
- ' See this wiki page for more information.',
- 'https://github.com/johnbillion/query-monitor/wiki/db.php-Symlink'
- );
- echo '
';
+ }
}
}
diff --git a/query-monitor/output/raw/db_queries.php b/query-monitor/output/raw/db_queries.php
index 621bc78644..e8cd1b6f33 100644
--- a/query-monitor/output/raw/db_queries.php
+++ b/query-monitor/output/raw/db_queries.php
@@ -28,33 +28,17 @@ public function name() {
/**
* @return array
- * @phpstan-return array{
- * total: int,
- * time: float,
- * queries: mixed[],
- * errors?: array{
- * total: int,
- * errors: array>,
- * },
- * dupes?: array{
- * total: int,
- * queries: array,
- * },
- * }|array{}
*/
public function get_output() {
+ $output = array();
/** @var QM_Data_DB_Queries $data */
$data = $this->collector->get_data();
- if ( empty( $data->rows ) ) {
- return array();
+ if ( empty( $data->wpdb ) ) {
+ return $output;
}
- $output = array(
- 'total' => $data->total_qs,
- 'time' => round( $data->total_time, 4 ),
- 'queries' => array_map( array( $this, 'output_query_row' ), $data->rows ),
- );
+ $output['wpdb'] = $this->output_queries( $data->wpdb );
if ( ! empty( $data->errors ) ) {
$output['errors'] = array(
@@ -81,6 +65,35 @@ public function get_output() {
return $output;
}
+ /**
+ * @param stdClass $db
+ * @return array
+ * @phpstan-return array{
+ * total: int,
+ * time: float,
+ * queries: mixed[],
+ * }|array{}
+ */
+ protected function output_queries( stdClass $db ) {
+ $this->query_row = 0;
+
+ $output = array();
+
+ if ( empty( $db->rows ) ) {
+ return $output;
+ }
+
+ foreach ( $db->rows as $row ) {
+ $output[] = $this->output_query_row( $row );
+ }
+
+ return array(
+ 'total' => $db->total_qs,
+ 'time' => round( $db->total_time, 4 ),
+ 'queries' => $output,
+ );
+ }
+
/**
* @param array $row
* @return array
diff --git a/query-monitor/query-monitor.php b/query-monitor/query-monitor.php
index 6e325de8d3..80f0004402 100644
--- a/query-monitor/query-monitor.php
+++ b/query-monitor/query-monitor.php
@@ -10,13 +10,13 @@
*
* Plugin Name: Query Monitor
* Description: The developer tools panel for WordPress.
- * Version: 3.15.0
+ * Version: 3.12.1
* Plugin URI: https://querymonitor.com/
* Author: John Blackbourn
* Author URI: https://querymonitor.com/
* Text Domain: query-monitor
* Domain Path: /languages/
- * Requires PHP: 7.4
+ * Requires PHP: 7.2
*
* 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
@@ -33,7 +33,7 @@
exit;
}
-define( 'QM_VERSION', '3.15.0' );
+define( 'QM_VERSION', '3.12.1' );
$qm_dir = dirname( __FILE__ );
@@ -77,17 +77,6 @@
return;
}
-# Don't load QM during plugin updates to prevent function signature changes causing issues between versions.
-if ( is_admin() ) {
- if ( isset( $_GET['action'] ) && 'upgrade-plugin' === $_GET['action'] ) {
- return;
- }
-
- if ( isset( $_POST['action'] ) && 'update-plugin' === $_POST['action'] ) {
- return;
- }
-}
-
unset( $qm_dir );
QueryMonitor::init( __FILE__ )->set_up();
diff --git a/query-monitor/readme.txt b/query-monitor/readme.txt
index aa8598ea77..ac1395ef2b 100644
--- a/query-monitor/readme.txt
+++ b/query-monitor/readme.txt
@@ -1,11 +1,11 @@
# Query Monitor
Contributors: johnbillion
Tags: debug, debug-bar, development, performance, query monitor, rest-api
-Requires at least: 5.6
-Tested up to: 6.4
-Stable tag: 3.15.0
+Requires at least: 5.2
+Tested up to: 6.2
+Stable tag: 3.12.1
License: GPLv2 or later
-Requires PHP: 7.4
+Requires PHP: 7.2
Donate link: https://github.com/sponsors/johnbillion
Query Monitor is the developer tools panel for WordPress.
@@ -18,8 +18,6 @@ It includes some advanced features such as debugging of Ajax calls, REST API cal
Query Monitor focuses heavily on presenting its information in a useful manner, for example by showing aggregate database queries grouped by the plugins, themes, or functions that are responsible for them. It adds an admin toolbar menu showing an overview of the current page, with complete debugging information shown in panels once you select a menu item.
-Query Monitor supports versions of WordPress up to three years old, and PHP version 7.4 or higher.
-
For complete information, please see [the Query Monitor website](https://querymonitor.com/).
Here's an overview of what's shown for each page load:
@@ -27,7 +25,6 @@ Here's an overview of what's shown for each page load:
* Database queries, including notifications for slow, duplicate, or erroneous queries. Allows filtering by query type (`SELECT`, `UPDATE`, `DELETE`, etc), responsible component (plugin, theme, WordPress core), and calling function, and provides separate aggregate views for each.
* The template filename, the complete template hierarchy, and names of all template parts that were loaded or not loaded (for block themes and classic themes).
* PHP errors presented nicely along with their responsible component and call stack, and a visible warning in the admin toolbar.
-* Usage of "Doing it Wrong" or "Deprecated" functionality in the code on your site.
* Blocks and associated properties within post content and within full site editing (FSE).
* Matched rewrite rules, associated query strings, and query vars.
* Enqueued scripts and stylesheets, along with their dependencies, dependents, and alerts for broken dependencies.
@@ -37,7 +34,6 @@ Here's an overview of what's shown for each page load:
* Environment information, including detailed information about PHP, the database, WordPress, and the web server.
* The values of all WordPress conditional functions such as `is_single()`, `is_home()`, etc.
* Transients that were updated.
-* Usage of `switch_to_blog()` and `restore_current_blog()` on Multisite installations.
In addition:
@@ -124,9 +120,11 @@ Please use [the issue tracker on Query Monitor's GitHub repo](https://github.com
Yes, the [Altis Developer Tools](https://www.altis-dxp.com/resources/developer-docs/dev-tools/) are built on top of Query Monitor.
-### Is Query Monitor available on WordPress VIP?
+### Is Query Monitor available on WordPress.com VIP Go?
+
+Yes, it's included as part of the VIP Go platform. However, a user needs to be granted the `view_query_monitor` capability to see Query Monitor even if they're an administrator.
-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](https://docs.wpvip.com/how-tos/enable-query-monitor/).
+Please note that information about database queries and the environment is somewhat restricted on VIP. This is a platform restriction and not a Query Monitor issue.
### I'm using multiple instances of `wpdb`. How do I get my additional instances to show up in Query Monitor?
@@ -142,240 +140,4 @@ Yes. You can enable this on the Settings panel.
In addition, if you like the plugin then I'd love for you to [leave a review](https://wordpress.org/support/view/plugin-reviews/query-monitor). Tell all your friends about it too!
-## Changelog ##
-
-### 3.15.0 (10 November 2023) ###
-
-* Adds [a new assertion feature via the `qm/assert` action](https://querymonitor.com/wordpress-debugging/assertions/)
-* Confirms the plugin is tested up to WordPress 6.4
-
-
-### 3.14.1 (21 October 2023) ###
-
-* Improves compatibility with WordPress Playground
-
-### 3.14.0 (18 October 2023) ###
-
-* Corrects the port number handling when displaying URLs for scripts and styles
-* Improves the `db.php` handling when activating and deactivating Query Monitor on a single site within a Multisite network, and when `DISALLOW_FILE_MODS` is in use
-* Improves check for Debug Bar existence
-* Identifies drop-in plugins as a specific component instead of "other"
-* Simplifies some of the data structure used when logging queries
-* Specifies that Query Monitor supports WordPress versions up to three years old
-
-
-### 3.13.1 (15 July 2023) ###
-
-* Avoids a fatal error if a deprecated warning is triggered early on during the bootstrap process
-* Avoids a PHP warning that can be triggered during certain HTTP API requests when Curl is not in use
-* Skips loading QM during the plugin update process
-
-### 3.13.0 (9 July 2023) ###
-
-* Adds a dedicated panel for "Doing it Wrong" and deprecated functionality usage
-* Allows data in the HTTP API requests panel to be filtered by host name
-* Adds a "Type" column wherever a list of hooks can show both actions and filters
-* Improves various aspects of the "Editor" setting
-* Increases the minimum supported version of PHP to 7.4
-* Many thanks to @crstauf for the majority of the new features in this release
-
-### 3.12.3 (17 May 2023) ###
-
-* Improves theme template part data collection when the Gutenberg plugin is in use with a block theme
-* Skips attempting to resolve a block template if the theme doesn't support block templates
-* Removes the fallback to `$EZSQL_ERROR` for database query errors as it's not possible to determine if the error should be ignored
-
-### 3.12.2 (27 April 2023) ###
-
-* Adds the total count to the table footer of the PHP Errors panel
-* Improves the destination URL for links that point to the site editor
-* Implements some minor visual improvements
-* Removes unreliable information about the transport for HTTP API requests
-* Removes Query Monitor output from the interim login modal
-
-### 3.12.1 (24 March 2023) ###
-
-* Corrects some inter-panel links that point to the Queries panel and sub-panels
-* Switches to `sessionStorage` for the selected table column filters so they don't persist across tabs or sessions
-* Removes the "Debug Bar:" prefix on the menus for panels inherited from the Debug Bar plugin
-
-
-### 3.12.0 (16 March 2023) ###
-
-* Clarifies and improves information in the Template panel when a block theme or full site editing (FSE) is in use
-* Avoids PHP warnings if a third party plugin makes unexpected changes to language file paths
-* Implements some minor performance improvements
-* Removes misleading information about WordPress memory limits
-* Removes support for multiple instances of `wpdb` (see the FAQ for more information)
-
-### 3.11.2 (23 February 2023) ###
-
-* Implements various accessibility improvements
-* Fixes an issue where not all admin area footer scripts were shown in the Scripts panel
-* Improves output when the SQLite feature in the Performance Labs plugin is in use
-* Removes QM output altogether from the Customizer
-* Ensures `wp-content/db.php` from another plugin doesn't get removed when deactivating QM
-
-
-### 3.11.1 (3 January 2023) ###
-
-* Avoids a fatal error in PHP 8 when `posix_getpwuid()` or `posix_getgrgid()` doesn't return an expected value.
-
-### 3.11.0 (30 December 2022) ###
-
-* Adds a new "Multisite" panel that shows usage of `switch_to_blog()` and `restore_current_blog()` on Multisite installations
-* Improves the output shown for blocks and template parts when block themes or full site editing is in use
-* Introduces new `QM_Data` and `QM_Component` classes to make the data collection more structured and reliable
-* Increases the minimum supported version of PHP to 7.2
-* Improves the performance of SVG icons
-* Removes the ability to completely hide silenced PHP errors
-* Avoids some deprecated notices in PHP 8.2
-* Improves the performance of the PHP class autoloader
-
-### 3.10.1 (9 September 2022) ###
-
-* Prevents logging duplicate entries for multiple calls to load the same translation file
-* Brings the dispatcher priority back down to `9` for maximum compatibility with other plugins that use a shutdown handler
-
-
-### 3.10.0 (8 September 2022) ###
-
-* Adds information about the current language on the Languages panel
-* Reduces the chance that Query Monitor blames itself for PHP errors that don't have a stack trace
-* Replaces the use of Dashicons with inline SVGs and removes the `dashicons` dependency
-* Switches to class autoloading via Composer for reduced memory usage
-* Changes the priority of the `shutdown` dispatcher from `0` to `PHP_INT_MAX` to ensure as much data as possible is collected
-* Improves the styling of Debug Bar add-ons
-* Fixes some erroneous localisation of float values in REST API output
-* Bumps the minimum supported PHP version to 5.6
-* Improves various other bits and bobs
-
-### 3.9.0 (15 April 2022) ###
-
-* Introduces a dark mode toggle on the Settings panel, which replaces the `QM_DARK_MODE` constant
-* Prevents errors with undefined constants being reported in `db.php`
-* Adds more comprehensive handling of unexpected values in stack traces
-* Fixes PHP Warning 'Header may not contain NUL bytes' when outputting headers
-
-### 3.8.2 (7 January 2022) ###
-
-* Fixes some deprecated notices with PHP 8.1
-* Improves the handling of SQL queries that consist only of MySQL comments
-
-### 3.8.1 (2 January 2022) ###
-
-* Fixes an incompatibility with PHP versions prior to 7.2
-* Fixes a warning that was being triggered within the PHP header dispatcher
-* Introduces the `qm/component_type/{$type}` filter
-* Introduces a `QM_VERSION` constant
-
-### 3.8.0 (27 December 2021) ###
-
-* Introduces the ability for a third party to cease all further data collection and output at any point by calling `do_action( 'qm/cease' )`, for example to prevent memory exhaustion during long-running operations
-* Reduces the width of the admin toolbar menu item by using lower decimal precision
-* Improves the Template panel information when a block theme is in use (for Full Site Editing)
-* Improves the performance and accuracy of stack traces and calling function information
-* Corrects some formatting of numbers and error messages in the REST API output
-* Adds more useful information when a persistent object cache or opcode cache isn't in use
-* Improves clarity in the Scripts and Styles panels when any of the URLs include a port number
-* Introduces the `qm/component_context/{$type}` filter to complement `qm/component_name/{$type}` and `qm/component_dirs`
-* Improves internal code quality, internationalisation, and further reduces overall memory usage
-
-### 3.7.1 (13 May 2021) ###
-
-* Add a fallback for timing processing during Ajax requests that are dispatched before the `shutdown` hook.
-
-### 3.7.0 (13 May 2021) ###
-
-* Introduce debugging output in a `qm` property in enveloped REST API responses
-* Add HTTP API call information to the overview panel
-* Don't show QM output inside WordPress embeds as nobody uses this
-* Don't try to access the `QM_HIDE_SELF` constant before it's defined
-* Process the timing and memory related stats as early as possible so the data isn't too skewed
-
-
-### 3.6.8 (9 May 2021) ###
-
-* Add WordPress memory usage statistic to Overview panel
-* Add block context information to the Blocks panel
-* Fix row highlighting of TH cells
-* Fix some panel resizing bugs
-
-
-### 3.6.7 (20 January 2021) ###
-
-* Implement a `QM_DB_SYMLINK` constant to prevent the `db.php` symlink being put into place.
-* Remove a dependency on `SAVEQUERIES` in the query collector.
-* Remove invalid `scope` attributes on table cells.
-
-
-### 3.6.6 (13 January 2021) ###
-
-* PHP 8 fix.
-* Improve the display for various empty values when logging.
-* Don't display child menus until the parent menu is active. Makes the menu clearer.
-* Detect local host names in HTTP API requests and don't mark them as ignoring certificate verification.
-* Prevent the text in toggle buttons from being selected when selecting data in tables.
-* Remove support for the Dark Mode plugin which isn't Dark Mode any more.
-
-
-### 3.6.5 (13 November 2020) ###
-
-* Always show the Logs panel, with a link to help docs.
-* Whole bunch of improvements to QM's "broken" state handling.
-* Remove usage of deprecated jQuery methods.
-* Add support for Altis dependencies as components.
-* Add `innodb_buffer_pool_size` variable to the mysql environment list.
-* Preformat the Logger output
-* Fix the PHP version check.
-
-
-### 3.6.4 (20 August 2020) ###
-
-* Correct an error introduced in 3.6.2 with the extra early error handling (ironic).
-
-### 3.6.3 (20 August 2020) ###
-
-* Correct the size of the close icon.
-
-### 3.6.2 (20 August 2020) ###
-
- * Capture and display the most recent PHP error that occurred before QM loaded.
- * Add support for the environment type added in WP 5.5.
- * Avoid a potentially blank translation for some plural forms.
- * Increase some contrast in dark mode.
- * Combine the response-related sections of the Request panel.
- * Add extra sanity checking when attempting to fetch the posix user information.
-
-### 3.6.1 (25 July 2020) ###
-
-* Adjust the bottom margin when the QM panel is open so QM doesn't cover the bottom of the page. Works more often than not.
-* Prevent QM from triggering a fatal itself if a fatal occurs before the HTML dispatcher is loaded.
-* Add an informational message to the template output when template hooks are in use.
-* Fix errors caused by missing user or group IDs when collecting environment data.
-* Add TextMate to list of supported editors.
-* Demote some cache warnings to informational messages.
-* Support passing backtrace to `QM_Backtrace`.
-
-
-### 3.6.0 (8 May 2020) ###
-
-* Improvements to the UI when a fatal error occurs, including an admin toolbar warning.
-* Improvements to the UI when QM is running in "broken" mode due to missing jQuery or an unrecoverable JavaScript error.
-* Don't display fatal errors if error display is off and the user cannot view QM.
-* Improvements to the visual appearance of the `wp_die()` output.
-* Simplify re-throwing a caught exception so QM doesn't get the blame for fatal errors, eg. in the WordPress core fatal error handler.
-* Add support for logging a variable of any type in the logger, as a replacement for var dumping.
-* Don't show a message for errors in Ajax calls that have already occurred on the main page load.
-* Don't dispatch QM during an iframed request, eg the plugin info modal or an upgrader action.
-* Hide QM itself from various panels by default to remove noise. Can be controlled via the existing `QM_HIDE_SELF` configuration constant.
-* Support for the new `is_favicon()` conditional added in WP 5.4.
-* Fix the side panel resizing functionality.
-* Add a WP-CLI command for creating the symlink to the db file.
-* Add filters to `QM_Util::get_file_dirs()` and `get_file_component()` to allow support for non-standard plugin and theme locations.
-* Add an action that fires when QM enqueues its assets, so add-on plugins can enqueue theirs only when necessary.
-
-
-### 3.5.2 (2 December 2019) ###
-
-* Add support for exposing [Full Site Editing](https://github.com/WordPress/gutenberg/issues?q=label%3A%22%5BFeature%5D+Full+Site+Editing%22) blocks in the Block Editor panel.
+
diff --git a/query-monitor/vendor/autoload.php b/query-monitor/vendor/autoload.php
index 1d4019b09e..d906ff5de1 100644
--- a/query-monitor/vendor/autoload.php
+++ b/query-monitor/vendor/autoload.php
@@ -22,4 +22,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
-return ComposerAutoloaderInit9bc748a33ab984c092a749a74d7b8261::getLoader();
+return ComposerAutoloaderInitfaf42c5f235c65e8397793ae676be6da::getLoader();
diff --git a/query-monitor/vendor/composer/ClassLoader.php b/query-monitor/vendor/composer/ClassLoader.php
index 7824d8f7ea..a72151c77c 100644
--- a/query-monitor/vendor/composer/ClassLoader.php
+++ b/query-monitor/vendor/composer/ClassLoader.php
@@ -45,34 +45,35 @@ class ClassLoader
/** @var \Closure(string):void */
private static $includeFile;
- /** @var string|null */
+ /** @var ?string */
private $vendorDir;
// PSR-4
/**
- * @var array>
+ * @var array[]
+ * @psalm-var array>
*/
private $prefixLengthsPsr4 = array();
/**
- * @var array>
+ * @var array[]
+ * @psalm-var array>
*/
private $prefixDirsPsr4 = array();
/**
- * @var list
+ * @var array[]
+ * @psalm-var array
*/
private $fallbackDirsPsr4 = array();
// PSR-0
/**
- * List of PSR-0 prefixes
- *
- * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
- *
- * @var array>>
+ * @var array[]
+ * @psalm-var array>
*/
private $prefixesPsr0 = array();
/**
- * @var list
+ * @var array[]
+ * @psalm-var array
*/
private $fallbackDirsPsr0 = array();
@@ -80,7 +81,8 @@ class ClassLoader
private $useIncludePath = false;
/**
- * @var array
+ * @var string[]
+ * @psalm-var array
*/
private $classMap = array();
@@ -88,20 +90,21 @@ class ClassLoader
private $classMapAuthoritative = false;
/**
- * @var array
+ * @var bool[]
+ * @psalm-var array
*/
private $missingClasses = array();
- /** @var string|null */
+ /** @var ?string */
private $apcuPrefix;
/**
- * @var array
+ * @var self[]
*/
private static $registeredLoaders = array();
/**
- * @param string|null $vendorDir
+ * @param ?string $vendorDir
*/
public function __construct($vendorDir = null)
{
@@ -110,7 +113,7 @@ public function __construct($vendorDir = null)
}
/**
- * @return array>
+ * @return string[]
*/
public function getPrefixes()
{
@@ -122,7 +125,8 @@ public function getPrefixes()
}
/**
- * @return array>
+ * @return array[]
+ * @psalm-return array>
*/
public function getPrefixesPsr4()
{
@@ -130,7 +134,8 @@ public function getPrefixesPsr4()
}
/**
- * @return list
+ * @return array[]
+ * @psalm-return array
*/
public function getFallbackDirs()
{
@@ -138,7 +143,8 @@ public function getFallbackDirs()
}
/**
- * @return list
+ * @return array[]
+ * @psalm-return array
*/
public function getFallbackDirsPsr4()
{
@@ -146,7 +152,8 @@ public function getFallbackDirsPsr4()
}
/**
- * @return array Array of classname => path
+ * @return string[] Array of classname => path
+ * @psalm-return array
*/
public function getClassMap()
{
@@ -154,7 +161,8 @@ public function getClassMap()
}
/**
- * @param array $classMap Class to filename map
+ * @param string[] $classMap Class to filename map
+ * @psalm-param array $classMap
*
* @return void
*/
@@ -171,25 +179,24 @@ public function addClassMap(array $classMap)
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
- * @param string $prefix The prefix
- * @param list|string $paths The PSR-0 root directories
- * @param bool $prepend Whether to prepend the directories
+ * @param string $prefix The prefix
+ * @param string[]|string $paths The PSR-0 root directories
+ * @param bool $prepend Whether to prepend the directories
*
* @return void
*/
public function add($prefix, $paths, $prepend = false)
{
- $paths = (array) $paths;
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
- $paths,
+ (array) $paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
- $paths
+ (array) $paths
);
}
@@ -198,19 +205,19 @@ public function add($prefix, $paths, $prepend = false)
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
- $this->prefixesPsr0[$first][$prefix] = $paths;
+ $this->prefixesPsr0[$first][$prefix] = (array) $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
- $paths,
+ (array) $paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
- $paths
+ (array) $paths
);
}
}
@@ -219,9 +226,9 @@ public function add($prefix, $paths, $prepend = false)
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
- * @param string $prefix The prefix/namespace, with trailing '\\'
- * @param list|string $paths The PSR-4 base directories
- * @param bool $prepend Whether to prepend the directories
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param string[]|string $paths The PSR-4 base directories
+ * @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*
@@ -229,18 +236,17 @@ public function add($prefix, $paths, $prepend = false)
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
- $paths = (array) $paths;
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
- $paths,
+ (array) $paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
- $paths
+ (array) $paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
@@ -250,18 +256,18 @@ public function addPsr4($prefix, $paths, $prepend = false)
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
- $this->prefixDirsPsr4[$prefix] = $paths;
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
- $paths,
+ (array) $paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
- $paths
+ (array) $paths
);
}
}
@@ -270,8 +276,8 @@ public function addPsr4($prefix, $paths, $prepend = false)
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
- * @param string $prefix The prefix
- * @param list|string $paths The PSR-0 base directories
+ * @param string $prefix The prefix
+ * @param string[]|string $paths The PSR-0 base directories
*
* @return void
*/
@@ -288,8 +294,8 @@ public function set($prefix, $paths)
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
- * @param string $prefix The prefix/namespace, with trailing '\\'
- * @param list|string $paths The PSR-4 base directories
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param string[]|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*
@@ -475,9 +481,9 @@ public function findFile($class)
}
/**
- * Returns the currently registered loaders keyed by their corresponding vendor directories.
+ * Returns the currently registered loaders indexed by their corresponding vendor directories.
*
- * @return array
+ * @return self[]
*/
public static function getRegisteredLoaders()
{
diff --git a/query-monitor/vendor/composer/autoload_classmap.php b/query-monitor/vendor/composer/autoload_classmap.php
new file mode 100644
index 0000000000..fbe1e55337
--- /dev/null
+++ b/query-monitor/vendor/composer/autoload_classmap.php
@@ -0,0 +1,92 @@
+ $baseDir . '/classes/debug_bar.php',
+ 'Debug_Bar_Panel' => $baseDir . '/classes/debug_bar_panel.php',
+ 'QM' => $baseDir . '/classes/QM.php',
+ 'QM_Activation' => $baseDir . '/classes/Activation.php',
+ 'QM_Backtrace' => $baseDir . '/classes/Backtrace.php',
+ 'QM_CLI' => $baseDir . '/classes/CLI.php',
+ 'QM_Collector' => $baseDir . '/classes/Collector.php',
+ 'QM_Collectors' => $baseDir . '/classes/Collectors.php',
+ 'QM_Component' => $baseDir . '/classes/Component.php',
+ 'QM_DB' => $baseDir . '/classes/DB.php',
+ 'QM_Data' => $baseDir . '/classes/Data.php',
+ 'QM_DataCollector' => $baseDir . '/classes/DataCollector.php',
+ 'QM_Data_Admin' => $baseDir . '/data/admin.php',
+ 'QM_Data_Assets' => $baseDir . '/data/assets.php',
+ 'QM_Data_Block_Editor' => $baseDir . '/data/block_editor.php',
+ 'QM_Data_Cache' => $baseDir . '/data/cache.php',
+ 'QM_Data_Caps' => $baseDir . '/data/caps.php',
+ 'QM_Data_Conditionals' => $baseDir . '/data/conditionals.php',
+ 'QM_Data_DB_Callers' => $baseDir . '/data/db_callers.php',
+ 'QM_Data_DB_Components' => $baseDir . '/data/db_components.php',
+ 'QM_Data_DB_Dupes' => $baseDir . '/data/db_dupes.php',
+ 'QM_Data_DB_Queries' => $baseDir . '/data/db_queries.php',
+ 'QM_Data_Environment' => $baseDir . '/data/environment.php',
+ 'QM_Data_Fallback' => $baseDir . '/data/fallback.php',
+ 'QM_Data_HTTP' => $baseDir . '/data/http.php',
+ 'QM_Data_Hooks' => $baseDir . '/data/hooks.php',
+ 'QM_Data_Languages' => $baseDir . '/data/languages.php',
+ 'QM_Data_Logger' => $baseDir . '/data/logger.php',
+ 'QM_Data_Multisite' => $baseDir . '/data/multisite.php',
+ 'QM_Data_Overview' => $baseDir . '/data/overview.php',
+ 'QM_Data_PHP_Errors' => $baseDir . '/data/php_errors.php',
+ 'QM_Data_Raw_Request' => $baseDir . '/data/raw_request.php',
+ 'QM_Data_Redirect' => $baseDir . '/data/redirect.php',
+ 'QM_Data_Request' => $baseDir . '/data/request.php',
+ 'QM_Data_Theme' => $baseDir . '/data/theme.php',
+ 'QM_Data_Timing' => $baseDir . '/data/timing.php',
+ 'QM_Data_Transients' => $baseDir . '/data/transients.php',
+ 'QM_Dispatcher' => $baseDir . '/classes/Dispatcher.php',
+ 'QM_Dispatchers' => $baseDir . '/classes/Dispatchers.php',
+ 'QM_Hook' => $baseDir . '/classes/Hook.php',
+ 'QM_Output' => $baseDir . '/classes/Output.php',
+ 'QM_Output_Headers' => $baseDir . '/output/Headers.php',
+ 'QM_Output_Headers_Overview' => $baseDir . '/output/headers/overview.php',
+ 'QM_Output_Headers_PHP_Errors' => $baseDir . '/output/headers/php_errors.php',
+ 'QM_Output_Headers_Redirects' => $baseDir . '/output/headers/redirects.php',
+ 'QM_Output_Html' => $baseDir . '/output/Html.php',
+ 'QM_Output_Html_Admin' => $baseDir . '/output/html/admin.php',
+ 'QM_Output_Html_Assets' => $baseDir . '/output/html/assets.php',
+ 'QM_Output_Html_Assets_Scripts' => $baseDir . '/output/html/assets_scripts.php',
+ 'QM_Output_Html_Assets_Styles' => $baseDir . '/output/html/assets_styles.php',
+ 'QM_Output_Html_Block_Editor' => $baseDir . '/output/html/block_editor.php',
+ 'QM_Output_Html_Caps' => $baseDir . '/output/html/caps.php',
+ 'QM_Output_Html_Conditionals' => $baseDir . '/output/html/conditionals.php',
+ 'QM_Output_Html_DB_Callers' => $baseDir . '/output/html/db_callers.php',
+ 'QM_Output_Html_DB_Components' => $baseDir . '/output/html/db_components.php',
+ 'QM_Output_Html_DB_Dupes' => $baseDir . '/output/html/db_dupes.php',
+ 'QM_Output_Html_DB_Queries' => $baseDir . '/output/html/db_queries.php',
+ 'QM_Output_Html_Debug_Bar' => $baseDir . '/output/html/debug_bar.php',
+ 'QM_Output_Html_Environment' => $baseDir . '/output/html/environment.php',
+ 'QM_Output_Html_HTTP' => $baseDir . '/output/html/http.php',
+ 'QM_Output_Html_Headers' => $baseDir . '/output/html/headers.php',
+ 'QM_Output_Html_Hooks' => $baseDir . '/output/html/hooks.php',
+ 'QM_Output_Html_Languages' => $baseDir . '/output/html/languages.php',
+ 'QM_Output_Html_Logger' => $baseDir . '/output/html/logger.php',
+ 'QM_Output_Html_Multisite' => $baseDir . '/output/html/multisite.php',
+ 'QM_Output_Html_Overview' => $baseDir . '/output/html/overview.php',
+ 'QM_Output_Html_PHP_Errors' => $baseDir . '/output/html/php_errors.php',
+ 'QM_Output_Html_Request' => $baseDir . '/output/html/request.php',
+ 'QM_Output_Html_Theme' => $baseDir . '/output/html/theme.php',
+ 'QM_Output_Html_Timing' => $baseDir . '/output/html/timing.php',
+ 'QM_Output_Html_Transients' => $baseDir . '/output/html/transients.php',
+ 'QM_Output_Raw' => $baseDir . '/output/Raw.php',
+ 'QM_Output_Raw_Cache' => $baseDir . '/output/raw/cache.php',
+ 'QM_Output_Raw_Conditionals' => $baseDir . '/output/raw/conditionals.php',
+ 'QM_Output_Raw_DB_Queries' => $baseDir . '/output/raw/db_queries.php',
+ 'QM_Output_Raw_HTTP' => $baseDir . '/output/raw/http.php',
+ 'QM_Output_Raw_Logger' => $baseDir . '/output/raw/logger.php',
+ 'QM_Output_Raw_Transients' => $baseDir . '/output/raw/transients.php',
+ 'QM_PHP' => $baseDir . '/classes/PHP.php',
+ 'QM_Plugin' => $baseDir . '/classes/Plugin.php',
+ 'QM_Timer' => $baseDir . '/classes/Timer.php',
+ 'QM_Util' => $baseDir . '/classes/Util.php',
+ 'QueryMonitor' => $baseDir . '/classes/QueryMonitor.php',
+);
diff --git a/query-monitor/vendor/composer/autoload_namespaces.php b/query-monitor/vendor/composer/autoload_namespaces.php
new file mode 100644
index 0000000000..15a2ff3ad6
--- /dev/null
+++ b/query-monitor/vendor/composer/autoload_namespaces.php
@@ -0,0 +1,9 @@
+setClassMapAuthoritative(true);
diff --git a/query-monitor/vendor/composer/autoload_static.php b/query-monitor/vendor/composer/autoload_static.php
index 62cbeba3ec..e6cfecd708 100644
--- a/query-monitor/vendor/composer/autoload_static.php
+++ b/query-monitor/vendor/composer/autoload_static.php
@@ -4,7 +4,7 @@
namespace Composer\Autoload;
-class ComposerStaticInit9bc748a33ab984c092a749a74d7b8261
+class ComposerStaticInitfaf42c5f235c65e8397793ae676be6da
{
public static $classMap = array (
'Debug_Bar' => __DIR__ . '/../..' . '/classes/debug_bar.php',
@@ -14,7 +14,6 @@ class ComposerStaticInit9bc748a33ab984c092a749a74d7b8261
'QM_Backtrace' => __DIR__ . '/../..' . '/classes/Backtrace.php',
'QM_CLI' => __DIR__ . '/../..' . '/classes/CLI.php',
'QM_Collector' => __DIR__ . '/../..' . '/classes/Collector.php',
- 'QM_Collector_Assets' => __DIR__ . '/../..' . '/classes/Collector_Assets.php',
'QM_Collectors' => __DIR__ . '/../..' . '/classes/Collectors.php',
'QM_Component' => __DIR__ . '/../..' . '/classes/Component.php',
'QM_DB' => __DIR__ . '/../..' . '/classes/DB.php',
@@ -30,7 +29,6 @@ class ComposerStaticInit9bc748a33ab984c092a749a74d7b8261
'QM_Data_DB_Components' => __DIR__ . '/../..' . '/data/db_components.php',
'QM_Data_DB_Dupes' => __DIR__ . '/../..' . '/data/db_dupes.php',
'QM_Data_DB_Queries' => __DIR__ . '/../..' . '/data/db_queries.php',
- 'QM_Data_Doing_It_Wrong' => __DIR__ . '/../..' . '/data/doing_it_wrong.php',
'QM_Data_Environment' => __DIR__ . '/../..' . '/data/environment.php',
'QM_Data_Fallback' => __DIR__ . '/../..' . '/data/fallback.php',
'QM_Data_HTTP' => __DIR__ . '/../..' . '/data/http.php',
@@ -67,7 +65,6 @@ class ComposerStaticInit9bc748a33ab984c092a749a74d7b8261
'QM_Output_Html_DB_Dupes' => __DIR__ . '/../..' . '/output/html/db_dupes.php',
'QM_Output_Html_DB_Queries' => __DIR__ . '/../..' . '/output/html/db_queries.php',
'QM_Output_Html_Debug_Bar' => __DIR__ . '/../..' . '/output/html/debug_bar.php',
- 'QM_Output_Html_Doing_It_Wrong' => __DIR__ . '/../..' . '/output/html/doing_it_wrong.php',
'QM_Output_Html_Environment' => __DIR__ . '/../..' . '/output/html/environment.php',
'QM_Output_Html_HTTP' => __DIR__ . '/../..' . '/output/html/http.php',
'QM_Output_Html_Headers' => __DIR__ . '/../..' . '/output/html/headers.php',
@@ -98,7 +95,7 @@ class ComposerStaticInit9bc748a33ab984c092a749a74d7b8261
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
- $loader->classMap = ComposerStaticInit9bc748a33ab984c092a749a74d7b8261::$classMap;
+ $loader->classMap = ComposerStaticInitfaf42c5f235c65e8397793ae676be6da::$classMap;
}, null, ClassLoader::class);
}
diff --git a/query-monitor/vendor/composer/installed.json b/query-monitor/vendor/composer/installed.json
new file mode 100644
index 0000000000..f20a6c47c6
--- /dev/null
+++ b/query-monitor/vendor/composer/installed.json
@@ -0,0 +1,5 @@
+{
+ "packages": [],
+ "dev": false,
+ "dev-package-names": []
+}
diff --git a/query-monitor/vendor/composer/installed.php b/query-monitor/vendor/composer/installed.php
new file mode 100644
index 0000000000..64205780c7
--- /dev/null
+++ b/query-monitor/vendor/composer/installed.php
@@ -0,0 +1,23 @@
+ array(
+ 'name' => 'johnbillion/query-monitor',
+ 'pretty_version' => 'dev-release',
+ 'version' => 'dev-release',
+ 'reference' => '10c40a3e8a9d62b091d235646ac0dc80892d2b6b',
+ 'type' => 'wordpress-plugin',
+ 'install_path' => __DIR__ . '/../../',
+ 'aliases' => array(),
+ 'dev' => false,
+ ),
+ 'versions' => array(
+ 'johnbillion/query-monitor' => array(
+ 'pretty_version' => 'dev-release',
+ 'version' => 'dev-release',
+ 'reference' => '10c40a3e8a9d62b091d235646ac0dc80892d2b6b',
+ 'type' => 'wordpress-plugin',
+ 'install_path' => __DIR__ . '/../../',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ ),
+);
diff --git a/query-monitor/vendor/composer/platform_check.php b/query-monitor/vendor/composer/platform_check.php
index 580fa96095..589e9e770b 100644
--- a/query-monitor/vendor/composer/platform_check.php
+++ b/query-monitor/vendor/composer/platform_check.php
@@ -4,8 +4,8 @@
$issues = array();
-if (!(PHP_VERSION_ID >= 70400)) {
- $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.';
+if (!(PHP_VERSION_ID >= 70200)) {
+ $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.0". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
diff --git a/query-monitor/wp-content/db.php b/query-monitor/wp-content/db.php
index 8363a46d75..2e272ec3cc 100644
--- a/query-monitor/wp-content/db.php
+++ b/query-monitor/wp-content/db.php
@@ -2,7 +2,7 @@
/**
* Plugin Name: Query Monitor Database Class (Drop-in)
* Description: Database drop-in for Query Monitor, the developer tools panel for WordPress.
- * Version: 3.15.0
+ * Version: 3.12.1
* Plugin URI: https://querymonitor.com/
* Author: John Blackbourn
* Author URI: https://querymonitor.com/
@@ -46,17 +46,6 @@
return;
}
-# Don't load QM during plugin updates to prevent function signature changes causing issues between versions.
-if ( is_admin() ) {
- if ( isset( $_GET['action'] ) && 'upgrade-plugin' === $_GET['action'] ) {
- return;
- }
-
- if ( isset( $_POST['action'] ) && 'update-plugin' === $_POST['action'] ) {
- return;
- }
-}
-
// This must be required before vendor/autoload.php so QM can serve its own message about PHP compatibility.
$qm_dir = dirname( dirname( __FILE__ ) );
$qm_php = "{$qm_dir}/classes/PHP.php";