SAVEQUERIES
',
'false
'
);
} else {
$notice = __( 'No database queries were logged.', 'query-monitor' );
}
echo $this->build_notice( $notice ); // WPCS: XSS ok.
$this->after_non_tabular_output();
}
/**
* @param arraydb.php
',
'QM_DB_SYMLINK
'
);
printf(
' See this wiki page for more information.',
'https://github.com/johnbillion/query-monitor/wiki/db.php-Symlink'
);
echo '{$sql}
";
} else {
$sql = self::format_sql( $row['sql'] );
}
if ( 'SELECT' !== $row['type'] ) {
$sql = "{$sql}";
}
if ( isset( $row['trace'] ) ) {
$caller = $row['trace']->get_caller();
$caller_name = self::output_filename( $row['caller'], $caller['calling_file'], $caller['calling_line'] );
$stack = array();
$filtered_trace = $row['trace']->get_filtered_trace();
array_shift( $filtered_trace );
foreach ( $filtered_trace as $frame ) {
$stack[] = self::output_filename( $frame['display'], $frame['calling_file'], $frame['calling_line'] );
}
} else {
if ( ! empty( $row['caller'] ) ) {
$caller_name = '' . esc_html( $row['caller'] ) . '
';
} else {
$caller_name = '' . esc_html__( 'Unknown', 'query-monitor' ) . '
';
}
$stack = $row['stack'];
array_shift( $stack );
$stack = array_map( function( $frame ) {
return '' . esc_html( $frame ) . '
';
}, $stack );
}
$row_attr = array();
if ( $row['result'] instanceof WP_Error ) {
$row_attr['class'] = 'qm-warn';
}
if ( isset( $cols['sql'] ) ) {
$row_attr['data-qm-type'] = $row['type'];
if ( 'SELECT' !== $row['type'] ) {
$row_attr['data-qm-type'] .= ' non-select';
}
}
if ( isset( $cols['component'] ) && $row['component'] ) {
$row_attr['data-qm-component'] = $row['component']->name;
if ( 'core' !== $row['component']->context ) {
$row_attr['data-qm-component'] .= ' non-core';
}
}
if ( isset( $cols['caller'] ) && ! empty( $row['caller_name'] ) ) {
$row_attr['data-qm-caller'] = $row['caller_name'];
if ( $row['is_main_query'] ) {
$row_attr['data-qm-caller'] .= ' qm-main-query';
}
}
if ( isset( $cols['time'] ) ) {
$row_attr['data-qm-time'] = $row['ltime'];
}
$attr = '';
foreach ( $row_attr as $a => $v ) {
$attr .= ' ' . $a . '="' . esc_attr( $v ) . '"';
}
echo "%s
', esc_html__( 'Main Query', 'query-monitor' ) ); } echo '