PluginProbe
WP Debugging / 2.9.2
WP Debugging v2.9.2
2.12.6 2.12.5 trunk 2.10.0 2.10.1 2.10.2 2.11.0 2.11.1 2.11.10 2.11.11 2.11.12 2.11.13 2.11.14 2.11.15 2.11.16 2.11.17 2.11.18 2.11.19 2.11.2 2.11.20 2.11.21 2.11.22 2.11.23 2.11.24 2.11.3 All 59 releases
← All changes | src/Bootstrap.php +5 -11 2.11.242.9.2 View file →
@@ -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 }
@@ -183,9 +177,9 @@
183 177 */
184 178 public function deactivate() {
185 179 $restore_constants = get_site_option( 'wp_debugging_restore' );
186 180 $remove_user_added = array_diff( self::$options, array_flip( $this->defined_constants ) );
187 - $remove_constants = array_diff( array_flip( $this->defined_constants ), array_keys( (array) $restore_constants ) );
181 + $remove_constants = array_diff( array_flip( $this->defined_constants ), array_keys( $restore_constants ) );
188 182 $remove_constants = array_merge( $remove_constants, $remove_user_added );
189 183
190 184 ( new Settings( self::$options, self::$config_path, $this->defined_constants ) )->remove_constants( $remove_constants );
191 185