diff --git a/CHANGELOG.md b/CHANGELOG.md index 45a567a..23bed41 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ Changelog ========= += 1.9.7 (2024-01-03): = +- Ensure defaults are always set to remove warnings in PHP 8.1+ + 1.9.6 (2023-09-10) - Added typehints to methods - Added code for making plugin WP VIP GO compatible for the `From mail` diff --git a/includes/admin.php b/includes/admin.php index 34be634..af87214 100755 --- a/includes/admin.php +++ b/includes/admin.php @@ -43,11 +43,13 @@ public function __construct() { parent::__construct(); + $this->init(); + // Load localizations if available load_plugin_textdomain('mailgun', false, 'mailgun/languages'); // Activation hook - register_activation_hook($this->plugin_file, [&$this, 'init']); + register_activation_hook($this->plugin_file, [&$this, 'activation']); // Hook into admin_init and register settings and potentially register an admin_notice add_action('admin_init', [&$this, 'admin_init']); @@ -59,8 +61,22 @@ public function __construct() add_action('wp_ajax_mailgun-test', [&$this, 'ajax_send_test']); } + /** + * Adds the default options during plugin activation. + * + * @return void + * + */ + public function activation() { + if (!$this->options) { + $this->options = $this->defaults; + add_option('mailgun', $this->options); + } + } + + /** - * Initialize the default options during plugin activation. + * Initialize the default property. * * @return void * @@ -90,10 +106,7 @@ public function init() 'override-from' => '0', 'tag' => $sitename, ); - if (!$this->options) { - $this->options = $this->defaults; - add_option('mailgun', $this->options); - } + } /** diff --git a/mailgun.php b/mailgun.php index 143a610..c39d7c3 100755 --- a/mailgun.php +++ b/mailgun.php @@ -3,8 +3,9 @@ * Plugin Name: Mailgun * Plugin URI: http://wordpress.org/extend/plugins/mailgun/ * Description: Mailgun integration for WordPress - * Version: 1.9.6 - * Tested up to: 6.3.1 + * Version: 1.9.7 + * Requires PHP: 7.4 + * Requires at least: 4.4 * Author: Mailgun * Author URI: http://www.mailgun.com/ * License: GPLv2 or later diff --git a/readme.md b/readme.md index 1b2badd..166f901 100755 --- a/readme.md +++ b/readme.md @@ -1,12 +1,10 @@ Mailgun for WordPress ===================== -Contributors: mailgun, sivel, lookahead.io, m35dev +Contributors: mailgun, sivel, lookahead.io, m35dev, alanfuller Tags: mailgun, smtp, http, api, mail, email -Requires at least: 3.3 -Tested up to: 6.3.1 -Stable tag: 1.9.6 -Requires PHP: 7.4 +Tested up to: 6.4 +Stable tag: 1.9.7 License: GPLv2 or later Easily send email from your WordPress site through Mailgun using the HTTP API or SMTP. @@ -132,6 +130,8 @@ MAILGUN_TRACK_OPENS Type: string Choices: 'yes' or 'no' == Changelog == += 1.9.7 (2024-01-03): = +- Ensure defaults are always set to remove warnings in PHP 8.1+ = 1.9.6 (2023-09-10): = - Added typehints to methods diff --git a/readme.txt b/readme.txt index 510c26a..95cbf0a 100755 --- a/readme.txt +++ b/readme.txt @@ -1,12 +1,10 @@ Mailgun for WordPress ===================== -Contributors: mailgun, sivel, lookahead.io, m35dev +Contributors: mailgun, sivel, lookahead.io, m35dev, alanfuller Tags: mailgun, smtp, http, api, mail, email -Requires at least: 4.4 -Tested up to: 6.3.1 -Stable tag: 1.9.6 -Requires PHP: 7.4 +Tested up to: 6.4 +Stable tag: 1.9.7 License: GPLv2 or later Easily send email from your WordPress site through Mailgun using the HTTP API or SMTP. @@ -130,6 +128,8 @@ MAILGUN_TRACK_OPENS Type: string Choices: 'yes' or 'no' == Changelog == += 1.9.7 (2024-01-03): = +- Ensure defaults are always set to remove warnings in PHP 8.1+ = 1.9.6 (2023-09-10): = - Added typehints to methods