wp-admin guard and null result guard shipped
What this is
2 session-breaking bugs were found in live testing and fixed in a single release. The first: if you clicked an element that was part of the WordPress admin bar, Lens ran a diagnosis on it, consumed a credit, and returned a result for an element that only exists for logged-in admins. The fix built a 3-layer guard: content.js flags is_wp_admin via closest(‘#wpadminbar’), popup.js checks the flag before entering the confirming state, and lens-diagnose.ts verifies server-side. The guard was verified live against span.ab-icon, an admin bar element that had been picked in testing without the user realising it.
The second: if the AI returned an empty result, the popup showed a blank screen and still decremented the credit. The null result guard fixed this. When claudeResult is null, the session row is flagged null_result: true, no credit is decremented, and the popup shows a specific message instead of a blank screen.
What it answers
– why did loupely lens diagnose my wordpress admin bar
– does loupely lens charge me if it diagnoses the wrong element
– what happens if loupely lens returns an empty diagnosis
– does loupely lens refund credits for a null result
– how does loupely lens detect the wordpress admin bar
Why we built it
A credit charged for a null result and a credit charged for an admin bar element are both the same broken promise. Both were caught in testing and fixed before any paying user could hit them.
- Wp-admin guard added to content.js: is_wp_admin flagged via closest('#wpadminbar') and written to capture meta
- Wp-admin check added to popup.js: handleSuccessfulCapture checks is_wp_admin before showConfirmingState(), clears keys and shows idle if true
- Wp-admin guard added to lens-diagnose.ts: server-side guard uses DOM flag only (session_fields.is_wp_admin), stylesheet-origin branch removed to prevent false positives on front-end WordPress pages
- Null result guard added to lens-diagnose.ts and popup.js: empty claudeResult flags null_result: true on the session row, skips credit decrement, shows specific popup message
- Admin bar picks no longer consume a credit or run a diagnosis; popup returns to idle with a specific message
- Empty AI responses no longer consume a credit; null result guard catches the failure before it reaches the user