- PHP 94.7%
- TypeScript 3.6%
- Hack 0.9%
- JavaScript 0.7%
- CSS 0.1%
| .github/workflows | ||
| assets | ||
| src | ||
| templates | ||
| tests | ||
| .gitignore | ||
| changelog.txt | ||
| composer.json | ||
| composer.lock | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| phpunit.xml.dist | ||
| README.md | ||
| spacebring.php | ||
| tsconfig.json | ||
| vite.config.js | ||
Spacebring for WordPress
Spacebring for WordPress synchronizes public locations and resources from Spacebring into WordPress and renders upcoming public events with the [spacebring_events] shortcode.
Spacebring remains the system of record and booking application. WordPress acts as a public presentation layer and links visitors to configured Spacebring portal pages.
Features
- Spacebring customer API authentication
- Encrypted credential storage, with
wp-config.phpconstant overrides - Explicit all-locations or single-location display selection
- Selectable synchronization for all 12 documented resource types
- Capacity, pricing, plans, schedule, permissions, duration, check-in, refund, and parent metadata
- Filterable Spacebring booking deep links for every resource
- Public-visibility enforcement for resources and events
- Complete cursor pagination for list endpoints
- Durable, privacy-allowlisted event snapshots with last-known-good fallback
- Background event refreshes every 30 minutes
- Automatic synchronization every six hours, twice daily, or daily
- Overlap protection, retry/backoff, stale-record reconciliation, and sync status
- Persistent 30-day sync history, Site Health checks, and WP-CLI commands
- Svix-compatible signed, timestamp-checked, idempotent webhook receiver
- Multiple-location event aggregation
- Upcoming, public, uncanceled event filtering
- Multi-instance event list/calendar shortcode
- Theme-overridable frontend templates
Requirements
- WordPress 6.2 or newer
- PHP 8.0 or newer with OpenSSL
- Composer for source installations
- Node.js 18 or newer for frontend development
Installation from source
composer install --no-dev --optimize-autoloader
npm ci
npm run build
Place the plugin directory in wp-content/plugins, then activate Spacebring in WordPress.
Configuration
Open Spacebring → Settings and enter the Spacebring customer API username and password. Configure the portal base URL to enable event links.
For managed environments, credentials can be supplied without storing them in the database:
define('SPACEBRING_API_USERNAME', 'your-client-id');
define('SPACEBRING_API_PASSWORD', getenv('SPACEBRING_API_PASSWORD'));
Do not commit credentials to source control. Spacebring content that is not marked public is never publicly published by this plugin.
To enable webhook-driven refreshes, save the signing secret and configure this endpoint in Spacebring:
https://your-wordpress-site.example/wp-json/spacebring/v1/webhook
Webhook requests are verified against the raw body, timestamp, message ID, and signature. Only receipt metadata is retained; webhook payloads are not stored.
Synchronization behavior
The automatic schedule is configured under Spacebring → Synchronization. A complete successful run:
- Fetches current locations.
- Retrieves every page of each selected resource type for every location.
- Creates or updates the corresponding WordPress posts.
- Keeps non-public resources private.
- Drafts imported records that disappeared from a fully successful upstream scope.
Failed or partial scopes are not reconciled, preventing transient API failures from removing valid content. A manual sync can be run from the same page.
Upcoming events are stored in a dedicated WordPress table using an explicit public-field allowlist. Frontend requests normally read this local snapshot, reducing API traffic and keeping the calendar available during a Spacebring outage. A failed location refresh never replaces that location's last-known-good data.
Events shortcode
[spacebring_events]
[spacebring_events limit="10"]
[spacebring_events assets="false"]
The shortcode displays upcoming public events across synchronized locations. Set the Spacebring portal URL in plugin settings to link each event back to Spacebring.
Override the template by copying:
templates/frontend/shortcodes/events.php
to:
your-theme/spacebring/shortcodes/events.php
Development
composer install
composer test
composer audit --locked
npm ci
npm run typecheck
npm run build
Production cron and diagnostics can use:
wp spacebring status
wp spacebring sync
wp spacebring events
Privacy and security
The plugin intentionally does not synchronize bookings, memberships, visitors, invoices, transactions, or other customer records. Sync logs contain operational summaries rather than complete API payloads.
Report security issues privately to the repository owner instead of opening a public issue.
License
MIT