Architecture
Developer reference: This section is for theme and plugin developers extending Booking Engine Connector.
Reference diagrams use Mermaid. PHP namespaces live under BookingEngineConnector\.
Overview
The plugin:
- Loads the PSR-4 autoloader (
includes/), definesBEC_*constants, runsbootstrap.php(database migrations), thenPlugin::instance()->init(). - On activation: incremental migrations, default options (sync interval, fallback/checkout defaults), schedules WP-Cron.
- On
plugins_loaded: template helpers, text domain, registration of search/front/admin/sync/CPT/field registries/shortcodes/Elementor query hook.
Elementor Pro (Loop Grid)
BookingEngineConnector\Elementor\AvailabilityQueryFilter registers Elementor’s action elementor/query/{query_id} (default query id bec_available_only, overridable via bec_elementor_availability_query_id). It narrows the Loop Grid using QuoteService::getQuote() and the current SearchContext.
Developer filters: bec_elementor_availability_query_id, bec_elementor_available_post_ids, bec_elementor_availability_max_units.
User-facing setup: Elementor — hide units with no availability.
Bootstrap & module registration
Layered architecture
Sync sequence
Front flow — query string → quote → CTA or fallback
URL parameters include bec_checkin, bec_checkout, optional occupancy keys (See SearchContext).
Shortcodes reuse the same services (SearchForm, CheckoutUrlService, QuoteService, etc.).
Kross provider internals
Directory mind map
Concept map
| Area | Responsibility |
|---|---|
| Remote inventory | ProviderInterface::fetchRemoteUnits() |
| Persisted posts/meta | SyncService + canonical core fields + optional mapped meta |
| Booking context | SearchContext built from bec_* query args |
| Extensibility | Filters/actions prefixed bec_* |