Mailgun for WordPress - Version 1.8.4

Version Description

Download this release

Release Info

Developer omykhailenko
Plugin Icon 128x128 Mailgun for WordPress
Version 1.8.4
Comparing to
See all releases

Code changes from version 1.8.5 to 1.8.4

CHANGELOG.md CHANGED
@@ -1,9 +1,6 @@
1
  Changelog
2
  =========
3
- 1.8.5 (2022-09-21)
4
- - Make code changes to have more optimized way to use Mailgun object in the code
5
-
6
- 1.8.3 (2022-08-30)
7
  - Plugin refactoring. Widget fixes for working with Legacy Widget Block. PHP8.0 support check
8
 
9
  1.7.9 (2021-05-24)
1
  Changelog
2
  =========
3
+ = 1.8.3 (2022-08-30): =
 
 
 
4
  - Plugin refactoring. Widget fixes for working with Legacy Widget Block. PHP8.0 support check
5
 
6
  1.7.9 (2021-05-24)
includes/admin.php CHANGED
@@ -465,7 +465,7 @@ class MailgunAdmin extends Mailgun
465
  }
466
 
467
  // Error message will always be returned in case of failure, if not - connection wasn't successful
468
- $error_msg = $error_msg ?: "Can't connect to Mailgun";
469
  die(
470
  json_encode(array(
471
  'message' => __('Failure', 'mailgun'),
465
  }
466
 
467
  // Error message will always be returned in case of failure, if not - connection wasn't successful
468
+ $error_msg = $error_msg ? $error_msg : "Can't connect to Mailgun";
469
  die(
470
  json_encode(array(
471
  'message' => __('Failure', 'mailgun'),
includes/lists-page.php CHANGED
@@ -19,7 +19,7 @@
19
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
  */
21
 
22
- $mailgun = Mailgun::getInstance();
23
 
24
  // check mailgun domain & api key
25
  $missing_error = '';
19
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
  */
21
 
22
+ global $mailgun;
23
 
24
  // check mailgun domain & api key
25
  $missing_error = '';
includes/options-page.php CHANGED
@@ -19,7 +19,7 @@
19
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
  */
21
 
22
- $mailgun = Mailgun::getInstance();
23
 
24
  $mailgun_domain_const = ((defined('MAILGUN_DOMAIN') && MAILGUN_DOMAIN) ? MAILGUN_DOMAIN : null);
25
  $mailgun_domain = $mailgun_domain_const ?: $this->get_option('domain');
19
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
  */
21
 
22
+ global $mailgun;
23
 
24
  $mailgun_domain_const = ((defined('MAILGUN_DOMAIN') && MAILGUN_DOMAIN) ? MAILGUN_DOMAIN : null);
25
  $mailgun_domain = $mailgun_domain_const ?: $this->get_option('domain');
includes/widget.php CHANGED
@@ -37,7 +37,7 @@ class list_widget extends \WP_Widget
37
  // This is where the action happens
38
  public function widget($args, $instance)
39
  {
40
- $mailgun = Mailgun::getInstance();
41
 
42
  if (!isset($instance['list_address']) || !$instance['list_address']) {
43
  return;
@@ -63,6 +63,8 @@ class list_widget extends \WP_Widget
63
  // Widget Backend
64
  public function form($instance)
65
  {
 
 
66
  if (isset($instance['list_address'])) {
67
  $list_address = $instance['list_address'];
68
  } else {
@@ -75,8 +77,8 @@ class list_widget extends \WP_Widget
75
  $collect_name = '';
76
  }
77
 
78
- $list_title = $instance['list_title'] ?? null;
79
- $list_description = $instance['list_description'] ?? null;
80
 
81
  // Widget admin form
82
  ?>
37
  // This is where the action happens
38
  public function widget($args, $instance)
39
  {
40
+ global $mailgun;
41
 
42
  if (!isset($instance['list_address']) || !$instance['list_address']) {
43
  return;
63
  // Widget Backend
64
  public function form($instance)
65
  {
66
+ global $mailgun;
67
+
68
  if (isset($instance['list_address'])) {
69
  $list_address = $instance['list_address'];
70
  } else {
77
  $collect_name = '';
78
  }
79
 
80
+ $list_title = isset($instance['list_title']) ? $instance['list_title'] : null;
81
+ $list_description = isset($instance['list_description']) ? $instance['list_description'] : null;
82
 
83
  // Widget admin form
84
  ?>
mailgun.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Mailgun
4
  * Plugin URI: http://wordpress.org/extend/plugins/mailgun/
5
  * Description: Mailgun integration for WordPress
6
- * Version: 1.8.5
7
  * Author: Mailgun
8
  * Author URI: http://www.mailgun.com/
9
  * License: GPLv2 or later
@@ -39,11 +39,6 @@
39
  */
40
  class Mailgun
41
  {
42
- /**
43
- * @var Mailgun $instance
44
- */
45
- private static $instance;
46
-
47
  /**
48
  * @var false|mixed|null
49
  */
@@ -98,18 +93,6 @@ class Mailgun
98
  }
99
  }
100
 
101
- /**
102
- * @return static
103
- */
104
- public static function getInstance()
105
- {
106
- if (!isset(self::$instance)) {
107
- self::$instance = new self();
108
- }
109
-
110
- return self::$instance;
111
- }
112
-
113
  /**
114
  * Get specific option from the options table.
115
  *
@@ -523,7 +506,7 @@ class Mailgun
523
  }
524
  }
525
 
526
- $mailgun = Mailgun::getInstance();
527
 
528
  if (@include __DIR__ . '/includes/widget.php') {
529
  add_action('widgets_init', [&$mailgun, 'load_list_widget']);
3
  * Plugin Name: Mailgun
4
  * Plugin URI: http://wordpress.org/extend/plugins/mailgun/
5
  * Description: Mailgun integration for WordPress
6
+ * Version: 1.8.3
7
  * Author: Mailgun
8
  * Author URI: http://www.mailgun.com/
9
  * License: GPLv2 or later
39
  */
40
  class Mailgun
41
  {
 
 
 
 
 
42
  /**
43
  * @var false|mixed|null
44
  */
93
  }
94
  }
95
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  /**
97
  * Get specific option from the options table.
98
  *
506
  }
507
  }
508
 
509
+ $mailgun = new Mailgun();
510
 
511
  if (@include __DIR__ . '/includes/widget.php') {
512
  add_action('widgets_init', [&$mailgun, 'load_list_widget']);
readme.md CHANGED
@@ -5,7 +5,7 @@ Contributors: mailgun, sivel, lookahead.io, m35dev
5
  Tags: mailgun, smtp, http, api, mail, email
6
  Requires at least: 3.3
7
  Tested up to: 6.0.1
8
- Stable tag: 1.8.5
9
  License: GPLv2 or later
10
 
11
 
5
  Tags: mailgun, smtp, http, api, mail, email
6
  Requires at least: 3.3
7
  Tested up to: 6.0.1
8
+ Stable tag: 1.8.3
9
  License: GPLv2 or later
10
 
11
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Contributors: mailgun, sivel, lookahead.io, m35dev
5
  Tags: mailgun, smtp, http, api, mail, email
6
  Requires at least: 3.3
7
  Tested up to: 6.0.1
8
- Stable tag: 1.8.5
9
  License: GPLv2 or later
10
 
11
 
5
  Tags: mailgun, smtp, http, api, mail, email
6
  Requires at least: 3.3
7
  Tested up to: 6.0.1
8
+ Stable tag: 1.8.3
9
  License: GPLv2 or later
10
 
11