Created
November 6, 2025 18:48
-
-
Save georgestephanis/3e55eb82bd4c63b817fd4db9ce07541b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Plugin Name: George Load Time Debugging | |
| function qm_track_current_action( $suffix = '' ) { | |
| static $last_action = null; | |
| if ( $last_action ) { | |
| do_action( 'qm/stop', $last_action ); | |
| } | |
| if ( function_exists( 'current_action' ) ) { | |
| $last_action = current_action() . ( $suffix ? ' : ' . str_replace( WP_CONTENT_DIR, '', $suffix ) : '' ); | |
| } else { | |
| $last_action = 'unknown action'; | |
| } | |
| do_action( 'qm/start', $last_action ); | |
| } | |
| add_action( 'mu_plugins_loaded', 'qm_track_current_action' ); | |
| add_action( 'mu_plugin_loaded', 'qm_track_current_action' ); | |
| add_action( 'network_plugin_loaded', 'qm_track_current_action' ); | |
| add_action( 'plugin_loaded', 'qm_track_current_action' ); | |
| add_action( 'setup_theme', 'qm_track_current_action' ); | |
| add_action( 'after_setup_theme', 'qm_track_current_action' ); | |
| add_action( 'init', 'qm_track_current_action' ); | |
| add_action( 'wp_loaded', 'qm_track_current_action' ); | |
| add_action( 'parse_request', 'qm_track_current_action' ); | |
| add_action( 'wp', 'qm_track_current_action' ); | |
| add_action( 'template_redirect', 'qm_track_current_action' ); | |
| add_action( 'wp_footer', 'qm_track_current_action' ); | |
| add_action( 'adminmenu', 'qm_track_current_action' ); | |
| add_action( 'admin_footer', 'qm_track_current_action' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment