| @@ -24,14 +24,19 @@ | ||
| 24 | 24 | * |
| 25 | 25 | * @return void |
| 26 | 26 | */ |
| 27 | 27 | public function init() { |
| 28 | - if ( ! class_exists( 'QueryMonitor' ) ) { | |
| 29 | - return; | |
| 30 | - } | |
| 31 | - | |
| 32 | 28 | $this->register_collector(); |
| 33 | 29 | add_filter( 'qm/outputter/html', [ $this, 'register_output_html' ], 10 ); |
| 30 | + } | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * Check if controller is enabled. | |
| 34 | + * | |
| 35 | + * @return bool | |
| 36 | + */ | |
| 37 | + public function controller_enabled() { | |
| 38 | + return class_exists( 'QueryMonitor' ); | |
| 34 | 39 | } |
| 35 | 40 | |
| 36 | 41 | /** |
| 37 | 42 | * Register collector. |