Page Builder Plugin v0.3.2
Rebuilds the credit module so the customer-site plugin defers entirely to the platform for balances, removing a class of cache-drift and tampering bugs.
Credit System
- Platform-authoritative balances -
CreditManagernow posts every deduction to/wp-json/nitroshock/v1/use-creditson nitroshock.ai and stores only the returned balance in a 60-second transient cache. - No more local ledger writes - the plugin no longer mutates credit state locally.
add_credits()is intentionally a no-op (returnsnot_supported); top-ups happen on the platform. - Removed tamper-detection theatre - the option/transient HMAC hashing and "admin tampering" email notifier are retired. They guarded values the plugin is no longer authoritative for.
- Hourly security cron retired - the legacy
nitroshock_security_checkevent is unscheduled automatically on plugin load.
Improvements
- Slimmer codebase -
CreditManager.phpreduced from ~430 lines to ~240 lines. A.bak-pre-optionAsnapshot of the previous file is kept on disk for reference. - Stable public API -
get_user_credits(),deduct_credits(),refresh_credits_from_api(),get_purchase_history(), and the credits AJAX handler keep their existing signatures.