╔═══════════════════════════════════════════════════════════════╗
║ ║
║ ██████╗ ██╗███████╗ ██████╗ ██████╗ ██████╗ ██████╗ ║
║ ██╔══██╗██║██╔════╝██╔════╝██╔═══██╗██╔══██╗██╔══██╗ ║
║ ██║ ██║██║███████╗██║ ██║ ██║██████╔╝██║ ██║ ║
║ ██║ ██║██║╚════██║██║ ██║ ██║██╔══██╗██║ ██║ ║
║ ██████╔╝██║███████║╚██████╗╚██████╔╝██║ ██║██████╔╝ ║
║ ╚═════╝ ╚═╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ║
║ ║
║ 🚀 EMBED CREATOR FOR WORDPRESS 🚀 ║
║ ║
╚═══════════════════════════════════════════════════════════════╝
📊 Version: 2.5.1
⚡ Requires PHP: 7.4+
🌐 Requires WordPress: 5.0+
🎯 The ultimate WordPress plugin for Discord embeds with live preview, template management, flexible webhook/bot configurations and optional live notifications system for Twitch & YouTube!
- ✨ Features
- 📺 Live Notifications (Twitch & YouTube)
- 😀 Emoji fetcher (server guild emojis)
- ⚙️ Requirements
- 📦 Installation
- 🚀 Usage
- 🔧 Configuration Details
- 🗄️ Database
- ⏰ Cron
- 🔌 API Integration
- 📄 Template System
- 💻 JavaScript Integration
- 🐛 Debugging & Troubleshooting
- 📝 Changelog
- 📞 Support & License
-
🎨 Embed Builder
- Title, description (Markdown), URL, color, timestamp, author, footer, images, custom fields
- Live preview styled like Discord with Discord Custom Emoji support
- Role mentions helper (inserts <@&ROLEID>)
- Discord Custom Emojis display as 20x20px images in live preview
-
📚 Template Management
- Save, load, and delete embed templates
- Stored in the database and loaded via AJAX
-
🔗 Webhook Configuration
- Channel Webhook: use a standard webhook URL
- Server Webhook: use Bot Token + Server ID and select channels via Discord API
- Test connection in a configuration modal
- Persistent settings saved via WordPress options
-
📩 Message Management
- Send via channel webhook or Bot API
- History of sent messages with filters (today, week, month)
- Load an existing Discord message by URL and edit it
-
🔴 Live Notifications (optional)
- Monitor Twitch and YouTube channels and post live notifications automatically
- Requires StreamWeasels plugin for Twitch/YouTube API integration
- Configurable templates, role mentions and cooldown anti-spam
-
😀 Emoji Fetcher
- Load guild emojis via Bot Token + Server ID (for custom emoji insertion into templates)
- Client-side emoji picker with transient caching on the server
-
🎭 UI/UX
- Toast notifications instead of alert() (where available)
- Autofill prevention and small admin UI fixes
- Responsive layout: editor and live preview side by side
- Full internationalization support (English/German)
-
🐛 Debug & Logging
- Optional console logs and PHP error_log entries for AJAX and API calls
- Built-in Debug Console on the admin page
🔴 LIVE 📺 Twitch/YouTube Monitor 🔴 LIVE
┌───────────────────────────────────────────────┐
│ ◉ StreamWeasels Integration REQUIRED │
│ ◉ Twitch Helix API ✓ │
│ ◉ YouTube Data API v3 ✓ │
│ ◉ WordPress Cron (3min) ✓ │
│ ◉ Anti-Spam Cooldown ✓ │
└───────────────────────────────────────────────┘
This plugin includes a Live Notifications module that can periodically check Twitch and YouTube for live streams and post a customizable Discord embed when a channel goes live.
Features:
- StreamWeasels integration: Requires StreamWeasels plugin for Twitch/YouTube API credentials and data access.
- Twitch: Helix API checks for streams.
- YouTube: Data API v3 checks for live videos.
- Runs on a WordPress Cron every 3 minutes (custom interval
every_three_minutes). - Per-channel cooldown (default 10 minutes) to avoid spamming.
- Saved live templates with CRUD, per-template enable/disable and immediate send action.
Setup:
- Install and configure StreamWeasels plugin - Required for Twitch/YouTube API integration.
- Set up StreamWeasels credentials for the platforms you want to monitor.
- Go to Discord Embeds → Live Notifications and configure platform, webhook target and template.
- The plugin will automatically create the required database tables on activation.
Cron:
- Hook:
discord_embed_check_live_status - Interval:
every_three_minutes(180s)
Database:
- Table
wp_discord_live_notificationsstores monitored channels and last status.
Template placeholders:
{platform},{title},{url},{thumbnail}
😀 😃 😄 😁 😆 CUSTOM GUILD EMOJIS 🎉 🎊 🎈 ✨ 🌟
┌────────────────────────────────────────────────────────────┐
│ ◉ Discord Bot API Integration ✓ │
│ ◉ Server-side Caching (60min) ✓ │
│ ◉ Click-to-Insert Emoji Picker ✓ │
│ ◉ Fully Localized UI ✓ │
└────────────────────────────────────────────────────────────┘
-
The plugin can load custom guild emojis from Discord so you can insert them into descriptions or fields. Key points:
-
Server endpoint: AJAX action
load_server_emojis(requiresnonce,bot_token,server_id). -
The server caches emoji lists in a transient (default: 60 minutes) to avoid rate limits.
-
Client behavior:
- Buttons with class
.open-emoji-pickeropen a centralized emoji picker modal. - The picker renders guild emojis in a grid and inserts codes like
<:name:id>or<a:name:id>into the currently focused textarea or a target description. - Fully localized loading states and error messages.
- Buttons with class
Recent fixes and UX improvements related to emojis:
- Server:
load_server_emojisreturnsemojisarray and caches results using transients. - Client:
- Per-tab scoped handlers so main editor and live notifications handlers don't conflict.
- Per-button original-label capture (
data('original-text')) before changing to the loading label; restore in the AJAXcompletehandler. - Defensive insertion functions (accept jQuery elements, safe selection/position handling) to avoid runtime exceptions.
- Complete internationalization of all user-facing text.
✅ WordPress 5.0+ ✅ PHP 7.4+
✅ Discord Bot Token ✅ HTTP Outbound Requests
✅ Server Permissions ✅ StreamWeasels (optional)
- WordPress 5.0+ and PHP 7.4+
- For "Server Webhook" mode: a Discord Bot with proper permissions and the bot added to your server
- Outbound HTTP requests must be allowed from your WordPress host (wp_remote_* functions)
📥 INSTALLATION METHODS 📥
┌─────────────────────────────────┐
│ Method 1: WordPress Dashboard │ ⭐ RECOMMENDED
│ Method 2: FTP Upload │
│ Method 3: WP-CLI │
└─────────────────────────────────┘
- Add Plugin: Go to Plugins → Add New in your WordPress Admin
- Upload ZIP: Click Upload Plugin
- Choose File: Select the
discord-embed-wp-plugin.zipfile - Install: Click Install Now
- Activate: Click Activate Plugin
- Done! The new Discord Embeds menu is available
- Extract the ZIP file
- Upload the folder to
wp-content/plugins/ - Activate the plugin under Plugins
wp plugin install discord-embed-wp-plugin.zip --activateIf upgrading from an earlier version that added live notifications, run any required database migrations via the plugin's automatic updater or via WP-CLI. One‑off migration scripts that were previously included in the repository have been removed from the plugin root and are no longer bundled with releases.
If you maintain self-hosted copies and need the original migration scripts, check your project's version control history or contact the plugin author for archive copies before proceeding.
🎯 QUICK START GUIDE 🎯
┌──────────────────────────────────────┐
│ 1️⃣ Select/create template ✓ │
│ 2️⃣ Build embed ✓ │
│ 3️⃣ Configure webhook ✓ │
│ 4️⃣ Save or send ✓ │
│ 5️⃣ Live Notifications setup ✓ │
└──────────────────────────────────────┘
- Template Management: Select an existing template or start a new one
- Embed Builder: Build your embed (title, description with Markdown, color, images, fields, author/footer, timestamp)
- Webhook Configuration:
- Channel Webhook: paste the webhook URL
- Server Webhook: enter Bot Token + Server ID, then load and select a channel
- Send or Save: Save the template or send the embed to Discord
- Live Notifications: Configure templates and enable monitoring in the Live Notifications tab
-
Webhook types
- Channel Webhook: posts directly to a webhook URL.
- Server Webhook: sends via the Discord Bot API to a selected channel (requires bot token + server membership and permissions).
-
Optional fields on send
usernameandavatar_urlare supported when posting to webhooks.
On activation, the plugin creates/updates database tables:
wp_discord_embeds- id, name, embed_data (JSON), created_at, updated_at
wp_discord_sent_messages- id, discord_message_id, embed_data, webhook_url, channel_id, sent_at, status, webhook_type, error_message
wp_discord_live_notifications(if live notifications enabled)- id, platform, channel_name, last_live_status, last_check, last_notification_sent, notification_count
The Live Notifications scheduler uses WordPress cron. Use wp_next_scheduled('discord_embed_check_live_status') to inspect the next run and do_action('discord_embed_check_live_status') to trigger manually.
// Endpoint
GET https://api.twitch.tv/helix/streams?user_login={channel}
// Headers
Client-ID: {twitch_client_id}
Authorization: Bearer {twitch_access_token}// Endpoint
GET https://www.googleapis.com/youtube/v3/search
// Parameters
part=snippet
channelId={channel_id}
eventType=live
type=video
key={youtube_api_key}Embed template example:
{
"title": "ᴛᴡɪᴛᴄʜ 🔴 🅻🅸🆅🅴 🎧",
"description": "✨ Hey , STREAMER is live now at:\n📺 {url} !\n\nCome join the fun! 🚀",
"color": 9442302,
"thumbnail": {"url": "{thumbnail}"},
"footer": {"text": "Live - "},
"timestamp": "2024-01-01T12:00:00Z"
}Available placeholders: {platform}, {title}, {url}, {thumbnail}
Examples:
// Tab switch to Live Notifications
$('#tab-live-notifications-link').click();
// Settings load
loadLiveNotificationSettings();
// Platform tests
testPlatform('twitch');
testPlatform('youtube');Important notes:
- AJAX endpoints are protected by nonces and
manage_optionschecks. - Emoji picker uses
action=load_server_emojisand requires Bot Token + Server ID.
Client-side debugging:
- Open browser DevTools and inspect console/network for AJAX calls:
load_server_emojis,load_server_roles,load_server_channels, etc.
Server-side debugging:
- Enable WordPress debug logging (
WP_DEBUG&WP_DEBUG_LOG) to see PHP error_log entries generated by the plugin.
Recent fixes you should know about:
- Complete internationalization: All German hardcoded strings replaced with WordPress i18n system
- Hardened markdown/insert functions to accept jQuery objects and avoid selection-related TypeErrors.
- Scoped emoji click handlers and per-button label capture/restore to prevent loading labels from becoming permanent.
- Fixed syntax errors in live-notifications.js that occurred during translation updates.
🐛 LIVE NOTIFICATION HISTORY FIX 🐛
├─ ✅ Fixed Live Notification History showing empty (wrong webhook_type filter)
├─ 🔄 Live notifications now stored with 'live_server'/'live_channel' webhook_type
├─ 🔍 History query matches both new and legacy entries (twitch.tv/youtube URLs)
├─ 🧩 Fixed JS embed_data parsing (single embed vs {embeds:[...]} format)
└─ ✨ History now correctly displays all sent live notifications
🔴 LIVE NOTIFICATION EDIT & THUMBNAIL FIX 🔴
├─ ✅ Live notifications now EDIT existing Discord message instead of posting duplicates
├─ 🔄 PATCH request updates the original message while stream is live
├─ 📸 Twitch & YouTube thumbnails now use cache-busting (?t=timestamp)
├─ 🛡️ Fallback: if edit fails (message deleted), automatically sends new post
├─ 🔁 Offline→Live transition always sends new message (bypasses cooldown)
├─ 🗄️ New DB column 'current_message_id' tracks active live notification
├─ 📊 Auto DB migration for existing installations (admin_init)
└─ ✨ notification_count only increments on new posts, not edits
🎯 DYNAMIC PLACEHOLDER SYSTEM ENHANCEMENT 🎯
├─ ✅ Implemented dynamic placeholder replacement in Live Notifications
├─ 🔄 Replaced static sample data with real form field extraction
├─ 📊 Platform-specific URL generation (Twitch/YouTube channels)
├─ 🖼️ Dynamic thumbnail URL generation based on platform selection
├─ 🎪 Enhanced user experience with actual channel data in previews
├─ 🧹 Improved template system responsiveness to user input changes
└─ ✨ Eliminated hardcoded placeholder values for better UX
🎨 EMBEDDED EDITOR DISCORD EMOJI INTEGRATION 🎨
├─ ✅ Discord Custom Emojis now display in main Embed Editor live preview
├─ 🖼️ Custom emoji support for Title, Description, Fields, Author, Footer
├─ 📸 20x20px standard Discord emoji sizing with CDN integration
├─ 🎯 Animated Discord emojis (<a:name:id>) fully supported
├─ 🔗 Role mentions (<@&roleId>) displayed as styled pills
├─ 🧹 Fixed JavaScript placeholder escaping bug
└─ ✨ Complete feature parity between both live preview systems
� EMBEDDED EDITOR DISCORD EMOJI INTEGRATION 🎨
├─ ✅ Discord Custom Emojis now display in main Embed Editor live preview
├─ 🖼️ Custom emoji support for Title, Description, Fields, Author, Footer
├─ 📸 20x20px standard Discord emoji sizing with CDN integration
├─ 🎯 Animated Discord emojis (<a:name:id>) fully supported
├─ 🔗 Role mentions (<@&roleId>) displayed as styled pills
├─ 🧹 Fixed JavaScript placeholder escaping bug
└─ ✨ Complete feature parity between both live preview systems
🔴 LIVE NOTIFICATION DISCORD EMOJI INTEGRATION 🔴
├─ ✅ Discord Custom Emojis now display in Live Notification preview
├─ 🖼️ Custom emoji support (<:name:id>) with CDN image rendering
├─ 📸 20x20px standard Discord emoji sizing and styling
├─ 🎯 Animated Discord emojis (<a:name:id>) fully supported
├─ 🔗 Role mentions (<@&roleId>) displayed as styled pills
├─ 🧹 Fixed template loading HTML escape bug causing broken previews
└─ ✨ Enhanced preview styling to match main embed editor exactly
🔴 LIVE NOTIFICATION EMBEDDED LIVE PREVIEW INTEGRATION 🔴
├─ ✅ Added comprehensive live preview for Live Notifications
├─ 🖥️ Two-column layout: Editor on left, Live Preview on right
├─ ⚡ Real-time preview updates as you type and modify settings
├─ 🎨 Discord-style mockup matching main embed editor appearance
├─ 📱 Responsive design with mobile-friendly single column layout
├─ 🔧 Enhanced template system with instant preview feedback
├─ 📏 Optimized 560px preview width for perfect image scaling
└─ ✨ Complete visual consistency across entire plugin interface
🎨 FIELD WIDTH & CHECKBOX FIXES 🎨
├─ ✅ Fixed field width consistency across all scenarios
├─ 🔧 Resolved field size shrinking when loading templates
├─ ☑️ Enhanced checkbox visibility and styling
├─ 📏 Unified field HTML structure for consistency
├─ 🎯 Improved user experience in field editor
└─ ✨ Better visual alignment and proportions
🎨 FOOTER ICON & UI IMPROVEMENTS 🎨
├─ ➕ Added Footer Icon URL to Live Notifications
├─ 🔧 Enhanced template system with footer icons
├─ 📐 Fixed layout overlapping in template controls
├─ ✨ Improved spacing and button positioning
├─ 🎯 Better user experience consistency
└─ 🔄 All template functions support footer icons
🔧 LIVE PREVIEW FIXES 🔧
├─ 🖼️ Fixed overlapping elements in Embed Editor
├─ 📱 Improved Live Preview layout responsiveness
├─ ✅ Better visual consistency across UI components
├─ 🎯 Enhanced overall user interface stability
└─ 🧹 Minor cosmetic improvements throughout
🛠️ MINOR COSMETIC UPDATES 🛠️
├─ ✨ Small UI polish and refinements
├─ 🔧 Code cleanup and optimization
├─ 📋 Improved internal documentation
└─ 🎨 Enhanced visual consistency
🗂️ PROJECT REORGANIZATION 🗂️
├─ 📁 Moved all CSS/JS files to assets/ folder
├─ 🔧 Updated all file references in plugin
├─ 📋 Synchronized package-filelist.txt
├─ ✅ Maintained full functionality
├─ 🧹 Cleaner project structure
└─ 📦 Better maintainability
🚀 MAJOR FEATURE UPDATE 🚀
├─ 🌍 Complete internationalization (EN/DE)
├─ 📄 MIT License migration from GPL
├─ 🎨 Redesigned README with ASCII art
├─ ✅ 20+ new localization strings
├─ 🔧 JavaScript syntax fixes
├─ 📦 Improved installation guide
└─ 🌟 Enhanced user experience
- Complete internationalization: All user-facing text now uses WordPress i18n system
- Added localization strings for buttons, error messages, and status text
- Fixed JavaScript syntax errors in live-notifications.js
- Updated German and English .po translation files
- Updated Live Notifications and emoji picker UX; defensive JS improvements; various bugfixes.
- Added Live Notifications: StreamWeasels integration, Twitch/YouTube checks, templates, roles, cooldowns, cron scheduling.
📋 PROJECT INFO 📋
┌─────────────────────────────┐
│ License: MIT License │
│ Author: happytunesai │
│ GitHub: Repository │
└─────────────────────────────┘
- 📄 License: MIT License
- 👨💻 Author: happytunesai
- 🔗 Repository: https://github.com/happytunesai/discord-embed-wp-plugin
┌─────────────────────────────────────────────┐
│ © 2025 happytunesai. All rights reserved. │
└─────────────────────────────────────────────┘
