Install
Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/kjroelke/wp-plugin-roelke-gift-giving-draw/releases/download/v1.0.0/gift-giving-draw.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
A WordPress plugin that generates annual gift-giving pairings, enforces strict participation rules, allows unlimited redraws, and stores finalized results in a custom SQL table.
Features
- Pairing Generation: Creates random pairings between participants
- Household Constraint: Prevents same-household pairings
- Adult Only: Includes only adults (18+) in the drawing
- Repeat Prevention: Prevents repeat pairings within the past X years (configurable)
- Draft & Finalize: Admin can regenerate pairings before finalizing
- Historical Records: View past drawings stored in custom database tables
- React Admin UI: Modern interface powered by a shortcode on a private page
Installation
- Upload the plugin to your
/wp-content/plugins/directory - Activate the plugin through the WordPress admin
- The plugin will automatically create the required database tables
Usage
- Add the
[gift_giving_draw]shortcode to any page - Access the page as an admin user
- Use the "Manage" tab to add households and participants
- Use the "Generate Drawing" tab to create new pairings
- Review, redraw if needed, and finalize
Development
# Install dependencies
npm install
composer install
# Start development mode
npm run start
# Build for production
npm run build
# Lint code
npm run lint:js
npm run lint:css
composer phpcs
Architecture
Domain Layer
Participant: Model representing a person in the drawHousehold: Model representing a household (family unit)Pairing: Model representing a giver-receiver pairPairing_Engine: Core logic for generating valid pairings
Persistence Layer
Database_Schema: Manages custom SQL tablesHousehold_Repository: CRUD operations for householdsParticipant_Repository: CRUD operations for participantsDrawing_Repository: Manages finalized drawings
REST API
/gift-giving-draw/v1/households- Household management/gift-giving-draw/v1/participants- Participant management/gift-giving-draw/v1/drawings/generate- Generate draft pairings/gift-giving-draw/v1/drawings/finalize- Save finalized drawing/gift-giving-draw/v1/drawings/years- Get years with drawings/gift-giving-draw/v1/drawings/{year}- Get/delete drawing for year
Admin UI
React-based interface with tabs for:
- Generate Drawing (draft, redraw, finalize)
- History (view past drawings)
- Manage (households and participants)
Security
- All REST endpoints require
manage_optionscapability - Uses WordPress nonces for CSRF protection
- All input is sanitized
- All database queries use prepared statements
License
GPLv3 or later
Releases
1 release. Each count is every asset in that release; expand a row for the breakdown.
Tag
Published
Assets
Downloads