@@ -21,31 +21,31 @@ discard block |
||
21 | 21 | */ |
22 | 22 | |
23 | 23 | // Avoid direct calls to this file. |
24 | -if ( ! function_exists( 'add_action' ) ) { |
|
25 | - header( 'Status: 403 Forbidden' ); |
|
26 | - header( 'HTTP/1.1 403 Forbidden' ); |
|
24 | +if ( ! function_exists('add_action')) { |
|
25 | + header('Status: 403 Forbidden'); |
|
26 | + header('HTTP/1.1 403 Forbidden'); |
|
27 | 27 | exit(); |
28 | 28 | } |
29 | 29 | |
30 | -if ( ! function_exists( 'debug_bar_cron_has_parent_plugin' ) ) { |
|
30 | +if ( ! function_exists('debug_bar_cron_has_parent_plugin')) { |
|
31 | 31 | /** |
32 | 32 | * Show admin notice & de-activate if debug-bar plugin not active. |
33 | 33 | */ |
34 | 34 | function debug_bar_cron_has_parent_plugin() { |
35 | - if ( is_admin() && ( ! class_exists( 'Debug_Bar' ) && current_user_can( 'activate_plugins' ) ) ) { |
|
36 | - add_action( 'admin_notices', create_function( null, 'echo \'<div class="error"><p>\', sprintf( __( \'Activation failed: Debug Bar must be activated to use the <strong>Debug Bar Cron</strong> Plugin. %sVisit your plugins page to activate.\', \'zt-debug-bar-cron\' ), \'<a href="\' . esc_url( admin_url( \'plugins.php#debug-bar\' ) ) . \'">\' ), \'</a></p></div>\';' ) ); |
|
35 | + if (is_admin() && ( ! class_exists('Debug_Bar') && current_user_can('activate_plugins'))) { |
|
36 | + add_action('admin_notices', create_function(null, 'echo \'<div class="error"><p>\', sprintf( __( \'Activation failed: Debug Bar must be activated to use the <strong>Debug Bar Cron</strong> Plugin. %sVisit your plugins page to activate.\', \'zt-debug-bar-cron\' ), \'<a href="\' . esc_url( admin_url( \'plugins.php#debug-bar\' ) ) . \'">\' ), \'</a></p></div>\';')); |
|
37 | 37 | |
38 | - deactivate_plugins( plugin_basename( __FILE__ ) ); |
|
39 | - if ( isset( $_GET['activate'] ) ) { |
|
40 | - unset( $_GET['activate'] ); |
|
38 | + deactivate_plugins(plugin_basename(__FILE__)); |
|
39 | + if (isset($_GET['activate'])) { |
|
40 | + unset($_GET['activate']); |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | } |
44 | - add_action( 'admin_init', 'debug_bar_cron_has_parent_plugin' ); |
|
44 | + add_action('admin_init', 'debug_bar_cron_has_parent_plugin'); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
48 | -if ( ! function_exists( 'zt_add_debug_bar_cron_panel' ) ) { |
|
48 | +if ( ! function_exists('zt_add_debug_bar_cron_panel')) { |
|
49 | 49 | /** |
50 | 50 | * Adds panel, as defined in the included class, to Debug Bar. |
51 | 51 | * |
@@ -53,12 +53,12 @@ discard block |
||
53 | 53 | * |
54 | 54 | * @return array |
55 | 55 | */ |
56 | - function zt_add_debug_bar_cron_panel( $panels ) { |
|
57 | - if ( ! class_exists( 'ZT_Debug_Bar_Cron' ) ) { |
|
56 | + function zt_add_debug_bar_cron_panel($panels) { |
|
57 | + if ( ! class_exists('ZT_Debug_Bar_Cron')) { |
|
58 | 58 | require_once 'class-debug-bar-cron.php'; |
59 | 59 | $panels[] = new ZT_Debug_Bar_Cron(); |
60 | 60 | } |
61 | 61 | return $panels; |
62 | 62 | } |
63 | - add_filter( 'debug_bar_panels', 'zt_add_debug_bar_cron_panel' ); |
|
63 | + add_filter('debug_bar_panels', 'zt_add_debug_bar_cron_panel'); |
|
64 | 64 | } |
@@ -10,16 +10,16 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Avoid direct calls to this file. |
13 | -if ( ! function_exists( 'add_action' ) ) { |
|
14 | - header( 'Status: 403 Forbidden' ); |
|
15 | - header( 'HTTP/1.1 403 Forbidden' ); |
|
13 | +if ( ! function_exists('add_action')) { |
|
14 | + header('Status: 403 Forbidden'); |
|
15 | + header('HTTP/1.1 403 Forbidden'); |
|
16 | 16 | exit(); |
17 | 17 | } |
18 | 18 | |
19 | 19 | /** |
20 | 20 | * The class in this file extends the functionality provided by the parent plugin "Debug Bar". |
21 | 21 | */ |
22 | -if ( ! class_exists( 'ZT_Debug_Bar_Cron' ) && class_exists( 'Debug_Bar_Panel' ) ) { |
|
22 | +if ( ! class_exists('ZT_Debug_Bar_Cron') && class_exists('Debug_Bar_Panel')) { |
|
23 | 23 | |
24 | 24 | /** |
25 | 25 | * Add a new Debug Bar Panel. |
@@ -72,10 +72,10 @@ discard block |
||
72 | 72 | * @return void |
73 | 73 | */ |
74 | 74 | public function init() { |
75 | - load_plugin_textdomain( 'zt-debug-bar-cron', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); |
|
76 | - $this->title( __( 'Cron', 'zt-debug-bar-cron' ) ); |
|
77 | - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts_styles' ) ); |
|
78 | - add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts_styles' ) ); |
|
75 | + load_plugin_textdomain('zt-debug-bar-cron', false, dirname(plugin_basename(__FILE__)).'/languages/'); |
|
76 | + $this->title(__('Cron', 'zt-debug-bar-cron')); |
|
77 | + add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts_styles')); |
|
78 | + add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts_styles')); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | * @return void |
86 | 86 | */ |
87 | 87 | public function enqueue_scripts_styles() { |
88 | - $suffix = ( ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min' ); |
|
88 | + $suffix = ((defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'); |
|
89 | 89 | |
90 | 90 | wp_enqueue_style( |
91 | 91 | self::DBCRON_NAME, |
92 | - plugins_url( 'css/' . self::DBCRON_NAME . $suffix . '.css', __FILE__ ), |
|
93 | - array( 'debug-bar' ), |
|
92 | + plugins_url('css/'.self::DBCRON_NAME.$suffix.'.css', __FILE__), |
|
93 | + array('debug-bar'), |
|
94 | 94 | self::DBCRON_STYLES_VERSION |
95 | 95 | ); |
96 | 96 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @return void |
103 | 103 | */ |
104 | 104 | public function prerender() { |
105 | - $this->set_visible( true ); |
|
105 | + $this->set_visible(true); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | |
@@ -114,69 +114,69 @@ discard block |
||
114 | 114 | public function render() { |
115 | 115 | $this->get_crons(); |
116 | 116 | |
117 | - $this->_doing_cron = get_transient( 'doing_cron' ) ? __( 'Yes', 'zt-debug-bar-cron' ) : __( 'No', 'zt-debug-bar-cron' ); |
|
117 | + $this->_doing_cron = get_transient('doing_cron') ? __('Yes', 'zt-debug-bar-cron') : __('No', 'zt-debug-bar-cron'); |
|
118 | 118 | |
119 | 119 | // Get the time of the next event. |
120 | - $cron_times = ( is_array( $this->_crons ) ? array_keys( $this->_crons ) : array() ); |
|
120 | + $cron_times = (is_array($this->_crons) ? array_keys($this->_crons) : array()); |
|
121 | 121 | $unix_time_next_cron = $cron_times[0]; |
122 | - $time_next_cron = date( 'Y-m-d H:i:s', $unix_time_next_cron ); |
|
122 | + $time_next_cron = date('Y-m-d H:i:s', $unix_time_next_cron); |
|
123 | 123 | |
124 | - $human_time_next_cron = human_time_diff( $unix_time_next_cron ); |
|
124 | + $human_time_next_cron = human_time_diff($unix_time_next_cron); |
|
125 | 125 | |
126 | 126 | // Add a class if past current time and doing cron is not running. |
127 | - $times_class = ( time() > $unix_time_next_cron && 'No' === $this->_doing_cron ) ? ' past' : ''; |
|
127 | + $times_class = (time() > $unix_time_next_cron && 'No' === $this->_doing_cron) ? ' past' : ''; |
|
128 | 128 | |
129 | - if ( ! class_exists( 'Debug_Bar_Pretty_Output' ) ) { |
|
130 | - require_once plugin_dir_path( __FILE__ ) . 'inc/debug-bar-pretty-output/class-debug-bar-pretty-output.php'; |
|
129 | + if ( ! class_exists('Debug_Bar_Pretty_Output')) { |
|
130 | + require_once plugin_dir_path(__FILE__).'inc/debug-bar-pretty-output/class-debug-bar-pretty-output.php'; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | // Limit recursion depth if possible - method available since DBPO v1.4. |
134 | - if ( method_exists( 'Debug_Bar_Pretty_Output', 'limit_recursion' ) ) { |
|
135 | - Debug_Bar_Pretty_Output::limit_recursion( 2 ); |
|
134 | + if (method_exists('Debug_Bar_Pretty_Output', 'limit_recursion')) { |
|
135 | + Debug_Bar_Pretty_Output::limit_recursion(2); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | echo ' |
139 | 139 | <div class="debug-bar-cron"> |
140 | - <h2><span>', esc_html__( 'Total Events', 'zt-debug-bar-cron' ), ':</span>', intval( $this->_total_crons ), '</h2> |
|
141 | - <h2><span>', esc_html__( 'Doing Cron', 'zt-debug-bar-cron' ), ':</span>', esc_html( $this->_doing_cron ), '</h2> |
|
142 | - <h2 class="times', esc_attr( $times_class ), '"><span>', esc_html__( 'Next Event', 'zt-debug-bar-cron' ), ':</span> |
|
143 | - ', esc_html( $time_next_cron ), '<br /> |
|
144 | - ', intval( $unix_time_next_cron ), '<br /> |
|
145 | - ', esc_html( $this->display_past_time( $human_time_next_cron, $unix_time_next_cron ) ), ' |
|
140 | + <h2><span>', esc_html__('Total Events', 'zt-debug-bar-cron'), ':</span>', intval($this->_total_crons), '</h2> |
|
141 | + <h2><span>', esc_html__('Doing Cron', 'zt-debug-bar-cron'), ':</span>', esc_html($this->_doing_cron), '</h2> |
|
142 | + <h2 class="times', esc_attr($times_class), '"><span>', esc_html__('Next Event', 'zt-debug-bar-cron'), ':</span> |
|
143 | + ', esc_html($time_next_cron), '<br /> |
|
144 | + ', intval($unix_time_next_cron), '<br /> |
|
145 | + ', esc_html($this->display_past_time($human_time_next_cron, $unix_time_next_cron)), ' |
|
146 | 146 | </h2> |
147 | - <h2><span>', esc_html__( 'Current Time', 'zt-debug-bar-cron' ), ':</span>', esc_html( date( 'H:i:s' ) ), '</h2> |
|
147 | + <h2><span>', esc_html__('Current Time', 'zt-debug-bar-cron'), ':</span>', esc_html(date('H:i:s')), '</h2> |
|
148 | 148 | |
149 | 149 | <div class="clear"></div> |
150 | 150 | |
151 | - <h3>', esc_html__( 'Custom Events', 'zt-debug-bar-cron' ), '</h3>'; |
|
151 | + <h3>', esc_html__('Custom Events', 'zt-debug-bar-cron'), '</h3>'; |
|
152 | 152 | |
153 | - if ( ! is_null( $this->_user_crons ) ) { |
|
154 | - $this->display_events( $this->_user_crons ); |
|
153 | + if ( ! is_null($this->_user_crons)) { |
|
154 | + $this->display_events($this->_user_crons); |
|
155 | 155 | } else { |
156 | 156 | echo ' |
157 | - <p>', esc_html__( 'No Custom Events scheduled.', 'zt-debug-bar-cron' ), '</p>'; |
|
157 | + <p>', esc_html__('No Custom Events scheduled.', 'zt-debug-bar-cron'), '</p>'; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | echo ' |
161 | - <h3>', esc_html__( 'Schedules', 'zt-debug-bar-cron' ), '</h3>'; |
|
161 | + <h3>', esc_html__('Schedules', 'zt-debug-bar-cron'), '</h3>'; |
|
162 | 162 | |
163 | 163 | $this->display_schedules(); |
164 | 164 | |
165 | 165 | echo ' |
166 | - <h3>', esc_html__( 'Core Events', 'zt-debug-bar-cron' ), '</h3>'; |
|
166 | + <h3>', esc_html__('Core Events', 'zt-debug-bar-cron'), '</h3>'; |
|
167 | 167 | |
168 | - if ( ! is_null( $this->_core_crons ) ) { |
|
169 | - $this->display_events( $this->_core_crons ); |
|
168 | + if ( ! is_null($this->_core_crons)) { |
|
169 | + $this->display_events($this->_core_crons); |
|
170 | 170 | } else { |
171 | 171 | echo ' |
172 | - <p>', esc_html__( 'No Core Events scheduled.', 'zt-debug-bar-cron' ), '</p>'; |
|
172 | + <p>', esc_html__('No Core Events scheduled.', 'zt-debug-bar-cron'), '</p>'; |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | echo ' |
176 | 176 | </div>'; |
177 | 177 | |
178 | 178 | // Unset recursion depth limit if possible - method available since DBPO v1.4. |
179 | - if ( method_exists( 'Debug_Bar_Pretty_Output', 'unset_recursion_limit' ) ) { |
|
179 | + if (method_exists('Debug_Bar_Pretty_Output', 'unset_recursion_limit')) { |
|
180 | 180 | Debug_Bar_Pretty_Output::unset_recursion_limit(); |
181 | 181 | } |
182 | 182 | } |
@@ -191,11 +191,11 @@ discard block |
||
191 | 191 | * @return array Array of crons. |
192 | 192 | */ |
193 | 193 | private function get_crons() { |
194 | - if ( ! is_null( $this->_crons ) ) { |
|
194 | + if ( ! is_null($this->_crons)) { |
|
195 | 195 | return $this->_crons; |
196 | 196 | } |
197 | 197 | |
198 | - if ( ! $crons = _get_cron_array() ) { |
|
198 | + if ( ! $crons = _get_cron_array()) { |
|
199 | 199 | return $this->_crons; |
200 | 200 | } |
201 | 201 | |
@@ -205,28 +205,28 @@ discard block |
||
205 | 205 | // @internal To find all, search WP trunk for `wp_schedule_(single_)?event`. |
206 | 206 | $core_cron_hooks = array( |
207 | 207 | 'do_pings', |
208 | - 'importer_scheduled_cleanup', // WP 3.1+. |
|
208 | + 'importer_scheduled_cleanup', // WP 3.1+. |
|
209 | 209 | 'publish_future_post', |
210 | - 'update_network_counts', // WP 3.1+. |
|
211 | - 'upgrader_scheduled_cleanup', // WP 3.3+. |
|
212 | - 'wp_maybe_auto_update', // WP 3.7+. |
|
210 | + 'update_network_counts', // WP 3.1+. |
|
211 | + 'upgrader_scheduled_cleanup', // WP 3.3+. |
|
212 | + 'wp_maybe_auto_update', // WP 3.7+. |
|
213 | 213 | 'wp_scheduled_auto_draft_delete', // WP 3.4+. |
214 | - 'wp_scheduled_delete', // WP 2.9+. |
|
215 | - 'wp_split_shared_term_batch', // WP 4.3+. |
|
214 | + 'wp_scheduled_delete', // WP 2.9+. |
|
215 | + 'wp_split_shared_term_batch', // WP 4.3+. |
|
216 | 216 | 'wp_update_plugins', |
217 | 217 | 'wp_update_themes', |
218 | 218 | 'wp_version_check', |
219 | 219 | ); |
220 | 220 | |
221 | 221 | // Sort and count crons. |
222 | - foreach ( $this->_crons as $time => $time_cron_array ) { |
|
223 | - foreach ( $time_cron_array as $hook => $data ) { |
|
222 | + foreach ($this->_crons as $time => $time_cron_array) { |
|
223 | + foreach ($time_cron_array as $hook => $data) { |
|
224 | 224 | $this->_total_crons++; |
225 | 225 | |
226 | - if ( in_array( $hook, $core_cron_hooks, true ) ) { |
|
227 | - $this->_core_crons[ $time ][ $hook ] = $data; |
|
226 | + if (in_array($hook, $core_cron_hooks, true)) { |
|
227 | + $this->_core_crons[$time][$hook] = $data; |
|
228 | 228 | } else { |
229 | - $this->_user_crons[ $time ][ $hook ] = $data; |
|
229 | + $this->_user_crons[$time][$hook] = $data; |
|
230 | 230 | } |
231 | 231 | } |
232 | 232 | } |
@@ -242,70 +242,70 @@ discard block |
||
242 | 242 | * |
243 | 243 | * @return void|string Void on failure; table display of events on success. |
244 | 244 | */ |
245 | - private function display_events( $events ) { |
|
246 | - if ( is_null( $events ) || empty( $events ) ) { |
|
245 | + private function display_events($events) { |
|
246 | + if (is_null($events) || empty($events)) { |
|
247 | 247 | return; |
248 | 248 | } |
249 | 249 | |
250 | 250 | echo ' |
251 | 251 | <table class="zt-debug-bar-cron-event-table"> |
252 | 252 | <thead><tr> |
253 | - <th class="col1">', esc_html__( 'Next Execution', 'zt-debug-bar-cron' ), '</th> |
|
254 | - <th class="col2">', esc_html__( 'Hook', 'zt-debug-bar-cron' ), '</th> |
|
255 | - <th class="col3">', esc_html__( 'Interval Hook', 'zt-debug-bar-cron' ), '</th> |
|
256 | - <th class="col4">', esc_html__( 'Interval Value', 'zt-debug-bar-cron' ), '</th> |
|
257 | - <th class="col5">', esc_html__( 'Args', 'zt-debug-bar-cron' ), '</th> |
|
253 | + <th class="col1">', esc_html__('Next Execution', 'zt-debug-bar-cron'), '</th> |
|
254 | + <th class="col2">', esc_html__('Hook', 'zt-debug-bar-cron'), '</th> |
|
255 | + <th class="col3">', esc_html__('Interval Hook', 'zt-debug-bar-cron'), '</th> |
|
256 | + <th class="col4">', esc_html__('Interval Value', 'zt-debug-bar-cron'), '</th> |
|
257 | + <th class="col5">', esc_html__('Args', 'zt-debug-bar-cron'), '</th> |
|
258 | 258 | </tr></thead> |
259 | 259 | <tbody>'; |
260 | 260 | |
261 | - foreach ( $events as $time => $time_cron_array ) { |
|
262 | - foreach ( $time_cron_array as $hook => $data ) { |
|
261 | + foreach ($events as $time => $time_cron_array) { |
|
262 | + foreach ($time_cron_array as $hook => $data) { |
|
263 | 263 | echo ' |
264 | 264 | <tr> |
265 | 265 | <td'; |
266 | 266 | |
267 | 267 | // Add a class if past current time. |
268 | - if ( time() > $time && 'No' === $this->_doing_cron ) { |
|
268 | + if (time() > $time && 'No' === $this->_doing_cron) { |
|
269 | 269 | echo ' class="past"'; |
270 | 270 | } |
271 | 271 | |
272 | 272 | echo '> |
273 | - ', esc_html( date( 'Y-m-d H:i:s', $time ) ), '<br /> |
|
274 | - ', intval( $time ), '<br /> |
|
275 | - ', esc_html( $this->display_past_time( human_time_diff( $time ), $time ) ), ' |
|
273 | + ', esc_html(date('Y-m-d H:i:s', $time)), '<br /> |
|
274 | + ', intval($time), '<br /> |
|
275 | + ', esc_html($this->display_past_time(human_time_diff($time), $time)), ' |
|
276 | 276 | </td> |
277 | - <td>', esc_html( $hook ), '</td>'; |
|
277 | + <td>', esc_html($hook), '</td>'; |
|
278 | 278 | |
279 | - foreach ( $data as $hash => $info ) { |
|
279 | + foreach ($data as $hash => $info) { |
|
280 | 280 | // Report the schedule. |
281 | 281 | echo ' |
282 | 282 | <td>'; |
283 | - if ( $info['schedule'] ) { |
|
284 | - echo esc_html( $info['schedule'] ); |
|
283 | + if ($info['schedule']) { |
|
284 | + echo esc_html($info['schedule']); |
|
285 | 285 | } else { |
286 | - echo esc_html__( 'Single Event', 'zt-debug-bar-cron' ); |
|
286 | + echo esc_html__('Single Event', 'zt-debug-bar-cron'); |
|
287 | 287 | } |
288 | 288 | echo '</td>'; |
289 | 289 | |
290 | 290 | // Report the interval. |
291 | 291 | echo ' |
292 | 292 | <td>'; |
293 | - if ( isset( $info['interval'] ) ) { |
|
293 | + if (isset($info['interval'])) { |
|
294 | 294 | /* TRANSLATORS: %s is number of seconds. */ |
295 | - printf( esc_html__( '%ss', 'zt-debug-bar-cron' ) . '<br />', intval( wp_strip_all_tags( $info['interval'] ) ) ); |
|
295 | + printf(esc_html__('%ss', 'zt-debug-bar-cron').'<br />', intval(wp_strip_all_tags($info['interval']))); |
|
296 | 296 | /* TRANSLATORS: %s is number of minutes. */ |
297 | - printf( esc_html__( '%sm', 'zt-debug-bar-cron' ) . '<br />', intval( wp_strip_all_tags( $info['interval'] ) / 60 ) ); |
|
297 | + printf(esc_html__('%sm', 'zt-debug-bar-cron').'<br />', intval(wp_strip_all_tags($info['interval']) / 60)); |
|
298 | 298 | /* TRANSLATORS: %s is number of hours. */ |
299 | - printf( esc_html__( '%sh', 'zt-debug-bar-cron' ), intval( wp_strip_all_tags( $info['interval'] ) / ( 60 * 60 ) ) ); |
|
299 | + printf(esc_html__('%sh', 'zt-debug-bar-cron'), intval(wp_strip_all_tags($info['interval']) / (60 * 60))); |
|
300 | 300 | } else { |
301 | - echo esc_html__( 'Single Event', 'zt-debug-bar-cron' ); |
|
301 | + echo esc_html__('Single Event', 'zt-debug-bar-cron'); |
|
302 | 302 | } |
303 | 303 | echo '</td>'; |
304 | 304 | |
305 | 305 | // Report the args. |
306 | 306 | echo ' |
307 | 307 | <td>'; |
308 | - $this->display_cron_arguments( $info['args'] ); |
|
308 | + $this->display_cron_arguments($info['args']); |
|
309 | 309 | echo '</td>'; |
310 | 310 | } |
311 | 311 | |
@@ -327,21 +327,21 @@ discard block |
||
327 | 327 | * |
328 | 328 | * @return void |
329 | 329 | */ |
330 | - function display_cron_arguments( $args ) { |
|
330 | + function display_cron_arguments($args) { |
|
331 | 331 | // Arguments defaults to an empty array if no arguments are given. |
332 | - if ( is_array( $args ) && array() === $args ) { |
|
333 | - echo esc_html__( 'No Args', 'zt-debug-bar-cron' ); |
|
332 | + if (is_array($args) && array() === $args) { |
|
333 | + echo esc_html__('No Args', 'zt-debug-bar-cron'); |
|
334 | 334 | return; |
335 | 335 | } |
336 | 336 | |
337 | 337 | // Ok, we have an argument, let's pretty print it. |
338 | - if ( defined( 'Debug_Bar_Pretty_Output::VERSION' ) ) { |
|
339 | - echo Debug_Bar_Pretty_Output::get_output( $args, '', true ); // WPCS: XSS ok. |
|
338 | + if (defined('Debug_Bar_Pretty_Output::VERSION')) { |
|
339 | + echo Debug_Bar_Pretty_Output::get_output($args, '', true); // WPCS: XSS ok. |
|
340 | 340 | } |
341 | 341 | else { |
342 | 342 | // An old version of the pretty output class was loaded. |
343 | 343 | // Real possibility as there are several DB plugins using the pretty print class. |
344 | - Debug_Bar_Pretty_Output::output( $args, '', true ); |
|
344 | + Debug_Bar_Pretty_Output::output($args, '', true); |
|
345 | 345 | } |
346 | 346 | } |
347 | 347 | |
@@ -355,24 +355,24 @@ discard block |
||
355 | 355 | echo ' |
356 | 356 | <table class="zt-debug-bar-cron-event-table"> |
357 | 357 | <thead><tr> |
358 | - <th class="col1">', esc_html__( 'Interval Hook', 'zt-debug-bar-cron' ), '</th> |
|
359 | - <th class="col2">', esc_html__( 'Interval (S)', 'zt-debug-bar-cron' ), '</th> |
|
360 | - <th class="col3">', esc_html__( 'Interval (M)', 'zt-debug-bar-cron' ), '</th> |
|
361 | - <th class="col4">', esc_html__( 'Interval (H)', 'zt-debug-bar-cron' ), '</th> |
|
362 | - <th class="col5">', esc_html__( 'Display Name', 'zt-debug-bar-cron' ), '</th> |
|
358 | + <th class="col1">', esc_html__('Interval Hook', 'zt-debug-bar-cron'), '</th> |
|
359 | + <th class="col2">', esc_html__('Interval (S)', 'zt-debug-bar-cron'), '</th> |
|
360 | + <th class="col3">', esc_html__('Interval (M)', 'zt-debug-bar-cron'), '</th> |
|
361 | + <th class="col4">', esc_html__('Interval (H)', 'zt-debug-bar-cron'), '</th> |
|
362 | + <th class="col5">', esc_html__('Display Name', 'zt-debug-bar-cron'), '</th> |
|
363 | 363 | </tr></thead> |
364 | 364 | <tbody>'; |
365 | 365 | |
366 | 366 | |
367 | 367 | $schedules = wp_get_schedules(); |
368 | - foreach ( $schedules as $interval_hook => $data ) { |
|
368 | + foreach ($schedules as $interval_hook => $data) { |
|
369 | 369 | echo ' |
370 | 370 | <tr> |
371 | - <td>', esc_html( $interval_hook ), '</td> |
|
372 | - <td>', intval( wp_strip_all_tags( $data['interval'] ) ), '</td> |
|
373 | - <td>', intval( wp_strip_all_tags( $data['interval'] ) / 60 ), '</td> |
|
374 | - <td>', intval( wp_strip_all_tags( $data['interval'] ) / ( 60 * 60 ) ), '</td> |
|
375 | - <td>', esc_html( $data['display'] ) . '</td> |
|
371 | + <td>', esc_html($interval_hook), '</td> |
|
372 | + <td>', intval(wp_strip_all_tags($data['interval'])), '</td> |
|
373 | + <td>', intval(wp_strip_all_tags($data['interval']) / 60), '</td> |
|
374 | + <td>', intval(wp_strip_all_tags($data['interval']) / (60 * 60)), '</td> |
|
375 | + <td>', esc_html($data['display']).'</td> |
|
376 | 376 | </tr>'; |
377 | 377 | } |
378 | 378 | |
@@ -390,10 +390,10 @@ discard block |
||
390 | 390 | * |
391 | 391 | * @return string |
392 | 392 | */ |
393 | - private function display_past_time( $human_time, $time ) { |
|
394 | - if ( time() > $time ) { |
|
393 | + private function display_past_time($human_time, $time) { |
|
394 | + if (time() > $time) { |
|
395 | 395 | /* TRANSLATORS: %s is a human readable time difference. */ |
396 | - return sprintf( __( '%s ago', 'zt-debug-bar-cron' ), $human_time ); |
|
396 | + return sprintf(__('%s ago', 'zt-debug-bar-cron'), $human_time); |
|
397 | 397 | } else { |
398 | 398 | return $human_time; |
399 | 399 | } |
@@ -337,8 +337,7 @@ |
||
337 | 337 | // Ok, we have an argument, let's pretty print it. |
338 | 338 | if ( defined( 'Debug_Bar_Pretty_Output::VERSION' ) ) { |
339 | 339 | echo Debug_Bar_Pretty_Output::get_output( $args, '', true ); // WPCS: XSS ok. |
340 | - } |
|
341 | - else { |
|
340 | + } else { |
|
342 | 341 | // An old version of the pretty output class was loaded. |
343 | 342 | // Real possibility as there are several DB plugins using the pretty print class. |
344 | 343 | Debug_Bar_Pretty_Output::output( $args, '', true ); |