PluginProbe
WP Debugging / 2.7.2
WP Debugging v2.7.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 +10 -12 2.11.212.7.2 View file →
@@ -8,13 +8,8 @@
8 8 */
9 9
10 10 namespace Fragen\WP_Debugging;
11 11
12 -// Exit if called directly.
13 -if ( ! defined( 'WPINC' ) ) {
14 - die;
15 -}
16 -
17 12 /**
18 13 * Class Bootstrap
19 14 */
20 15 class Bootstrap {
@@ -79,16 +74,14 @@
79 74 echo '</p></div>';
80 75
81 76 return false;
82 77 }
78 + if ( ! \file_exists( self::$config_path ) || ! trim( \file_get_contents( self::$config_path ) ) ) {
79 + return;
80 + }
83 81
84 82 $this->load_hooks();
85 - add_action(
86 - 'plugins_loaded',
87 - function() {
88 - \WP_Dependency_Installer::instance()->run( $this->dir );
89 - }
90 - );
83 + \WP_Dependency_Installer::instance()->run( $this->dir );
91 84 }
92 85
93 86 /**
94 87 * Get the `wp-config.php` file path.
@@ -124,9 +117,9 @@
124 117 * @return void
125 118 */
126 119 public function load_hooks() {
127 120 add_action(
128 - 'plugins_loaded',
121 + 'init',
129 122 function() {
130 123 ( new Settings( self::$options, self::$config_path, $this->defined_constants ) )
131 124 ->load_hooks()
132 125 ->process_filter_constants();
@@ -196,13 +189,18 @@
196 189 *
197 190 * @return void
198 191 */
199 192 private function set_pre_activation_constants() {
193 + if ( ! \file_exists( self::$config_path ) || ! trim( \file_get_contents( self::$config_path ) ) ) {
194 + return;
195 + }
200 196 $config_transformer = new \WPConfigTransformer( self::$config_path );
201 197 $predefined_constants = [];
202 198 foreach ( $this->defined_constants as $defined_constant ) {
203 199 if ( $config_transformer->exists( 'constant', strtoupper( $defined_constant ) ) ) {
204 200 $value = $config_transformer->get_value( 'constant', strtoupper( $defined_constant ) );
201 + $value = trim( $value, '"\'' ); // Normalize quoted value.
202 +
205 203 $predefined_constants[ $defined_constant ]['value'] = $value;
206 204 }
207 205 }
208 206 update_site_option( 'wp_debugging_restore', $predefined_constants );