| @@ -7,10 +7,10 @@ | ||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | namespace ElasticPress\StatusReport; |
| 10 | 10 | |
| 11 | -use \ElasticPress\QueryLogger; | |
| 12 | -use \ElasticPress\Utils; | |
| 11 | +use ElasticPress\QueryLogger; | |
| 12 | +use ElasticPress\Utils; | |
| 13 | 13 | |
| 14 | 14 | defined( 'ABSPATH' ) || exit; |
| 15 | 15 | |
| 16 | 16 | /** |
| @@ -40,9 +40,9 @@ | ||
| 40 | 40 | * Return the report title |
| 41 | 41 | * |
| 42 | 42 | * @return string |
| 43 | 43 | */ |
| 44 | - public function get_title() : string { | |
| 44 | + public function get_title(): string { | |
| 45 | 45 | return __( 'Failed Queries', 'elasticpress' ); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
| @@ -49,9 +49,9 @@ | ||
| 49 | 49 | * Return the report fields |
| 50 | 50 | * |
| 51 | 51 | * @return array |
| 52 | 52 | */ |
| 53 | - public function get_groups() : array { | |
| 53 | + public function get_groups(): array { | |
| 54 | 54 | $this->maybe_clear_logs(); |
| 55 | 55 | |
| 56 | 56 | $logs = $this->query_logger->get_logs( false ); |
| 57 | 57 | |
| @@ -107,9 +107,9 @@ | ||
| 107 | 107 | * Return the output of a button to clear the logged queries |
| 108 | 108 | * |
| 109 | 109 | * @return string |
| 110 | 110 | */ |
| 111 | - public function get_actions() : array { | |
| 111 | + public function get_actions(): array { | |
| 112 | 112 | global $wp; |
| 113 | 113 | |
| 114 | 114 | $logs = $this->query_logger->get_logs( false ); |
| 115 | 115 | |
| @@ -131,9 +131,9 @@ | ||
| 131 | 131 | /** |
| 132 | 132 | * If a nonce is present, clear the logs |
| 133 | 133 | */ |
| 134 | 134 | protected function maybe_clear_logs() { |
| 135 | - if ( empty( $_GET['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( $_GET['_wpnonce'] ), 'ep-clear-logged-queries' ) ) { // phpcs:ignore WordPress.Security.NonceVerification | |
| 135 | + if ( empty( $_GET['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( $_GET['_wpnonce'] ), 'ep-clear-logged-queries' ) ) { | |
| 136 | 136 | return; |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | $this->query_logger->clear_logs(); |