PluginProbe
ElasticPress / 5.3.5
ElasticPress v5.3.5
5.3.5 5.3.4 3.6.5 3.6.6 4.0.0 4.0.1 4.1.0 4.2.0 4.2.1 4.2.2 4.3.0 4.3.1 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.6.0 4.6.1 4.7.0 4.7.1 4.7.2 5.0.0 5.0.1 5.0.2 All 108 releases
elasticpress / includes / classes / StatusReport / AjaxReport.php

AjaxReport.php in ElasticPress 5.3.5, at includes/classes/StatusReport/AjaxReport.php

58 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * AjaxReport abstract class
4 *
5 * @package elasticpress
6 *
7 * @since 5.2.0
8 */
9
10 namespace ElasticPress\StatusReport;
11
12 defined( 'ABSPATH' ) || exit;
13
14 /**
15 * AjaxReport class
16 *
17 * @package ElasticPress
18 */
19 abstract class AjaxReport extends Report {
20 /**
21 * Groups must return empty array in Ajax context. Always
22 *
23 * @return array
24 */
25 final public function get_groups(): array {
26 return [];
27 }
28
29 /**
30 * Return the report messages.
31 *
32 * @return array
33 */
34 public function get_messages(): array {
35 if ( isset( $_POST['action'] ) && 'ep_load_groups' === $_POST['action'] ) { // phpcs:ignore WordPress.Security.NonceVerification
36 return [];
37 }
38
39 $messages = [
40 [
41 'type' => 'warning',
42 'message' => sprintf(
43 __( 'To see this report, please generate a full report first by clicking the "Generate Full Status Report" button.', 'elasticpress' ),
44 ),
45 ],
46 ];
47
48 return $messages;
49 }
50
51 /**
52 * Return the report groups in an AJAX context
53 *
54 * @return string
55 */
56 abstract public function get_groups_ajax(): array;
57 }
58