PluginProbe
Extendify / 3.1.5
Extendify v3.1.5
3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 0.7.0 All 126 releases
extendify / app / PluginNotifications / AdminPage.php

AdminPage.php in Extendify 3.1.5, at app/PluginNotifications/AdminPage.php

59 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Extendify\PluginNotifications;
4
5 defined('ABSPATH') || die('No direct access.');
6
7 class AdminPage
8 {
9 public static function handleActions()
10 {
11 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
12 if (sanitize_text_field(wp_unslash($_REQUEST['page'] ?? '')) !== 'extendify-notifications') {
13 return;
14 }
15
16 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
17 $action = sanitize_text_field(wp_unslash($_REQUEST['extendify_action'] ?? ''));
18
19 if (empty($action)) {
20 return;
21 }
22
23 check_admin_referer('extendify_notifications_action', '_extendify_nonce');
24
25 if ($action === 'dismiss') {
26 $id = sanitize_text_field(wp_unslash($_REQUEST['notice_id'] ?? ''));
27 if ($id) {
28 Admin::dismissNotice($id);
29 }
30 }
31
32 if ($action === 'dismiss-all') {
33 Admin::dismissAll();
34 }
35
36 \wp_safe_redirect(\admin_url('index.php?page=extendify-notifications'));
37 exit;
38 }
39
40 public static function render()
41 {
42 if (!class_exists('WP_List_Table')) {
43 require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
44 }
45
46 $table = new NotificationsListTable();
47 $table->prepare_items();
48
49 echo '<div class="wrap">';
50 echo '<h1>' . esc_html__('Plugin Notifications', 'extendify-local') . '</h1>';
51 $table->views();
52 echo '<form method="post">';
53 \wp_nonce_field('extendify_notifications_bulk', '_extendify_nonce');
54 $table->display();
55 echo '</form>';
56 echo '</div>';
57 }
58 }
59