Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.3.0: mu-plugin that unsets collectors, causes QM to crash later #399

Closed
lkraav opened this issue Feb 14, 2019 · 2 comments
Closed

3.3.0: mu-plugin that unsets collectors, causes QM to crash later #399

lkraav opened this issue Feb 14, 2019 · 2 comments

Comments

@lkraav
Copy link

lkraav commented Feb 14, 2019

add_filter( 'qm/built-in-collectors', function( $files ) {                                                                                                                                                                                    
                                                                                                                                                                                                                                              
    unset( $files['hooks'] );                                                                                                                                                                                                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                              
    return $files;                                                                                                                                                                                                                            
                                                                                                                                                                                                                                              
} );

you will get:

[14-Feb-2019 12:55:58 UTC] PHP Fatal error:  Uncaught Error: Class 'QM_Collector_Hooks' not found in /home/warmpress/wp-content/plugins/query-monitor.git/classes/Collector.php:154
Stack trace:
#0 /home/warmpress/wp-content/plugins/query-monitor.git/classes/Collectors.php(55): QM_Collector->process_concerns()
#1 /home/warmpress/wp-content/plugins/query-monitor.git/classes/Dispatcher.php(52): QM_Collectors->process()
#2 /home/warmpress/wp-content/plugins/query-monitor.git/dispatchers/Html.php(222): QM_Dispatcher->get_outputters('html')
#3 /home/warmpress/wp-content/plugins/query-monitor.git/dispatchers/Html.php(186): QM_Dispatcher_Html->before_output()
#4 /home/warmpress/wp-includes/class-wp-hook.php(286): QM_Dispatcher_Html->dispatch('')
#5 /home/warmpress/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
#6 /home/warmpress/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
#7 /home/warmpress/wp-includes/load.php(788): do_action('shutdown')
#8 [internal function]: shutdown_action_hook()
#9 {main}
  thrown in /home/warmpress/wp-content/plugins/query-monitor.git/classes/Collector.php on line 154
@johnbillion
Copy link
Owner

Cheers. The QM_Collector class is using the QM_Collector_Hooks class for the new Hooks in Use functionality. I'll see about abstracting this out further so it doesn't depend on the actual collector.

@lkraav
Copy link
Author

lkraav commented Feb 14, 2019

I'm also doing unset languages but that seems to hold up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants