Discord Webhook Notifications for MainWP is a WordPress plugin that sends notifications to a Discord server when plugin or theme updates are available on MainWP child sites.
Disclaimer: This is not an official MainWP plugin and is not affiliated with or endorsed by MainWP. It is an independent project developed by Sprucely Designed.
This plugin integrates with MainWP to monitor plugin and theme updates across all your connected child sites. When an update is detected, a notification is sent to a specified Discord webhook URL.
- Plugin Updates: The plugin retrieves data from the
plugin_upgradescolumn of thewp_mainwp_wptable, excluding sites withis_ignorePluginUpdatesset to 1. - Theme Updates: The plugin retrieves data from the
theme_upgradescolumn of thewp_mainwp_wptable, excluding sites withis_ignoreThemeUpdatesset to 1.
To improve performance and reduce database load, the plugin uses caching:
- Database Queries: Results from database queries are cached for 15 minutes.
- Thumbnail URLs: Fetched thumbnail URLs are cached for one week.
- Sent Notifications: Notifications that have been sent are stored in a transient to prevent duplicate notifications, with a cache duration of one week.
As tracked in Issue #14, when installing the plugin from the GitHub release .zip file, the folder created in the wp-content/plugins directory includes the -v#.#.# version info. This can cause issues during updates.
On the first install, follow these steps to remove the version info from the plugin folder name:
-
Download the Latest Release:
- Download the latest release
.zipfile from GitHub.
- Download the latest release
-
Extract and Rename:
- Extract the contents of the
.zipfile. - Rename the extracted folder from
mainwp-discord-notifications-v#.#.#tomainwp-discord-notifications.
- Extract the contents of the
-
Install the Plugin:
- Upload the renamed
mainwp-discord-notificationsfolder to yourwp-content/pluginsdirectory. - Activate the plugin from the
wp-adminPlugins page.
- Upload the renamed
This ensures that future updates via Git Updater or manually will not encounter issues with folder name mismatches.
Follow Issue 14 for updates. Future releases will include a build process to resolve this issue. Thank you for your understanding and patience.
-
Download the Plugin:
- Download the source code ZIP file from the latest release.
-
Upload the Plugin:
- Go to your WordPress dashboard.
- Navigate to
Plugins > Add New. - Click on
Upload Plugin. - Select the downloaded ZIP file and click
Install Now.
-
Activate the Plugin:
- After the plugin is installed, click on
Activate Plugin.
- After the plugin is installed, click on
-
Configure Webhook URLs:
- Open your
wp-config.phpfile. - Define the constants for the webhook URLs:
define( 'MAINWP_PLUGIN_UPDATES_DISCORD_WEBHOOK_URL', 'your_plugin_updates_webhook_url' ); define( 'MAINWP_THEME_UPDATES_DISCORD_WEBHOOK_URL', 'your_theme_updates_webhook_url' );
- Open your
To get automatic updates for this plugin, you can use the Git Updater plugin. For detailed instructions on how to install and configure Git Updater, please refer to the Git Updater Documentation.
Once installed and configured, the plugin will automatically check for updates following your mainwp_cronupdatescheck_action cron schedule (with an hourly fallback) and send notifications to the specified Discord channel if updates are available.
The notifications will include:
- Plugin/Theme Name
- New Version
- Author (if available)
- Description (if available)
- Changelog Summary (if available)
- Link to the full changelog
Want to make MainWP better for everyone by contributing to Discord Notifications for MainWP? We'd love your help! Please read our contributing guide to learn about our development process and how to propose bug fixes and improvements.
This plugin is licensed under the GPL3. See the LICENSE file for more details.
This plugin is provided as-is without any warranties. No official support is provided. However, you can submit an issue on GitHub if you encounter any problems or have any questions. Please note that submitting an issue does not guarantee a resolution or a response.
Developed by Sprucely Designed