Skip to content

Commit 22575f1

Browse files
Andrew Bakerclaude
andcommitted
v1.7.45 — Remove debug overlay, restore filemtime cache busting
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ecda61e commit 22575f1

File tree

3 files changed

+25
-46
lines changed

3 files changed

+25
-46
lines changed

assets/cs-perf-monitor.js

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@
1010
(function () {
1111
'use strict';
1212

13-
// ── Debug overlay (remove once iOS click issue is diagnosed) ──────────────
14-
var _dbg = [];
15-
function dbg(msg) {
16-
_dbg.push(msg);
17-
var el = document.getElementById('cs-dbg');
18-
if (el) el.textContent = _dbg.slice(-6).join(' | ');
19-
}
20-
// Runs immediately (before DOMContentLoaded) to confirm script loaded
21-
dbg('SCRIPT_LOADED');
22-
2313
var LS_OPEN = 'cs_perf_open';
2414
var LS_HEIGHT = 'cs_perf_height';
2515
var LS_TAB = 'cs_perf_tab';
@@ -96,34 +86,26 @@
9686
hooksCount = document.getElementById('cs-ptc-hooks');
9787
hookSearch = document.getElementById('cs-hkf-search');
9888

99-
dbg('DCL');
100-
if (!panel) { dbg('NO_PANEL'); return; }
101-
dbg('PANEL_OK');
89+
if (!panel) return;
10290

10391
// Move the help panel to document.body so it's outside the fixed panel
10492
// hierarchy — avoids iOS Safari touch-blocking and overflow:hidden clipping.
10593
var helpPanel = document.getElementById('cs-perf-help');
10694
if (helpPanel) document.body.appendChild(helpPanel);
10795

108-
try {
109-
dbg('N1'); computeN1Patterns();
110-
dbg('PLG'); populatePluginFilter();
111-
dbg('ASP'); populateAssetPluginFilter();
112-
dbg('BAD'); updateBadges();
113-
dbg('TTL'); updateTotalTime();
114-
dbg('CTX'); renderPageContext();
115-
dbg('FLT'); applyFilters();
116-
dbg('LOG'); renderLogs();
117-
dbg('AST'); renderAssets();
118-
dbg('HKS'); renderHooks();
119-
dbg('SUM'); renderSummary();
120-
dbg('RST'); restoreState();
121-
dbg('BIND_START');
122-
bindEvents();
123-
dbg('BIND_DONE');
124-
} catch (e) {
125-
dbg('ERR:' + (e && e.message ? e.message.slice(0, 60) : String(e)));
126-
}
96+
computeN1Patterns();
97+
populatePluginFilter();
98+
populateAssetPluginFilter();
99+
updateBadges();
100+
updateTotalTime();
101+
renderPageContext();
102+
applyFilters();
103+
renderLogs();
104+
renderAssets();
105+
renderHooks();
106+
renderSummary();
107+
restoreState();
108+
bindEvents();
127109
});
128110

129111
// ── Page context strip ────────────────────────────────────────────────────
@@ -192,9 +174,8 @@
192174
}
193175

194176
function togglePanel() {
195-
dbg('TOGGLE');
196-
if (panel.classList.contains('cs-perf-open')) { dbg('CLOSE'); closePanel(); }
197-
else { dbg('OPEN'); openPanel(parseInt(localStorage.getItem(LS_HEIGHT), 10) || DEFAULT_H, true); }
177+
if (panel.classList.contains('cs-perf-open')) closePanel();
178+
else openPanel(parseInt(localStorage.getItem(LS_HEIGHT), 10) || DEFAULT_H, true);
198179
}
199180

200181
// ── Tab switching ─────────────────────────────────────────────────────────
@@ -978,11 +959,10 @@
978959
if (helpBtn && helpBtn.contains(e.target)) return;
979960
togglePanel();
980961
});
981-
toggleBtn.addEventListener('click', function (e) { dbg('BTN_CLK'); e.stopPropagation(); togglePanel(); });
962+
toggleBtn.addEventListener('click', function (e) { e.stopPropagation(); togglePanel(); });
982963
// iOS Safari fallback: touchend fires reliably even when parent has
983964
// overflow/fixed positioning quirks that can swallow click events.
984965
toggleBtn.addEventListener('touchend', function (e) {
985-
dbg('BTN_TCH');
986966
e.preventDefault(); // prevent the follow-up click from double-toggling
987967
e.stopPropagation();
988968
togglePanel();

cs-code-block.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: CloudScale Code Block
44
* Plugin URI: https://andrewbaker.ninja
55
* Description: Syntax highlighted code block with auto language detection, clipboard copy, dark/light mode toggle, code block migrator, and read only SQL query tool. Works as a Gutenberg block and as a [cs_code] shortcode.
6-
* Version: 1.7.44
6+
* Version: 1.7.45
77
* Author: Andrew Baker
88
* Author URI: https://andrewbaker.ninja
99
* License: GPL-2.0-or-later
@@ -38,7 +38,7 @@
3838
*/
3939
class CloudScale_Code_Block {
4040

41-
const VERSION = '1.7.44';
41+
const VERSION = '1.7.45';
4242
const HLJS_VERSION = '11.11.1';
4343
const HLJS_CDN = 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/';
4444
const TOOLS_SLUG = 'cloudscale-code-sql';
@@ -1633,8 +1633,8 @@ public static function perf_enqueue( string $hook ) {
16331633
if ( ! current_user_can( 'manage_options' ) ) {
16341634
return;
16351635
}
1636-
// Temporarily using time() to force cache bust while debugging iOS click issue.
1637-
$bust = time();
1636+
$base = plugin_dir_path( __FILE__ ) . 'assets/';
1637+
$bust = filemtime( $base . 'cs-perf-monitor.css' );
16381638
wp_enqueue_style(
16391639
'cs-perf-monitor',
16401640
plugins_url( 'assets/cs-perf-monitor.css', __FILE__ ),
@@ -1869,8 +1869,8 @@ public static function perf_frontend_enqueue() {
18691869
if ( ! current_user_can( 'manage_options' ) ) {
18701870
return;
18711871
}
1872-
// Temporarily using time() to force cache bust while debugging iOS click issue.
1873-
$bust = time();
1872+
$base = plugin_dir_path( __FILE__ ) . 'assets/';
1873+
$bust = filemtime( $base . 'cs-perf-monitor.css' );
18741874
wp_enqueue_style(
18751875
'cs-perf-monitor',
18761876
plugins_url( 'assets/cs-perf-monitor.css', __FILE__ ),
@@ -2360,7 +2360,6 @@ private static function perf_panel_html(): string {
23602360
. '<div id="cs-perf-resize" title="Drag to resize"></div>'
23612361
. '<div id="cs-perf-header">'
23622362
. '<div class="cs-perf-hl">'
2363-
. '<div id="cs-dbg" style="position:fixed;bottom:52px;left:0;right:0;background:#c00;color:#fff;font-size:11px;padding:2px 8px;z-index:999999;font-family:monospace;pointer-events:none">debug init…</div>'
23642363
. '<button id="cs-perf-toggle" class="cs-perf-monitor-btn" title="Toggle panel (Ctrl+Shift+M)" aria-expanded="false">'
23652364
. '<span class="cs-perf-logo">&#9889;</span>'
23662365
. '<span class="cs-perf-name">CS&nbsp;Monitor</span>'

readme.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: code block, syntax highlighting, gutenberg block, dark mode, highlight.js
44
Requires at least: 6.0
55
Tested up to: 6.7
66
Requires PHP: 7.4
7-
Stable tag: 1.7.44
7+
Stable tag: 1.7.45
88
License: GPLv2 or later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -79,7 +79,7 @@ Yes. Press Enter to run the query. Use Shift+Enter to insert a newline. Ctrl+Ent
7979

8080
== Changelog ==
8181

82-
= 1.7.44 =
82+
= 1.7.45 =
8383
* Added: CS Monitor — Assets tab showing all enqueued JS and CSS files with plugin attribution, type filter, and search
8484
* Added: CS Monitor — Hooks tab showing top 50 hooks by cumulative time, with sortable columns and search
8585
* Added: CS Monitor — Object cache stats card in Summary (hit rate, hits/misses, persistent cache detection)

0 commit comments

Comments
 (0)