Architecture

How the EpassCard WordPress plugin connects membership, event, and gift card data to the EpassCard API.

Data flow

WordPress (membership / events / gift cards) │ ▼ EPC_Module (integration) │ hooks: create, renew, status, reminders ▼ EPC_Pass_Service::sync_pass() │ mapping + source values → API payload ▼ EPC_Api_Client → EpassCard REST API │ ▼ EPC_DB (epc_passes, epc_api_logs)

Key components

ClassRole
EPC_PluginBootstrap, module registry
EPC_Module_LoaderLoad module files and classes
EPC_ModuleAbstract integration (mapping UI, hooks)
EPC_Pass_ServiceCreate/update passes from mappings
EPC_Api_ClientHTTP client, templates, pass CRUD
EPC_DBepc_passes table
EPC_Api_LogRequest/response logging
EPC_Pass_Emailwp_mail delivery
EPC_Pass_NotificationsPush cron, dedupe, send helpers
EPC_FrontendMy Account, shortcode
EPC_ConnectionEncrypted API key storage

Pass identity

  • module — slug (e.g. memberpress, event_tickets, pw_gift_cards)
  • source_id — integration record id (subscription, attendee, booking, gift card, etc.)
  • entity_id — product / level / ticket / event id
  • user_id — WordPress user (when available)

Built-in modules

  • modules/module-memberpress.php
  • modules/module-paid-memberships-pro.php
  • modules/module-simple-membership.php
  • modules/module-ultimate-membership-pro.php
  • modules/module-woocommerce-subscriptions.php
  • modules/module-event-tickets.php
  • modules/module-events-manager.php
  • modules/module-pw-gift-cards.php
  • modules/module-yith-gift-cards.php

Prefixes

Functions epc_* · Classes EPC_* · Options/tables epc_*

Boot order

plugins_loaded (20) → EPC_Plugin::boot(): DB upgrade, API log, email, frontend, crons, admin menu, enabled modules.

Register custom modules on plugins_loaded priority 10 or earlier.

Push notification flow

MemberPress / WCS reminder hook Daily cron (UMP, PMPro, Simple Membership, │ Event Tickets, Events Manager, PW, YITH) │ │ ▼ ▼ build_push_notification_copy() │ ▼ EPC_Pass_Notifications::send_for_pass() │ ▼ POST /send-pass-notification/{passUuid}

Push notifications (developer)