v1.0.5 — capture-phase click + test-mode diagnostics
Fixes silent click-trigger failures on Divi pages + adds debugging console logs in test mode.
What changed
- The click-trigger listener now runs in capture phase at the document root. Previously it ran in bubble phase, which meant any Divi module along the click path that calls `event.stopPropagation()` would swallow the event before our handler ever saw it. Capture phase fires first, before any descendant can stop the event.
- Test-mode console diagnostics. While test mode is on, the plugin logs to the browser DevTools console (F12 → Console):
- On init: the triggers / frequency / testMode state.
- On click-trigger setup: how many elements currently match the configured selector (or a warning if the selector is invalid CSS).
- On every click anywhere on the page: the target element and whether it matched the configured selector.
- When the popup shows.
- The live site emits nothing — diagnostics are scoped to test mode only.
Debugging a click trigger that isn't firing
- Enable test mode on the page with your trigger button.
- Open DevTools → Console (F12 → Console tab).
- Reload the page. You should see `[AQM Popup] Initialized.` and a line listing how many elements match your selector.
- Click your trigger button. A line like `[AQM Popup] Click event — target: matched selector? true` should appear.
- If `matched selector?` is `false`, your selector doesn't match the button — sanity-check by running `document.querySelectorAll('your-selector')` in the console.