WB Gamification 1.5.0 - Conversion-ledger fix, silent-failure hardening, security scoping
Second bug-sweep release. Closes 21 reported issues across blocks, admin, notifications, and integrations. Adds a manual-award admin UI, a circuit-breaker for runaway Action Scheduler state, and two new local-CI gates that catch the bug classes we hit during the sweep before they ship again.
- New - Manual-award form on the Badge edit screen lets admins grant any rule-driven or manually-awarded badge to a chosen member without writing SQL.
- New - MemberUploadCap engine grants the upload_files capability to members only while the Submit Achievement editor is rendering and during the media-upload action, so the Add Media button works for non-admins without exposing the full Media Library. Opt-out filter wb_gam_grant_member_uploads.
- New - Action Scheduler circuit-breaker plus drain CLI (wp wb-gamification as drain) for sites whose actionscheduler_actions table has grown past safe limits.
- New - Local-CI gate 2.13 boot-invariants detects class_exists guards above top-level class declarations (the root cause of the silent boot failure that hid the admin menu on one install).
- New - Local-CI gate 2.14 enforces the seed-default-badge contract so every default badge condition (action_count, point_milestone) matches the badge name's literal action.
- Improve - Toast notifications now use the WordPress Heartbeat fast interval (5 s) on gamification surfaces so realtime feedback feels immediate.
- Improve - Earning Guide card layout puts the action label below the icon and points row so long action names no longer wrap vertically inside a cramped middle column.
- Improve - Cohort Rank block gets tier-coloured accents (Bronze / Silver / Gold / Diamond) driven by a data-tier attribute and per-tier CSS variables.
- Improve - Community Challenges block ships a proper completed-state visual treatment (green pill plus gradient card) so completed challenges read distinctly from active ones.
- Improve - User Status Bar block uses an SVG-mask chevron toggle and exposes a theme-aware top offset so the sticky panel sits below custom theme admin bars.
- Improve - Activity Stream block alignment tightened to match the Reign-stack social-feed conventions.
- Fix - Point-type conversion now credits the destination currency. The conversion path previously debited the source point type but never wrote the credit (a broken transaction nesting plus a duplicate-key write), so members lost points on every conversion. Conversions now run as one atomic debit-plus-credit sharing a single audit event.
- Fix - Badge award conditions are saved atomically. A failed save no longer leaves a badge with no condition (which silently stopped it from auto-awarding); the editor now reports an error instead of a false success.
- Fix - API key creation verifies the key was stored before returning it, so admins are never handed a key that was never persisted and can never authenticate.
- Fix - Submission approval only marks a submission approved once its points award succeeds; on failure the submission stays pending instead of approving with zero points awarded.
- Fix - Admin REST writes across challenges, community challenges, levels, rules, webhooks, rewards, and badges now return a 500 on a database failure instead of silently reporting success, and multi-row deletes roll back together.
- Fix - Deactivating the plugin now clears every scheduled cron hook, leaving no orphaned events behind.
- Security - The member upload_files grant is scoped to the achievement-submission flow instead of being granted site-wide to every logged-in user, closing a privilege-escalation and storage-abuse vector on open-registration communities.
- Fix - Setup Wizard now triggers on first activation in CLI and one-click sandbox flows; Installer::maybe_install on plugins_loaded@0 covers restore-from-backup and container clone scenarios that bypassed the activation hook.
- Fix - WooCommerce purchase events fire on woocommerce_payment_complete instead of woocommerce_order_status_completed so members earn points the moment the gateway confirms payment, not whenever an admin manually marks the order complete. First-purchase detection counts processing and completed orders together.
- Fix - Redemption email events are now whitelisted in EmailSettingsController so the per-event toggle actually sends the redemption confirmation email when enabled.
- Fix - Redemption Store block reads stock=0 as Unlimited (not Out of stock) to match the documented admin contract.
- Fix - Hub Challenges card now surfaces in-flight community challenges alongside personal challenges and uses a panel_blocks array so the hub can mount multiple blocks per panel.
- Fix - Community challenge bonus award no longer dead-letters; CommunityChallengeEngine listens on its own wb_gam_community_bonus_award AS hook and routes through PointsEngine::award for every contributor.
- Fix - Completed community challenges remain visible until their expiry instead of vanishing the instant the global goal is hit; CommunityChallengeEngine::get_visible() returns active plus completed-but-not-expired entries.
- Fix - Cohort tier names edited from the Cohort Settings admin page now flow through to the Cohort Rank block via CohortEngine::get_tier_name() which reads wb_gam_cohort_settings before falling back to the TIERS constant.
- Fix - Duplicate toast notifications eliminated via a Set-based dedupe in assets/js/toast.js keyed on toast id or content fingerprint, closing the cursor-race that produced repeated bubbles.
- Fix - Default badge conditions corrected to match their names: First Post, Prolific Writer, and Content Creator track wp_publish_post action_count; First Comment and Engaged Reader track wp_leave_comment action_count. Replaces the 50-points placeholder that previously fired on the wrong trigger.
- Fix - LeaderboardNudge no longer enters infinite Action Scheduler recursion on databases where points_changed broadcasts can re-enter the dispatcher. Closes the 3.5M-row runaway encountered on one production install.
- Fix - Class-hoist guard at the top of wb-gamification.php removed; the guard ran against an already-hoisted top-level class declaration and silently aborted boot, hiding the Gamification admin menu on affected installs. Local-CI 2.13 now prevents the regression.
- Dev - Manifest v2.2 refreshed end-to-end; audit/derived/ now caches 16 static-analysis sub-checks including the new boot-hoist-guards finder.
- Dev - plan/ and audit/ folders consolidated; the single plan/MASTER-CHECKLIST.md replaces every dated release plan, bug-sweep spec, and UX-audit markdown that previously accumulated under plan/.