From 8a2f1099d9be5fd21466d8a674a583be050edee4 Mon Sep 17 00:00:00 2001 From: devuri Date: Wed, 10 Mar 2021 00:46:34 -0500 Subject: [PATCH] feat: adds Environment::secure() --- src/Environment.php | 19 +++++++++++++++++++ src/Setup.php | 3 +++ 2 files changed, 22 insertions(+) diff --git a/src/Environment.php b/src/Environment.php index f8154c6..4f2ed8a 100644 --- a/src/Environment.php +++ b/src/Environment.php @@ -61,4 +61,23 @@ public static function debug(): void { ini_set('display_errors', '0'); } + public static function secure(): void { + + // Disable Plugin and Theme Editor. + self::define('DISALLOW_FILE_EDIT', true ); + self::define('DISALLOW_FILE_MODS', true ); + + self::define('WP_DEBUG_DISPLAY', false); + self::define('SCRIPT_DEBUG', false); + + self::define('WP_CRON_LOCK_TIMEOUT', 120); + self::define('EMPTY_TRASH_DAYS', 10); + + self::define( 'WP_DEBUG', false ); + self::define('WP_DEBUG_LOG', false ); + ini_set('display_errors', '0'); + + } + + } diff --git a/src/Setup.php b/src/Setup.php index e60f80e..aac24be 100644 --- a/src/Setup.php +++ b/src/Setup.php @@ -112,6 +112,9 @@ public function debug(): ConfigInterface { case 'development': Environment::development(); break; + case 'secure': + Environment::secure(); + break; default: Environment::production(); }