Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| Debug | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 1 |
| is_debug_mode | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
12 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Implement debug helper methods. |
| 4 | * |
| 5 | * @link https://automattic.com |
| 6 | * @since 1.0.0 |
| 7 | * @package automattic/jetpack-boost |
| 8 | */ |
| 9 | |
| 10 | namespace Automattic\Jetpack_Boost\Lib; |
| 11 | |
| 12 | /** |
| 13 | * Class Debug |
| 14 | */ |
| 15 | class Debug { |
| 16 | /** |
| 17 | * Returns whether the debug mode has been triggered. |
| 18 | */ |
| 19 | public static function is_debug_mode() { |
| 20 | $script_debug = defined( 'SCRIPT_DEBUG' ) && \SCRIPT_DEBUG; |
| 21 | $manual_debug_mode = filter_input( INPUT_GET, 'jetpack-boost-debug' ); |
| 22 | |
| 23 | $debug = $script_debug || $manual_debug_mode; |
| 24 | |
| 25 | /** |
| 26 | * Filter debug status on/off |
| 27 | * |
| 28 | * @param bool $debug_status enable or disable debug mode. |
| 29 | * |
| 30 | * @since 1.0.0 |
| 31 | */ |
| 32 | return apply_filters( 'jetpack_boost_debug', $debug ); |
| 33 | } |
| 34 | } |