-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify-plugin.php
More file actions
42 lines (40 loc) · 1.61 KB
/
Copy pathverify-plugin.php
File metadata and controls
42 lines (40 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* Plugin verification script
* Add this to your wp-config.php temporarily: include_once(WP_CONTENT_DIR . '/plugins/restorewp/verify-plugin.php');
*/
// Force admin menu registration for testing
add_action('admin_menu', function() {
// Force add menu regardless of capabilities for testing
add_menu_page(
'RestoreWP Test',
'RestoreWP Test',
'read', // Lower capability for testing
'restorewp-test-menu',
function() {
echo '<div class="wrap">';
echo '<h1>RestoreWP Plugin Verification</h1>';
echo '<p><strong>Plugin Status:</strong> Active and Loading!</p>';
echo '<p><strong>Current User:</strong> ' . wp_get_current_user()->user_login . '</p>';
echo '<p><strong>User Capabilities:</strong></p>';
echo '<ul>';
$caps = ['manage_options', 'edit_posts', 'read'];
foreach($caps as $cap) {
$has = current_user_can($cap) ? 'YES' : 'NO';
echo '<li>' . $cap . ': ' . $has . '</li>';
}
echo '</ul>';
echo '<p><strong>Plugin Path:</strong> ' . RESTOREWP_PLUGIN_PATH . '</p>';
echo '<p><strong>Assets URL:</strong> ' . RESTOREWP_ASSETS_URL . '</p>';
echo '</div>';
},
'dashicons-migrate',
21
);
}, 999);
// Add admin notice
add_action('admin_notices', function() {
if (current_user_can('read')) {
echo '<div class="notice notice-success"><p><strong>RestoreWP Verification:</strong> Plugin is loading! Check "RestoreWP Test" in the admin menu.</p></div>';
}
});