# wp-optimize/4.7.0/includes/list-tables/class-wp-optimize-queries-list-table.php

WP-Optimize – Cache, Compress images, Minify &amp; Clean database to boost page speed &amp; performance, version 4.7.0. 84 lines.

- Page: https://pluginprobe.com/plugins/wp-optimize/4.7.0/code/includes/list-tables/class-wp-optimize-queries-list-table.php
- Raw: https://pluginprobe.com/plugins/wp-optimize/4.7.0/raw/includes/list-tables/class-wp-optimize-queries-list-table.php
- Modified: 2026-04-21T16:53:34+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-optimize/4.7.0/code/includes/list-tables/class-wp-optimize-queries-list-table.php#L10-L20`.

```php
<?php
if (!defined('ABSPATH')) die('No direct access allowed');

if (!class_exists('WP_Optimize_Queries_List_Table')) :

class WP_Optimize_Queries_List_Table extends WP_List_Table {

	/**
	 * WP column headers definition
	 *
	 * @var array
	 */
	public $_column_headers;

	/**
	 * WP table property for table items
	 *
	 * @var array
	 */
	public $items;

	/**
	 * {@inheritdoc}
	 */
	public function get_columns() {
		$columns = array(
			'last_used' => __('Last access', 'wp-optimize'),
			'table_name' => __('Table name', 'wp-optimize'),
			'total_queries'	=> __('Total queries', 'wp-optimize'),
			'avg_per_min' => __('Average executions per minute', 'wp-optimize'),
			'avg_time' => __('Average query time', 'wp-optimize'),
			'slow_queries_count' => __('Slow queries', 'wp-optimize'),
			'slow_queries_detail' => __('Details', 'wp-optimize')
		);

		return $columns;
	}

	/**
	 * {@inheritdoc}
	 */
	public function prepare_items() {
		$columns = $this->get_columns();
		$hidden = array();
		$sortable = array();
		$this->_column_headers = array($columns, $hidden, $sortable);
		
		$this->items = array();
	}

	/**
	 * Append a new item to the standard table
	 *
	 * @param array $row The information for each column of the new row
	 *                   Example:
	 *                   [
	 * 	                 "table_name" => string,  # Name of the table
	 *                   "last_used"  => datetime, # string Last execution timestamp
	 *                   "total_queries" => integer, # Total execution count
	 *                   "avg_per_min" => float, # Average total executions per minute for the query group
	 *                   "avg_time" => float, # Average execution time for the query group
	 *                   "slow_queries_count" => integer, # How many slow queries were detected
	 *                   "slow_queries_detail" => string, # Extended information about slow queries
	 *                   ]
	 * @return void
	 */
	public function add_item($row) {
		$this->items[] = $row;
	}

	/**
	 * Parse the column value
	 *
	 * @param array  $item        The row data
	 * @param string $column_name What column are we parsing
	 * @return string|integer
	 */
	public function column_default($item, $column_name) {
		return $item[$column_name];
	}
}

endif;

```
