Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/marijnvandevoorde/small-victories-bookings/archive/refs/heads/main.zipNo longer actively maintained. The code stays available as is. Forks are welcome; issues and pull requests may not get an answer.
A flexible WordPress plugin for managing bookings with custom forms and availability tracking.
Features
- Custom Form Fields: Create forms with any number of custom fields (text, email, phone, number)
- Option Management: Define bookable options with availability limits
- Stock Management: Automatically tracks availability and prevents overbooking
- Batch Import: Quick option setup via batch import (name;availability format)
- Responsive Design: Mobile-friendly forms with customizable column layouts
- Submissions Management: View all submissions in the WordPress admin
- CSV Export: Export submissions by option with all field data
- Multi-language Support: Includes translations for Dutch, French, German, and English
- Transaction Safety: Database transactions prevent double-booking race conditions
Installation
- Upload the plugin files to
/wp-content/plugins/small-victories-bookings/ - Activate the plugin through the 'Plugins' menu in WordPress
- Navigate to 'SV Bookings' in the admin menu to create your first form
Usage
Creating a Form
- Go to SV Bookings > Add New
- Enter a form name and choose the number of columns for options display
- Define your custom form fields (e.g., Name, Email, Phone, Company)
- Add options with availability counts either:
- Via Batch Import: Paste lines like
Option Name;10 - Or Manually: Add options one by one
- Via Batch Import: Paste lines like
Adding to Pages
Use the shortcode with your form ID:
[timeslot_form id="1"]
Viewing Submissions
- Go to SV Bookings > Submissions
- Select a form from the dropdown
- View all submissions with their field responses and selected options
- Click Export to CSV to download the data
CSV Export Format
The CSV export organizes data by option:
- Column 1: Option name
- Subsequent columns: Submissions with all field values joined by " - "
Example: John Doe - john@example.com - 555-1234
Database Schema
Tables
wp_timeslot_forms: Form definitions with custom fields (JSON)wp_timeslot_options: Bookable options with availability countswp_timeslot_submissions: Submissions with field responses (JSON)wp_timeslot_submission_options: Many-to-many relationship for selected options
Migrations
The plugin includes an automatic migration system. Version 2 schema:
- Converts fixed
nameandemailcolumns to flexible JSONresponsefield - Adds
fieldsJSON column to forms for custom field definitions - Migrates existing data automatically on plugin update
Internationalization
Translations included for:
- English (default)
- Dutch (nl_NL)
- French (fr_FR)
- German (de_DE)
To add a new language:
- Copy
languages/small-victories-bookings.pot - Create a new
.pofile (e.g.,small-victories-bookings-es_ES.po) - Translate the strings
- Compile to
.mousingmsgfmt -o file.mo file.po
Development
File Structure
small-victories-bookings/
├── assets/
│ ├── admin.css # Admin styling
│ ├── admin.js # Admin scripts
│ ├── frontend.css # Public form styling
│ └── frontend.js # Form submission handling
├── includes/
│ ├── admin-forms-list.php # Forms overview
│ ├── admin-form-editor.php # Form creation/editing
│ ├── admin-submissions.php # Submissions view
│ └── frontend-form.php # Public form display
├── languages/
│ ├── *.pot # Translation template
│ ├── *.po # Translation sources
│ └── *.mo # Compiled translations
└── small-victories-bookings.php # Main plugin file
Hooks & Filters
The plugin uses standard WordPress hooks:
plugins_loaded: Load textdomain and run migrationsadmin_menu: Register admin pageswp_ajax_timeslot_submit: Handle form submissionsadmin_init: Handle CSV exports
Requirements
- WordPress 5.0 or higher
- PHP 7.4 or higher
- MySQL 5.6 or higher (with JSON support)
Changelog
Version 1.0.4
- Added custom form fields with JSON storage
- Implemented database migration system
- Added multi-language support (NL, FR, DE)
- Enhanced form styling with hover effects
- Added CSV export functionality
Version 1.0.0
- Initial release
- Basic form and option management
- Fixed name/email fields
- Availability tracking
- Transaction-safe submissions
License
GPL v2 or later
Author
Small Victories https://small-victories.co
Support
For issues and feature requests, please visit: https://github.com/marijnvandevoorde/small-victories-bookings