sprucely-designed / mainwp-discord-notifications

GNU General Public License v3.0
4 stars 1 forks source link

Constant for webhooks #3

Closed JosKlever closed 2 months ago

JosKlever commented 2 months ago

There's a strange difference between the constants for the webhooks.

define( 'MAINWP_UPDATES_DISCORD_WEBHOOK_URL', 'your_plugin_updates_webhook_url' );
define( 'MAINWP_THEME_UPDATES_DISCORD_WEBHOOK_URL', 'your_theme_updates_webhook_url' );

The one for the plugins, doesn't mention plugin. So maybe it's good to create some clarity, now the number of users is still low.

define( 'MAINWP_PLUGIN_UPDATES_DISCORD_WEBHOOK_URL', 'your_plugin_updates_webhook_url' );
define( 'MAINWP_THEME_UPDATES_DISCORD_WEBHOOK_URL', 'your_theme_updates_webhook_url' );
sisaacrussell commented 2 months ago

Great suggestion! I updated the plugin constant to MAINWP_PLUGIN_UPDATES_DISCORD_WEBHOOK_URL with backward compatibility for the MAINWP_UPDATES_DISCORD_WEBHOOK_URL in version 1.1.0. I also added checks so that if those constants aren't defined, the functions won't run (which I think may have caused a fatal error in those cases, but didn't test).