Advanced Settings¶
Configure API keys, data management, and advanced options.
Accessing Settings¶
Go to MindfulMedia → Settings → Advanced
API Keys¶
YouTube Data API¶
| Setting | Description |
|---|---|
| YouTube API Key | Google API key for YouTube features |
Required for:
- Automatic video duration fetching
- Video metadata retrieval
Getting a YouTube API Key¶
- Go to Google Cloud Console
- Create a new project (or select existing)
- Enable "YouTube Data API v3"
- Create credentials → API Key
- Copy the key to settings
Note: Vimeo and SoundCloud don't require API keys.
Data Management¶
Uninstall Behavior¶
| Setting | Effect |
|---|---|
| Keep engagement data | Preserve likes, comments, subscriptions, history on uninstall |
| Delete all data | Remove custom tables and data on uninstall |
When to keep:
- Temporary deactivation
- Plugin updates
- Troubleshooting
When to delete:
- Permanently removing plugin
- Starting fresh
- Privacy compliance
What Gets Deleted¶
If "Delete all data" is chosen:
| Data | Deleted |
|---|---|
| Likes | Yes |
| Comments | Yes |
| Subscriptions | Yes |
| Watch History | Yes |
| Playback Progress | Yes |
| Custom Tables | Yes |
| Plugin Settings | Yes |
| Media Posts | No (standard WordPress content) |
| Taxonomies | No (standard WordPress data) |
Database Tables¶
Custom tables created by MindfulMedia:
| Table | Purpose |
|---|---|
wp_mindful_media_likes |
User likes |
wp_mindful_media_comments |
Media comments |
wp_mindful_media_subscriptions |
User subscriptions |
wp_mindful_media_watch_history |
View tracking |
wp_mindful_media_playback_progress |
Resume positions |
Table Structure¶
Likes:
Subscriptions:
id BIGINT PRIMARY KEY
user_id BIGINT
term_id BIGINT
taxonomy VARCHAR(50)
notify TINYINT (0/1)
created_at DATETIME
Watch History:
Playback Progress:
Caching¶
Transients Used¶
| Transient | Purpose | TTL |
|---|---|---|
mm_term_media_count_{id} |
Term item counts | 1 hour |
mm_featured_items |
Featured items cache | 30 min |
Clearing Cache¶
Plugin caches clear automatically when:
- Content is published
- Content is updated
- Terms are modified
Manual Clear¶
Delete transients via:
- Database direct
- Transient manager plugin
- Code:
delete_transient('transient_name')
Debug Mode¶
For troubleshooting (not exposed in UI):
Enables:
- Verbose error logging
- SQL query logging
- AJAX response debugging
Import/Export¶
Exporting Settings¶
Settings stored in wp_options:
| Option | Content |
|---|---|
mindful_media_settings |
All plugin settings |
Backup¶
Use standard WordPress backup tools:
- Plugin settings via export
- Media posts via WordPress export
- Database backup for engagement data
Migration¶
To migrate to new site:
- Export WordPress content (includes media posts)
- Export plugin settings
- Backup custom tables
- Import on new site
- Restore settings and tables
Performance¶
Optimization Tips¶
| Area | Recommendation |
|---|---|
| Images | Use optimized thumbnails |
| Queries | Limit items per page |
| Caching | Enable page caching |
| CDN | Serve media from CDN |
Database Indexes¶
Custom tables include indexes on:
user_idpost_idterm_idcreated_at
Security¶
Nonce Verification¶
All AJAX requests use WordPress nonces:
Capability Checks¶
| Action | Required Capability |
|---|---|
| Edit Media | edit_posts |
| Delete Media | delete_posts |
| Manage Settings | manage_options |
| User Engagement | read (logged in) |
Data Sanitization¶
All inputs sanitized:
sanitize_text_field()for textesc_url_raw()for URLsintval()for integerswp_kses_post()for rich content
Troubleshooting¶
Common Issues¶
Duration not fetching:
- Check API key is set (YouTube)
- Verify video URL format
- Check API quota limits
Engagement not saving:
- Verify tables exist in database
- Check user is logged in
- Check AJAX endpoints responding
Settings not saving:
- Check user has
manage_optionscapability - Verify nonce is valid
- Check for PHP errors
Debug Information¶
Get debug info for support:
- WordPress version
- PHP version
- Plugin version
- Active theme
- Conflicting plugins
- Browser console errors