Gemini Patreon Control
π€ WordPress plugin for automated content scheduling using Google Gemini AI and Patreon integration. Perfect for web novels, comics, and serialized content creators.
by Farhan Sheikh Β· github.com/farhansh911/wp-gemini-patreon-automation
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/farhansh911/wp-gemini-patreon-automation/archive/refs/heads/main.zipWordPress plugin that automates episode access management using AI and integrates with Patreon for content monetization.
π― Features
1. AI-Powered Episode Management
- Use natural language commands to control episode access
- Powered by Google's Gemini AI
- Examples:
- "Make episode 5 free for everyone"
- "Change episode 12 to advance access"
- "Unlock episode 8"
2. Automatic Episode Number Sync
- Extracts episode numbers from titles automatically
- Bulk sync tool for existing episodes
- Supports multiple formats (Episode XXX, Ep XXX, Chapter XXX)
3. Scheduled Auto-Unlock
- Set different unlock schedules per novel/series
- Automatic conversion from advance (paid) to free
- Weekend skipping option (Mon-Fri only publishing)
- Unlocks episodes starting from the oldest first
4. Patreon Integration
- Automatically updates Patreon post visibility
- Syncs tier requirements
- Works with Patreon WordPress plugin
π Requirements
- WordPress 5.0+
- PHP 7.4+
- Custom post types:
novelsandepisodes - ACF (Advanced Custom Fields) - optional
- Patreon WordPress Plugin
- Google Gemini API key
- Patreon Creator Access Token
π Installation
- Download the plugin files
- Upload to
/wp-content/plugins/gemini-patreon-control/ - Activate the plugin through WordPress admin
- Navigate to Gemini Control in admin menu
βοΈ Setup
Step 1: Configure API Keys
Go to Gemini Control β Settings and configure:
-
Gemini API Key
- Get your key from Google AI Studio
- Paste into the "Gemini API Key" field
-
Patreon Credentials
- Creator Access Token
- Refresh Token
- Client ID
- Client Secret
- Get these from Patreon Developer Portal
-
Patreon Silver Tier ID
- Go to Patreon.com β Settings β Tiers
- Click your $5 tier
- Copy the ID from the URL
-
Field Names
- Episode Number meta key (default:
episode_number) - Patreon post ID meta key (default:
patreon_post_id) - ACF field type (default:
section)
- Episode Number meta key (default:
Step 2: Sync Episode Numbers
- Go to Gemini Control β Sync Episodes
- Click "Preview" to see what will be synced
- Click "Sync All Episodes" to auto-fill episode numbers
Step 3: Configure Auto-Unlock
- Go to Gemini Control β Auto Unlock
- Click "Add Novel Schedule"
- For each novel:
- Select the novel
- Enter search term (text that appears in episode titles)
- Set unlock interval (e.g., 1 day, 2 days)
- Set time (24-hour format, e.g., 02:00)
- Check "Skip Sat/Sun" if needed
- Click "Save Schedules"
- Test with "Test (Preview)" button
π Usage
AI Commands
Go to Gemini Control β AI Commands and type natural language:
Make episode 5 free for everyone
The AI will:
- Find episode 5
- Change taxonomy from "Advance" to "Free"
- Update Patreon tier to public
- Update ACF fields
Automatic Scheduling
Once configured, episodes will automatically unlock based on your schedule:
Example 1: Daily Publishing (Mon-Fri)
- Novel: Surviving The Game as a Barbarian
- Schedule: Every 1 day at 02:00 AM
- Skip weekends: Yes
- Result: One episode unlocks Mon-Fri at 2 AM
Example 2: Every Other Day
- Novel: Lee Gwak
- Schedule: Every 2 days at 02:00 AM
- Skip weekends: Yes
- Result: One episode every 2 weekdays
ποΈ Technical Details
Custom Post Types
The plugin expects two custom post types:
Episodes:
post_type: 'episodes'
taxonomy: 'chapter-categories' (terms: 'advance', 'free')
meta: 'episode_number' (integer)
meta: 'patreon_post_id' (string)
Novels:
post_type: 'novels'
Used for grouping episodes
How Auto-Unlock Works
- Cron Job: Runs daily at the earliest scheduled time
- Episode Selection: Finds oldest advance episode by episode number
- Weekend Logic: If "Skip Sat/Sun" is enabled, only counts Mon-Fri
- Execution:
- Changes taxonomy from "Advance" to "Free"
- Removes Patreon tier restriction
- Updates ACF fields
- Calculates next unlock date
Episode Matching
Episodes are matched to novels by searching for the novel title (or custom search term) in the episode title:
Novel: "Surviving The Game as a Barbarian"
Search Term: "Surviving Game Barbarian"
Matches: "Surviving The Game as a Barbarian Episode 219" β
π Security
Important Security Notes:
- β οΈ Never commit API keys to version control
- β οΈ Store keys securely - Use environment variables or wp-config.php constants for production
- β οΈ Restrict admin access - Only administrators can access plugin features
- β οΈ Sanitize inputs - All user inputs are sanitized and validated
- β οΈ Use nonces - All forms use WordPress nonces for CSRF protection
Recommended: Use Environment Variables
Instead of storing keys in database, use wp-config.php:
define('GEMINI_API_KEY', 'your-key-here');
define('PATREON_ACCESS_TOKEN', 'your-token-here');
π Troubleshooting
"Episode not found"
- Check that episode has
episode_numbermeta field filled - Run Sync Episodes tool to auto-fill missing numbers
- Verify custom post type is
episodes
"Patreon API error"
- Verify your access token is valid
- Check that token hasn't expired
- Ensure you have creator permissions
"No episodes to unlock"
- Check that episodes have "Advance" taxonomy term
- Verify search term matches episode titles
- Check that episodes exist for the novel
Wrong timezone
- Plugin uses WordPress timezone from Settings β General
- Verify your timezone is set correctly
π Changelog
Version 1.0.0
- Initial release
- AI-powered episode management
- Auto-unlock scheduling
- Patreon integration
- Weekend skipping
- Episode number sync tool
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
π License
This plugin is licensed under GPL v2 or later.
π€ Author
Created for automated web novel/light novel publishing workflows.
π Credits
- Powered by Google Gemini AI
- Patreon API
- Built for WordPress
β οΈ Disclaimer
This plugin is provided "as is" without warranty. Always backup your site before installing new plugins. Test thoroughly on a staging site first.
π Support
For issues, questions, or feature requests, please open an issue on GitHub.
Note: This plugin is designed for content creators managing serialized content (web novels, comics, etc.) with tiered Patreon access.