trace = new QM_Backtrace( array( 'ignore_frames' => 1, ) ); return $handler; } public function dispatch() { if ( ! $this->should_dispatch() ) { return; } require_once $this->qm->plugin_path( 'output/Html.php' ); $switched_locale = function_exists( 'switch_to_locale' ) && switch_to_locale( get_user_locale() ); $stack = array(); $filtered_trace = $this->trace->get_display_trace(); // Ignore the `apply_filters('wp_die_handler')` stack frame: array_shift( $filtered_trace ); foreach ( $filtered_trace as $i => $item ) { $stack[] = QM_Output_Html::output_filename( $item['display'], $item['file'], $item['line'] ); } if ( isset( $filtered_trace[ $i - 1 ] ) ) { $culprit = $filtered_trace[ $i - 1 ]; } else { $culprit = $filtered_trace[ $i ]; } $component = QM_Backtrace::get_frame_component( $culprit ); printf( // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet '', esc_url( includes_url( 'css/dashicons.css' ) ) ); ?> '; echo '
'; echo ''; if ( $component ) { $name = ( 'plugin' === $component->type ) ? $component->context : $component->name; printf( /* translators: %s: Plugin or theme name */ esc_html__( 'This message was triggered by %s.', 'query-monitor' ), '' . esc_html( $name ) . '' ); } echo '
'; echo '' . esc_html__( 'Call stack:', 'query-monitor' ) . '
'; echo '