PluginProbe
Debug Log Manager – Conveniently Monitor and Inspect Errors / 2.5.2
Debug Log Manager – Conveniently Monitor and Inspect Errors v2.5.2
2.5.2 2.5.1 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.3.0 1.3.1 1.3.3 1.4.0 1.5.0 1.5.1 1.5.2 1.5.3 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.8.0 1.8.2 1.8.3 1.8.4 All 49 releases
debug-log-manager / bootstrap.php

bootstrap.php in Debug Log Manager – Conveniently Monitor and Inspect Errors 2.5.2, at bootstrap.php

578 lines 20.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // We're using the singleton design pattern
4 // https://code.tutsplus.com/articles/design-patterns-in-wordpress-the-singleton-pattern--wp-31621
5 // https://carlalexander.ca/singletons-in-wordpress/
6 // https://torquemag.io/2016/11/singletons-wordpress-good-evil/
7
8 /**
9 * Main class of the plugin used to add functionalities
10 *
11 * @since 1.0.0
12 */
13 class Debug_Log_Manager {
14
15 // Refers to a single instance of this class
16 private static $instance = null;
17
18 // For the debug log object
19 private $debug_log;
20
21 // For the wp-config object
22 private $wp_config;
23
24 // For the log trimmer object
25 private $log_trimmer;
26
27 /**
28 * Creates or returns a single instance of this class
29 *
30 * @return Debug_Log_Manager a single instance of this class.
31 */
32 public static function get_instance() {
33
34 if ( null == self::$instance ) {
35 self::$instance = new self;
36 }
37
38 return self::$instance;
39
40 }
41
42 /**
43 * Initialize plugin functionalities
44 */
45 private function __construct() {
46
47 global $pagenow;
48
49 // Register admin menu and subsequently the main admin page
50 add_action( 'admin_menu', [ $this, 'register_admin_menu' ] );
51
52 // Do not display any admin notices while viewing logs.
53 add_action( 'admin_notices', [ $this, 'suppress_admin_notices' ], 0 );
54 add_action( 'all_admin_notices', [ $this, 'suppress_generic_notices' ], 0 );
55
56 // Add action links
57 add_filter( 'plugin_action_links_'.DLM__SLUG.'/'.DLM__SLUG.'.php', [ $this, 'action_links' ] );
58
59 if ( is_admin() ) {
60
61 if ( $this->is_dlm() ) {
62
63 // Update footer text
64 add_filter( 'admin_footer_text', [ $this, 'footer_text' ] );
65
66 // Replace WP version text in footer
67 add_filter( 'update_footer', [ $this, 'footer_version_text' ], 20 );
68
69
70 // Enqueue admin scripts and styles only on the plugin's main page
71 add_action( 'admin_enqueue_scripts', [ $this, 'admin_scripts' ] );
72
73 }
74
75 }
76
77 // Enqueue admin scripts and styles on plugin editor page
78 if ( 'plugin-editor.php' === $pagenow ) {
79 add_action( 'admin_enqueue_scripts', [ $this, 'plugin_editor_scripts' ] );
80 }
81
82 // Enqueue admin scripts and styles on theme editor page
83 if ( 'theme-editor.php' === $pagenow ) {
84 add_action( 'admin_enqueue_scripts', [ $this, 'theme_editor_scripts' ] );
85 }
86
87 // Add admin bar icon if error logging is enabled and admin URL is not the plugin's main page. It will show on on the front end too (when logged-in), as we're also logging JavaScript errors.
88
89 $default_value = array(
90 'status' => 'disabled',
91 'on' => date( 'Y-m-d H:i:s' ),
92 );
93
94 $logging_info = get_option( 'debug_log_manager', $default_value );
95 $logging_status = $logging_info['status'];
96
97 if ( ( $logging_status == 'enabled' ) && ! $this->is_dlm() ) {
98
99 // https://developer.wordpress.org/reference/hooks/admin_bar_menu/
100 add_action( 'admin_bar_menu', [ $this, 'admin_bar_icon' ], 100 );
101
102 }
103
104 // Add dashboard widget
105 add_action( 'wp_dashboard_setup', [ $this, 'add_dashboard_widget' ] );
106
107 // Add inline CSS for the admin bar icon (menu item)
108 add_action( 'admin_enqueue_scripts', [ $this, 'admin_bar_icon_css' ] );
109 add_action( 'wp_enqueue_scripts', [ $this, 'admin_bar_icon_css' ] );
110
111 // Enqueue public scripts and styles
112 add_action( 'wp_enqueue_scripts', [ $this, 'public_scripts' ] );
113
114 // Schedule log trim cron for existing installs upgraded without re-activation.
115 if ( ! wp_next_scheduled( 'dlm_trim_debug_log' ) ) {
116 wp_schedule_event( time(), 'hourly', 'dlm_trim_debug_log' );
117 }
118
119 $this->log_trimmer = new DLM\Classes\Log_Trimmer;
120 add_action( 'dlm_trim_debug_log', [ $this->log_trimmer, 'maybe_trim_log' ] );
121
122 // Register ajax calls
123 $this->debug_log = new DLM\Classes\Debug_Log;
124 $this->wp_config = new DLM\Classes\WP_Config_Transformer;
125 add_action( 'wp_ajax_toggle_debugging', [ $this->debug_log, 'toggle_debugging' ] );
126 add_action( 'wp_ajax_toggle_autorefresh', [ $this->debug_log, 'toggle_autorefresh' ] );
127 add_action( 'wp_ajax_get_latest_entries', [ $this->debug_log, 'get_latest_entries' ] );
128 add_action( 'wp_ajax_clear_log', [ $this->debug_log, 'clear_log' ] );
129 add_action( 'wp_ajax_disable_wp_file_editor', [ $this->debug_log, 'disable_wp_file_editor' ] );
130 add_action( 'wp_ajax_toggle_js_error_logging', [ $this->debug_log, 'toggle_js_error_logging' ] );
131 add_action( 'wp_ajax_toggle_script_debug_modification_status', [ $this->debug_log, 'toggle_script_debug_modification_status' ] );
132 add_action( 'wp_ajax_toggle_process_non_utc_timezones_status', [ $this->debug_log, 'toggle_process_non_utc_timezones_status' ] );
133 add_action( 'wp_ajax_log_js_errors', [ $this->debug_log, 'log_js_errors' ] );
134 add_action( 'wp_ajax_nopriv_log_js_errors', [ $this->debug_log, 'log_js_errors' ] );
135
136 }
137
138 /**
139 * Check if current screen is this plugin's main page
140 *
141 * @since 1.0.0
142 */
143 public function is_dlm() {
144
145 $request_uri = sanitize_text_field( $_SERVER['REQUEST_URI'] ); // e.g. /wp-admin/index.php?page=page-slug
146
147 if ( strpos( $request_uri, 'tools.php?page=' . DLM__SLUG ) !== false ) {
148 return true; // Yes, this is the plugin's main page
149 } else {
150 return false; // Nope, this is NOT the plugin's page
151 }
152
153 }
154
155 /**
156 * Register admin menu
157 *
158 * @since 1.0.0
159 */
160 public function register_admin_menu() {
161
162 add_submenu_page(
163 'tools.php',
164 __( 'Debug Log Manager', 'debug-log-manager' ),
165 __( 'Debug Log Manager', 'debug-log-manager' ),
166 'manage_options',
167 'debug-log-manager',
168 [ $this, 'create_main_page' ]
169 );
170
171 }
172
173 /**
174 * Register action links
175 *
176 * @since 1.0.0
177 */
178 public function action_links( $links ) {
179
180 $settings_link = '<a href="tools.php?page='.DLM__SLUG.'">' . esc_html__( 'View Debug Log', 'debug-log-manager' ) . '</a>';
181
182 array_unshift($links, $settings_link);
183
184 return $links;
185
186 }
187
188 /**
189 * Change admin footer text
190 *
191 * @since 1.0.0
192 */
193 public function footer_text() {
194 ?>
195 <a href="https://bowo.io/dotorg-dlm" target="_blank"><?php esc_html_e( 'Debug Log Manager', 'debug-log-manager' ); ?></a> is on <a href="https://bowo.io/github-dlm" target="_blank">github</a>
196 <?php
197 }
198
199 /**
200 * Replace WP version number text in footer
201 *
202 * @since 2.1.4
203 */
204 public function footer_version_text() {
205 return 'Also by Bowo &#8594; <a href="https://bowo.io/wpn-dlm" target="_blank">WordPress Newsboard</a>: The latest from 100+ sources';
206 }
207
208 /**
209 * Add debug icon in the admin bar
210 *
211 * @since 1.6.0
212 */
213 public function admin_bar_icon( WP_Admin_Bar $wp_admin_bar ) {
214
215 $current_user = wp_get_current_user();
216 $current_user_roles = array_values( $current_user->roles ); // indexed array
217
218 if ( in_array( 'administrator', $current_user_roles ) ) {
219
220 // https://developer.wordpress.org/reference/classes/wp_admin_bar/add_menu/
221 // https://developer.wordpress.org/reference/classes/wp_admin_bar/add_node/ for more examples
222 $wp_admin_bar->add_menu( array(
223 'id' => DLM__SLUG,
224 'parent' => 'top-secondary',
225 'group' => null,
226 'title' => '<span class="dashicons dashicons-warning"></span>',
227 'href' => admin_url( 'tools.php?page=' . DLM__SLUG ),
228 'meta' => array(
229 'class' => 'dlm-admin-bar-icon',
230 'title' => esc_attr__( 'Error logging is enabled. Click to access the Debug Log Manager.', 'debug-log-manager' )
231 ),
232 ) );
233
234 }
235
236 }
237
238 /**
239 * Create the main admin page of the plugin
240 *
241 * @since 1.0.0
242 */
243 public function create_main_page() {
244
245 $log_file_path = get_option( 'debug_log_manager_file_path' );
246 $log_file_shortpath = str_replace( sanitize_text_field( $_SERVER['DOCUMENT_ROOT'] ), "", $log_file_path );
247 $file_size = size_format( (int) filesize( $log_file_path ) );
248
249 ?>
250
251 <div class="wrap dlm-main-page">
252 <div id="dlm-header" class="dlm-header">
253 <div class="dlm-header-left">
254 <h1 class="dlm-heading"><?php esc_html_e( 'Debug Log Manager', 'debug-log-manager' ); ?> <small><?php esc_html_e( 'by', 'debug-log-manager' ); ?> <a href="https://bowo.io/bowoio-dlm" target="_blank">Bowo</a></small></h1>
255 </div>
256 <div class="dlm-header-right">
257 <a href="https://bowo.io/review-dlm" target="_blank" class="dlm-header-action"><span>�
258 </span> <?php esc_html_e( 'Review', 'debug-log-manager' ); ?></a>
259 <a href="https://bowo.io/feedback-dlm" target="_blank" class="dlm-header-action"> <?php esc_html_e( 'Feedback', 'debug-log-manager' ); ?></a>
260 <a href="https://bowo.io/sponsor-dlm" target="_blank" class="button button-primary plugin-sponsor">&#10084; <?php esc_html_e( 'Sponsor', 'debug-log-manager' ); ?></a>
261 </div>
262 </div>
263 <div class="dlm-body">
264 <div class="dlm-log-management">
265 <div class="dlm-logging-status">
266 <div class="dlm-log-status-toggle">
267 <input type="checkbox" id="debug-log-checkbox" class="inset-3 debug-log-checkbox"><label for="debug-log-checkbox" class="green debug-log-switcher"></label>
268 </div>
269 <?php echo wp_kses_post( $this->debug_log->get_status() ); ?>
270 </div>
271 <div class="dlm-autorefresh-status">
272 <div class="dlm-log-autorefresh-toggle">
273 <input type="checkbox" id="debug-autorefresh-checkbox" class="inset-3 debug-autorefresh-checkbox"><label for="debug-autorefresh-checkbox" class="green debug-autorefresh-switcher"></label>
274 </div>
275 <?php echo wp_kses_post( $this->debug_log->get_autorefresh_status() ); ?>
276 </div>
277 </div>
278 <?php
279 // Ref: https://docs.wpvip.com/vip-code-analysis-bot/customize-phpcs/
280 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- already late-escaped before output here
281 $this->debug_log->get_entries_datatable();
282 ?>
283 </div>
284 <div class="dlm-footer">
285 <div id="dlm-log-file-location-section" class="dlm-footer-section">
286 <div class="dlm-log-file-location"><strong><?php esc_html_e( 'Log file', 'debug-log-manager' ); ?></strong>: <?php echo esc_html( $log_file_shortpath ); ?> (<span id="dlm-log-file-size"><?php echo esc_html( $file_size ); ?></span>)</div>
287 <button id="dlm-log-clear" class="button button-small button-secondary dlm-footer-button dlm-log-clear"><?php esc_html_e( 'Clear Log', 'debug-log-manager' ); ?></button>
288 </div>
289 <div id="dlm-disable-wp-file-editor-section" class="dlm-footer-section dlm-top-border" style="display:none;">
290 <div><?php esc_html_e( 'Once error logging is enabled, the core\'s plugin/theme editor stays enabled even if error logging has been disabled later on. This allows for viewing the files where errors occurred even when logging has been disabled. You can optionally disable the editor here once you\'re done debugging.', 'debug-log-manager' ); ?></div>
291 <button id="dlm-disable-wp-file-editor" class="button button-small button-secondary dlm-footer-button dlm-disable-wp-file-editor"><?php esc_html_e( 'Disable Editor', 'debug-log-manager' ); ?></button>
292 </div>
293 <div id="dlm-extra-settings" class="dlm-footer-section dlm-top-border">
294 <div class="dlm-extra-setting">
295 <div class="dlm-js-error-logging-status-toggle">
296 <input type="checkbox" id="js-error-logging-checkbox" class="inset-3 js-error-logging-checkbox"><label for="js-error-logging-checkbox" class="green js-error-logging-switcher"></label>
297 </div>
298 <div class="dlm-extra-setting-label">
299 <?php echo esc_html__( 'Do not log javascript errors', 'debug-log-manager' ); ?>
300 </div>
301 </div>
302 <div class="dlm-extra-setting">
303 <div class="dlm-script-debug-mod-status-toggle">
304 <input type="checkbox" id="script-debug-mod-checkbox" class="inset-3 script-debug-mod-checkbox"><label for="script-debug-mod-checkbox" class="green script-debug-mod-switcher"></label>
305 </div>
306 <div class="dlm-extra-setting-label">
307 <?php echo esc_html__( 'Do not modify SCRIPT_DEBUG value in wp-config.php', 'debug-log-manager' ); ?>
308 </div>
309 </div>
310 <div class="dlm-extra-setting">
311 <div class="dlm-process-non-utc-timezones-status-toggle">
312 <input type="checkbox" id="process-non-utc-timezones-checkbox" class="inset-3 process-non-utc-timezones-checkbox"><label for="process-non-utc-timezones-checkbox" class="green process-non-utc-timezones-switcher"></label>
313 </div>
314 <div class="dlm-extra-setting-label">
315 <?php echo esc_html__( 'Do not process entries with non-UTC timezones, which can be resource-intensive when log file size is significantly large.', 'debug-log-manager' ); ?>
316 </div>
317 </div>
318 </div>
319 <?php
320 echo wp_kses_post( $this->wp_config->wpconfig_file( 'status' ) );
321 ?>
322 </div>
323 </div>
324
325 <?php
326
327 }
328
329 /**
330 * To stop other plugins' admin notices overlaying in the Debug Log Manager UI, remove them.
331 *
332 * @hooked admin_notices
333 *
334 * @since 1.8.7
335 */
336 public function suppress_admin_notices() {
337
338 global $plugin_page;
339
340 if ( DLM__SLUG === $plugin_page ) {
341 remove_all_actions( 'admin_notices' );
342 }
343
344 }
345
346 /**
347 * Suppress all generic notices on the plugin settings page
348 *
349 * @since 1.8.8
350 */
351 public function suppress_generic_notices() {
352
353 global $plugin_page;
354
355 // Suppress all notices
356
357 if ( DLM__SLUG === $plugin_page ) {
358
359 remove_all_actions( 'all_admin_notices' );
360
361 }
362
363 }
364
365 /**
366 * Add dashboard widget with latest errors
367 *
368 * @since 1.8.0
369 */
370 public function add_dashboard_widget() {
371
372 $user = wp_get_current_user();
373 $roles = array_values( $user->roles );
374
375 if ( in_array( 'administrator', $roles ) ) {
376 wp_add_dashboard_widget(
377 'debug_log_manager_widget', // widget ID
378 __( 'Debug Log | Latest Errors', 'debug-log-manager' ), // widget title
379 array( $this, 'get_dashboard_widget_entries' ) // callback #1 to display entries
380 // array( $this, 'dashboard_widget_settings' ) // callback #2 for configuration
381 );
382 }
383
384 }
385
386 /**
387 * Load latest errors for dashboard widget
388 *
389 * @since 1.8.0
390 */
391 public function get_dashboard_widget_entries() {
392
393 $this->debug_log->get_dashboard_widget_entries();
394
395 }
396
397 /**
398 * Enqueue admin scripts
399 *
400 * @since 1.0.0
401 */
402 public function admin_scripts() {
403
404 wp_enqueue_style( 'dlm-admin', DLM__URL . 'assets/css/admin.css', array(), DLM__VERSION );
405 wp_enqueue_style( 'dlm-datatables', DLM__URL . 'assets/css/datatables.min.css', array(), DLM__VERSION );
406 wp_enqueue_style( 'dlm-toast', DLM__URL . 'assets/css/jquery.toast.min.css', array(), DLM__VERSION );
407 wp_enqueue_script( 'dlm-app', DLM__URL . 'assets/js/admin.js', array(), DLM__VERSION, false );
408 wp_enqueue_script( 'dlm-jsticky', DLM__URL . 'assets/js/jquery.jsticky.mod.min.js', array( 'jquery' ), DLM__VERSION, false );
409 wp_enqueue_script( 'dlm-datatables', DLM__URL . 'assets/js/datatables.min.js', array( 'jquery' ), DLM__VERSION, false );
410 wp_enqueue_script( 'dlm-toast', DLM__URL . 'assets/js/jquery.toast.min.js', array( 'jquery' ), DLM__VERSION, false );
411
412 // Pass on data from PHP to JS
413
414 $default_value = array(
415 'status' => 'disabled',
416 'on' => date( 'Y-m-d H:i:s' ),
417 );
418
419 $log_info = get_option( 'debug_log_manager', $default_value );
420 $log_status = $log_info['status']; // WP_DEBUG log status: enabled / disabled
421
422 if ( false !== get_option( 'debug_log_manager_autorefresh' ) ) {
423 $autorefresh_status = get_option( 'debug_log_manager_autorefresh' );
424 } else {
425 $autorefresh_status = 'disabled';
426 update_option( 'debug_log_manager_autorefresh', $autorefresh_status, false );
427 }
428
429 $js_error_logging_status = get_option( 'debug_log_manager_js_error_logging', 'enabled' );
430 $modify_script_debug_status = get_option( 'debug_log_manager_modify_script_debug', 'enabled' );
431 $process_non_utc_timezones_status = get_option( 'debug_log_manager_process_non_utc_timezones', 'enabled' );
432
433 $title_of_column_to_filter = __( 'Type', 'debug-log-manager' );
434
435 $nonce = wp_create_nonce( 'dlm-app' . get_current_user_id() );
436
437 wp_localize_script(
438 'dlm-app',
439 'dlmVars',
440 array(
441 'logStatus' => $log_status,
442 'autorefreshStatus' => $autorefresh_status,
443 'jsErrorLoggingStatus' => $js_error_logging_status,
444 'modifyScriptDebugStatus' => $modify_script_debug_status,
445 'processNonUtcTimezonesStatus' => $process_non_utc_timezones_status,
446 'titleOfColumnToFilter' => $title_of_column_to_filter,
447 'nonce' => $nonce,
448 'jsErrorLogging' => array(
449 'status' => '',
450 'url' => admin_url( 'admin-ajax.php' ),
451 'nonce' => wp_create_nonce( DLM__SLUG ),
452 'action' => 'log_js_errors',
453 ),
454 'toastMessage' => array(
455 'toggleDebugSuccess' => __( 'Error logging has been enabled and the latest entries have been loaded.', 'debug-log-manager' ),
456 'copySuccess' => __( 'Entries have been copied from an existing debug.log file.', 'debug-log-manager' ),
457 'logFileCleared' => __( 'Log file has been cleared.', 'debug-log-manager' ),
458 'editoDisabled' => __( 'WordPress plugin/theme editor has been disabled. ', 'debug-log-manager' ),
459 'paginationActive' => __( 'Pagination is active. Auto-refresh has been disabled.', 'debug-log-manager' ),
460 ),
461 'dataTable' => array(
462 'emptyTable' => __( 'No data available in table', 'debug-log-manager' ),
463 'info' => __( 'Showing _START_ to _END_ of _TOTAL_ entries', 'debug-log-manager' ),
464 'infoEmpty' => __( 'Showing 0 to 0 of 0 entries', 'debug-log-manager' ),
465 'infoFiltered' => __( '(filtered from _MAX_ total entries)', 'debug-log-manager' ),
466 'lengthMenu' => __( 'Show _MENU_ entries', 'debug-log-manager' ),
467 'search' => __( 'Search:', 'debug-log-manager' ),
468 'zeroRecords' => __( 'No matching records found', 'debug-log-manager' ),
469 'paginate' => array(
470 'first' => __( 'First', 'debug-log-manager' ),
471 'last' => __( 'Last', 'debug-log-manager' ),
472 'next' => __( 'Next', 'debug-log-manager' ),
473 'previous' => __( 'Previous', 'debug-log-manager' ),
474 ),
475 ),
476 )
477 );
478
479 }
480
481 /**
482 * Scripts for WP plugin editor page
483 *
484 * @since 2.0.0
485 */
486 public function plugin_editor_scripts() {
487
488 wp_enqueue_style( 'dlm-plugin-theme-editor', DLM__URL . 'assets/css/plugin-theme-editor.css', array(), DLM__VERSION );
489 wp_enqueue_script( 'dlm-plugin-editor', DLM__URL . 'assets/js/plugin-editor.js', array( 'jquery', 'wp-theme-plugin-editor' ), DLM__VERSION, false );
490
491 }
492
493 /**
494 * Scripts for WP theme editor page
495 *
496 * @since 2.0.0
497 */
498 public function theme_editor_scripts() {
499
500 wp_enqueue_style( 'dlm-plugin-theme-editor', DLM__URL . 'assets/css/plugin-theme-editor.css', array(), DLM__VERSION );
501 wp_enqueue_script( 'dlm-theme-editor', DLM__URL . 'assets/js/theme-editor.js', array( 'jquery', 'wp-theme-plugin-editor' ), DLM__VERSION, false );
502
503 }
504
505 /**
506 * Admin bar icon's inline css
507 *
508 * @since 1.6.0
509 */
510 public function admin_bar_icon_css() {
511
512 // https://developer.wordpress.org/reference/functions/wp_add_inline_style/
513 wp_add_inline_style( 'admin-bar', '
514
515 #wpadminbar .dlm-admin-bar-icon .dashicons {
516 font-family: dashicons;
517 font-size: 20px;
518 width: 20px;
519 height: 20px;
520 line-height: 32px;
521 }
522
523 #wpadminbar .quicklinks ul li.dlm-admin-bar-icon a {
524 background: green;
525 }
526
527 #wpadminbar:not(.mobile) .ab-top-menu>li:hover>.ab-item {
528 transition: .25s;
529 }
530
531 #wpadminbar:not(.mobile) .ab-top-menu>li.dlm-admin-bar-icon:hover>.ab-item,
532 #wpadminbar:not(.mobile) .ab-top-menu>li.dlm-admin-bar-icon>.ab-item:focus {
533 background: #006600;
534 color: #fff;
535 }
536
537 ' );
538
539 }
540
541 /**
542 * Enqueue public scripts
543 *
544 * @since 1.4.0
545 */
546 public function public_scripts() {
547 $log_info_default_value = array(
548 'status' => 'disabled',
549 'on' => date( 'Y-m-d H:i:s' ),
550 );
551
552 $log_info = get_option( 'debug_log_manager', $log_info_default_value );
553 $log_status = $log_info['status']; // WP_DEBUG log status: enabled / disabled
554
555 $js_error_logging_status = get_option( 'debug_log_manager_js_error_logging', 'enabled' ); // enabled | disabled
556
557 if ( 'enabled' == $log_status && 'enabled' == $js_error_logging_status ) {
558 wp_enqueue_script( 'dlm-public', DLM__URL . 'assets/js/public.js', array( 'jquery' ), DLM__VERSION, false );
559
560 wp_localize_script(
561 'dlm-public',
562 'dlmVars',
563 array(
564 'logStatus' => $log_status,
565 'jsErrorLogging' => array(
566 'status' => '',
567 'url' => admin_url( 'admin-ajax.php' ),
568 'nonce' => wp_create_nonce( DLM__SLUG ),
569 'action' => 'log_js_errors',
570 ),
571 )
572 );
573 }
574 }
575
576 }
577
578 Debug_Log_Manager::get_instance();