parent = $parent; } public function nonceAction(): string { return 'abj404UpdateOptions'; } public function nonceArg(): string { return 'nonce'; } public function useCheckAdminReferer(): bool { return false; } public function handle(string $action, string &$sub): string { $logger = $this->parent->getLogger(); if (array_key_exists('deleteDebugFile', $_POST) && $_POST['deleteDebugFile']) { $filepath = $logger->getDebugFilePath(); if (!file_exists($filepath)) { return sprintf(__("Debug file not found. (%s)", '404-solution'), $filepath); } else if ($logger->deleteDebugFile()) { return sprintf(__("Debug file(s) deleted. (%s)", '404-solution'), $filepath); } else { return sprintf(__("Issue deleting debug file. (%s)", '404-solution'), $filepath); } } $sub = 'abj404_options'; return ''; } }