Mailgun for WordPress - Version 1.5.8

Version Description

(2017-01-23): = * Rewrite a large chunk of old SMTP code * Fix a bug with SMTP + "override from" that was introduced in 1.5.7 * SMTP debug logging is now controlled by MG_DEBUG_SMTP constant

Download this release

Release Info

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

Code changes from version 1.5.8.1 to 1.5.8

.gitignore ADDED
@@ -0,0 +1 @@
 
1
+ svn/
CHANGELOG.md CHANGED
@@ -1,11 +1,6 @@
1
  Changelog
2
  =========
3
 
4
- 1.5.8.1 (2017-02-06):
5
- - Fix "Undefined property: MailgunAdmin::$hook_suffix" (#48)
6
- - Fix "Undefined variable: from_name on every email process" (API and SMTP) (#49)
7
- - Admin code now loads only on admin user access
8
-
9
  1.5.8 (2017-01-23):
10
  * Rewrite a large chunk of old SMTP code
11
  * Fix a bug with SMTP + "override from" that was introduced in 1.5.7
1
  Changelog
2
  =========
3
 
 
 
 
 
 
4
  1.5.8 (2017-01-23):
5
  * Rewrite a large chunk of old SMTP code
6
  * Fix a bug with SMTP + "override from" that was introduced in 1.5.7
includes/admin.php CHANGED
@@ -306,8 +306,7 @@ class MailgunAdmin extends Mailgun
306
  public function admin_notices()
307
  {
308
  $screen = get_current_screen();
309
- if (!current_user_can('manage_options') || $screen->id == $this->hook_suffix
310
- ) {
311
  return;
312
  }
313
 
@@ -315,7 +314,7 @@ class MailgunAdmin extends Mailgun
315
  || (!$this->get_option('password') && $this->get_option('useAPI') === '0')
316
  ) {
317
  ?>
318
- <div id='mailgun-warning' class='notice notice-warning fade'><p><strong><?php _e('Mailgun is almost ready. ', 'mailgun'); ?></strong><?php printf(__('You must <a href="%1$s">configure Mailgun</a> for it to work.', 'mailgun'), menu_page_url('mailgun', false)); ?></p></div>
319
  <?php
320
 
321
  }
@@ -325,7 +324,7 @@ class MailgunAdmin extends Mailgun
325
  || !$this->get_option('from-address'))
326
  ) {
327
  ?>
328
- <div id='mailgun-warning' class='notice notice-warning fade'><p><strong><?php _e('Mailgun is almost ready. ', 'mailgun'); ?></strong><?php printf(__('"Override From" option requires that "From Name" and "From Address" be set to work properly! <a href="%1$s">Configure Mailgun now</a>.', 'mailgun'), menu_page_url('mailgun', false)); ?></p></div>
329
  <?php
330
 
331
  }
306
  public function admin_notices()
307
  {
308
  $screen = get_current_screen();
309
+ if ($screen->id == $this->hook_suffix) {
 
310
  return;
311
  }
312
 
314
  || (!$this->get_option('password') && $this->get_option('useAPI') === '0')
315
  ) {
316
  ?>
317
+ <div id='mailgun-warning' class='updated fade'><p><strong><?php _e('Mailgun is almost ready. ', 'mailgun'); ?></strong><?php printf(__('You must <a href="%1$s">configure Mailgun</a> for it to work.', 'mailgun'), menu_page_url('mailgun', false)); ?></p></div>
318
  <?php
319
 
320
  }
324
  || !$this->get_option('from-address'))
325
  ) {
326
  ?>
327
+ <div id='mailgun-warning' class='updated fade'><p><strong><?php _e('Mailgun is almost ready. ', 'mailgun'); ?></strong><?php printf(__('"Override From" option requires that "From Name" and "From Address" be set to work properly! <a href="%1$s">Configure Mailgun now</a>.', 'mailgun'), menu_page_url('mailgun', false)); ?></p></div>
328
  <?php
329
 
330
  }
includes/wp-mail-api.php CHANGED
@@ -203,14 +203,6 @@ function wp_mail($to, $subject, $message, $headers = '', $attachments = array())
203
  }
204
  }
205
 
206
- if (!isset($from_name)) {
207
- $from_name = null;
208
- }
209
-
210
- if (!isset($from_email)) {
211
- $from_email = null;
212
- }
213
-
214
  $from_name = mg_detect_from_name($from_name);
215
  $from_email = mg_detect_from_address($from_email);
216
 
203
  }
204
  }
205
 
 
 
 
 
 
 
 
 
206
  $from_name = mg_detect_from_name($from_name);
207
  $from_email = mg_detect_from_address($from_email);
208
 
includes/wp-mail-smtp.php CHANGED
@@ -128,14 +128,6 @@ function mg_smtp_mail_filter(array $args)
128
  }
129
  }
130
 
131
- if (!isset($from_name)) {
132
- $from_name = null;
133
- }
134
-
135
- if (!isset($from_addr)) {
136
- $from_addr = null;
137
- }
138
-
139
  $from_name = mg_detect_from_name($from_name);
140
  $from_addr = mg_detect_from_address($from_addr);
141
 
128
  }
129
  }
130
 
 
 
 
 
 
 
 
 
131
  $from_name = mg_detect_from_name($from_name);
132
  $from_addr = mg_detect_from_address($from_addr);
133
 
mailgun.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Mailgun
5
  * Plugin URI: http://wordpress.org/extend/plugins/mailgun/
6
  * Description: Mailgun integration for WordPress
7
- * Version: 1.5.8.1
8
  * Author: Mailgun
9
  * Author URI: http://www.mailgun.com/
10
  * License: GPLv2 or later
4
  * Plugin Name: Mailgun
5
  * Plugin URI: http://wordpress.org/extend/plugins/mailgun/
6
  * Description: Mailgun integration for WordPress
7
+ * Version: 1.5.8
8
  * Author: Mailgun
9
  * Author URI: http://www.mailgun.com/
10
  * License: GPLv2 or later
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: 4.7.1
8
- Stable tag: 1.5.8.1
9
  License: GPLv2 or later
10
 
11
 
@@ -76,11 +76,6 @@ MAILGUN_FROM_ADDRESS Type: string
76
 
77
  == Changelog ==
78
 
79
- = 1.5.8.1 (2017-02-06): =
80
- - Fix "Undefined property: MailgunAdmin::$hook_suffix" (#48)
81
- - Fix "Undefined variable: from_name on every email process" (API and SMTP) (#49)
82
- - Admin code now loads only on admin user access
83
-
84
  = 1.5.8 (2017-01-23): =
85
  * Rewrite a large chunk of old SMTP code
86
  * Fix a bug with SMTP + "override from" that was introduced in 1.5.7
5
  Tags: mailgun, smtp, http, api, mail, email
6
  Requires at least: 3.3
7
  Tested up to: 4.7.1
8
+ Stable tag: 1.5.8
9
  License: GPLv2 or later
10
 
11
 
76
 
77
  == Changelog ==
78
 
 
 
 
 
 
79
  = 1.5.8 (2017-01-23): =
80
  * Rewrite a large chunk of old SMTP code
81
  * Fix a bug with SMTP + "override from" that was introduced in 1.5.7