Skip to main content

Version Docs Updated

Purpose

MHM Rentiva uses a three-layer communication architecture ("Nervous System") to manage user interactions and synchronize data across modules: AJAX, REST API (v1), and the Interactivity API.

🧠 Nervous System: Communication Channels

The plugin's internal communication architecture is optimized for high performance and low latency.


⚑ 1. AJAX Layer (admin-ajax.php)​

The primary channel used for Vendor dashboard and front-end form interactions.

Hook (Action)Responsible ControllerFunction
mhm_fetch_vendor_statsAnalyticsControllerFetches dashboard KPI and Sparkline data.
mhm_request_payoutPayoutAjaxControllerInitiates payout requests atomically.
mhm_rentiva_filter_resultsSearchResultsFilters the vehicle list without a page reload.
mhm_approve_ibanVendorOnboardingControllerApproves IBAN changes from the admin panel.

🌐 2. REST API v1 (mhm-rentiva/v1)​

The architecture that communicates with external services (payment providers, mobile apps) and handles complex configurations.

Core Endpoints:​

  • /locations: Provides geographic location data for the Transfer and Booking modules.
  • /health: Audits database tables, license status, and the PHP environment.
  • /payouts/{id}/callback: Uses HMAC verification to reject unsigned requests from payment systems.
  • /availability: Performs real-time calendar availability checks and price calculation via the Pricing Engine.

πŸ§ͺ 3. Interactivity API (WP 6.5+)​

Used for block-based and reactive interfaces in line with WordPress's new standards.

  • mhmLive.endpoint: Used to reflect a server-side state change on the frontend in real time (e.g., Favorites counter).
  • Filtering: Provides asynchronous data loading using data-wp-context.
  • Micro-interactions: Button animations and form validation feedback use this layer.

πŸ›‘οΈ 4. Security and Verification​

The following security layers are required across all communication channels:

  • Nonce (CSRF): Verification of the _wpnonce field on every AJAX request.
  • Capability: Role-based access control via current_user_can.
  • AuthHelper: API key-based verification for external access.

Section Summary​

  • AJAX is optimized for user dashboard interactions.
  • REST API v1 is the gateway to system integrity and the outside world.
  • The Interactivity API offers reactive methods for a modern, fluid user experience.

Changelog​

DateVersionNote
23.04.20264.27.2English translation added.
19.03.20264.21.2Interactivity API and AJAX audit details added.