| @@ -2,18 +2,16 @@ | ||
| 2 | 2 | namespace Mgleis\DiskUsageInsights; |
| 3 | 3 | |
| 4 | 4 | use Mgleis\DiskUsageInsights\Frontend\Controller\DeleteSnapshotController; |
| 5 | 5 | use Mgleis\DiskUsageInsights\Frontend\Controller\IndexController; |
| 6 | +use Mgleis\DiskUsageInsights\Frontend\Controller\ResultsController; | |
| 6 | 7 | use Mgleis\DiskUsageInsights\Frontend\Controller\ScanController; |
| 7 | 8 | use Mgleis\DiskUsageInsights\Frontend\Controller\ScanStatusController; |
| 8 | 9 | use Mgleis\DiskUsageInsights\Frontend\Controller\ScanWorkerController; |
| 9 | -use Mgleis\DiskUsageInsights\Frontend\Controller\ShowResultsController; | |
| 10 | -use Mgleis\DiskUsageInsights\Frontend\Controller\ShowResultsTableController; | |
| 11 | 10 | use Mgleis\DiskUsageInsights\Frontend\Controller\ShowSnapshotsController; |
| 12 | 11 | |
| 13 | 12 | class Plugin { |
| 14 | 13 | |
| 15 | - const TITLE = 'Disk Usage Insights'; | |
| 16 | 14 | const NONCE = 'disk_usage_insights'; |
| 17 | 15 | /** @var string */ |
| 18 | 16 | private $version = ''; |
| 19 | 17 | |
| @@ -36,10 +34,10 @@ | ||
| 36 | 34 | // Add to Tools menue |
| 37 | 35 | add_action('admin_menu', function () { |
| 38 | 36 | add_submenu_page( |
| 39 | 37 | 'tools.php', |
| 40 | - self::TITLE, | |
| 41 | - self::TITLE, | |
| 38 | + 'Disk Usage Insights', | |
| 39 | + 'Disk Usage Insights', | |
| 42 | 40 | 'administrator', |
| 43 | 41 | 'disk-usage-insights', |
| 44 | 42 | [$this, 'index'] |
| 45 | 43 | ); |
| @@ -56,9 +54,8 @@ | ||
| 56 | 54 | add_action('wp_ajax_dui_worker', function() { (new ScanWorkerController())->worker(); }); |
| 57 | 55 | add_action('wp_ajax_dui_status', function() { (new ScanStatusController())->status(); }); |
| 58 | 56 | add_action('wp_ajax_dui_delete_snapshot', function() { (new DeleteSnapshotController())->delete(); }); |
| 59 | 57 | add_action('wp_ajax_dui_list_snapshots', function() { (new ShowSnapshotsController())->execute(); }); |
| 60 | - add_action('wp_ajax_dui_results_table', function() { (new ShowResultsTableController())->execute(); }); | |
| 61 | 58 | } |
| 62 | 59 | |
| 63 | 60 | public function addScripts($hook_suffix) { |
| 64 | 61 | if ($hook_suffix != 'tools_page_disk-usage-insights') { |
| @@ -89,12 +86,12 @@ | ||
| 89 | 86 | $admin_bar->add_menu(array( |
| 90 | 87 | 'id' => 'menu-id', |
| 91 | 88 | 'parent' => null, |
| 92 | 89 | 'group' => null, |
| 93 | - 'title' => '<img src="' . WpHelper::getPluginUrl() . '/res/pie.svg" style="margin-top:5px; width:20px" alt="'. self::TITLE .'">', | |
| 90 | + 'title' => '<img src="' . WpHelper::getPluginUrl() . '/res/pie.svg" style="margin-top:5px; width:20px" alt="Disk Usage Insights">', | |
| 94 | 91 | 'href' => admin_url('tools.php?page=disk-usage-insights'), |
| 95 | 92 | 'meta' => [ |
| 96 | - 'title' => self::TITLE | |
| 93 | + 'title' => 'Disk Usage Insights' | |
| 97 | 94 | ] |
| 98 | 95 | )); |
| 99 | 96 | } |
| 100 | 97 | |
| @@ -101,9 +98,9 @@ | ||
| 101 | 98 | public function index() { |
| 102 | 99 | if (!isset($_GET['snapshot'])) { |
| 103 | 100 | return (new IndexController())->execute(); |
| 104 | 101 | } else { |
| 105 | - return (new ShowResultsController())->execute(); | |
| 102 | + return (new ResultsController())->execute(); | |
| 106 | 103 | } |
| 107 | 104 | } |
| 108 | 105 | |
| 109 | 106 | } |