-
-
Notifications
You must be signed in to change notification settings - Fork 228
Open
Description
Description
Query Monitor is triggering an infinite recursion loop during translation loading, causing XDebug to abort script execution after reaching the maximum stack depth of 512 frames.
Issue Details
- Error:
PHP Fatal error: Uncaught Error: Xdebug has detected a possible infinite loop, and aborted your script with a stack depth of '512' frames
- WordPress Version: 6.7.0 (based on error message)
- Environment: Local development with XDebug enabled
- Reproduction Path: Plugin attempts to load translations for the 'query-monitor' text domain
Steps to Reproduce
- Use the latest WordPress (6.7.0+)
- Ensure XDebug is installed and enabled on your development environment
- Deactivate the Query Monitor plugin
- Reactivate the Query Monitor plugin
- The error should occur immediately after reactivation
Stack Trace Analysis
The error occurs in a circular dependency between WordPress translation functions and Query Monitor capability checks. The stack trace shows a repeating pattern where:
- WordPress tries to load translations for Query Monitor
- This triggers capability checks via Query Monitor's hooks
- These capability checks attempt to get more translations
- This leads to an infinite recursion
Possible Causes
- Query monitor removed the 'view_query_monitor' capability on deactivation https://github.com/johnbillion/query-monitor/blob/develop/classes/Activation.php#L56-L62
- Query Monitor hooks into capability checks that run during translation loading
- The
QM_Collector_Doing_It_Wrong->maybe_prevent_doing_it_wrong_error()
method seems to be in the recursion path https://github.com/johnbillion/query-monitor/blob/develop/collectors/doing_it_wrong.php#L96-L102 - Translation loading for Query Monitor's text domain is occurring before the plugin is fully initialized
Impact
This issue causes sites with XDebug enabled to crash during plugin activation, making debugging difficult and potentially affecting development environments.
Screenshots
karneaud, doiftrue and MaxBoyman
Metadata
Metadata
Assignees
Labels
No labels