plugin = $plugin; } /** * Renders the page. */ public function render(): void { $channel_label = $this->plugin->channel()->label(); global $wpdb; if ( ! current_user_can( Plugin::CAPABILITY ) ) { return; } // phpcs:disable WordPress.Security.NonceVerification.Recommended -- read-only filters. $level = isset( $_GET['level'] ) ? sanitize_key( wp_unslash( $_GET['level'] ) ) : ''; $paged = isset( $_GET['paged'] ) ? max( 1, absint( $_GET['paged'] ) ) : 1; // phpcs:enable WordPress.Security.NonceVerification.Recommended $level = in_array( $level, self::LEVELS, true ) ? $level : ''; $table = DbLogger::table(); $offset = ( $paged - 1 ) * self::PER_PAGE; // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- own table. if ( '' !== $level ) { $total = (int) $wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(*) FROM %i WHERE level = %s', $table, $level ) ); $rows = $wpdb->get_results( $wpdb->prepare( 'SELECT * FROM %i WHERE level = %s ORDER BY id DESC LIMIT %d OFFSET %d', $table, $level, self::PER_PAGE, $offset ) ); } else { $total = (int) $wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(*) FROM %i', $table ) ); $rows = $wpdb->get_results( $wpdb->prepare( 'SELECT * FROM %i ORDER BY id DESC LIMIT %d OFFSET %d', $table, self::PER_PAGE, $offset ) ); } // phpcs:enable $format = get_option( 'date_format' ) . ' ' . get_option( 'time_format' ); $base = admin_url( 'admin.php?page=' . Menu::LOG_SLUG ); ?>
| created_at . ' UTC' ) ) ); ?> | level_label( (string) $row->level ) ); ?> | channel ); ?> |
message ); ?>
context ) ) : ?>
pretty( (string) $row->context ) ); ?> |