timber / debug-bar-timber

Debug Bar Extension for the Timber Library
https://github.com/timber/debug-bar-timber
55 stars 8 forks source link

Check for Debug_Bar class later. #25

Closed mikelittle closed 3 years ago

mikelittle commented 3 years ago

When the Debug_Bar class is supplied by Query Monitor, the check for it can run too early.

Query monitor instantiates the Debug_Bar class on the init action at the default priority of 10. https://github.com/johnbillion/query-monitor/blob/develop/collectors/debug_bar.php#L109 and https://github.com/johnbillion/query-monitor/blob/develop/collectors/debug_bar.php#L46

Debug bar timber also checks on the same action with the same priority. This means it can sometimes check too early. Resulting in the incorrect message "In order to use the Timber Debug Bar, you need to install and activate the WordPress Debug Bar Plugin"

Plugins_‹_I_m_a_Scientist__Get_me_out_of_here__—_WordPress

This PR changes the priority to 11 to ensure Query Monitor runs first.

jarednova commented 3 years ago

Thanks for the PR @mikelittle !