PluginProbe
Disk Usage Insights / trunk
Disk Usage Insights vtrunk
trunk 1.0 1.10 1.11 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9
disk-usage-insights / disk-usage-insights.php

disk-usage-insights.php in Disk Usage Insights trunk, at disk-usage-insights.php

37 lines 958 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Disk Usage Insights
4 * Plugin URI: https://github.com/mgleis/disk-usage-insights
5 * Description: Find large files and folders in your WordPress installation in no time!
6 * Author: Marcel Gleis
7 * License: GPLv3
8 * Version: 1.11
9 * Requires PHP: 7.4
10 */
11 const DISK_USAGE_INSIGHTS_VERSION = '1.11';
12
13 // Ensure running within WordPress
14 if (!defined('ABSPATH')) {
15 exit;
16 }
17
18 add_action('plugins_loaded', 'mgleis_diskusageinsights_init_plugin');
19
20 function mgleis_diskusageinsights_init_plugin() {
21
22 // Ensure the admin interface is in use
23 if (!is_admin()) {
24 return;
25 }
26
27 // If site is a multisite: Ensure the logged in user has SuperAdmin privileges
28 if (is_multisite() && !current_user_can('manage_sites')) {
29 return;
30 }
31
32 // initialize plugin
33 require_once __DIR__.'/vendor/autoload.php';
34 $plugin = new Mgleis\DiskUsageInsights\Plugin(DISK_USAGE_INSIGHTS_VERSION);
35 $plugin->init();
36 }
37