eternal-wall-monument

byBachir Djoukbala

# PROMPT: Build "The Eternal Wall" WordPress Plugin (v2.0) Build a complete, production-ready WordPress plugin ZIP called "The Eternal Wall" (eternal-wall-v2.0.0.zip). ## 1. Concept & Business Rules The Eternal Wall is a pay-to-enter digital monument where visitors pay to inscribe their name permanently on a 2D interactive stone wall. - Sealed Wall: The full wall is accessible ONLY to logged-in users who have at least 1 paid, permanent inscription (and admins). Visitors see a blurred teaser wall and a live counter of carved names. - Permanent: Confirmed inscriptions can NEVER be edited, updated, or deleted by anyone (including admins). Enforced via MySQL BEFORE UPDATE/DELETE triggers + PHP model guards. - Carve Again: Carvers can purchase additional inscriptions anytime. ## 2. Server-Authoritative Pricing - Base: $1.00 USD per 10 characters, rounded up (1-10 chars = $1, 11-20 = $2 ... 91-100 = $10). Max 100 characters. - Graphemes: Emojis and composite symbols count as 1 character (grapheme_strlen with PCRE \X fallback). - Premium: Optional +$20 USD upgrade (burnished gold slab, double width, glowing border). - Currency: Store price in USD, charge customer in DZD (Algerian Dinar) using an admin-configurable rate (default: 135 DZD/USD). ## 3. Payment Gateway: Chargily Pay v2 (Algeria) Support Algerian CIB & EDAHABIA cards. Do not hardcode secret keys. - Endpoints: https://pay.chargily.net/api/v2 (live) and /test/api/v2 (test). - Flow: Frontend selects text, coords, premium -> server quotes price and creates pending record -> server calls Chargily POST /checkouts with Bearer token -> returns checkout URL. - Webhook (/wp-json/eternal-wall/v1/webhook/chargily): Verify HMAC-SHA256 in "signature" header using webhook secret. Zero-trust: fetch checkout status directly from Chargily API. If status=paid, idempotently finalize inscription and assign sequential number. - Architecture: Abstract EW_Payment_Gateway interface so other providers can be added later. ## 4. File Structure (PHP 7.4+ compatible, prefix EW_ / ew_) eternal-wall/ ├── eternal-wall.php # Plugin header, constants (EW_VERSION 2.0.0), activation/deactivation ├── uninstall.php # Safe uninstall (never drops inscriptions table) ├── readme.txt # Setup guide, shortcode instructions ├── includes/ │ ├── class-ew-plugin.php # Singleton bootstrap │ ├── class-ew-settings.php # Options: Chargily keys, test mode, DZD rate, Google OAuth │ ├── class-ew-pricing.php # Server quote & grapheme counter │ ├── class-ew-security.php # Nonces, rate limits, access checks (can_view_wall) │ ├── class-ew-database.php # dbDelta tables & immutability triggers │ ├── class-ew-inscriptions.php # Model, 2D coordinates, viewport queries │ ├── class-ew-payment-gateway.php# Gateway interface │ ├── class-ew-chargily.php # Chargily Pay v2 implementation │ ├── class-ew-payments.php # Quote verification & checkout orchestration │ ├── class-ew-webhooks.php # Replay-protected webhook receiver │ ├── class-ew-auth.php # Native WP sign-up/login + Google OAuth │ ├── class-ew-rest-api.php # Endpoints: /count, /me, /wall, /checkout, /webhook/chargily │ └── class-ew-shortcode.php # [eternal_wall] shortcode dispatcher ├── admin/ │ ├── class-ew-admin.php # Admin menu & assets │ ├── class-ew-admin-dashboard.php# Counter stats & connection tester │ ├── class-ew-admin-inscriptions.php # Read-only inscription browser (no delete action) │ └── class-ew-admin-settings.php # Settings form with masked secret keys ├── public/ │ ├── css/eternal-wall.css # Scoped (.ew-root) dark stone & gold theme │ └── js/ │ ├── eternal-wall-canvas.js # 2D zoom/pan stone canvas with viewport culling │ ├── eternal-wall-carve.js # Live stone slab preview, grapheme counter, checkout │ └── eternal-wall-search.js # Search by text/#number with auto-pan to coordinates └── templates/ ├── landing.php # Ghost teaser wall, counter, "Pay to Enter" CTA ├── auth.php # Login/register tabs + Google OAuth button ├── carve.php # Carving workshop, slab preview, spot picker ├── wall.php # Interactive 2D pannable wall └── sealed.php # "The wall is sealed" gatekeeper message ## 5. Database Schema 1) wp_eternal_wall_inscriptions: - id (BIGINT UNSIGNED AUTO_INCREMENT PK) - number (BIGINT UNSIGNED UNIQUE NULLABLE) # Sequential #1, #2... assigned only on confirmation - user_id (BIGINT UNSIGNED) - content (VARCHAR(191)) - char_count (INT UNSIGNED) - is_premium (TINYINT(1) DEFAULT 0) - status (VARCHAR(20) DEFAULT 'pending') # pending, confirmed, failed - coord_x (INT), coord_y (INT) - amount_dzd (DECIMAL(10,2)), amount_usd (DECIMAL(10,2)) - gateway (VARCHAR(50) DEFAULT 'chargily') - payment_ref (VARCHAR(191) UNIQUE) - created_at (DATETIME), confirmed_at (DATETIME NULL) 2) wp_eternal_wall_events: - id, event_id (UNIQUE), gateway, payload (LONGTEXT), processed_at (DATETIME) 3) Triggers: ew_no_delete & ew_no_update on wp_eternal_wall_inscriptions. If OLD.status = 'confirmed', SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Permanent inscriptions cannot be modified or deleted.'. ## 6. Frontend & Shortcode: [eternal_wall] - Landing (Visitor): Monumental hero, live counter of inscribed souls, blurred teaser wall, "Pay to Enter" button. - Carve Room (Logged-in): Textarea (1-100 graphemes), real-time chiseled stone preview, premium toggle, 2D coordinate spot picker, live DZD/USD price, permanence agreement checkbox, "Pay & Carve Forever" button. - Wall View (Paid Carver/Admin): Full 2D canvas with drag-to-pan, pinch/scroll zoom, viewport culling (only renders visible slabs). Search box auto-pans to slab. Regular slabs = dark stone; Premium = gold double-width with glow. "Carve Again" top-bar button. ## 7. Design System - Scoped to .ew-root to avoid theme collisions. - Colors: Deep obsidian (#0B0E14, #121721), stone gray (#1E2533, #2A3447), burnished gold (#D4AF37, #F3E5AB, #996515). - Fonts: Monumental serif headings (Cinzel/Spectral), clean sans-serif body. Generate all code files following this structure, ensure syntax validity, and package into the final plugin ZIP.

landing.php
landing.php

Comments (0)

No comments yet. Be the first!

Architecture

The Eternal Wall - Service and Runtime Networkv1
External
Storage
WordPress Plugin Runtime eternal-wall
Eternal Wall Frontend
Client
Chargily Pay v2 Live and Test
Google OAuth
wp_eternal_wall_inscriptions
wp_eternal_wall_events
WordPress Options Settings
eternal_wall Shortcode Dispatcher
REST API wp-json eternal-wall v1
EW_Pricing Server Quote
EW_Payments Checkout Orchestration
EW_Webhooks Replay Protected Receiver
EW_Security can_view_wall
EW_Auth Native and Google OAuth
EW_Payment_Gateway Interface
Landing Teaser Wall and Counter Gauge
Carve Room Interface
2D Wall Canvas and Search
Admin Dashboard Settings Inscriptions
Visitor Carver and Administrator Browser
landing.php design preview
landing.php: View teaser and counter
auth.php: Sign in as admin
Dashboard: View counter stats
Dashboard: Run connection test
Settings: Configure Chargily keys
Settings: Set DZD rate
Settings: Save settings
Dashboard: Retest connection
Inscriptions: Browse inscriptions
wall.php: View full wall
wall.php: Search by name
landing.php design preview
landing.php: View teaser and counter
auth.php: Sign in as admin
Dashboard: View counter stats
Dashboard: Run connection test
Settings: Configure Chargily keys
Settings: Set DZD rate
Settings: Save settings
Dashboard: Retest connection
Inscriptions: Browse inscriptions
wall.php: View full wall
wall.php: Search by name