CalDAV Booking
Caldav booking plugin for Wordpress
by SKAWINSKI GmbH · github.com/skawinski-gmbh/wordpress-caldav_booking_plugin · 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/skawinski-gmbh/wordpress-caldav_booking_plugin/archive/refs/heads/main.zipCalDAV Booking Plugin for WordPress
A WordPress plugin for appointment booking with CalDAV synchronization. Compatible with SOGo, Mailcow, Nextcloud, and other CalDAV servers.
✨ Features
- Inverse Availability System - Only explicitly marked calendar events (e.g., "VERFÜGBAR") create bookable time windows
- Multiple Meeting Types - Configure different appointment types with custom durations, colors, and descriptions
- Real-time Availability - Checks CalDAV server for current availability
- Race Condition Protection - Database-level locking prevents double bookings
- Async Processing - Fast booking response with background CalDAV synchronization
- Email Notifications - Customizable templates for customer and admin emails
- Spam Protection - Rate limiting and honeypot fields
- Responsive Design - Works on all devices
- Caching - Built-in caching for improved performance
📋 Requirements
- WordPress 5.0 or higher
- PHP 7.4 or higher
- CalDAV server (SOGo, Mailcow, Nextcloud, etc.)
- SSL certificate (recommended)
🚀 Installation
From GitHub Release
- Download the latest release ZIP from Releases
- In WordPress Admin, go to Plugins → Add New → Upload Plugin
- Select the downloaded ZIP file and click Install Now
- Activate the plugin
Manual Installation
- Clone this repository or download the source code
- Copy the
caldav-booking-pluginfolder to/wp-content/plugins/ - Activate the plugin in WordPress Admin
⚙️ Configuration
1. CalDAV Server Settings
Go to Settings → CalDAV Booking and configure:
| Setting | Description | Example |
|---|---|---|
| CalDAV URL | Base URL of your CalDAV server | https://mail.example.com/SOGo/dav |
| Username | CalDAV username | user@example.com |
| Password | CalDAV password | ******** |
| Calendar Path | Path to the calendar | Calendar/personal |
2. Availability Keywords
The plugin uses an inverse availability system. Create events in your calendar with specific keywords to mark available time slots:
- Default keyword:
VERFÜGBAR - Additional keywords can be configured in settings
Example: Create a recurring event "VERFÜGBAR" from 9:00-17:00 on weekdays.
3. Meeting Types
Configure different appointment types:
- Name: Display name (e.g., "Quick Call")
- Duration: Length in minutes (15, 30, 45, 60, 90, 120)
- Description: Optional description shown to customers
- Color: Visual indicator
4. Email Templates
Customize email notifications with placeholders:
| Placeholder | Description |
|---|---|
{name} |
Customer name |
{email} |
Customer email |
{phone} |
Customer phone |
{date} |
Appointment date |
{time} |
Start time |
{end_time} |
End time |
{type} |
Meeting type |
{message} |
Customer message |
{site_name} |
Website name |
📖 Usage
Shortcode
Add the booking form to any page or post:
[caldav_booking]
Shortcode Options
[caldav_booking title="Book an Appointment" days="14" type="Consultation"]
| Option | Description | Default |
|---|---|---|
title |
Form heading | "Termin buchen" |
days |
Days to show ahead | 14 |
type |
Filter to specific meeting type | (all types) |
🔒 Security Features
- Nonce Verification - All AJAX requests are verified
- Input Sanitization - All user inputs are sanitized
- SQL Injection Protection - Prepared statements for all queries
- Rate Limiting - Max 5 bookings per IP per hour
- Honeypot Field - Hidden field to catch bots
- CSRF Protection - WordPress nonce system
🛠️ Development
Prerequisites
- PHP 7.4+
- Composer (optional, for development tools)
- Node.js (optional, for JS linting)
Local Development
# Clone the repository
git clone https://github.com/SKAWINSKI-GmbH/wordpress-caldav_booking_plugin.git
# Install development dependencies (optional)
composer install
# Run PHP linting
find . -name "*.php" -exec php -l {} \;
# Run PHPCS
phpcs --standard=WordPress caldav-booking.php
Creating a Release
- Update version number in
caldav-booking.php - Commit changes
- Create and push a tag:
git tag v1.0.0
git push origin v1.0.0
The GitHub Actions workflow will automatically:
- Run all tests
- Build the release ZIP
- Create a GitHub Release with the ZIP attached
📁 File Structure
caldav-booking-plugin/
├── .github/
│ └── workflows/
│ └── ci.yml # GitHub Actions CI/CD
├── assets/
│ ├── admin.css # Admin styles
│ ├── booking.css # Frontend styles
│ └── booking.js # Frontend JavaScript
├── caldav-booking.php # Main plugin file
├── LICENSE # MIT License
├── README.md # This file
└── .gitignore # Git ignore rules
🔧 Hooks & Filters
Actions
// After a booking is created
do_action('caldav_booking_created', $booking_id, $booking_data);
// After CalDAV sync completes
do_action('caldav_booking_synced', $booking_id, $result);
Filters
// Modify available slots
add_filter('caldav_available_slots', function($slots, $date, $duration) {
return $slots;
}, 10, 3);
// Modify email content
add_filter('caldav_email_content', function($content, $booking) {
return $content;
}, 10, 2);
🐛 Troubleshooting
Bookings not appearing in calendar
- Check CalDAV credentials in settings
- Use "Test Connection" button
- Ensure WP-Cron is running (or set up a real cron job)
Slow performance
- Enable caching in settings
- Consider using a real cron job instead of WP-Cron:
*/5 * * * * wget -q -O - https://yoursite.com/wp-cron.php?doing_wp_cron
Emails not sending
- Enable email debug mode in settings
- Check
wp-content/caldav-email-debug.log - Consider using an SMTP plugin
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📞 Support
This plugin is provided as-is on a best-effort basis.
- Issues: GitHub Issues
- Response Time: No guaranteed response time - issues are addressed as time permits
- Commercial Support: For priority support or custom development, contact SKAWINSKI GmbH
⚠️ Note: This is an open-source project maintained in spare time. Please check existing issues and documentation before opening new issues.
🙏 Credits
Developed by SKAWINSKI GmbH