| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
|
| 7 |
if( ! class_exists( 'MywpDeveloperAbstractModule' ) ) { |
| 8 |
return false; |
| 9 |
} |
| 10 |
|
| 11 |
if ( ! class_exists( 'MywpDeveloperModuleDebugtrace' ) ) : |
| 12 |
|
| 13 |
final class MywpDeveloperModuleDebugtrace extends MywpDeveloperAbstractModule { |
| 14 |
|
| 15 |
static protected $id = 'dev_debugtrace'; |
| 16 |
|
| 17 |
static protected $priority = 1010; |
| 18 |
|
| 19 |
public static function mywp_debug_renders( $debug_renders ) { |
| 20 |
|
| 21 |
$debug_renders[ self::$id ] = array( |
| 22 |
'debug_type' => 'dev', |
| 23 |
'title' => __( 'Debug Backtrace' , 'my-wp' ), |
| 24 |
); |
| 25 |
|
| 26 |
return $debug_renders; |
| 27 |
|
| 28 |
} |
| 29 |
|
| 30 |
protected static function mywp_developer_debug() { |
| 31 |
|
| 32 |
if( ! MywpDeveloper::is_debug_item( 'debug_debugtrace' ) ) { |
| 33 |
|
| 34 |
echo esc_html( __( 'Not activated.' , 'my-wp' ) ); |
| 35 |
|
| 36 |
return false; |
| 37 |
|
| 38 |
} |
| 39 |
|
| 40 |
echo 'debug_backtrace() = '; |
| 41 |
|
| 42 |
echo esc_html( print_r( debug_backtrace() , true ) ); |
| 43 |
|
| 44 |
} |
| 45 |
|
| 46 |
protected static function mywp_debug_render() { |
| 47 |
|
| 48 |
if( ! MywpDeveloper::is_debug_item( 'debug_debugtrace' ) ) { |
| 49 |
|
| 50 |
echo esc_html( __( 'Not activated.' , 'my-wp' ) ); |
| 51 |
|
| 52 |
return false; |
| 53 |
|
| 54 |
} |
| 55 |
|
| 56 |
printf( '<textarea readonly="readonly">%s</textarea>' , esc_textarea( print_r( debug_backtrace() , true ) ) ); |
| 57 |
|
| 58 |
} |
| 59 |
|
| 60 |
} |
| 61 |
|
| 62 |
MywpDeveloperModuleDebugtrace::init(); |
| 63 |
|
| 64 |
endif; |
| 65 |
|