48 | >
49 | );
50 | };
51 |
52 | export default Content;
53 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # wp-live-debug
2 |
3 | ## live debug log viewer within wp-admin.
4 |
5 | 
6 | [](https://github.com/PHPCompatibility/PHPCompatibility)
7 | [](https://github.com/WordPress/WordPress-Coding-Standards)
8 |
9 | [](https://sonarcloud.io/dashboard?id=mrxkon_wp-live-debug) [](https://sonarcloud.io/dashboard?id=mrxkon_wp-live-debug)
10 | [](https://sonarcloud.io/dashboard?id=mrxkon_wp-live-debug) [](https://sonarcloud.io/dashboard?id=mrxkon_wp-live-debug)
11 |
12 | [](https://xkon.gr) [](https://profiles.wordpress.org/xkon) [](https://github.com/mrxkon/wp-live-debug/pulls)
13 |
14 | [](https://wordpress.org) [](https://wordpress.org/plugins/wp-live-debug/)
15 | [](http://www.gnu.org/licenses/gpl-2.0.html)
16 |
17 | ---
18 |
19 | I've found myself needing to have a "live view" of the debug.log in many occasions when dealing with code remotely. It's useful for debugging in general or quickly checking what's the latest in the logs if there's no server-side access.
20 |
21 | This plugin allows you to control the debug related constants and have a debug.log view inside your wp-admin area.
22 |
23 | Credits & Licences:
24 | This plugin utilizes `@wordpress/components`, `@wordpress/element`, `@wordpress/i18n` and other packages.
25 |
26 | Props to all the contributors that made this possible :) .
27 |
--------------------------------------------------------------------------------
/app/php/class-config.php:
--------------------------------------------------------------------------------
1 | $log_file,
45 | )
46 | );
47 | }
48 |
49 | /**
50 | * Check if auto refresh is enabled.
51 | */
52 | public static function auto_refresh_is() {
53 | if ( ! check_ajax_referer( 'wp-live-debug-nonce' ) ) {
54 | wp_send_json_error();
55 | }
56 |
57 | wp_send_json_success( get_option( 'wp_live_debug_auto_refresh' ) );
58 | }
59 |
60 | /**
61 | * Refresh debug.log toggle
62 | */
63 | public static function alter_auto_refresh() {
64 | if ( ! check_ajax_referer( 'wp-live-debug-nonce' ) ) {
65 | wp_send_json_error();
66 | }
67 |
68 | $allowed = array(
69 | 'enabled',
70 | 'disabled',
71 | );
72 |
73 | $value = $_POST['value'];
74 |
75 | if ( ! in_array( $value, $allowed, true ) ) {
76 | wp_send_json_error();
77 | }
78 |
79 | update_option( 'wp_live_debug_auto_refresh', $value );
80 |
81 | wp_send_json_success();
82 | }
83 |
84 | /**
85 | * Read debug.log.
86 | */
87 | public static function read_debug_log() {
88 | if ( ! check_ajax_referer( 'wp-live-debug-nonce' ) ) {
89 | wp_send_json_error();
90 | }
91 |
92 | $log_file = get_option( 'wp_live_debug_debug_log_location' );
93 |
94 | if ( file_exists( $log_file ) ) {
95 | if ( 2000000 > filesize( $log_file ) ) {
96 | $debug_contents = file_get_contents( $log_file );
97 |
98 | if ( empty( $debug_contents ) ) {
99 | $debug_contents = esc_html__( 'Awesome! The log seems to be empty.', 'wp-live-deubg' );
100 | }
101 | } else {
102 | $debug_contents = esc_html__( 'The log is over 2 MB. Please open it via FTP.', 'wp-live-debug' );
103 | }
104 | } else {
105 | $debug_contents = esc_html__( 'Could not find the log file.', 'wp-live-deubg' );
106 | }
107 |
108 | echo $debug_contents;
109 |
110 | wp_die();
111 | }
112 |
113 | /**
114 | * Clear log.
115 | */
116 | public static function clear_debug_log() {
117 | if ( ! check_ajax_referer( 'wp-live-debug-nonce' ) ) {
118 | wp_send_json_error();
119 | }
120 |
121 | $log_file = get_option( 'wp_live_debug_debug_log_location' );
122 |
123 | if ( ! file_exists( $log_file ) ) {
124 | wp_send_json_error();
125 | }
126 |
127 | if ( ! file_put_contents( $log_file, '' ) ) {
128 | wp_send_json_error();
129 | }
130 |
131 | wp_send_json_success();
132 | }
133 |
134 | /**
135 | * Delete log.
136 | */
137 | public static function delete_debug_log() {
138 | if ( ! check_ajax_referer( 'wp-live-debug-nonce' ) ) {
139 | wp_send_json_error();
140 | }
141 |
142 | $log_file = get_option( 'wp_live_debug_debug_log_location' );
143 |
144 | if ( ! file_exists( $log_file ) ) {
145 | wp_send_json_error();
146 | }
147 |
148 | if ( ! unlink( $log_file ) ) {
149 | wp_send_json_error();
150 | }
151 |
152 | wp_send_json_success();
153 | }
154 | }
155 |
--------------------------------------------------------------------------------
/app/js/src/components/Sidebar.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { __ } from '@wordpress/i18n';
5 | import { Panel, PanelBody, PanelRow, FormToggle, Spinner, Button } from '@wordpress/components';
6 |
7 | /**
8 | * Main.
9 | *
10 | * @param {Object} props
11 | */
12 | const Sidebar = ( props ) => {
13 | return (
14 | <>
15 |
16 | }>
17 | { props.hasManualBackup ? (
18 | <>
19 |
20 |
24 |
29 |
30 |
31 |
35 |
40 |
41 |
42 |
46 |
51 |
52 |
53 |
57 |
62 |
63 |
64 |
68 |
73 |
74 | >
75 | ) : (
76 |
77 | { __( 'Backup wp-config for more settings!', 'wp-live-debug' ) }
78 |
79 | ) }
80 |
81 |
85 |
90 |
91 |
92 |
98 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 | { __( 'You will find extra wp-config.php backups in your WordPress root directory as:', 'wp-live-debug' ) }
113 |
114 |
115 |
116 |
117 | { props.hasAutoBackup &&
118 | <>wp-config.WPLD-auto.php >
119 | }
120 | { props.hasManualBackup &&
121 | wp-config.WPLD-manual.php
122 | }
123 |
124 |
125 |
126 |
127 | { __( 'For more information you can visit', 'wp-live-debug' ) } { __( 'Debugging in WordPress', 'wp-live-debug' ) }.
128 |
129 |
130 |
131 |
132 | >
133 | );
134 | };
135 |
136 | export default Sidebar;
137 |
--------------------------------------------------------------------------------
/app/php/class-constants.php:
--------------------------------------------------------------------------------
1 | Add New
29 | * Search for WP Live Debug
30 | * Click the Install Now button to install the plugin
31 | * Click the Activate button to activate the plugin
32 |
33 | **Manually**
34 |
35 | * Unzip the downloaded package
36 | * Upload `wp-live-debug` directory to the /wp-content/plugins/ directory
37 | * Activate the plugin through the ‘Plugins’ menu in WordPress
38 |
39 | == Screenshots ==
40 |
41 | 1. WP Live Debug
42 |
43 | == Changelog ==
44 |
45 | = 5.3.2 =
46 | * Refactored PHP.
47 | * Refactored JS.
48 | * Convert to React.
49 | * Utilize @wordpress packages.
50 | * Refurbish the UI.
51 |
52 | = 4.9.8.6 =
53 | * Log viewer UI changes.
54 | * Add full log path on viewer title.
55 | * Clear any log.
56 | * Delete any log.
57 | * Various fixes.
58 | * PHPCS fixes.
59 | * Code docs.
60 | * Keeping 1 extra wp-config.php backup on activation.
61 | * Disable debug toggles until 1 action is finished.
62 | * Loading icons on Clear Log, Delete Log, Backup and Restore wp-config.
63 | * Download wp-config on activation.
64 |
65 | = 4.9.8.5 =
66 | * Add Info to Snapshot
67 |
68 | = 4.9.8.4 =
69 | * Introduce WPMU DEV Tab
70 | * Snapshot constants
71 | * Global installation .log reader
72 |
73 | = 4.9.8.3 =
74 | * Added scheduled task nonces
75 | * Fixed the SSL form to work via 'enter' also
76 | * Minor fixes
77 |
78 | = 4.9.8.2 =
79 | * Adds SSL verification for any domain
80 | * Security fixes ( thanks Vladislav Bailovic ( https://github.com/vladislavbailovic ) ! )
81 |
82 | = 4.9.8.1 =
83 | * Added Tabs view to shorten the pages length ( thanks Nahid F. Mohit ( https://github.com/nfmohit-wpmudev ) ! )
84 | * Refactored SSL tests the wp way
85 |
86 | = 4.9.8 =
87 | * Refactored Live Debugging
88 | * Added Server Information
89 | * Added General WordPress Information
90 | * Added PHP Information
91 | * Added Scheduled Tasks Information
92 | * Added Checksums tool to verify core files
93 | * Added a simple wp_mail() check
94 | * Added SSL/TLS Information
95 |
96 | = 4.9.4.2 =
97 | * Update required PHP to 5.3.
98 | * Update required WordPress version to 4.8.
99 |
100 | = 4.9.4.1 =
101 | * Fixed removing 'n' from the debug view.
102 |
103 | = 4.9.4 =
104 | * Code refactoring.
105 | * Minor fixes.
106 |
107 | = 4.9.2.1 =
108 |
109 | * Fixed faulty Plugin URI.
110 |
111 | = 4.9.2 =
112 |
113 | * Checks if file exists first to avoid errors.
114 | * Bumping version to follow WordPress releases.
115 |
116 | = 1.0.1 =
117 |
118 | * Fixed `No such file or directory` warning
119 |
120 | = 1.0.0 =
121 |
122 | * Initial Release
123 |
124 | == Upgrade Notice ==
125 |
126 | = 4.9.8.6 =
127 | Log viewer UI changes. Add full log path on viewer title. Clear any log. Delete any log. Various fixes. PHPCS fixes. Code docs. Keeping 1 extra wp-config.php backup on activation. Disable debug toggles until 1 action is finished. Loading icons on Clear Log, Delete Log, Backup and Restore wp-config. Download wp-config on activation.
128 |
129 | = 4.9.8.5 =
130 | Add Info to Snapshot.
131 |
132 | = 4.9.8.4 =
133 | Introduce WPMU DEV Tab. Snapshot constants. Global installation .log reader.
134 |
135 | = 4.9.8.3 =
136 | Added scheduled task nonces. Fixed the SSL form to work via 'enter' also. Minor fixes
137 |
138 | = 4.9.8.2 =
139 | Adds SSL verification for any domain. Security fixes ( thanks Vladislav Bailovic ( https://github.com/vladislavbailovic ) ! ).
140 |
141 | = 4.9.8.1 =
142 | Added Tabs view to shorten the pages length ( thanks Nahid F. Mohit ( https://github.com/nfmohit-wpmudev ) ! ). Refactored SSL tests the wp way.
143 |
144 | = 4.9.8 =
145 |
146 | Refactored Live Debugging. Added Server Information. Added General WordPress Information. Added PHP Information. Added Scheduled Tasks Information. Added Checksums tool to verify core files. Added a simple wp_mail() check. Added SSL/TLS Information.
147 |
148 | = 4.9.4.2 =
149 |
150 | Update required PHP to 5.3. Update required WordPress version to 4.8.
151 |
152 | = 4.9.4.1 =
153 |
154 | Fixed removing 'n' from the debug view.
155 |
156 | = 4.9.4 =
157 |
158 | Code refactoring. Minor fixes.
159 |
160 | = 4.9.2.1 =
161 |
162 | Fixed faulty Plugin URI.
163 |
164 | = 4.9.2 =
165 |
166 | Minor fixes. Bumping version to follow WordPress releases.
167 |
168 | = 1.0.1 =
169 |
170 | Fixed `No such file or directory` warning
171 |
172 | = 1.0.0 =
173 |
174 | Initial Release
175 |
--------------------------------------------------------------------------------
/app/php/class-setup.php:
--------------------------------------------------------------------------------
1 |
122 |
123 | admin_url( 'admin-ajax.php' ),
155 | 'nonce' => wp_create_nonce( 'wp-live-debug-nonce' ),
156 | )
157 | );
158 | }
159 | }
160 |
161 | /**
162 | * Load text-domain.
163 | */
164 | function text_domain() {
165 | load_plugin_textdomain( 'wp-live-debug', false, WP_LIVE_DEBUG_DIR . 'languages' );
166 | }
167 | }
168 |
--------------------------------------------------------------------------------
/app/js/build/index.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(a){if(t[a])return t[a].exports;var l=t[a]={i:a,l:!1,exports:{}};return e[a].call(l.exports,l,l.exports,n),l.l=!0,l.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var l in e)n.d(a,l,function(t){return e[t]}.bind(null,l));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t,n){var a=n(4),l=n(5),o=n(6);e.exports=function(e,t){return a(e)||l(e,t)||o()}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],a=!0,l=!1,o=void 0;try{for(var c,r=e[Symbol.iterator]();!(a=(c=r.next()).done)&&(n.push(c.value),!t||n.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(l)throw o}}return n}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,n){"use strict";n.r(t);var a=n(0),l=n(3),o=n.n(l),c=n(2),r=n(1),s=function(e){return Object(a.createElement)(a.Fragment,null,Object(a.createElement)("div",{className:"header",role:"region","aria-label":Object(c.__)("WP Live Debug Top Bar","wp-live-debug"),tabIndex:"-1"},Object(a.createElement)("div",{className:"page-title"},Object(a.createElement)("h1",{className:"header-title"},Object(c.__)("WP Live Debug","wp-live-debug"))),Object(a.createElement)("div",{className:"backup-restore"},e.hasManualBackup?Object(a.createElement)(r.Button,{id:"wp-live-debug-restore",isPrimary:!0,onClick:e.BackupActions},Object(c.__)("Restore wp-config","wp-live-debug")):Object(a.createElement)(r.Button,{id:"wp-live-debug-backup",isPrimary:!0,onClick:e.BackupActions},Object(c.__)("Backup wp-config","wp-live-debug")))))},u=function(){return Object(a.createElement)("textarea",{id:"wp-live-debug-area",name:"wp-live-debug-area",spellCheck:"false"})},i=function(e){return Object(a.createElement)(a.Fragment,null,Object(a.createElement)(r.Panel,{header:Object(c.__)("Settings & Information","wp-live-debug")},Object(a.createElement)(r.PanelBody,{title:Object(c.__)("Constants Settings","wp-live-debug"),initialOpen:!0,className:e.loading,icon:Object(a.createElement)(r.Spinner,null)},e.hasManualBackup?Object(a.createElement)(a.Fragment,null,Object(a.createElement)(r.PanelRow,null,Object(a.createElement)("label",{htmlFor:"WP_DEBUG",className:"components-toggle-control__label"},"WP_DEBUG"),Object(a.createElement)(r.FormToggle,{id:"WP_DEBUG",checked:e.debugEnabled,onClick:e.alterConstant})),Object(a.createElement)(r.PanelRow,null,Object(a.createElement)("label",{htmlFor:"WP_DEBUG_LOG",className:"components-toggle-control__label"},"WP_DEBUG_LOG"),Object(a.createElement)(r.FormToggle,{id:"WP_DEBUG_LOG",checked:e.debugLogEnabled,onClick:e.alterConstant})),Object(a.createElement)(r.PanelRow,null,Object(a.createElement)("label",{htmlFor:"WP_DEBUG_DISPLAY",className:"components-toggle-control__label"},"WP_DEBUG_DISPLAY"),Object(a.createElement)(r.FormToggle,{id:"WP_DEBUG_DISPLAY",checked:e.debugDisplayEnabled,onClick:e.alterConstant})),Object(a.createElement)(r.PanelRow,null,Object(a.createElement)("label",{htmlFor:"SCRIPT_DEBUG",className:"components-toggle-control__label"},"SCRIPT_DEBUG"),Object(a.createElement)(r.FormToggle,{id:"SCRIPT_DEBUG",checked:e.scriptDebugEnabled,onClick:e.alterConstant})),Object(a.createElement)(r.PanelRow,null,Object(a.createElement)("label",{htmlFor:"SAVEQUERIES",className:"components-toggle-control__label"},"SAVEQUERIES"),Object(a.createElement)(r.FormToggle,{id:"SAVEQUERIES",checked:e.saveQueriesEnabled,onClick:e.alterConstant}))):Object(a.createElement)(r.PanelRow,null,Object(a.createElement)("span",null,Object(c.__)("Backup wp-config for more settings!","wp-live-debug"))),Object(a.createElement)(r.PanelRow,null,Object(a.createElement)("label",{htmlFor:"alterAutoRefresh",className:"components-toggle-control__label"},"Auto Refresh"),Object(a.createElement)(r.FormToggle,{id:"alterAutoRefresh",checked:e.autoRefreshEnabled,onClick:e.alterAutoRefresh})),Object(a.createElement)(r.PanelRow,null,Object(a.createElement)(r.Button,{isLink:!0,onClick:e.clearLog},Object(c.__)("Clear log.","wp-live-debug")),Object(a.createElement)(r.Button,{isLink:!0,isDestructive:!0,onClick:e.deleteLog},Object(c.__)("Delete log.","wp-live-debug"))))),Object(a.createElement)(r.Panel,null,Object(a.createElement)(r.PanelBody,{title:Object(c.__)("More Information","wp-live-debug"),initialOpen:!1},Object(a.createElement)(r.PanelRow,null,Object(a.createElement)("span",null,Object(c.__)("You will find extra wp-config.php backups in your WordPress root directory as:","wp-live-debug"))),Object(a.createElement)(r.PanelRow,null,Object(a.createElement)("span",null,e.hasAutoBackup&&Object(a.createElement)(a.Fragment,null,Object(a.createElement)("strong",null,"wp-config.WPLD-auto.php "),Object(a.createElement)("br",null)),e.hasManualBackup&&Object(a.createElement)("strong",null,"wp-config.WPLD-manual.php"))),Object(a.createElement)(r.PanelRow,null,Object(a.createElement)("span",null,Object(c.__)("For more information you can visit","wp-live-debug")," ",Object(a.createElement)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://wordpress.org/support/article/debugging-in-wordpress/"},Object(c.__)("Debugging in WordPress","wp-live-debug")),".")))))},b=function(e){return Object(a.createElement)(a.Fragment,null,Object(a.createElement)("div",{className:"content",role:"region","aria-label":Object(c.__)("Log view","wp-live-debug"),tabIndex:"-1"},Object(a.createElement)("div",{className:"main"},Object(a.createElement)("h2",null,Object(c.__)("Viewing:","wp-live-debug")," ",e.debugLogLocation),Object(a.createElement)(u,null)),Object(a.createElement)("div",{className:"sidebar"},Object(a.createElement)(i,{loading:e.loading,alterConstant:e.alterConstant,alterAutoRefresh:e.alterAutoRefresh,hasManualBackup:e.hasManualBackup,hasAutoBackup:e.hasAutoBackup,debugEnabled:e.debugEnabled,debugLogEnabled:e.debugLogEnabled,debugDisplayEnabled:e.debugDisplayEnabled,scriptDebugEnabled:e.scriptDebugEnabled,saveQueriesEnabled:e.saveQueriesEnabled,autoRefreshEnabled:e.autoRefreshEnabled,clearLog:e.clearLog,deleteLog:e.deleteLog}))))},d=function(){var e=Object(a.useState)(!0),t=o()(e,2),n=t[0],l=t[1],c=Object(a.useState)(!1),r=o()(c,2),u=r[0],i=r[1],d=Object(a.useState)(!1),p=o()(d,2),g=p[0],_=p[1],w=Object(a.useState)(!1),m=o()(w,2),E=m[0],f=m[1],O=Object(a.useState)(!1),j=o()(O,2),v=j[0],h=j[1],P=Object(a.useState)(!1),S=o()(P,2),R=S[0],k=S[1],x=Object(a.useState)(!1),B=o()(x,2),y=B[0],L=B[1],D=Object(a.useState)(!1),T=o()(D,2),C=T[0],G=T[1],U=Object(a.useState)(!1),A=o()(U,2),I=A[0],H=A[1],q=Object(a.useState)("show-spinner"),M=o()(q,2),N=M[0],W=M[1],F=Object(a.useState)(""),X=o()(F,2),J=X[0],Q=X[1],V=function(){var e=document.getElementById("wp-live-debug-area");null!==e&&(e.scrollTop=e.scrollHeight)},Y=function(){var e=new XMLHttpRequest,t=wp_live_debug_globals.ajax_url,a=wp_live_debug_globals.nonce;e.open("POST",t,!0),e.setRequestHeader("Content-Type","application/x-www-form-urlencoded;"),e.onload=function(){if(this.status>=200&&this.status<400){var e=document.getElementById("wp-live-debug-area");null!==e&&(e.value=this.response),n&&V()}},e.send("action=wp-live-debug-read-debug-log&_ajax_nonce="+a)};Object(a.useEffect)((function(){var e=setInterval((function(){!0===I&&(Y(),V())}),3e3);return function(){return clearInterval(e)}}));var z,K,Z;return n&&(z=new XMLHttpRequest,K=wp_live_debug_globals.ajax_url,Z=wp_live_debug_globals.nonce,z.open("POST",K,!0),z.setRequestHeader("Content-Type","application/x-www-form-urlencoded;"),z.onload=function(){this.status>=200&&this.status<400&&G(!0)},z.send("action=wp-live-debug-check-auto-backup-json&_ajax_nonce="+Z),function(){var e=new XMLHttpRequest,t=wp_live_debug_globals.ajax_url,n=wp_live_debug_globals.nonce;e.open("POST",t,!0),e.setRequestHeader("Content-Type","application/x-www-form-urlencoded;"),e.onload=function(){this.status>=200&&this.status<400&&(!0===JSON.parse(this.response).success&&L(!0))},e.send("action=wp-live-debug-check-manual-backup-json&_ajax_nonce="+n)}(),function(){var e=new XMLHttpRequest,t=wp_live_debug_globals.ajax_url,n=wp_live_debug_globals.nonce;e.open("POST",t,!0),e.setRequestHeader("Content-Type","application/x-www-form-urlencoded;"),e.onload=function(){if(this.status>=200&&this.status<400){var e=JSON.parse(this.response);Q(e.data.debuglog_path)}},e.send("action=wp-live-debug-find-debug-log-json&_ajax_nonce="+n)}(),function(){var e=new XMLHttpRequest,t=wp_live_debug_globals.ajax_url,n=wp_live_debug_globals.nonce;e.open("POST",t,!0),e.setRequestHeader("Content-Type","application/x-www-form-urlencoded;"),e.onload=function(){if(this.status>=200&&this.status<400){var e=JSON.parse(this.response);!0===e.success&&(e.data.forEach((function(e){switch(e){case"WP_DEBUG":i(!0);break;case"WP_DEBUG_LOG":_(!0);break;case"WP_DEBUG_DISPLAY":f(!0);break;case"SCRIPT_DEBUG":h(!0);break;case"SAVEQUERIES":k(!0)}})),W("hide-spinner"))}},e.send("action=wp-live-debug-is-constant-true&_ajax_nonce="+n)}(),function(){var e=new XMLHttpRequest,t=wp_live_debug_globals.ajax_url,n=wp_live_debug_globals.nonce;e.open("POST",t,!0),e.setRequestHeader("Content-Type","application/x-www-form-urlencoded;"),e.onload=function(){if(this.status>=200&&this.status<400){var e=JSON.parse(this.response);!0===e.success&&("disabled"===e.data?H(!1):"enabled"===e.data&&H(!0))}},e.send("action=wp-live-debug-auto-refresh-is&_ajax_nonce="+n)}(),Y(),l(!1)),Object(a.createElement)(a.Fragment,null,Object(a.createElement)(s,{BackupActions:function(e){if(W("show-spinner"),"wp-live-debug-backup"===e.target.id){var t=new XMLHttpRequest,n=wp_live_debug_globals.ajax_url,a=wp_live_debug_globals.nonce;t.open("POST",n,!0),t.setRequestHeader("Content-Type","application/x-www-form-urlencoded;"),t.onload=function(){this.status>=200&&this.status<400&&(!0===JSON.parse(this.response).success&&window.location.reload())},t.send("action=wp-live-debug-create-backup&_ajax_nonce="+a)}else{var l=new XMLHttpRequest,o=wp_live_debug_globals.ajax_url,c=wp_live_debug_globals.nonce;l.open("POST",o,!0),l.setRequestHeader("Content-Type","application/x-www-form-urlencoded;"),l.onload=function(){this.status>=200&&this.status<400&&(!0===JSON.parse(this.response).success&&window.location.reload())},l.send("action=wp-live-debug-restore-backup&_ajax_nonce="+c)}},hasManualBackup:y}),Object(a.createElement)(b,{loading:N,alterConstant:function(e){W("show-spinner");var t,n=e.target.id;switch(n){case"WP_DEBUG":t=!u;break;case"WP_DEBUG_LOG":t=!g&&J;break;case"WP_DEBUG_DISPLAY":t=!E;break;case"SCRIPT_DEBUG":t=!v;break;case"SAVEQUERIES":t=!R}var a=new XMLHttpRequest,l=wp_live_debug_globals.ajax_url,o=wp_live_debug_globals.nonce;a.open("POST",l,!0),a.setRequestHeader("Content-Type","application/x-www-form-urlencoded;"),a.onload=function(){if(this.status>=200&&this.status<400&&!0===JSON.parse(this.response).success){switch(n){case"WP_DEBUG":i(t);break;case"WP_DEBUG_LOG":!1!==t&&(t=!0),_(t);break;case"WP_DEBUG_DISPLAY":f(t);break;case"SCRIPT_DEBUG":h(t);break;case"SAVEQUERIES":k(t)}W("hide-spinner")}},a.send("action=wp-live-debug-alter-constant&_ajax_nonce="+o+"&constant="+n+"&value="+t)},alterAutoRefresh:function(){W("show-spinner");var e,t=new XMLHttpRequest,n=wp_live_debug_globals.ajax_url,a=wp_live_debug_globals.nonce;!1===I?(e="enabled",H(!0)):(e="disabled",H(!1)),t.open("POST",n,!0),t.setRequestHeader("Content-Type","application/x-www-form-urlencoded;"),t.onload=function(){this.status>=200&&this.status<400&&(!0===JSON.parse(this.response).success&&W("hide-spinner"))},t.send("action=wp-live-debug-alter-auto-refresh&_ajax_nonce="+a+"&value="+e)},hasManualBackup:y,hasAutoBackup:C,debugEnabled:u,debugLogLocation:J,debugLogEnabled:g,debugDisplayEnabled:E,scriptDebugEnabled:v,saveQueriesEnabled:R,autoRefreshEnabled:I,clearLog:function(){var e=new XMLHttpRequest,t=wp_live_debug_globals.ajax_url,n=wp_live_debug_globals.nonce;e.open("POST",t,!0),e.setRequestHeader("Content-Type","application/x-www-form-urlencoded;"),e.onload=function(){this.status>=200&&this.status<400&&JSON.parse(this.response).success},e.send("action=wp-live-debug-clear-debug-log&_ajax_nonce="+n)},deleteLog:function(){var e=new XMLHttpRequest,t=wp_live_debug_globals.ajax_url,n=wp_live_debug_globals.nonce;e.open("POST",t,!0),e.setRequestHeader("Content-Type","application/x-www-form-urlencoded;"),e.onload=function(){this.status>=200&&this.status<400&&JSON.parse(this.response).success},e.send("action=wp-live-debug-delete-debug-log&_ajax_nonce="+n)}}))};Object(a.render)(Object(a.createElement)(d,null),document.getElementById("wpld-page"))}]);
--------------------------------------------------------------------------------
/app/js/src/app.js:
--------------------------------------------------------------------------------
1 | /**
2 | * WordPress dependencies.
3 | */
4 | import { useState, useEffect } from '@wordpress/element';
5 |
6 | /**
7 | * Internal Dependencies.
8 | */
9 | import Header from './components/Header';
10 | import Content from './components/Content';
11 |
12 | /**
13 | * Main.
14 | */
15 | const App = () => {
16 | /**
17 | * Initialize states.
18 | */
19 | const [ firstRun, setfirstRun ] = useState( true );
20 | const [ hasWPDebug, setWPDebug ] = useState( false );
21 | const [ hasWPDebugLog, setWPDebugLog ] = useState( false );
22 | const [ hasWPDebugDisplay, setWPDebugDisplay ] = useState( false );
23 | const [ hasScriptDebug, setScriptDebug ] = useState( false );
24 | const [ hasSaveQueries, setSaveQueries ] = useState( false );
25 | const [ hasManualBackup, setHasManualBackup ] = useState( false );
26 | const [ hasAutoBackup, setHasAutoBackup ] = useState( false );
27 | const [ hasAutoRefresh, setAutoRefresh ] = useState( false );
28 | const [ loading, setLoading ] = useState( 'show-spinner' );
29 | const [ debugLogLocation, setDebugLogLocation ] = useState( '' );
30 |
31 | /**
32 | * Check if wp-config.WPLD-auto.php exists.
33 | */
34 | const autoBackupExists = () => {
35 | const request = new XMLHttpRequest();
36 | const url = wp_live_debug_globals.ajax_url;
37 | const nonce = wp_live_debug_globals.nonce;
38 | const action = 'wp-live-debug-check-auto-backup-json';
39 |
40 | request.open( 'POST', url, true );
41 | request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );
42 | request.onload = function() {
43 | if ( this.status >= 200 && this.status < 400 ) {
44 | setHasAutoBackup( true );
45 | }
46 | };
47 | request.send( 'action=' + action + '&_ajax_nonce=' + nonce );
48 | };
49 |
50 | /**
51 | * Check if wp-config.WPLD-manual.php exists.
52 | */
53 | const manualBackupExists = () => {
54 | const request = new XMLHttpRequest();
55 | const url = wp_live_debug_globals.ajax_url;
56 | const nonce = wp_live_debug_globals.nonce;
57 | const action = 'wp-live-debug-check-manual-backup-json';
58 |
59 | request.open( 'POST', url, true );
60 | request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );
61 | request.onload = function() {
62 | if ( this.status >= 200 && this.status < 400 ) {
63 | const resp = JSON.parse( this.response );
64 | if ( true === resp.success ) {
65 | setHasManualBackup( true );
66 | }
67 | }
68 | };
69 | request.send( 'action=' + action + '&_ajax_nonce=' + nonce );
70 | };
71 |
72 | /**
73 | * See any of the constants are true and alter their state.
74 | */
75 | const isConstantTrue = () => {
76 | const request = new XMLHttpRequest();
77 | const url = wp_live_debug_globals.ajax_url;
78 | const nonce = wp_live_debug_globals.nonce;
79 | const action = 'wp-live-debug-is-constant-true';
80 |
81 | request.open( 'POST', url, true );
82 | request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );
83 | request.onload = function() {
84 | if ( this.status >= 200 && this.status < 400 ) {
85 | const resp = JSON.parse( this.response );
86 | if ( true === resp.success ) {
87 | resp.data.forEach( ( constant ) => {
88 | switch ( constant ) {
89 | case 'WP_DEBUG':
90 | setWPDebug( true );
91 | break;
92 | case 'WP_DEBUG_LOG':
93 | setWPDebugLog( true );
94 | break;
95 | case 'WP_DEBUG_DISPLAY':
96 | setWPDebugDisplay( true );
97 | break;
98 | case 'SCRIPT_DEBUG':
99 | setScriptDebug( true );
100 | break;
101 | case 'SAVEQUERIES':
102 | setSaveQueries( true );
103 | break;
104 | }
105 | } );
106 |
107 | setLoading( 'hide-spinner' );
108 | }
109 | }
110 | };
111 | request.send( 'action=' + action + '&_ajax_nonce=' + nonce );
112 | };
113 |
114 | /**
115 | * Scroll the LogViewer.
116 | */
117 | const scrollLogViewer = () => {
118 | const debugArea = document.getElementById( 'wp-live-debug-area' );
119 |
120 | if ( null !== debugArea ) {
121 | debugArea.scrollTop = debugArea.scrollHeight;
122 | }
123 | };
124 |
125 | /**
126 | * Find debug.log location.
127 | */
128 | const findDebugLog = () => {
129 | const request = new XMLHttpRequest();
130 | const url = wp_live_debug_globals.ajax_url;
131 | const nonce = wp_live_debug_globals.nonce;
132 | const action = 'wp-live-debug-find-debug-log-json';
133 |
134 | request.open( 'POST', url, true );
135 | request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );
136 | request.onload = function() {
137 | if ( this.status >= 200 && this.status < 400 ) {
138 | const resp = JSON.parse( this.response );
139 | setDebugLogLocation( resp.data.debuglog_path );
140 | }
141 | };
142 | request.send( 'action=' + action + '&_ajax_nonce=' + nonce );
143 | };
144 |
145 | /**
146 | * Read the debug.log.
147 | */
148 | const readDebugLog = () => {
149 | const request = new XMLHttpRequest();
150 | const url = wp_live_debug_globals.ajax_url;
151 | const nonce = wp_live_debug_globals.nonce;
152 | const action = 'wp-live-debug-read-debug-log';
153 |
154 | request.open( 'POST', url, true );
155 | request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );
156 | request.onload = function() {
157 | if ( this.status >= 200 && this.status < 400 ) {
158 | const debugArea = document.getElementById( 'wp-live-debug-area' );
159 | if ( null !== debugArea ) {
160 | debugArea.value = this.response;
161 | }
162 | if ( firstRun ) {
163 | scrollLogViewer();
164 | }
165 | }
166 | };
167 | request.send( 'action=' + action + '&_ajax_nonce=' + nonce );
168 | };
169 |
170 | /**
171 | * Scroll the LogViewer on interval.
172 | */
173 | useEffect( () => {
174 | const interval = setInterval( () => {
175 | if ( true === hasAutoRefresh ) {
176 | readDebugLog();
177 | scrollLogViewer();
178 | }
179 | }, 3000 );
180 |
181 | return () => clearInterval( interval );
182 | } );
183 |
184 | /**
185 | * Clear the log.
186 | */
187 | const clearLog = () => {
188 | const request = new XMLHttpRequest();
189 | const url = wp_live_debug_globals.ajax_url;
190 | const nonce = wp_live_debug_globals.nonce;
191 | const action = 'wp-live-debug-clear-debug-log';
192 |
193 | request.open( 'POST', url, true );
194 | request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );
195 | request.onload = function() {
196 | if ( this.status >= 200 && this.status < 400 ) {
197 | const resp = JSON.parse( this.response );
198 | if ( true === resp.success ) {
199 | // silence
200 | }
201 | }
202 | };
203 | request.send( 'action=' + action + '&_ajax_nonce=' + nonce );
204 | };
205 |
206 | /**
207 | * Delete the log.
208 | */
209 | const deleteLog = () => {
210 | const request = new XMLHttpRequest();
211 | const url = wp_live_debug_globals.ajax_url;
212 | const nonce = wp_live_debug_globals.nonce;
213 | const action = 'wp-live-debug-delete-debug-log';
214 |
215 | request.open( 'POST', url, true );
216 | request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );
217 | request.onload = function() {
218 | if ( this.status >= 200 && this.status < 400 ) {
219 | const resp = JSON.parse( this.response );
220 | if ( true === resp.success ) {
221 | // silence
222 | }
223 | }
224 | };
225 | request.send( 'action=' + action + '&_ajax_nonce=' + nonce );
226 | };
227 |
228 | /**
229 | * Backup Button Actions.
230 | *
231 | * @param {Object} event
232 | */
233 | const BackupActions = ( event ) => {
234 | setLoading( 'show-spinner' );
235 |
236 | const target = event.target.id;
237 |
238 | if ( target === 'wp-live-debug-backup' ) {
239 | const request = new XMLHttpRequest();
240 | const url = wp_live_debug_globals.ajax_url;
241 | const nonce = wp_live_debug_globals.nonce;
242 | const action = 'wp-live-debug-create-backup';
243 |
244 | request.open( 'POST', url, true );
245 | request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );
246 | request.onload = function() {
247 | if ( this.status >= 200 && this.status < 400 ) {
248 | const resp = JSON.parse( this.response );
249 | if ( true === resp.success ) {
250 | window.location.reload();
251 | }
252 | }
253 | };
254 | request.send( 'action=' + action + '&_ajax_nonce=' + nonce );
255 | } else {
256 | const request = new XMLHttpRequest();
257 | const url = wp_live_debug_globals.ajax_url;
258 | const nonce = wp_live_debug_globals.nonce;
259 | const action = 'wp-live-debug-restore-backup';
260 |
261 | request.open( 'POST', url, true );
262 | request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );
263 | request.onload = function() {
264 | if ( this.status >= 200 && this.status < 400 ) {
265 | const resp = JSON.parse( this.response );
266 | if ( true === resp.success ) {
267 | window.location.reload();
268 | }
269 | }
270 | };
271 | request.send( 'action=' + action + '&_ajax_nonce=' + nonce );
272 | }
273 | };
274 |
275 | /**
276 | * Alter Constants.
277 | *
278 | * @param {Object} event
279 | */
280 | const alterConstant = ( event ) => {
281 | setLoading( 'show-spinner' );
282 |
283 | const target = event.target.id;
284 |
285 | let value;
286 |
287 | switch ( target ) {
288 | case 'WP_DEBUG':
289 | value = hasWPDebug ? false : true;
290 | break;
291 | case 'WP_DEBUG_LOG':
292 | value = hasWPDebugLog ? false : debugLogLocation;
293 | break;
294 | case 'WP_DEBUG_DISPLAY':
295 | value = hasWPDebugDisplay ? false : true;
296 | break;
297 | case 'SCRIPT_DEBUG':
298 | value = hasScriptDebug ? false : true;
299 | break;
300 | case 'SAVEQUERIES':
301 | value = hasSaveQueries ? false : true;
302 | break;
303 | }
304 |
305 | const request = new XMLHttpRequest();
306 | const url = wp_live_debug_globals.ajax_url;
307 | const nonce = wp_live_debug_globals.nonce;
308 | const action = 'wp-live-debug-alter-constant';
309 |
310 | request.open( 'POST', url, true );
311 | request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );
312 | request.onload = function() {
313 | if ( this.status >= 200 && this.status < 400 ) {
314 | const resp = JSON.parse( this.response );
315 | if ( true === resp.success ) {
316 | switch ( target ) {
317 | case 'WP_DEBUG':
318 | setWPDebug( value );
319 | break;
320 | case 'WP_DEBUG_LOG':
321 | if ( false !== value ) {
322 | value = true;
323 | }
324 | setWPDebugLog( value );
325 | break;
326 | case 'WP_DEBUG_DISPLAY':
327 | setWPDebugDisplay( value );
328 | break;
329 | case 'SCRIPT_DEBUG':
330 | setScriptDebug( value );
331 | break;
332 | case 'SAVEQUERIES':
333 | setSaveQueries( value );
334 | break;
335 | }
336 |
337 | setLoading( 'hide-spinner' );
338 | }
339 | }
340 | };
341 | request.send( 'action=' + action + '&_ajax_nonce=' + nonce + '&constant=' + target + '&value=' + value );
342 | };
343 |
344 | /**
345 | * Alter Auto Refresh
346 | */
347 | const alterAutoRefresh = () => {
348 | setLoading( 'show-spinner' );
349 | const request = new XMLHttpRequest();
350 | const url = wp_live_debug_globals.ajax_url;
351 | const nonce = wp_live_debug_globals.nonce;
352 | const action = 'wp-live-debug-alter-auto-refresh';
353 |
354 | let value;
355 |
356 | if ( false === hasAutoRefresh ) {
357 | value = 'enabled';
358 | setAutoRefresh( true );
359 | } else {
360 | value = 'disabled';
361 | setAutoRefresh( false );
362 | }
363 |
364 | request.open( 'POST', url, true );
365 | request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );
366 | request.onload = function() {
367 | if ( this.status >= 200 && this.status < 400 ) {
368 | const resp = JSON.parse( this.response );
369 | if ( true === resp.success ) {
370 | setLoading( 'hide-spinner' );
371 | }
372 | }
373 | };
374 | request.send( 'action=' + action + '&_ajax_nonce=' + nonce + '&value=' + value );
375 | };
376 |
377 | /**
378 | * Find if Auto Refresh is enabled.
379 | */
380 | const isAutoRefresh = () => {
381 | const request = new XMLHttpRequest();
382 | const url = wp_live_debug_globals.ajax_url;
383 | const nonce = wp_live_debug_globals.nonce;
384 | const action = 'wp-live-debug-auto-refresh-is';
385 |
386 | request.open( 'POST', url, true );
387 | request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );
388 | request.onload = function() {
389 | if ( this.status >= 200 && this.status < 400 ) {
390 | const resp = JSON.parse( this.response );
391 | if ( true === resp.success ) {
392 | if ( 'disabled' === resp.data ) {
393 | setAutoRefresh( false );
394 | } else if ( 'enabled' === resp.data ) {
395 | setAutoRefresh( true );
396 | }
397 | }
398 | }
399 | };
400 | request.send( 'action=' + action + '&_ajax_nonce=' + nonce );
401 | };
402 |
403 | /**
404 | * Run these only one time.
405 | */
406 | if ( firstRun ) {
407 | autoBackupExists();
408 | manualBackupExists();
409 | findDebugLog();
410 | isConstantTrue();
411 | isAutoRefresh();
412 | readDebugLog();
413 | setfirstRun( false );
414 | }
415 |
416 | /**
417 | * Render the UI.
418 | */
419 | return (
420 | <>
421 |
425 |
441 | >
442 | );
443 | };
444 |
445 | export default App;
446 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 |
294 | Copyright (C)
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | , 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
--------------------------------------------------------------------------------
/app/js/build/index.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./app/js/src/app.js","webpack:///./app/js/src/components/Content.js","webpack:///./app/js/src/components/Header.js","webpack:///./app/js/src/components/LogViewer.js","webpack:///./app/js/src/components/Sidebar.js","webpack:///./app/js/src/index.js","webpack:///./node_modules/@babel/runtime/helpers/arrayWithHoles.js","webpack:///./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","webpack:///./node_modules/@babel/runtime/helpers/nonIterableRest.js","webpack:///./node_modules/@babel/runtime/helpers/slicedToArray.js","webpack:///external {\"this\":[\"wp\",\"components\"]}","webpack:///external {\"this\":[\"wp\",\"element\"]}","webpack:///external {\"this\":[\"wp\",\"i18n\"]}"],"names":["App","useState","firstRun","setfirstRun","hasWPDebug","setWPDebug","hasWPDebugLog","setWPDebugLog","hasWPDebugDisplay","setWPDebugDisplay","hasScriptDebug","setScriptDebug","hasSaveQueries","setSaveQueries","hasManualBackup","setHasManualBackup","hasAutoBackup","setHasAutoBackup","hasAutoRefresh","setAutoRefresh","loading","setLoading","debugLogLocation","setDebugLogLocation","autoBackupExists","request","XMLHttpRequest","url","wp_live_debug_globals","ajax_url","nonce","action","open","setRequestHeader","onload","status","send","manualBackupExists","resp","JSON","parse","response","success","isConstantTrue","data","forEach","constant","scrollLogViewer","debugArea","document","getElementById","scrollTop","scrollHeight","findDebugLog","debuglog_path","readDebugLog","value","useEffect","interval","setInterval","clearInterval","clearLog","deleteLog","BackupActions","event","target","id","window","location","reload","alterConstant","alterAutoRefresh","isAutoRefresh","Content","props","__","debugEnabled","debugLogEnabled","debugDisplayEnabled","scriptDebugEnabled","saveQueriesEnabled","autoRefreshEnabled","Header","LogViewer","Sidebar","render"],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;;;;;;;;;AClFA;;;AAGA;AAEA;;;;AAGA;AACA;AAEA;;;;AAGA,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AAC5D,eAAN,IACD,qHALF,CADD,CAND,EAgBC,yEAAC,8DAAD,QACC,uFACG6D,0DAAE,CAAE,oCAAF,EAAwC,eAAxC,CADL,OACiE;AAAG,UAAM,EAAC,QAAV;AAAmB,OAAG,EAAC,qBAAvB;AAA6C,QAAI,EAAC;AAAlD,KAAoHA,0DAAE,CAAE,wBAAF,EAA4B,eAA5B,CAAtH,CADjE,MADD,CAhBD,CADD,CA9FD,CADD;AAyHA,CA1HD;;AA4HeS,sEAAf,E;;;;;;;;;;;;;;;;;;ACvIA;;;AAGA;AAEA;;;;AAGA;AAEA;;;;AAGAC,iEAAM,CAAE,yEAAC,4CAAD,OAAF,EAAWpC,QAAQ,CAACC,cAAT,CAAyB,WAAzB,CAAX,CAAN,C;;;;;;;;;;;ACbA;AACA;AACA;;AAEA,iC;;;;;;;;;;;ACJA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C,+BAA+B;AAC5E;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA,uC;;;;;;;;;;;AC9BA;AACA;AACA;;AAEA,kC;;;;;;;;;;;ACJA,qBAAqB,mBAAO,CAAC,iFAAkB;;AAE/C,2BAA2B,mBAAO,CAAC,6FAAwB;;AAE3D,sBAAsB,mBAAO,CAAC,mFAAmB;;AAEjD;AACA;AACA;;AAEA,gC;;;;;;;;;;;ACVA,aAAa,2CAA2C,EAAE,I;;;;;;;;;;;ACA1D,aAAa,wCAAwC,EAAE,I;;;;;;;;;;;ACAvD,aAAa,qCAAqC,EAAE,I","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./app/js/src/index.js\");\n","/**\n * WordPress dependencies.\n */\nimport { useState, useEffect } from '@wordpress/element';\n\n/**\n * Internal Dependencies.\n */\nimport Header from './components/Header';\nimport Content from './components/Content';\n\n/**\n * Main.\n */\nconst App = () => {\n\t/**\n\t * Initialize states.\n\t */\n\tconst [ firstRun, setfirstRun ] = useState( true );\n\tconst [ hasWPDebug, setWPDebug ] = useState( false );\n\tconst [ hasWPDebugLog, setWPDebugLog ] = useState( false );\n\tconst [ hasWPDebugDisplay, setWPDebugDisplay ] = useState( false );\n\tconst [ hasScriptDebug, setScriptDebug ] = useState( false );\n\tconst [ hasSaveQueries, setSaveQueries ] = useState( false );\n\tconst [ hasManualBackup, setHasManualBackup ] = useState( false );\n\tconst [ hasAutoBackup, setHasAutoBackup ] = useState( false );\n\tconst [ hasAutoRefresh, setAutoRefresh ] = useState( false );\n\tconst [ loading, setLoading ] = useState( 'show-spinner' );\n\tconst [ debugLogLocation, setDebugLogLocation ] = useState( '' );\n\n\t/**\n\t * Check if wp-config.WPLD-auto.php exists.\n\t */\n\tconst autoBackupExists = () => {\n\t\tconst request = new XMLHttpRequest();\n\t\tconst url = wp_live_debug_globals.ajax_url;\n\t\tconst nonce = wp_live_debug_globals.nonce;\n\t\tconst action = 'wp-live-debug-check-auto-backup-json';\n\n\t\trequest.open( 'POST', url, true );\n\t\trequest.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );\n\t\trequest.onload = function() {\n\t\t\tif ( this.status >= 200 && this.status < 400 ) {\n\t\t\t\tsetHasAutoBackup( true );\n\t\t\t}\n\t\t};\n\t\trequest.send( 'action=' + action + '&_ajax_nonce=' + nonce );\n\t};\n\n\t/**\n\t * Check if wp-config.WPLD-manual.php exists.\n\t */\n\tconst manualBackupExists = () => {\n\t\tconst request = new XMLHttpRequest();\n\t\tconst url = wp_live_debug_globals.ajax_url;\n\t\tconst nonce = wp_live_debug_globals.nonce;\n\t\tconst action = 'wp-live-debug-check-manual-backup-json';\n\n\t\trequest.open( 'POST', url, true );\n\t\trequest.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );\n\t\trequest.onload = function() {\n\t\t\tif ( this.status >= 200 && this.status < 400 ) {\n\t\t\t\tconst resp = JSON.parse( this.response );\n\t\t\t\tif ( true === resp.success ) {\n\t\t\t\t\tsetHasManualBackup( true );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\trequest.send( 'action=' + action + '&_ajax_nonce=' + nonce );\n\t};\n\n\t/**\n\t * See any of the constants are true and alter their state.\n\t */\n\tconst isConstantTrue = () => {\n\t\tconst request = new XMLHttpRequest();\n\t\tconst url = wp_live_debug_globals.ajax_url;\n\t\tconst nonce = wp_live_debug_globals.nonce;\n\t\tconst action = 'wp-live-debug-is-constant-true';\n\n\t\trequest.open( 'POST', url, true );\n\t\trequest.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );\n\t\trequest.onload = function() {\n\t\t\tif ( this.status >= 200 && this.status < 400 ) {\n\t\t\t\tconst resp = JSON.parse( this.response );\n\t\t\t\tif ( true === resp.success ) {\n\t\t\t\t\tresp.data.forEach( ( constant ) => {\n\t\t\t\t\t\tswitch ( constant ) {\n\t\t\t\t\t\t\tcase 'WP_DEBUG':\n\t\t\t\t\t\t\t\tsetWPDebug( true );\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'WP_DEBUG_LOG':\n\t\t\t\t\t\t\t\tsetWPDebugLog( true );\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'WP_DEBUG_DISPLAY':\n\t\t\t\t\t\t\t\tsetWPDebugDisplay( true );\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'SCRIPT_DEBUG':\n\t\t\t\t\t\t\t\tsetScriptDebug( true );\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'SAVEQUERIES':\n\t\t\t\t\t\t\t\tsetSaveQueries( true );\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t\tsetLoading( 'hide-spinner' );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\trequest.send( 'action=' + action + '&_ajax_nonce=' + nonce );\n\t};\n\n\t/**\n\t * Scroll the LogViewer.\n\t */\n\tconst scrollLogViewer = () => {\n\t\tconst debugArea = document.getElementById( 'wp-live-debug-area' );\n\n\t\tif ( null !== debugArea ) {\n\t\t\tdebugArea.scrollTop = debugArea.scrollHeight;\n\t\t}\n\t};\n\n\t/**\n\t * Find debug.log location.\n\t */\n\tconst findDebugLog = () => {\n\t\tconst request = new XMLHttpRequest();\n\t\tconst url = wp_live_debug_globals.ajax_url;\n\t\tconst nonce = wp_live_debug_globals.nonce;\n\t\tconst action = 'wp-live-debug-find-debug-log-json';\n\n\t\trequest.open( 'POST', url, true );\n\t\trequest.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );\n\t\trequest.onload = function() {\n\t\t\tif ( this.status >= 200 && this.status < 400 ) {\n\t\t\t\tconst resp = JSON.parse( this.response );\n\t\t\t\tsetDebugLogLocation( resp.data.debuglog_path );\n\t\t\t}\n\t\t};\n\t\trequest.send( 'action=' + action + '&_ajax_nonce=' + nonce );\n\t};\n\n\t/**\n\t * Read the debug.log.\n\t */\n\tconst readDebugLog = () => {\n\t\tconst request = new XMLHttpRequest();\n\t\tconst url = wp_live_debug_globals.ajax_url;\n\t\tconst nonce = wp_live_debug_globals.nonce;\n\t\tconst action = 'wp-live-debug-read-debug-log';\n\n\t\trequest.open( 'POST', url, true );\n\t\trequest.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );\n\t\trequest.onload = function() {\n\t\t\tif ( this.status >= 200 && this.status < 400 ) {\n\t\t\t\tconst debugArea = document.getElementById( 'wp-live-debug-area' );\n\t\t\t\tif ( null !== debugArea ) {\n\t\t\t\t\tdebugArea.value = this.response;\n\t\t\t\t}\n\t\t\t\tif ( firstRun ) {\n\t\t\t\t\tscrollLogViewer();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\trequest.send( 'action=' + action + '&_ajax_nonce=' + nonce );\n\t};\n\n\t/**\n\t * Scroll the LogViewer on interval.\n\t */\n\tuseEffect( () => {\n\t\tconst interval = setInterval( () => {\n\t\t\tif ( true === hasAutoRefresh ) {\n\t\t\t\treadDebugLog();\n\t\t\t\tscrollLogViewer();\n\t\t\t}\n\t\t}, 3000 );\n\n\t\treturn () => clearInterval( interval );\n\t} );\n\n\t/**\n\t * Clear the log.\n\t */\n\tconst clearLog = () => {\n\t\tconst request = new XMLHttpRequest();\n\t\tconst url = wp_live_debug_globals.ajax_url;\n\t\tconst nonce = wp_live_debug_globals.nonce;\n\t\tconst action = 'wp-live-debug-clear-debug-log';\n\n\t\trequest.open( 'POST', url, true );\n\t\trequest.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );\n\t\trequest.onload = function() {\n\t\t\tif ( this.status >= 200 && this.status < 400 ) {\n\t\t\t\tconst resp = JSON.parse( this.response );\n\t\t\t\tif ( true === resp.success ) {\n\t\t\t\t\t// silence\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\trequest.send( 'action=' + action + '&_ajax_nonce=' + nonce );\n\t};\n\n\t/**\n\t * Delete the log.\n\t */\n\tconst deleteLog = () => {\n\t\tconst request = new XMLHttpRequest();\n\t\tconst url = wp_live_debug_globals.ajax_url;\n\t\tconst nonce = wp_live_debug_globals.nonce;\n\t\tconst action = 'wp-live-debug-delete-debug-log';\n\n\t\trequest.open( 'POST', url, true );\n\t\trequest.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );\n\t\trequest.onload = function() {\n\t\t\tif ( this.status >= 200 && this.status < 400 ) {\n\t\t\t\tconst resp = JSON.parse( this.response );\n\t\t\t\tif ( true === resp.success ) {\n\t\t\t\t\t// silence\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\trequest.send( 'action=' + action + '&_ajax_nonce=' + nonce );\n\t};\n\n\t/**\n\t * Backup Button Actions.\n\t *\n\t * @param {Object} event\n\t */\n\tconst BackupActions = ( event ) => {\n\t\tsetLoading( 'show-spinner' );\n\n\t\tconst target = event.target.id;\n\n\t\tif ( target === 'wp-live-debug-backup' ) {\n\t\t\tconst request = new XMLHttpRequest();\n\t\t\tconst url = wp_live_debug_globals.ajax_url;\n\t\t\tconst nonce = wp_live_debug_globals.nonce;\n\t\t\tconst action = 'wp-live-debug-create-backup';\n\n\t\t\trequest.open( 'POST', url, true );\n\t\t\trequest.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );\n\t\t\trequest.onload = function() {\n\t\t\t\tif ( this.status >= 200 && this.status < 400 ) {\n\t\t\t\t\tconst resp = JSON.parse( this.response );\n\t\t\t\t\tif ( true === resp.success ) {\n\t\t\t\t\t\twindow.location.reload();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\trequest.send( 'action=' + action + '&_ajax_nonce=' + nonce );\n\t\t} else {\n\t\t\tconst request = new XMLHttpRequest();\n\t\t\tconst url = wp_live_debug_globals.ajax_url;\n\t\t\tconst nonce = wp_live_debug_globals.nonce;\n\t\t\tconst action = 'wp-live-debug-restore-backup';\n\n\t\t\trequest.open( 'POST', url, true );\n\t\t\trequest.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );\n\t\t\trequest.onload = function() {\n\t\t\t\tif ( this.status >= 200 && this.status < 400 ) {\n\t\t\t\t\tconst resp = JSON.parse( this.response );\n\t\t\t\t\tif ( true === resp.success ) {\n\t\t\t\t\t\twindow.location.reload();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\trequest.send( 'action=' + action + '&_ajax_nonce=' + nonce );\n\t\t}\n\t};\n\n\t/**\n\t * Alter Constants.\n\t *\n\t * @param {Object} event\n\t */\n\tconst alterConstant = ( event ) => {\n\t\tsetLoading( 'show-spinner' );\n\n\t\tconst target = event.target.id;\n\n\t\tlet value;\n\n\t\tswitch ( target ) {\n\t\t\tcase 'WP_DEBUG':\n\t\t\t\tvalue = hasWPDebug ? false : true;\n\t\t\t\tbreak;\n\t\t\tcase 'WP_DEBUG_LOG':\n\t\t\t\tvalue = hasWPDebugLog ? false : debugLogLocation;\n\t\t\t\tbreak;\n\t\t\tcase 'WP_DEBUG_DISPLAY':\n\t\t\t\tvalue = hasWPDebugDisplay ? false : true;\n\t\t\t\tbreak;\n\t\t\tcase 'SCRIPT_DEBUG':\n\t\t\t\tvalue = hasScriptDebug ? false : true;\n\t\t\t\tbreak;\n\t\t\tcase 'SAVEQUERIES':\n\t\t\t\tvalue = hasSaveQueries ? false : true;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tconst request = new XMLHttpRequest();\n\t\tconst url = wp_live_debug_globals.ajax_url;\n\t\tconst nonce = wp_live_debug_globals.nonce;\n\t\tconst action = 'wp-live-debug-alter-constant';\n\n\t\trequest.open( 'POST', url, true );\n\t\trequest.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );\n\t\trequest.onload = function() {\n\t\t\tif ( this.status >= 200 && this.status < 400 ) {\n\t\t\t\tconst resp = JSON.parse( this.response );\n\t\t\t\tif ( true === resp.success ) {\n\t\t\t\t\tswitch ( target ) {\n\t\t\t\t\t\tcase 'WP_DEBUG':\n\t\t\t\t\t\t\tsetWPDebug( value );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'WP_DEBUG_LOG':\n\t\t\t\t\t\t\tif ( false !== value ) {\n\t\t\t\t\t\t\t\tvalue = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsetWPDebugLog( value );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'WP_DEBUG_DISPLAY':\n\t\t\t\t\t\t\tsetWPDebugDisplay( value );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'SCRIPT_DEBUG':\n\t\t\t\t\t\t\tsetScriptDebug( value );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'SAVEQUERIES':\n\t\t\t\t\t\t\tsetSaveQueries( value );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tsetLoading( 'hide-spinner' );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\trequest.send( 'action=' + action + '&_ajax_nonce=' + nonce + '&constant=' + target + '&value=' + value );\n\t};\n\n\t/**\n\t * Alter Auto Refresh\n\t */\n\tconst alterAutoRefresh = () => {\n\t\tsetLoading( 'show-spinner' );\n\t\tconst request = new XMLHttpRequest();\n\t\tconst url = wp_live_debug_globals.ajax_url;\n\t\tconst nonce = wp_live_debug_globals.nonce;\n\t\tconst action = 'wp-live-debug-alter-auto-refresh';\n\n\t\tlet value;\n\n\t\tif ( false === hasAutoRefresh ) {\n\t\t\tvalue = 'enabled';\n\t\t\tsetAutoRefresh( true );\n\t\t} else {\n\t\t\tvalue = 'disabled';\n\t\t\tsetAutoRefresh( false );\n\t\t}\n\n\t\trequest.open( 'POST', url, true );\n\t\trequest.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );\n\t\trequest.onload = function() {\n\t\t\tif ( this.status >= 200 && this.status < 400 ) {\n\t\t\t\tconst resp = JSON.parse( this.response );\n\t\t\t\tif ( true === resp.success ) {\n\t\t\t\t\tsetLoading( 'hide-spinner' );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\trequest.send( 'action=' + action + '&_ajax_nonce=' + nonce + '&value=' + value );\n\t};\n\n\t/**\n\t * Find if Auto Refresh is enabled.\n\t */\n\tconst isAutoRefresh = () => {\n\t\tconst request = new XMLHttpRequest();\n\t\tconst url = wp_live_debug_globals.ajax_url;\n\t\tconst nonce = wp_live_debug_globals.nonce;\n\t\tconst action = 'wp-live-debug-auto-refresh-is';\n\n\t\trequest.open( 'POST', url, true );\n\t\trequest.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded;' );\n\t\trequest.onload = function() {\n\t\t\tif ( this.status >= 200 && this.status < 400 ) {\n\t\t\t\tconst resp = JSON.parse( this.response );\n\t\t\t\tif ( true === resp.success ) {\n\t\t\t\t\tif ( 'disabled' === resp.data ) {\n\t\t\t\t\t\tsetAutoRefresh( false );\n\t\t\t\t\t} else if ( 'enabled' === resp.data ) {\n\t\t\t\t\t\tsetAutoRefresh( true );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\trequest.send( 'action=' + action + '&_ajax_nonce=' + nonce );\n\t};\n\n\t/**\n\t * Run these only one time.\n\t */\n\tif ( firstRun ) {\n\t\tautoBackupExists();\n\t\tmanualBackupExists();\n\t\tfindDebugLog();\n\t\tisConstantTrue();\n\t\tisAutoRefresh();\n\t\treadDebugLog();\n\t\tsetfirstRun( false );\n\t}\n\n\t/**\n\t * Render the UI.\n\t */\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\n\t\t>\n\t);\n};\n\nexport default App;\n","/**\r\n * WordPress dependencies.\r\n */\r\nimport { __ } from '@wordpress/i18n';\r\n\r\n/**\r\n * Internal dependencies.\r\n */\r\nimport LogViewer from './LogViewer';\r\nimport Sidebar from './Sidebar';\r\n\r\n/**\r\n * Main.\r\n *\r\n * @param {Object} props\r\n */\r\nconst Content = ( props ) => {\r\n\treturn (\r\n\t\t<>\r\n\t\t\t