https://github.com/robertdevore/wp-query-execution-time
WP_Query Execution Time
https://github.com/robertdevore/wp-query-execution-time
Last synced: 6 months ago
JSON representation
WP_Query Execution Time
- Host: GitHub
- URL: https://github.com/robertdevore/wp-query-execution-time
- Owner: robertdevore
- License: gpl-3.0
- Created: 2023-10-22T19:54:56.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-22T20:04:08.000Z (over 2 years ago)
- Last Synced: 2025-08-03T06:33:10.737Z (6 months ago)
- Language: PHP
- Size: 16.6 KB
- Stars: 16
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WP_Query Execution Time
Measure the execution time of a specific WP_Query and log it to the browser console.
### How to use
1. Activate the plugin
2. Pass all of the the `wp_query_id` instances you want to target as an array to the `wpqet_target_query_id` filter
3. Review the console to view the execution time for your queries
**Filter example**
````
/**
* Target Query ID
*
* @return string
*/
function acme_target_query_id_filter( $ids ) {
$ids = array( 'your_query_id', 'another_id_here' );
return $ids;
}
add_filter( 'wpqet_target_query_id', 'acme_target_query_id_filter' );
````
**Example output**
`WP_Query Execution Time for wpd_products_widget: 0.0337 seconds`