diff --git a/+/assets/banner-1544x500.png b/+/assets/banner-1544x500.png index 874cf87..2dad1a4 100755 Binary files a/+/assets/banner-1544x500.png and b/+/assets/banner-1544x500.png differ diff --git a/+/assets/banner-1880x609.png b/+/assets/banner-1880x609.png index d06ba8e..c22b1dc 100755 Binary files a/+/assets/banner-1880x609.png and b/+/assets/banner-1880x609.png differ diff --git a/+/assets/banner-772x250.png b/+/assets/banner-772x250.png index da20cf2..172bd3f 100755 Binary files a/+/assets/banner-772x250.png and b/+/assets/banner-772x250.png differ diff --git a/+/assets/icon-256x256.png b/+/assets/icon-256x256.png index dfc3a1f..ee095bc 100644 Binary files a/+/assets/icon-256x256.png and b/+/assets/icon-256x256.png differ diff --git a/+/main.css b/+/main.css index 6a618a0..6aaf19d 100644 --- a/+/main.css +++ b/+/main.css @@ -1,3 +1,5 @@ +@import "../node_modules/@highlightjs/cdn-assets/styles/atom-one-dark.min.css"; + .glbb-close::before { content: "\f335"; font-size: 26px; @@ -316,11 +318,13 @@ body.blackbar #adminmenu { } #glbb table td { background: transparent; + border-width: 0; line-height: 1.5; padding: 10px 15px; vertical-align: top; } + #glbb table.glbb-grid thead { position: sticky; top: 0; @@ -358,6 +362,9 @@ body.blackbar #adminmenu { padding: 0; white-space: nowrap; } +#glbb table.glbb-grid tr th:first-child { + text-align: left; +} #glbb table.glbb-grid tr td.glbb-row-details { background-color: var(--glbb-color-darker-border); display: grid; diff --git a/README.md b/README.md index 25be59a..55714f7 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,17 @@ ![Black Bar banner](+/assets/banner-1880x609.png) -Black Bar is an unobtrusive Debug Bar for WordPress developers that attaches itself to the bottom of the browser window. It is a rewrite of [blackbox-debug-bar](https://wordpress.org/plugins/blackbox-debug-bar/) by [Grzegorz Winiarski](https://profiles.wordpress.org/gwin) which appears to be abandoned as it has not been updated since 2013. +Black Bar is an unobtrusive Debug Bar for WordPress developers. It collects and displays errors, executed SQL queries, slow actions and hooks, theme templates, global variables, and provides a profiler. ### How it helps you with development -- Debug both the front-end and admin area -- Displays any PHP errors that occur when loading a page -- Displays executed MySQL queries and the time it took to execute each query -- Displays the 50 slowest action and filter hooks -- Displays the loaded template files of the active theme -- Inspect global variables (COOKIE, GET, POST, SERVER, SESSION) -- Use the Profiler for measuring performance of your plugins and themes +- Debug your code with the Console +- Inspect global variables (COOKIE, GET, POST, SERVER, SESSION, WP_Screen) +- Measure performance of your code with the Profiler +- View any PHP errors that occur when loading a page in the Console +- View executed MySQL queries along with execution time and backtrace +- View template files of the active theme in loaded order +- View the 50 slowest action and filter hooks along with callbacks ordered by priority ### Minimum plugin requirements diff --git a/assets/main.css b/assets/main.css index d0ff954..fc90aec 100644 --- a/assets/main.css +++ b/assets/main.css @@ -1 +1 @@ -.glbb-close:before{content:"\f335";font-size:26px;margin:-3px 3px 3px -3px}.glbb-globals:before{content:"\f319";margin:1px -1px -1px 1px}.glbb-toggle:before{content:"\f340";margin-right:1px}.glbb-hooks:before{content:"\f469"}.glbb-console:before{content:"\f534"}.glbb-filters:before{content:"\f536"}.glbb-queries:before{content:"\f17e"}.glbb-profiler:before{content:"\f311"}.glbb-templates:before{content:"\f116"}body.blackbar #adminmenu{margin-bottom:46px}@media screen and (min-width:783px){body.blackbar #adminmenu{margin-bottom:32px}}#glbb{--glbb-color-active:#72aee6;--glbb-color-error:#f44336;--glbb-color-warning:#ffc107;--glbb-color-darker-border:rgba(35,40,45,.5);--glbb-color-darker:#1d2327;--glbb-color-dark:#32373c;--glbb-color-icon:rgba(240,245,250,.6);--glbb-color-light:#ccc;--glbb-color-lighter:#f0f0f1;--glbb-font-mono:"Operator Mono",Monaco,Consolas,"Andale Mono","DejaVu Sans Mono",monospace;--glbb-font-sans:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;-webkit-font-smoothing:subpixel-antialiased;-moz-osx-font-smoothing:auto;background-color:#1d2327;background-color:var(--glbb-color-darker);bottom:0;box-sizing:border-box;color:#ccc;color:var(--glbb-color-light);direction:ltr;display:flex;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,Helvetica,Arial;font-family:var(--glbb-font-sans);height:32px;left:0;position:fixed;top:auto;width:100%;z-index:999999}#glbb .hljs{background-color:var(--glbb-color-dark)}#glbb.glbb-mini{width:36px}#glbb.glbb-mini .glbb-toggle:before{transform:rotate(180deg)}#glbb.glbb-mini .glbb-panel-links a:not(.glbb-toggle){display:none}#glbb .glbb-hidden{display:none!important}#glbb .glbb-panel{font-feature-settings:"tnum";-webkit-overflow-scrolling:touch;background-color:var(--glbb-color-dark);bottom:32px;box-sizing:border-box;display:flex;flex-direction:column;font-size:13px;font-variant-numeric:tabular-nums;left:0;max-height:calc(100% - 32px);overflow:auto;overscroll-behavior:contain;position:fixed;right:0}#glbb .glbb-panel a{color:var(--glbb-color-active);font-weight:400;margin:0;padding:0;-webkit-text-decoration:underline;text-decoration:underline}#glbb .glbb-panel a:focus{outline:none;text-decoration-style:dotted}#glbb .glbb-panel .glbb-info{color:var(--glbb-color-lighter);font-weight:600}#glbb .glbb-panel .glbb-warning{color:var(--glbb-color-warning)}#glbb .glbb-panel .glbb-alert,#glbb .glbb-panel .glbb-critical,#glbb .glbb-panel .glbb-emergency,#glbb .glbb-panel .glbb-error{color:var(--glbb-color-error)}#glbb .glbb-panel-links{display:flex;flex:1}#glbb .glbb-panel-links a{align-items:center;background-color:var(--glbb-color-darker);box-sizing:border-box;color:var(--glbb-color-lighter);display:flex;font-family:var(--glbb-font-sans);font-size:13px;font-weight:400;gap:6px;height:32px;justify-content:center;line-height:1;line-height:32px;margin:0;overflow:hidden;padding:0 7px;position:relative;-webkit-text-decoration:none;text-decoration:none;white-space:nowrap;width:40px}#glbb .glbb-panel-links div{display:flex;flex:1;justify-content:flex-end}#glbb .glbb-panel-links span{display:none}#glbb .glbb-panel-links a[data-info]:after{color:var(--glbb-color-light);font-size:12px}#glbb .glbb-panel-links a[data-info].glbb-warning:after{color:var(--glbb-color-warning)}#glbb .glbb-panel-links a[data-info].glbb-error:after{color:var(--glbb-color-error)}@media screen and (min-width:401px){#glbb .glbb-panel-links a{width:44px}}@media screen and (min-width:601px){#glbb .glbb-panel-links a{width:auto}#glbb .glbb-panel-links a.glbb-console:after{content:attr(data-info)}#glbb .glbb-panel-links span{display:inline}}@media screen and (min-width:783px){#glbb .glbb-panel-links a.glbb-hooks:after,#glbb .glbb-panel-links a.glbb-queries:after{content:attr(data-info)}}#glbb .glbb-panel-links a:before{color:var(--glbb-color-icon)}#glbb .glbb-panel-links a:focus{box-shadow:none;outline:none}#glbb .glbb-panel-links a.glbb-active,#glbb .glbb-panel-links a:hover{background-color:var(--glbb-color-dark);color:var(--glbb-color-active)}#glbb .glbb-panel-links a.glbb-active:before,#glbb .glbb-panel-links a:hover:before{color:var(--glbb-color-active)}#glbb .glbb-panel-links a.glbb-close:hover,#glbb .glbb-panel-links a.glbb-close:hover:before{color:#e00}#glbb code,#glbb pre{background-color:var(--glbb-color-dark);background-image:none;border:none;color:var(--glbb-color-light);font-family:var(--glbb-font-mono);font-size:13px!important;line-height:1.5;margin:0;padding:0;white-space:pre}#glbb form{background-color:var(--glbb-color-darker);box-sizing:border-box;display:flex;flex-wrap:wrap;gap:10px;left:0;line-height:normal;margin:0;position:sticky;top:0;width:100%}#glbb label{align-items:center;cursor:pointer;display:flex;font-family:var(--glbb-font-sans);font-size:13px;font-weight:400;gap:.5em;line-height:18px;margin:0;padding:0}#glbb input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--glbb-color-light);background-origin:border-box;border-radius:0;border-width:0;display:inline-block;flex-shrink:0;height:16px;margin:0;padding:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:16px}#glbb input[type=checkbox]:checked{background-image:url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.83%204.89l1.34.94-5.81%208.38H9.02L5.78%209.67l1.34-1.25%202.57%202.4z%27%20fill%3D%27%2332373c%27%2F%3E%3C%2Fsvg%3E");background-position:50%;background-size:20px}#glbb input[type=checkbox]:checked:after,#glbb input[type=checkbox]:checked:before{display:none}#glbb input[type=text],#glbb select{background-color:var(--glbb-color-dark);border-radius:0;border-width:0;box-shadow:none;box-sizing:border-box;color:var(--glbb-color-light);font-family:var(--glbb-font-sans);font-size:13px;font-weight:400;height:24px;line-height:18px;margin:0;padding:3px 10px;width:100%}#glbb input[type=text]::-moz-placeholder{color:var(--glbb-color-light);font-family:var(--glbb-font-sans);font-size:13px;font-weight:400;line-height:18px;opacity:.5}#glbb input[type=text]::placeholder{color:var(--glbb-color-light);font-family:var(--glbb-font-sans);font-size:13px;font-weight:400;line-height:18px;opacity:.5}#glbb input[type=checkbox]:focus{box-shadow:0 0 0 2px var(--glbb-color-dark),0 0 0 3px var(--glbb-color-active);outline:none}#glbb input[type=text]:focus,#glbb select:focus{box-shadow:inset 0 0 0 1px var(--glbb-color-active);outline:none}@media screen and (min-width:480px){#glbb input[type=text],#glbb select{flex:1;max-width:300px}}#glbb table{background:none!important;border:none!important;border-collapse:collapse;color:var(--glbb-color-light);margin:0!important;table-layout:auto;text-align:left;text-shadow:none!important;width:100%}#glbb table td{background:transparent;line-height:1.5;padding:10px 15px;vertical-align:top}#glbb table.glbb-grid thead{position:sticky;top:0;z-index:2}#glbb table.glbb-grid thead tr{background-color:var(--glbb-color-darker);padding:10px 15px}#glbb table.glbb-grid tbody{position:relative;top:-1px;z-index:1}#glbb table.glbb-grid tbody tr{border-top:1px solid var(--glbb-color-darker-border)}#glbb table.glbb-grid tr{grid-column-gap:10px;background-color:var(--glbb-color-dark);border:none;-moz-column-gap:10px;column-gap:10px;display:grid;grid-template-columns:1fr;justify-content:flex-start;padding:5px 15px}#glbb table.glbb-grid tr td,#glbb table.glbb-grid tr th{background:transparent;border:none;font-family:var(--glbb-font-sans);font-size:13px;line-height:1.5;margin:0;padding:0;white-space:nowrap}#glbb table.glbb-grid tr td.glbb-row-details{background-color:var(--glbb-color-darker-border);display:grid;grid-column:1/-1;justify-content:flex-start;margin:5px 0;padding:10px 0;text-align:left;white-space:normal}#glbb table.glbb-grid tr.glbb-row-collapsed td.glbb-row-details{display:none}#glbb table.glbb-grid ol{display:flex;flex-direction:column;gap:5px;margin:0;padding:0}#glbb table.glbb-grid li{margin:0 0 0 3ch}#glbb table.glbb-grid td.glbb-row-details li{margin-left:5ch}#glbb table.glbb-grid .glbb-row-toggle{align-items:center;cursor:pointer;display:flex;margin-left:-5px}#glbb table.glbb-grid .glbb-row-toggle:before{transition:transform .15s}#glbb table.glbb-grid tr:not(.glbb-row-collapsed) .glbb-row-toggle:before{transform:rotate(90deg)}#glbb-console.glbb-panel{overflow:hidden}#glbb-console>div{-webkit-overflow-scrolling:touch;overflow:auto;overscroll-behavior:contain}#glbb-console form{background-color:var(--glbb-color-dark);border-top:1px solid var(--glbb-color-darker-border);bottom:0;gap:15px;padding:10px 15px;position:sticky;z-index:2}#glbb-console table.glbb-grid tr{align-items:flex-start;grid-template-columns:10ch 1fr}#glbb-console table.glbb-grid tr td{white-space:normal}#glbb-globals table.glbb-grid tr td.glbb-row-details{overflow:auto;padding:10px}#glbb-globals table.glbb-grid code,#glbb-globals table.glbb-grid pre{background-color:transparent}#glbb-hooks form{padding:10px 15px 0;z-index:1}#glbb-hooks table.glbb-grid tr{align-items:center;grid-template-columns:1fr repeat(4,minmax(100px,10%))}#glbb-hooks table.glbb-grid tr td:not(:first-child):not(.glbb-row-details),#glbb-hooks table.glbb-grid tr th:not(:first-child){text-align:right}#glbb-hooks table.glbb-grid td.glbb-row-details li{margin-left:6.5ch}#glbb-profiler table.glbb-grid tr{align-items:center;grid-template-columns:1fr repeat(2,minmax(100px,10%))}#glbb-profiler table.glbb-grid tr td:not(:first-child),#glbb-profiler table.glbb-grid tr th:not(:first-child){text-align:right}#glbb-queries form{padding:10px 15px;z-index:2}#glbb-queries table.glbb-grid tr{align-items:flex-start;grid-template-columns:80px 1fr} \ No newline at end of file +pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#282c34;color:#abb2bf}.hljs-comment,.hljs-quote{color:#5c6370;font-style:italic}.hljs-doctag,.hljs-formula,.hljs-keyword{color:#c678dd}.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#e06c75}.hljs-literal{color:#56b6c2}.hljs-addition,.hljs-attribute,.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#98c379}.hljs-attr,.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable{color:#d19a66}.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#61aeee}.hljs-built_in,.hljs-class .hljs-title,.hljs-title.class_{color:#e6c07b}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{-webkit-text-decoration:underline;text-decoration:underline}.glbb-close:before{content:"\f335";font-size:26px;margin:-3px 3px 3px -3px}.glbb-globals:before{content:"\f319";margin:1px -1px -1px 1px}.glbb-toggle:before{content:"\f340";margin-right:1px}.glbb-hooks:before{content:"\f469"}.glbb-console:before{content:"\f534"}.glbb-filters:before{content:"\f536"}.glbb-queries:before{content:"\f17e"}.glbb-profiler:before{content:"\f311"}.glbb-templates:before{content:"\f116"}body.blackbar #adminmenu{margin-bottom:46px}@media screen and (min-width:783px){body.blackbar #adminmenu{margin-bottom:32px}}#glbb{--glbb-color-active:#72aee6;--glbb-color-error:#f44336;--glbb-color-warning:#ffc107;--glbb-color-darker-border:rgba(35,40,45,.5);--glbb-color-darker:#1d2327;--glbb-color-dark:#32373c;--glbb-color-icon:rgba(240,245,250,.6);--glbb-color-light:#ccc;--glbb-color-lighter:#f0f0f1;--glbb-font-mono:"Operator Mono",Monaco,Consolas,"Andale Mono","DejaVu Sans Mono",monospace;--glbb-font-sans:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;-webkit-font-smoothing:subpixel-antialiased;-moz-osx-font-smoothing:auto;background-color:#1d2327;background-color:var(--glbb-color-darker);bottom:0;box-sizing:border-box;color:#ccc;color:var(--glbb-color-light);direction:ltr;display:flex;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,Helvetica,Arial;font-family:var(--glbb-font-sans);height:32px;left:0;position:fixed;top:auto;width:100%;z-index:999999}#glbb .hljs{background-color:var(--glbb-color-dark)}#glbb.glbb-mini{width:36px}#glbb.glbb-mini .glbb-toggle:before{transform:rotate(180deg)}#glbb.glbb-mini .glbb-panel-links a:not(.glbb-toggle){display:none}#glbb .glbb-hidden{display:none!important}#glbb .glbb-panel{font-feature-settings:"tnum";-webkit-overflow-scrolling:touch;background-color:var(--glbb-color-dark);bottom:32px;box-sizing:border-box;display:flex;flex-direction:column;font-size:13px;font-variant-numeric:tabular-nums;left:0;max-height:calc(100% - 32px);overflow:auto;overscroll-behavior:contain;position:fixed;right:0}#glbb .glbb-panel a{color:var(--glbb-color-active);font-weight:400;margin:0;padding:0;-webkit-text-decoration:underline;text-decoration:underline}#glbb .glbb-panel a:focus{outline:none;text-decoration-style:dotted}#glbb .glbb-panel .glbb-info{color:var(--glbb-color-lighter);font-weight:600}#glbb .glbb-panel .glbb-warning{color:var(--glbb-color-warning)}#glbb .glbb-panel .glbb-alert,#glbb .glbb-panel .glbb-critical,#glbb .glbb-panel .glbb-emergency,#glbb .glbb-panel .glbb-error{color:var(--glbb-color-error)}#glbb .glbb-panel-links{display:flex;flex:1}#glbb .glbb-panel-links a{align-items:center;background-color:var(--glbb-color-darker);box-sizing:border-box;color:var(--glbb-color-lighter);display:flex;font-family:var(--glbb-font-sans);font-size:13px;font-weight:400;gap:6px;height:32px;justify-content:center;line-height:1;line-height:32px;margin:0;overflow:hidden;padding:0 7px;position:relative;-webkit-text-decoration:none;text-decoration:none;white-space:nowrap;width:40px}#glbb .glbb-panel-links div{display:flex;flex:1;justify-content:flex-end}#glbb .glbb-panel-links span{display:none}#glbb .glbb-panel-links a[data-info]:after{color:var(--glbb-color-light);font-size:12px}#glbb .glbb-panel-links a[data-info].glbb-warning:after{color:var(--glbb-color-warning)}#glbb .glbb-panel-links a[data-info].glbb-error:after{color:var(--glbb-color-error)}@media screen and (min-width:401px){#glbb .glbb-panel-links a{width:44px}}@media screen and (min-width:601px){#glbb .glbb-panel-links a{width:auto}#glbb .glbb-panel-links a.glbb-console:after{content:attr(data-info)}#glbb .glbb-panel-links span{display:inline}}@media screen and (min-width:783px){#glbb .glbb-panel-links a.glbb-hooks:after,#glbb .glbb-panel-links a.glbb-queries:after{content:attr(data-info)}}#glbb .glbb-panel-links a:before{color:var(--glbb-color-icon)}#glbb .glbb-panel-links a:focus{box-shadow:none;outline:none}#glbb .glbb-panel-links a.glbb-active,#glbb .glbb-panel-links a:hover{background-color:var(--glbb-color-dark);color:var(--glbb-color-active)}#glbb .glbb-panel-links a.glbb-active:before,#glbb .glbb-panel-links a:hover:before{color:var(--glbb-color-active)}#glbb .glbb-panel-links a.glbb-close:hover,#glbb .glbb-panel-links a.glbb-close:hover:before{color:#e00}#glbb code,#glbb pre{background-color:var(--glbb-color-dark);background-image:none;border:none;color:var(--glbb-color-light);font-family:var(--glbb-font-mono);font-size:13px!important;line-height:1.5;margin:0;padding:0;white-space:pre}#glbb form{background-color:var(--glbb-color-darker);box-sizing:border-box;display:flex;flex-wrap:wrap;gap:10px;left:0;line-height:normal;margin:0;position:sticky;top:0;width:100%}#glbb label{align-items:center;cursor:pointer;display:flex;font-family:var(--glbb-font-sans);font-size:13px;font-weight:400;gap:.5em;line-height:18px;margin:0;padding:0}#glbb input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--glbb-color-light);background-origin:border-box;border-radius:0;border-width:0;display:inline-block;flex-shrink:0;height:16px;margin:0;padding:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:16px}#glbb input[type=checkbox]:checked{background-image:url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.83%204.89l1.34.94-5.81%208.38H9.02L5.78%209.67l1.34-1.25%202.57%202.4z%27%20fill%3D%27%2332373c%27%2F%3E%3C%2Fsvg%3E");background-position:50%;background-size:20px}#glbb input[type=checkbox]:checked:after,#glbb input[type=checkbox]:checked:before{display:none}#glbb input[type=text],#glbb select{background-color:var(--glbb-color-dark);border-radius:0;border-width:0;box-shadow:none;box-sizing:border-box;color:var(--glbb-color-light);font-family:var(--glbb-font-sans);font-size:13px;font-weight:400;height:24px;line-height:18px;margin:0;padding:3px 10px;width:100%}#glbb input[type=text]::-moz-placeholder{color:var(--glbb-color-light);font-family:var(--glbb-font-sans);font-size:13px;font-weight:400;line-height:18px;opacity:.5}#glbb input[type=text]::placeholder{color:var(--glbb-color-light);font-family:var(--glbb-font-sans);font-size:13px;font-weight:400;line-height:18px;opacity:.5}#glbb input[type=checkbox]:focus{box-shadow:0 0 0 2px var(--glbb-color-dark),0 0 0 3px var(--glbb-color-active);outline:none}#glbb input[type=text]:focus,#glbb select:focus{box-shadow:inset 0 0 0 1px var(--glbb-color-active);outline:none}@media screen and (min-width:480px){#glbb input[type=text],#glbb select{flex:1;max-width:300px}}#glbb table{background:none!important;border:none!important;border-collapse:collapse;color:var(--glbb-color-light);margin:0!important;table-layout:auto;text-align:left;text-shadow:none!important;width:100%}#glbb table td{background:transparent;border-width:0;line-height:1.5;padding:10px 15px;vertical-align:top}#glbb table.glbb-grid thead{position:sticky;top:0;z-index:2}#glbb table.glbb-grid thead tr{background-color:var(--glbb-color-darker);padding:10px 15px}#glbb table.glbb-grid tbody{position:relative;top:-1px;z-index:1}#glbb table.glbb-grid tbody tr{border-top:1px solid var(--glbb-color-darker-border)}#glbb table.glbb-grid tr{grid-column-gap:10px;background-color:var(--glbb-color-dark);border:none;-moz-column-gap:10px;column-gap:10px;display:grid;grid-template-columns:1fr;justify-content:flex-start;padding:5px 15px}#glbb table.glbb-grid tr td,#glbb table.glbb-grid tr th{background:transparent;border:none;font-family:var(--glbb-font-sans);font-size:13px;line-height:1.5;margin:0;padding:0;white-space:nowrap}#glbb table.glbb-grid tr th:first-child{text-align:left}#glbb table.glbb-grid tr td.glbb-row-details{background-color:var(--glbb-color-darker-border);display:grid;grid-column:1/-1;justify-content:flex-start;margin:5px 0;padding:10px 0;text-align:left;white-space:normal}#glbb table.glbb-grid tr.glbb-row-collapsed td.glbb-row-details{display:none}#glbb table.glbb-grid ol{display:flex;flex-direction:column;gap:5px;margin:0;padding:0}#glbb table.glbb-grid li{margin:0 0 0 3ch}#glbb table.glbb-grid td.glbb-row-details li{margin-left:5ch}#glbb table.glbb-grid .glbb-row-toggle{align-items:center;cursor:pointer;display:flex;margin-left:-5px}#glbb table.glbb-grid .glbb-row-toggle:before{transition:transform .15s}#glbb table.glbb-grid tr:not(.glbb-row-collapsed) .glbb-row-toggle:before{transform:rotate(90deg)}#glbb-console.glbb-panel{overflow:hidden}#glbb-console>div{-webkit-overflow-scrolling:touch;overflow:auto;overscroll-behavior:contain}#glbb-console form{background-color:var(--glbb-color-dark);border-top:1px solid var(--glbb-color-darker-border);bottom:0;gap:15px;padding:10px 15px;position:sticky;z-index:2}#glbb-console table.glbb-grid tr{align-items:flex-start;grid-template-columns:10ch 1fr}#glbb-console table.glbb-grid tr td{white-space:normal}#glbb-globals table.glbb-grid tr td.glbb-row-details{overflow:auto;padding:10px}#glbb-globals table.glbb-grid code,#glbb-globals table.glbb-grid pre{background-color:transparent}#glbb-hooks form{padding:10px 15px 0;z-index:1}#glbb-hooks table.glbb-grid tr{align-items:center;grid-template-columns:1fr repeat(4,minmax(100px,10%))}#glbb-hooks table.glbb-grid tr td:not(:first-child):not(.glbb-row-details),#glbb-hooks table.glbb-grid tr th:not(:first-child){text-align:right}#glbb-hooks table.glbb-grid td.glbb-row-details li{margin-left:6.5ch}#glbb-profiler table.glbb-grid tr{align-items:center;grid-template-columns:1fr repeat(2,minmax(100px,10%))}#glbb-profiler table.glbb-grid tr td:not(:first-child),#glbb-profiler table.glbb-grid tr th:not(:first-child){text-align:right}#glbb-queries form{padding:10px 15px;z-index:2}#glbb-queries table.glbb-grid tr{align-items:flex-start;grid-template-columns:80px 1fr} \ No newline at end of file diff --git a/assets/syntax.css b/assets/syntax.css deleted file mode 100644 index b6f61ce..0000000 --- a/assets/syntax.css +++ /dev/null @@ -1 +0,0 @@ -pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#282c34;color:#abb2bf}.hljs-comment,.hljs-quote{color:#5c6370;font-style:italic}.hljs-doctag,.hljs-formula,.hljs-keyword{color:#c678dd}.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#e06c75}.hljs-literal{color:#56b6c2}.hljs-addition,.hljs-attribute,.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#98c379}.hljs-attr,.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable{color:#d19a66}.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#61aeee}.hljs-built_in,.hljs-class .hljs-title,.hljs-title.class_{color:#e6c07b}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{-webkit-text-decoration:underline;text-decoration:underline} \ No newline at end of file diff --git a/changelog.txt b/changelog.txt index f0dc8c7..7510bbb 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,12 +1,14 @@ -= 4.0.0 (2023-02-15) = += 4.0.0 (2023-02-13) = - Added console level filters -- Added trace information to SQL queries - Added sorting to Action/Filter Hooks - Added syntax highlighting to console entries -- Fixed SQL formating +- Added trace information to SQL queries +- Beautified SQL formating +- Changed Profiler usage (use the "trace:start" and "trace:stop" hooks) +- Improved Profiler, it is now also more accurate - Refreshed UI -- Updated Profiler (now uses "trace:start" and "trace:stop" hooks) +- Requires PHP >= 7.3 = 3.1.0 (2023-02-05) = diff --git a/plugin/Controller.php b/plugin/Controller.php index 6fd003d..462672a 100644 --- a/plugin/Controller.php +++ b/plugin/Controller.php @@ -20,9 +20,8 @@ public function __construct(Application $app) */ public function enqueueAssets(): void { - wp_enqueue_script(Application::ID, $this->app->url('assets/main.js')); - wp_enqueue_style(Application::ID, $this->app->url('assets/main.css'), ['dashicons']); - wp_enqueue_style(Application::ID.'-syntax', $this->app->url('assets/syntax.css')); + wp_enqueue_script(Application::ID, $this->app->url('assets/main.js'), [], '4.0.0'); + wp_enqueue_style(Application::ID, $this->app->url('assets/main.css'), ['dashicons'], '4.0.0'); } /** diff --git a/readme.txt b/readme.txt index b307a92..799ace1 100644 --- a/readme.txt +++ b/readme.txt @@ -7,33 +7,25 @@ Stable tag: 4.0.0 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html -Black Bar is a Debug Bar for WordPress developers. It collects and displays errors, executed queries, globals, theme templates, and provides a profiler. +Black Bar is an unobtrusive Debug Bar for WordPress developers that attaches itself to the bottom of the browser window. == Description == -Black Bar is an unobtrusive Debug Bar for WordPress developers that attaches itself to the bottom of the browser window. It is a rewrite of [blackbox-debug-bar](https://wordpress.org/plugins/blackbox-debug-bar/) by [Grzegorz Winiarski](https://profiles.wordpress.org/gwin) which appears to be abandoned as it has not been updated since 2013. +Black Bar is an unobtrusive Debug Bar for WordPress developers. It collects and displays errors, executed SQL queries, slow actions and hooks, theme templates, global variables, and provides a profiler. How it helps you with development: -- Displays any PHP errors that occur when loading a page -- Displays executed MySQL queries and the time it took to execute each query -- Displays the 50 slowest action and filter hooks -- Displays the loaded template files of the active theme -- Inspect global variables (COOKIE, GET, POST, SERVER, SESSION) -- Use the Console for debugging your plugins and themes -- Use the Profiler for measuring the performance of your plugins and themes +- Debug your code with the Console +- Inspect global variables (COOKIE, GET, POST, SERVER, SESSION, WP_Screen) +- Measure performance of your code with the Profiler +- View any PHP errors that occur when loading a page in the Console +- View executed MySQL queries along with execution time and backtrace +- View template files of the active theme in loaded order +- View the 50 slowest action and filter hooks along with callbacks ordered by priority == Installation == -= Automatic installation = - -Log in to your WordPress dashboard, navigate to the Plugins menu and click "Add New". - -In the search field type "Black Bar" and click Search Plugins. Once you have found the plugin you can view details about it such as the point release, rating and description. You can install it by simply clicking "Install Now". - -= Manual installation = - -Download the Black Bar plugin and uploading it to your server via your favorite FTP application. The WordPress codex contains [instructions on how to do this here](https://codex.wordpress.org/Managing_Plugins#Manual_Plugin_Installation). +If you have never installed a WordPress plugin before, you can [read instructions on how to do this here](https://wordpress.org/documentation/article/manage-plugins/). == Frequently Asked Questions == @@ -43,7 +35,7 @@ To add entries to the console, insert the following line of PHP anywhere in your `apply_filters('console', 'Enter something to debug here');` -You can also add a specific log level like this: +You can also add an optional log level like this: `apply_filters('console', 'Enter something to debug here', 'error');` @@ -63,19 +55,22 @@ To use the profiler, insert the following lines of PHP _before_ and _after_ the = How do I enable the plugin for non-administrators? = +By default, Black Bar is only visible to administrator users. To enable it for all logged-in users, add the following code to your child theme's functions.php file: + `add_filter('blackbar/enabled', 'is_user_logged_in');` == Changelog == -= 4.0.0 (2023-02-15) = += 4.0.0 (2023-02-13) = - Added console level filters -- Added trace information to SQL queries - Added sorting to Action/Filter Hooks - Added syntax highlighting to console entries -- Fixed SQL formating +- Added trace information to SQL queries +- Beautified SQL formating +- Changed Profiler usage (use the "trace:start" and "trace:stop" hooks) +- Improved Profiler, it is now also more accurate - Refreshed UI - Requires PHP >= 7.3 -- Updated Profiler (now uses "trace:start" and "trace:stop" hooks) [See changelog for all versions](https://raw.githubusercontent.com/pryley/blackbar/main/changelog.txt). diff --git a/rollup.config.mjs b/rollup.config.mjs index f7ffa7b..ccda98b 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -46,21 +46,4 @@ export default [ }), ] }, - { - input: 'node_modules/@highlightjs/cdn-assets/styles/atom-one-dark.min.css', - onwarn (warning, warn) { - if (warning.code === 'FILE_NAME_CONFLICT') return - warn(warning) - }, - output: { - file: 'assets/syntax.css', - }, - plugins: [ - filesize(), - postcss({ - extract: true, - minimize: true, - }), - ] - }, ]