findings = $findings; } public function id(): string { // phpcs:ignore WordPress.WP.CapitalPDangit.MisspelledInText -- Stable registry machine ID. return 'wordpress.configuration'; } /** * @return array */ public function execute( string $timestamp ): array { $environment = wp_get_environment_type(); $debug = defined( 'WP_DEBUG' ) && true === WP_DEBUG; $display = defined( 'WP_DEBUG_DISPLAY' ) && true === WP_DEBUG_DISPLAY; $status = 'production' === $environment && $debug && $display ? 'warning' : 'pass'; $observations = array( array( 'flag' => 'wp_debug', 'enabled' => $debug, ), array( 'flag' => 'wp_debug_display', 'enabled' => $display, ), array( 'flag' => 'disallow_file_edit', 'enabled' => defined( 'DISALLOW_FILE_EDIT' ) && true === DISALLOW_FILE_EDIT, ), array( 'flag' => 'disallow_file_mods', 'enabled' => ! wp_is_file_mod_allowed( '320px_site_audit' ), ), array( 'flag' => 'environment_type', 'value' => $environment, ), ); return $this->findings->build( $this->id(), $status, array( 'observations' => $observations, 'method' => 'boolean_constant_and_wordpress_policy_allowlist', 'limitations' => array( 'No wp-config.php content or constant value outside this boolean allowlist was read.' ), ), count( $observations ), count( $observations ), 'complete', $timestamp ); } }