PluginProbe
My WP Customize Admin/Frontend / 1.18.0
My WP Customize Admin/Frontend v1.18.0
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 / developer.init.php

developer.init.php in My WP Customize Admin/Frontend 1.18.0, at developer/developer.init.php

163 lines 5.0 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( 'MywpDeveloperInit' ) ) :
8
9 final class MywpDeveloperInit {
10
11 public static function init() {
12
13 add_action( 'mywp_plugins_loaded' , array( __CLASS__ , 'plugins_loaded_include_modules' ) , 20 );
14 add_action( 'mywp_after_setup_theme' , array( __CLASS__ , 'after_setup_theme_include_modules' ) , 20 );
15
16 add_filter( 'mywp_debug_types' , array( __CLASS__ , 'add_debug_type_core' ) , 20 );
17 add_filter( 'mywp_debug_types' , array( __CLASS__ , 'add_debug_type_mywp' ) , 30 );
18 add_filter( 'mywp_debug_types' , array( __CLASS__ , 'add_debug_type_dev' ) , 40 );
19 add_filter( 'mywp_debug_types' , array( __CLASS__ , 'add_debug_type_custom' ) , 100 );
20
21 add_filter( 'mywp_debug_renders' , array( __CLASS__ , 'add_debug_renders_custom_example' ) );
22
23 add_action( 'mywp_debug_render_custom_example' , array( __CLASS__ , 'mywp_debug_render_custom_example' ) );
24
25 add_action( 'admin_enqueue_scripts' , array( __CLASS__ , 'enqueue_scripts' ) );
26 add_action( 'wp_enqueue_scripts' , array( __CLASS__ , 'enqueue_scripts' ) );
27 add_action( 'login_enqueue_scripts' , array( __CLASS__ , 'enqueue_scripts' ) );
28
29 add_action( 'admin_footer' , array( __CLASS__ , 'debug_footer_print' ) , 1000 );
30 add_action( 'wp_footer' , array( __CLASS__ , 'debug_footer_print' ) , 1000 );
31 add_action( 'login_footer' , array( __CLASS__ , 'debug_footer_print' ) , 1000 );
32
33 /*
34 add_action( 'shutdown' , array( __CLASS__ , 'debug_footer_print' ) , 1000 );
35 */
36
37 }
38
39 public static function plugins_loaded_include_modules() {
40
41 $dir = MYWP_PLUGIN_PATH . 'developer/modules/';
42
43 $includes = array(
44 'core_environment' => $dir . 'mywp.developer.module.core.environment.php',
45 'core_multisite' => $dir . 'mywp.developer.module.core.multisite.php',
46 'core_site' => $dir . 'mywp.developer.module.core.site.php',
47 'core_theme' => $dir . 'mywp.developer.module.core.theme.php',
48 'core_user' => $dir . 'mywp.developer.module.core.user.php',
49 'dev_actions' => $dir . 'mywp.developer.module.dev.actions.php',
50 'dev_admin' => $dir . 'mywp.developer.module.dev.admin.php',
51 'dev_debugtrace' => $dir . 'mywp.developer.module.dev.debugtrace.php',
52 'dev_date' => $dir . 'mywp.developer.module.dev.date.php',
53 'dev_frontend' => $dir . 'mywp.developer.module.dev.frontend.php',
54 'dev_request' => $dir . 'mywp.developer.module.dev.request.php',
55 'dev_times' => $dir . 'mywp.developer.module.dev.times.php',
56 'mywp_cache' => $dir . 'mywp.developer.module.mywp.cache.php',
57 'mywp_error' => $dir . 'mywp.developer.module.mywp.error.php',
58 'mywp_info' => $dir . 'mywp.developer.module.mywp.info.php',
59 );
60
61 $includes = apply_filters( 'mywp_developer_plugins_loaded_include_modules' , $includes );
62
63 MywpApi::require_files( $includes );
64
65 }
66
67 public static function after_setup_theme_include_modules() {
68
69 $includes = array();
70
71 $includes = apply_filters( 'mywp_developer_after_setup_theme_include_modules' , $includes );
72
73 MywpApi::require_files( $includes );
74
75 }
76
77 public static function add_debug_type_core( $debug_types ) {
78
79 $debug_types['core'] = __( 'Core' , 'my-wp' );
80
81 return $debug_types;
82
83 }
84
85 public static function add_debug_type_mywp( $debug_types ) {
86
87 $debug_types['mywp'] = __( 'My WP' , 'my-wp' );
88
89 return $debug_types;
90
91 }
92
93 public static function add_debug_type_dev( $debug_types ) {
94
95 $debug_types['dev'] = __( 'Dev' , 'my-wp' );
96
97 return $debug_types;
98
99 }
100
101 public static function add_debug_type_custom( $debug_types ) {
102
103 $debug_types['custom'] = __( 'Custom' , 'my-wp' );
104
105 return $debug_types;
106
107 }
108
109 public static function add_debug_renders_custom_example( $debug_renders ) {
110
111 $debug_renders['custom_example'] = array(
112 'debug_type' => 'custom',
113 'title' => __( 'You can add custom debug panel :-)' , 'my-wp' ),
114 );
115
116 return $debug_renders;
117
118 }
119
120 public static function mywp_debug_render_custom_example() {
121
122 printf( '<a href="%s" target="_blank">%s</a>' , esc_url( 'https://mywpcustomize.com/document/mywp-debug-panel-extends/' ) , __( 'Document for Debug panel' , 'my-wp' ) );
123
124 }
125
126 public static function enqueue_scripts() {
127
128 if( ! MywpDeveloper::is_debug() ) {
129
130 return false;
131
132 }
133
134 wp_register_style( 'mywp_developer' , MywpApi::get_plugin_url( 'css' ) . 'developer.css' , array() , MYWP_VERSION );
135 wp_register_script( 'mywp_developer' , MywpApi::get_plugin_url( 'js' ) . 'developer.js' , array( 'jquery' ) , MYWP_VERSION );
136
137 wp_enqueue_style( 'mywp_developer' );
138 wp_enqueue_script( 'mywp_developer' );
139
140 }
141
142 public static function debug_footer_print() {
143
144 if( ! MywpDeveloper::is_debug() ) {
145
146 return false;
147
148 }
149
150 if( MywpHelper::is_doing( 'cron' ) or MywpHelper::is_doing( 'xmlrpc' ) or MywpHelper::is_doing( 'ajax' ) or MywpHelper::is_doing( 'rest' ) ) {
151
152 return false;
153
154 }
155
156 MywpApi::include_file( MYWP_PLUGIN_PATH . 'views/debug-footer.php' );
157
158 }
159
160 }
161
162 endif;
163