PluginProbe
My WP Customize Admin/Frontend / 1.8
My WP Customize Admin/Frontend v1.8
1.27.4 1.27.3 trunk 1.0 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.10 1.10.1 1.10.2 1.11 1.12 1.12.1 1.12.2 1.13 1.13.1 1.13.2 1.14 1.15.0 1.16 1.17.0 All 76 releases
my-wp / developer / modules / mywp.developer.module.dev.request.php

mywp.developer.module.dev.request.php in My WP Customize Admin/Frontend 1.8, at developer/modules/mywp.developer.module.dev.request.php

115 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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( 'MywpDeveloperModuleDevRequest' ) ) :
12
13 final class MywpDeveloperModuleDevRequest extends MywpDeveloperAbstractModule {
14
15 static protected $id = 'dev_request';
16
17 static protected $priority = 80;
18
19 public static function mywp_debug_renders( $debug_renders ) {
20
21 $debug_renders[ self::$id ] = array(
22 'debug_type' => 'dev',
23 'title' => __( 'Request' , 'my-wp' ),
24 );
25
26 return $debug_renders;
27
28 }
29
30 protected static function get_debug_lists() {
31
32 global $wpdb;
33
34 $debug_lists = array(
35 'DOING_AJAX' => defined( 'DOING_AJAX' ),
36 'DOING_CRON' => defined( 'DOING_CRON' ),
37 'XMLRPC_REQUEST' => defined( 'XMLRPC_REQUEST' ),
38 'REST_REQUEST' => defined( 'REST_REQUEST' ),
39 'is_ssl()' => is_ssl(),
40 'is_admin()' => is_admin(),
41 'is_network_admin()' => is_network_admin(),
42 '$_POST' => $_POST,
43 '$_GET' => $_GET,
44 'parse_url' => parse_url( $_SERVER['REQUEST_URI'] ),
45 '$_COOKIE' => $_COOKIE,
46 );
47
48 $savequeries = MywpHelper::get_define( 'SAVEQUERIES' );
49
50 if( ! empty( $savequeries ) ) {
51
52 $debug_lists['queries'] = $wpdb->queries;
53
54 } else {
55
56 $debug_lists['not_queries'] = __( 'Require the define( "SAVEQUERIES" , true ).' , 'my-wp' );
57
58 }
59
60 return $debug_lists;
61
62 }
63
64 protected static function mywp_debug_render() {
65
66 $debug_lists = self::get_debug_lists();
67
68 if( empty( $debug_lists ) ) {
69
70 return false;
71
72 }
73
74 echo '<table class="debug-table">';
75
76 foreach( $debug_lists as $key => $val ) {
77
78 echo '<tr>';
79
80 printf( '<th>%s</th>' , $key );
81
82 echo '<td>';
83
84 if( in_array( $key , array( '$_POST' , '$_GET' , 'parse_url' , '$_COOKIE' , 'queries' ) ) ) {
85
86 if( is_array( $val ) ) {
87
88 printf( 'Count: %s<br />' , number_format( count( $val ) ) );
89
90 }
91
92 printf( '<textarea readonly="readonly">%s</textarea>' , print_r( map_deep( $val , 'esc_html' ) , true ) );
93
94 } else {
95
96 echo $val;
97
98 }
99
100 echo '</td>';
101
102 echo '</tr>';
103
104 }
105
106 echo '</table>';
107
108 }
109
110 }
111
112 MywpDeveloperModuleDevRequest::init();
113
114 endif;
115