WSA Agenda
WordPress plugin: calendar and events for Watersportvereniging Amstelveen
by WSA Watersport · github.com/wsawatersport/wsa-agenda · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/wsawatersport/wsa-agenda/archive/refs/heads/main.zipReadme
WSA Agenda — WordPress Plugin
Custom agenda/calendar plugin for WSA Watersport. No third-party calendar plugins. Built for WordPress 6.0+, PHP 8.0+.
Installation
- Upload the
wsa-agenda/folder to/wp-content/plugins/. - Activate the plugin via Plugins → Geïnstalleerde plugins.
- On activation the plugin:
- Creates the
/agendapage with[wsa_agenda]shortcode. - Seeds the default event categories with their colours.
- Creates the
wp_wsa_rsvp,wp_wsa_vacations, andwp_wsa_ics_feedsdatabase tables. - Registers the
wsa_boarduser role.
- Creates the
Adding board members
Board members can create, edit, and delete events, and manage categories/vacations/ICS feeds.
Option A — manually set the role:
- Go to Users in the WordPress admin.
- Edit the desired user.
- Change their role to WSA Bestuur.
Option B — via Google/Apple SSO:
Users who log in via SSO are created as subscriber by default. An admin must then upgrade them to wsa_board via Users → Edit. (See notes in class-sso.php if you want auto-promotion.)
Configuring Google OAuth
- Go to Google Cloud Console → APIs & Services → Credentials.
- Create an OAuth 2.0 Client ID (type: Web application).
- Add the following as an authorised redirect URI:
https://yourdomain.nl/wp-json/wsa/v1/sso/google/callback - In WordPress: WSA Agenda → Instellingen, paste your Client ID and Client Secret.
Configuring Apple SSO
- Sign in to Apple Developer → Certificates, Identifiers & Profiles.
- Create a Services ID (e.g.
nl.wsawatersport.login). - Enable Sign in with Apple for it and add redirect URL:
https://yourdomain.nl/wp-json/wsa/v1/sso/apple/callback⚠️ Apple requires HTTPS and a verified domain.
- Generate a Key with Sign in with Apple enabled. Download the
.p8file. - In WordPress: WSA Agenda → Instellingen, fill in:
- Services ID (the client ID you created above)
- Team ID (10-character code from your developer account)
- Key ID (shown in your key list)
- Private Key — paste the entire content of the
.p8file, including the-----BEGIN PRIVATE KEY-----and-----END PRIVATE KEY-----lines.
Managing the calendar
| Screen | Path |
|---|---|
| View all events | WSA Agenda → Evenementen |
| Categories | WSA Agenda → Categorieën |
| School vacations | WSA Agenda → Vakanties |
| ICS feeds | WSA Agenda → ICS Feeds |
| SSO settings | WSA Agenda → Instellingen |
| Export/Import | Tools → WSA Agenda Migratie |
Public holidays are fetched automatically from date.nager.at for the Netherlands (cached 7 days). No configuration needed.
Sandbox → Production migration
On the sandbox server
- Go to Tools → WSA Agenda Migratie.
- Review the pre-migration checklist — all items should be green (⚠️ warnings about old events are non-blocking).
- Click Exporteren als JSON. A file like
wsa-agenda-export-YYYY-MM-DD.jsonwill download.
On the production server
- Install and activate the WSA Agenda plugin.
- Configure OAuth credentials (they are NOT included in the export).
- Go to Tools → WSA Agenda Migratie.
- Upload the JSON file.
- Select a mode:
- Samenvoegen — adds/updates events without removing existing ones. Safe for incremental syncs.
- Vervangen — deletes all existing events first, then imports. Use for initial migration.
- Click Dry-run to preview what will happen.
- Click Import uitvoeren to apply.
The import:
- Upserts events by their stable
wsa_event_uuid. - Re-downloads attachments from sandbox URLs and registers them in the production Media Library.
- Upserts categories by slug, vacations by name+dates, ICS feeds by URL.
- Returns a completion report: N aangemaakt, M bijgewerkt, K overgeslagen.
RSVP registrations and OAuth credentials are never exported.
REST API
Base URL: https://yourdomain.nl/wp-json/wsa/v1
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /events?start=ISO&end=ISO&category=slug |
Public | List events in range |
| GET | /events/{id} |
Public | Single event (full detail + attachments) |
| POST | /events |
Board | Create event |
| PATCH | /events/{id} |
Board | Update event |
| DELETE | /events/{id} |
Board | Delete event |
| GET | /public-blocks?start=ISO&end=ISO |
Public | Merged public blocks (holidays, vacations, ICS) |
| POST | /events/{id}/rsvp |
Public | Register RSVP |
| GET | /events/{id}/rsvp |
Board | List RSVPs |
| GET | /events/{id}/rsvp/csv |
Board | Download RSVP as CSV |
| GET | /categories |
Public | List categories |
All write endpoints require a valid X-WP-Nonce header (nonce action: wp_rest).
Database tables
CREATE TABLE wp_wsa_rsvp (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
event_id BIGINT UNSIGNED NOT NULL,
name VARCHAR(200) NOT NULL,
email VARCHAR(200) NOT NULL,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id),
KEY event_id (event_id)
);
CREATE TABLE wp_wsa_vacations (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(200) NOT NULL,
start_date DATE NOT NULL,
end_date DATE NOT NULL,
regions VARCHAR(50) NOT NULL DEFAULT 'Noord,Midden,Zuid',
PRIMARY KEY (id)
);
CREATE TABLE wp_wsa_ics_feeds (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(200) NOT NULL,
url TEXT NOT NULL,
PRIMARY KEY (id)
);
Tables are created automatically on plugin activation via dbDelta(). They are also available as the SQL above for manual setup if needed.
Uninstallation
Deleting the plugin via Plugins → Verwijderen will permanently remove:
- All
wsa_eventposts and their meta - All
wsa_event_categoryterms and term meta - All three custom DB tables and their data
- All plugin options (SSO credentials etc.)
- All transients (holiday/ICS caches, OAuth state)
- The
wsa_boarduser role - The auto-created
/agendapage (if its content is still[wsa_agenda])
RSVP data is also removed as part of the wp_wsa_rsvp table drop. Export any RSVP CSV files beforehand if you need them.
Notes
- JS bundle size:
calendar.jsis intentionally under 40 KB unminified. No frameworks or jQuery. - WCAG AA: category colour picker is
<input type="color">. Administrators should ensure chosen colours pass contrast against white text (4.5:1 ratio). A contrast warning is noted in the admin UI description. - ICS import: only
VEVENTwithDTSTART,DTEND, andSUMMARYare imported.VALARMandVTIMEZONEare ignored. - Apple SSO private key: stored in
wp_options. Ensure your WordPress database andwp-config.phpare secured appropriately.