| @@ -63,9 +63,9 @@ | ||
| 63 | 63 | $this->file = $file; |
| 64 | 64 | $this->dir = dirname( $file ); |
| 65 | 65 | self::$options = get_site_option( 'wp_debugging', [ 'wp_debug' => '1' ] ); |
| 66 | 66 | self::$config_path = $this->get_config_path(); |
| 67 | - @ini_set( 'display_errors', 1 ); // phpcs:ignore WordPress.PHP.IniSet.display_errors_Blacklisted,WordPress.PHP.NoSilencedErrors.Discouraged,WordPress.PHP.IniSet.display_errors_Disallowed | |
| 67 | + @ini_set( 'display_errors', 1 ); // phpcs:ignore WordPress.PHP.IniSet.display_errors_Blacklisted | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | 71 | * Test for writable wp-config.php, exit with notice if not available. |
| @@ -81,14 +81,9 @@ | ||
| 81 | 81 | return false; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | $this->load_hooks(); |
| 85 | - add_action( | |
| 86 | - 'plugins_loaded', | |
| 87 | - function () { | |
| 88 | - \WP_Dependency_Installer::instance()->run( $this->dir ); | |
| 89 | - } | |
| 90 | - ); | |
| 85 | + \WP_Dependency_Installer::instance()->run( $this->dir ); | |
| 91 | 86 | } |
| 92 | 87 | |
| 93 | 88 | /** |
| 94 | 89 | * Get the `wp-config.php` file path. |
| @@ -102,9 +97,8 @@ | ||
| 102 | 97 | public function get_config_path() { |
| 103 | 98 | $config_path = ABSPATH . 'wp-config.php'; |
| 104 | 99 | |
| 105 | 100 | if ( ! file_exists( $config_path ) ) { |
| 106 | - // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged | |
| 107 | 101 | if ( @file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ! @file_exists( dirname( ABSPATH ) . '/wp-settings.php' ) ) { |
| 108 | 102 | $config_path = dirname( ABSPATH ) . '/wp-config.php'; |
| 109 | 103 | } |
| 110 | 104 | } |
| @@ -125,10 +119,10 @@ | ||
| 125 | 119 | * @return void |
| 126 | 120 | */ |
| 127 | 121 | public function load_hooks() { |
| 128 | 122 | add_action( |
| 129 | - 'plugins_loaded', | |
| 130 | - function () { | |
| 123 | + 'init', | |
| 124 | + function() { | |
| 131 | 125 | ( new Settings( self::$options, self::$config_path, $this->defined_constants ) ) |
| 132 | 126 | ->load_hooks() |
| 133 | 127 | ->process_filter_constants(); |
| 134 | 128 | } |