PluginProbe
My WP Customize Admin/Frontend / 1.3
My WP Customize Admin/Frontend v1.3
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.3, at developer/developer.init.php

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