Mailgun for WordPress - Version 1.5.6

Version Description

(2016-12-30): = * Fix a very subtle bug causing fatal errors with older PHP versions < 5.5 * Respect wp_mail_content_type (#37 - @FPCSJames)

Download this release

Release Info

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

Code changes from version 1.5.5 to 1.5.6

Files changed (5) hide show
  1. CHANGELOG.md +4 -0
  2. includes/admin.php +5 -4
  3. includes/wp-mail.php +8 -0
  4. mailgun.php +1 -1
  5. readme.txt +5 -1
CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
  Changelog
2
  =========
3
 
 
 
 
 
4
  1.5.5 (2016-12-27):
5
  * Restructure the `admin_notices` code
6
  * Restructure the "From Name" / "From Address" code
1
  Changelog
2
  =========
3
 
4
+ 1.5.6 (2016-12-30):
5
+ * Fix a very subtle bug causing fatal errors with older PHP versions < 5.5
6
+ * Respect `wp_mail_content_type` (#37 - @FPCSJames)
7
+
8
  1.5.5 (2016-12-27):
9
  * Restructure the `admin_notices` code
10
  * Restructure the "From Name" / "From Address" code
includes/admin.php CHANGED
@@ -295,22 +295,23 @@ class MailgunAdmin extends Mailgun
295
  return;
296
  }
297
 
298
- if ((empty($this->get_option('apiKey')) && $this->get_option('useAPI') == '1')
299
- || (empty($this->get_option('password')) && $this->get_option('useAPI') == '0')
300
  ) { ?>
301
  <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>
302
  <?php
303
  }
304
 
305
  if ($this->get_option('override-from') === '1'
306
- && (empty($this->get_option('from-name'))
307
- || empty($this->get_option('from-address')))
308
  ) { ?>
309
  <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>
310
  <?php
311
  }
312
  }
313
 
 
314
  /**
315
  * Add a settings link to the plugin actions.
316
  *
295
  return;
296
  }
297
 
298
+ if ((!$this->get_option('apiKey') && $this->get_option('useAPI') === '1')
299
+ || (!$this->get_option('password') && $this->get_option('useAPI') === '0')
300
  ) { ?>
301
  <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>
302
  <?php
303
  }
304
 
305
  if ($this->get_option('override-from') === '1'
306
+ && (!$this->get_option('from-name')
307
+ || !$this->get_option('from-address'))
308
  ) { ?>
309
  <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>
310
  <?php
311
  }
312
  }
313
 
314
+
315
  /**
316
  * Add a settings link to the plugin actions.
317
  *
includes/wp-mail.php CHANGED
@@ -276,6 +276,14 @@ function wp_mail($to, $subject, $message, $headers = '', $attachments = array())
276
  $body['bcc'] = implode(', ', $bcc);
277
  }
278
 
 
 
 
 
 
 
 
 
279
  // If we are not given a Content-Type from the supplied headers, use
280
  // text/html and *attempt* to strip tags and provide a text/plain
281
  // version.
276
  $body['bcc'] = implode(', ', $bcc);
277
  }
278
 
279
+ // Allow external content type filter to function normally
280
+ if (has_filter('wp_mail_content_type')) {
281
+ $content_type = apply_filters(
282
+ 'wp_mail_content_type',
283
+ $content_type
284
+ );
285
+ }
286
+
287
  // If we are not given a Content-Type from the supplied headers, use
288
  // text/html and *attempt* to strip tags and provide a text/plain
289
  // version.
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.5
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.6
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
8
- Stable tag: 1.5.5
9
  License: GPLv2 or later
10
 
11
 
@@ -68,6 +68,10 @@ MAILGUN_SECURE Type: boolean
68
 
69
  == Changelog ==
70
 
 
 
 
 
71
  = 1.5.5 (2016-12-27): =
72
  * Restructure the `admin_notices` code
73
  * Restructure the "From Name" / "From Address" code
5
  Tags: mailgun, smtp, http, api, mail, email
6
  Requires at least: 3.3
7
  Tested up to: 4.7
8
+ Stable tag: 1.5.6
9
  License: GPLv2 or later
10
 
11
 
68
 
69
  == Changelog ==
70
 
71
+ = 1.5.6 (2016-12-30): =
72
+ * Fix a very subtle bug causing fatal errors with older PHP versions < 5.5
73
+ * Respect `wp_mail_content_type` (#37 - @FPCSJames)
74
+
75
  = 1.5.5 (2016-12-27): =
76
  * Restructure the `admin_notices` code
77
  * Restructure the "From Name" / "From Address" code