Mailgun for WordPress - Version 1.5.12.3

Version Description

(2018-08-09): = - Fix Region select menu default when wp-config.php variable is set - Fix front end email input validation

Download this release

Release Info

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

Code changes from version 1.5.12.2 to 1.5.12.3

CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
  Changelog
2
  =========
3
 
 
 
 
 
4
  1.5.12.2 (2018-08-09)
5
  - Fix plugin not saving after update
6
 
1
  Changelog
2
  =========
3
 
4
+ 1.5.12.3 (2018-08-09)
5
+ - Fix Region select menu default when wp-config.php variable is set
6
+ - Fix front end email input validation
7
+
8
  1.5.12.2 (2018-08-09)
9
  - Fix plugin not saving after update
10
 
includes/admin.php CHANGED
@@ -68,9 +68,10 @@ class MailgunAdmin extends Mailgun
68
  if (substr($sitename, 0, 4) == 'www.') {
69
  $sitename = substr($sitename, 4);
70
  }
 
71
 
72
  $this->defaults = array(
73
- 'region' => '0',
74
  'useAPI' => '1',
75
  'apiKey' => '',
76
  'domain' => '',
68
  if (substr($sitename, 0, 4) == 'www.') {
69
  $sitename = substr($sitename, 4);
70
  }
71
+ $regionDefault = (defined('MAILGUN_REGION') && MAILGUN_REGION) ? MAILGUN_REGION : $this->get_option('region');
72
 
73
  $this->defaults = array(
74
+ 'region' => $regionDefault,
75
  'useAPI' => '1',
76
  'apiKey' => '',
77
  'domain' => '',
includes/mg-filter.php CHANGED
@@ -306,5 +306,4 @@ function mg_detect_region($getRegion)
306
  }
307
 
308
  return false;
309
- }
310
-
306
  }
307
 
308
  return false;
309
+ }
 
includes/options-page.php CHANGED
@@ -32,14 +32,29 @@
32
  <table class="form-table">
33
  <tr valign="top">
34
  <th scope="row">
35
- <?php _e('Select Your Region', 'mailgun'); ?>
 
 
 
 
 
 
 
36
  </th>
37
  <td>
38
- <select id="mailgun-region" name="mailgun[region]">
39
- <option value="us"<?php selected('us', $this->get_option('region')); ?>><?php _e('U.S./North America', 'mailgun') ?></option>
40
- <option value="eu"<?php selected('eu', $this->get_option('region')); ?>><?php _e('Europe', 'mailgun') ?></option>
41
- </select>
42
- <p class="description"><?php _e('Choose a region - U.S./North America or Europe - from which to send email, and to store your customer data.', 'mailgun') ?></p>
 
 
 
 
 
 
 
 
43
  </td>
44
  </tr>
45
  <tr valign="top">
32
  <table class="form-table">
33
  <tr valign="top">
34
  <th scope="row">
35
+ <?php
36
+ $config_region = (defined('MAILGUN_REGION') && MAILGUN_REGION);
37
+ if ($config_region):
38
+ _e('Your Region is', 'mailgun');
39
+ else:
40
+ _e('Select Your Region', 'mailgun');
41
+ endif;
42
+ ?>
43
  </th>
44
  <td>
45
+ <?php
46
+ if ($config_region):
47
+ $region = (MAILGUN_REGION === 'us') ? __('U.S./North America', 'mailgun') : __('Europe', 'mailgun');
48
+ ?>
49
+ <input readonly="readonly" id="mailgun-region" type="text" name="mailgun[region]" value="<?php echo $region ?>">
50
+ <p class="description"><?php _e('You have set the region in your wp-config.php file. Email will be sent from this region, and your customer data will be stored in this region.', 'mailgun') ?></p>
51
+ <?php else: ?>
52
+ <select id="mailgun-region" name="mailgun[region]">
53
+ <option value="us"<?php selected('us', $this->get_option('region')); ?>><?php _e('U.S./North America', 'mailgun') ?></option>
54
+ <option value="eu"<?php selected('eu', $this->get_option('region')); ?>><?php _e('Europe', 'mailgun') ?></option>
55
+ </select>
56
+ <p class="description"><?php _e('Choose a region - U.S./North America or Europe - from which to send email, and to store your customer data.', 'mailgun') ?></p>
57
+ <?php endif; ?>
58
  </td>
59
  </tr>
60
  <tr valign="top">
includes/wp-mail-api.php CHANGED
@@ -114,7 +114,7 @@ function wp_mail($to, $subject, $message, $headers = '', $attachments = array())
114
  extract(apply_filters('wp_mail', compact('to', 'subject', 'message', 'headers', 'attachments')));
115
 
116
  $mailgun = get_option('mailgun');
117
- $getRegion = (defined('MAILGUN_REGION') && MAILGUNE_REGION) ? MAILGUN_REGION : $mailgun['region'];
118
  $apiKey = (defined('MAILGUN_APIKEY') && MAILGUN_APIKEY) ? MAILGUN_APIKEY : $mailgun['apiKey'];
119
  $domain = (defined('MAILGUN_DOMAIN') && MAILGUN_DOMAIN) ? MAILGUN_DOMAIN : $mailgun['domain'];
120
 
114
  extract(apply_filters('wp_mail', compact('to', 'subject', 'message', 'headers', 'attachments')));
115
 
116
  $mailgun = get_option('mailgun');
117
+ $getRegion = (defined('MAILGUN_REGION') && MAILGUN_REGION) ? MAILGUN_REGION : $mailgun['region'];
118
  $apiKey = (defined('MAILGUN_APIKEY') && MAILGUN_APIKEY) ? MAILGUN_APIKEY : $mailgun['apiKey'];
119
  $domain = (defined('MAILGUN_DOMAIN') && MAILGUN_DOMAIN) ? MAILGUN_DOMAIN : $mailgun['domain'];
120
 
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.12.2
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.12.3
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.9.7
8
- Stable tag: 1.5.12.2
9
  License: GPLv2 or later
10
 
11
 
@@ -128,6 +128,10 @@ MAILGUN_FROM_ADDRESS Type: string
128
 
129
  == Changelog ==
130
 
 
 
 
 
131
  = 1.5.12.2 (2018-08-09): =
132
  - Fix plugin not saving after update
133
 
5
  Tags: mailgun, smtp, http, api, mail, email
6
  Requires at least: 3.3
7
  Tested up to: 4.9.7
8
+ Stable tag: 1.5.12.3
9
  License: GPLv2 or later
10
 
11
 
128
 
129
  == Changelog ==
130
 
131
+ = 1.5.12.3 (2018-08-09): =
132
+ - Fix Region select menu default when wp-config.php variable is set
133
+ - Fix front end email input validation
134
+
135
  = 1.5.12.2 (2018-08-09): =
136
  - Fix plugin not saving after update
137