Mailgun for WordPress - Version 1.5.5

Version Description

(2016-12-27): = * Restructure the admin_notices code * Restructure the "From Name" / "From Address" code * Add option to override "From Name" / "From Address" setting set by other plugins * Fix a bug causing default "From Name" / "From Address" to be always applied in some cases * Moved plugin header up in entrypoint file (https://wordpress.org/support/topic/plugin-activation-due-to-header/#post-8598062) * Fixed a bug causing "Override From" to be set to "yes" after upgrades

Download this release

Release Info

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

Code changes from version 1.5.4 to 1.5.5

CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
  Changelog
2
  =========
3
 
 
 
 
 
 
 
 
 
4
  1.5.4 (2016-12-23):
5
  * Changed some missed bracketed array usages to `array()` syntax
6
  * Fix `wp_mail_from` / `wp_mail_from_name` not working on old PHP / WP versions
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
7
+ * Add option to override "From Name" / "From Address" setting set by other plugins
8
+ * Fix a bug causing default "From Name" / "From Address" to be always applied in some cases
9
+ * Moved plugin header up in entrypoint file (https://wordpress.org/support/topic/plugin-activation-due-to-header/#post-8598062)
10
+ * Fixed a bug causing "Override From" to be set to "yes" after upgrades
11
+
12
  1.5.4 (2016-12-23):
13
  * Changed some missed bracketed array usages to `array()` syntax
14
  * Fix `wp_mail_from` / `wp_mail_from_name` not working on old PHP / WP versions
includes/admin.php CHANGED
@@ -65,16 +65,17 @@ class MailgunAdmin extends Mailgun
65
  }
66
 
67
  $defaults = array(
68
- 'useAPI' => '1',
69
- 'apiKey' => '',
70
- 'domain' => '',
71
- 'username' => '',
72
- 'password' => '',
73
- 'secure' => '1',
74
- 'track-clicks' => '',
75
- 'track-opens' => '',
76
- 'campaign-id' => '',
77
- 'tag' => $sitename,
 
78
  );
79
  if (!$this->options) {
80
  $this->options = $defaults;
@@ -223,9 +224,8 @@ class MailgunAdmin extends Mailgun
223
  $apiKey = $this->get_option('apiKey');
224
  $useAPI = $this->get_option('useAPI');
225
  $password = $this->get_option('password');
226
- if ((empty($apiKey) && $useAPI == '1') || (empty($password) && $useAPI == '0')) {
227
- add_action('admin_notices', array(&$this, 'admin_notices'));
228
- }
229
  }
230
 
231
  /**
@@ -293,10 +293,22 @@ class MailgunAdmin extends Mailgun
293
  $screen = get_current_screen();
294
  if ($screen->id == $this->hook_suffix) {
295
  return;
296
- } ?>
297
- <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>
 
 
 
 
298
  <?php
 
299
 
 
 
 
 
 
 
 
300
  }
301
 
302
  /**
65
  }
66
 
67
  $defaults = array(
68
+ 'useAPI' => '1',
69
+ 'apiKey' => '',
70
+ 'domain' => '',
71
+ 'username' => '',
72
+ 'password' => '',
73
+ 'secure' => '1',
74
+ 'track-clicks' => '',
75
+ 'track-opens' => '',
76
+ 'campaign-id' => '',
77
+ 'override-from' => '0',
78
+ 'tag' => $sitename,
79
  );
80
  if (!$this->options) {
81
  $this->options = $defaults;
224
  $apiKey = $this->get_option('apiKey');
225
  $useAPI = $this->get_option('useAPI');
226
  $password = $this->get_option('password');
227
+
228
+ add_action('admin_notices', array(&$this, 'admin_notices'));
 
229
  }
230
 
231
  /**
293
  $screen = get_current_screen();
294
  if ($screen->id == $this->hook_suffix) {
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
  /**
includes/options-page.php CHANGED
@@ -133,6 +133,18 @@
133
  <p class="description"><?php _e('The "User Name" part of the sender information (<code>"Excited User &lt;user@samples.mailgun.org&gt;"</code>).', 'mailgun'); ?></p>
134
  </td>
135
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
136
  <tr valign="top">
137
  <th scope="row">
138
  <?php _e('Tag', 'mailgun'); ?>
133
  <p class="description"><?php _e('The "User Name" part of the sender information (<code>"Excited User &lt;user@samples.mailgun.org&gt;"</code>).', 'mailgun'); ?></p>
134
  </td>
135
  </tr>
136
+ <tr valign="top">
137
+ <th scope="row">
138
+ <?php _e('Override "From" Details', 'mailgun'); ?>
139
+ </th>
140
+ <td>
141
+ <select name="mailgun[override-from]">
142
+ <option value="1"<?php selected('1', $this->get_option('override-from', null, '0')); ?>><?php _e('Yes', 'mailgun'); ?></option>
143
+ <option value="0"<?php selected('0', $this->get_option('override-from', null, '0')); ?>><?php _e('No', 'mailgun'); ?></option>
144
+ </select>
145
+ <p class="description"><?php _e('If enabled, all emails will be sent with the above "From Name" and "From Address", regardless of values set by other plugins. Useful for cases where other plugins don\'t play nice with our "From Name" / "From Address" setting.', 'mailgun'); ?></p>
146
+ </td>
147
+ </tr>
148
  <tr valign="top">
149
  <th scope="row">
150
  <?php _e('Tag', 'mailgun'); ?>
includes/wp-mail.php CHANGED
@@ -180,46 +180,63 @@ function wp_mail($to, $subject, $message, $headers = '', $attachments = array())
180
  }
181
  }
182
 
183
- // From email and name
184
- // If we don't have a name from the input headers
185
- if (!isset($from_name) && !empty($mailgun['from-name'])) {
186
  $from_name = $mailgun['from-name'];
187
- } else {
188
- $from_name = 'WordPress';
189
- }
190
-
191
- /* If we don't have an email from the input headers default to wordpress@$sitename
192
- * Some hosts will block outgoing mail from this address if it doesn't exist but
193
- * there's no easy alternative. Defaulting to admin_email might appear to be another
194
- * option but some hosts may refuse to relay mail from an unknown domain. See
195
- * http://trac.wordpress.org/ticket/5007.
196
- */
197
-
198
- if (!isset($from_email) && !empty($mailgun['from-address'])) {
199
  $from_email = $mailgun['from-address'];
200
  } else {
201
- // Get the site domain and get rid of www.
202
- $sitename = strtolower($_SERVER['SERVER_NAME']);
203
- if (substr($sitename, 0, 4) == 'www.') {
204
- $sitename = substr($sitename, 4);
 
 
 
 
 
 
205
  }
206
 
207
- $from_email = 'wordpress@'.$sitename;
208
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
 
210
- // Attempt to apply external filters to these values before using our own.
211
- if (has_filter('wp_mail_from')) {
212
- $from_email = apply_filters(
213
- 'wp_mail_from',
214
- $from_email
215
- );
216
- }
217
 
218
- if (has_filter('wp_mail_from_name')) {
219
- $from_name = apply_filters(
220
- 'wp_mail_from_name',
221
- $from_name
222
- );
 
 
 
 
 
 
 
 
 
223
  }
224
 
225
  $body = array(
180
  }
181
  }
182
 
183
+ if ($mailgun['override-from'] && !empty($mailgun['from-name'])
184
+ && !empty($mailgun['from-address'])
185
+ ) {
186
  $from_name = $mailgun['from-name'];
 
 
 
 
 
 
 
 
 
 
 
 
187
  $from_email = $mailgun['from-address'];
188
  } else {
189
+ // From email and name
190
+ // If we don't have a name from the input headers
191
+ if (empty($from_name) && !empty($mailgun['from-name'])) {
192
+ $from_name = $mailgun['from-name'];
193
+ } elseif (empty($from_email) && empty($mailgun['from-name'])) {
194
+ if (function_exists('get_current_site')) {
195
+ $from_name = get_current_site()->site_name;
196
+ } else {
197
+ $from_name = 'WordPress';
198
+ }
199
  }
200
 
201
+ /* If we don't have `From` input headers, use wordpress@$sitedomain
202
+ * Some hosts will block outgoing mail from this address if it doesn't
203
+ * exist but there's no easy alternative. Defaulting to admin_email
204
+ * might appear to be another option but some hosts may refuse to
205
+ * relay mail from an unknown domain.
206
+ *
207
+ * @link http://trac.wordpress.org/ticket/5007.
208
+ */
209
+
210
+ if (empty($from_email) && !empty($mailgun['from-address'])) {
211
+ $from_email = $mailgun['from-address'];
212
+ } elseif (empty($from_email) && empty($mailgun['from-address'])) {
213
+ if (function_exists('get_current_site')) {
214
+ $sitedomain = get_current_site()->domain;
215
+ } else {
216
+ // Get the site domain and get rid of www.
217
+ $sitedomain = strtolower($_SERVER['SERVER_NAME']);
218
+ if (substr($sitedomain, 0, 4) == 'www.') {
219
+ $sitedomain = substr($sitedomain, 4);
220
+ }
221
+ }
222
 
223
+ $from_email = 'wordpress@'.$sitedomain;
224
+ }
 
 
 
 
 
225
 
226
+ // Attempt to apply external filters to these values before using our own.
227
+ if (has_filter('wp_mail_from')) {
228
+ $from_email = apply_filters(
229
+ 'wp_mail_from',
230
+ $from_email
231
+ );
232
+ }
233
+
234
+ if (has_filter('wp_mail_from_name')) {
235
+ $from_name = apply_filters(
236
+ 'wp_mail_from_name',
237
+ $from_name
238
+ );
239
+ }
240
  }
241
 
242
  $body = array(
languages/mailgun-template.po CHANGED
@@ -2,94 +2,100 @@
2
  # This file is distributed under the same license as the Mailgun package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Mailgun 1.5.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mailgun\n"
7
- "POT-Creation-Date: 2016-12-21 20:39:18+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2016-12-21 14:49-0600\n"
12
  "Last-Translator: Sean Johnson <sean@mailgun.com>\n"
13
  "Language-Team: Mailgun <support@mailgun.com>\n"
14
 
15
- #. #-#-#-#-# plugin.pot (Mailgun 1.5.2) #-#-#-#-#
16
  #. Plugin Name of the plugin/theme
17
- #. #-#-#-#-# plugin.pot (Mailgun 1.5.2) #-#-#-#-#
18
  #. Author of the plugin/theme
19
- #: includes/admin.php:95 includes/options-page.php:26
20
  msgid "Mailgun"
21
  msgstr ""
22
 
23
- #: includes/admin.php:96 includes/lists-page.php:51
24
  msgid "Mailgun Lists"
25
  msgstr ""
26
 
27
- #: includes/admin.php:144
28
  msgid ""
29
  "The Mailgun plugin configuration has changed since you last saved. Do you "
30
  "wish to test anyway?\\n\\nClick \"Cancel\" and then \"Save Changes\" if you "
31
  "wish to save your changes."
32
  msgstr ""
33
 
34
- #: includes/admin.php:149
35
  msgid "Testing..."
36
  msgstr ""
37
 
38
- #: includes/admin.php:159 includes/options-page.php:174
39
  msgid "Test Configuration"
40
  msgstr ""
41
 
42
- #: includes/admin.php:168 includes/admin.php:372
43
  msgid "Failure"
44
  msgstr ""
45
 
46
- #: includes/admin.php:191
47
  msgid ""
48
  "<div id=\"message\" class=\"updated fade\"><p>The options page for the "
49
  "<strong>Mailgun</strong> plugin cannot be displayed. The file <strong>%s</"
50
  "strong> is missing. Please reinstall the plugin.</p></div>"
51
  msgstr ""
52
 
53
- #: includes/admin.php:205
54
  msgid ""
55
  "<div id=\"message\" class=\"updated fade\"><p>The lists page for the "
56
  "<strong>Mailgun</strong> plugin cannot be displayed. The file <strong>%s</"
57
  "strong> is missing. Please reinstall the plugin.</p></div>"
58
  msgstr ""
59
 
60
- #: includes/admin.php:297
61
  msgid "Mailgun is almost ready. "
62
  msgstr ""
63
 
64
- #: includes/admin.php:297
65
  msgid "You must <a href=\"%1$s\">configure Mailgun</a> for it to work."
66
  msgstr ""
67
 
68
- #: includes/admin.php:313
 
 
 
 
 
 
69
  msgid "Settings"
70
  msgstr ""
71
 
72
- #: includes/admin.php:335
73
  msgid "Unauthorized"
74
  msgstr ""
75
 
76
- #: includes/admin.php:345
77
  msgid "HTTP API"
78
  msgstr ""
79
 
80
- #: includes/admin.php:347
81
  msgid "Secure SMTP"
82
  msgstr ""
83
 
84
- #: includes/admin.php:347
85
  msgid "SMTP"
86
  msgstr ""
87
 
88
- #: includes/admin.php:353
89
  msgid "Mailgun WordPress Plugin Test"
90
  msgstr ""
91
 
92
- #: includes/admin.php:354
93
  msgid ""
94
  "This is a test email generated by the Mailgun WordPress plugin.\n"
95
  "\n"
@@ -98,7 +104,7 @@ msgid ""
98
  "The method used to send this email was: %s."
99
  msgstr ""
100
 
101
- #: includes/admin.php:362 includes/admin.php:364
102
  msgid "Success"
103
  msgstr ""
104
 
@@ -128,11 +134,13 @@ msgstr ""
128
 
129
  #: includes/options-page.php:39 includes/options-page.php:87
130
  #: includes/options-page.php:99 includes/options-page.php:112
 
131
  msgid "Yes"
132
  msgstr ""
133
 
134
  #: includes/options-page.php:40 includes/options-page.php:88
135
  #: includes/options-page.php:101 includes/options-page.php:113
 
136
  msgid "No"
137
  msgstr ""
138
 
@@ -233,42 +241,54 @@ msgid ""
233
  msgstr ""
234
 
235
  #: includes/options-page.php:138
 
 
 
 
 
 
 
 
 
 
 
 
236
  msgid "Tag"
237
  msgstr ""
238
 
239
- #: includes/options-page.php:142
240
  msgid ""
241
  "If added, this tag will exist on every outbound message. Statistics will be "
242
  "populated in the Mailgun Control Panel. Use a comma to define multiple tags."
243
  msgstr ""
244
 
245
- #: includes/options-page.php:142
246
  msgid "Learn more about"
247
  msgstr ""
248
 
249
- #: includes/options-page.php:142
250
  msgid "and"
251
  msgstr ""
252
 
253
- #: includes/options-page.php:146 includes/options-page.php:163
254
  msgid "Lists"
255
  msgstr ""
256
 
257
- #: includes/options-page.php:150
258
  msgid "Shortcode"
259
  msgstr ""
260
 
261
- #: includes/options-page.php:157
262
  msgid ""
263
  "Use the shortcode above to associate a widget instance with a mailgun list"
264
  msgstr ""
265
 
266
- #: includes/options-page.php:171
267
  msgid ""
268
  "Before attempting to test the configuration, please click \"Save Changes\"."
269
  msgstr ""
270
 
271
- #: includes/options-page.php:173
272
  msgid "Save Changes"
273
  msgstr ""
274
 
2
  # This file is distributed under the same license as the Mailgun package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Mailgun 1.5.5\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mailgun\n"
7
+ "POT-Creation-Date: 2016-12-27 21:02:24+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2016-12-27 15:07-0600\n"
12
  "Last-Translator: Sean Johnson <sean@mailgun.com>\n"
13
  "Language-Team: Mailgun <support@mailgun.com>\n"
14
 
15
+ #. #-#-#-#-# plugin.pot (Mailgun 1.5.5) #-#-#-#-#
16
  #. Plugin Name of the plugin/theme
17
+ #. #-#-#-#-# plugin.pot (Mailgun 1.5.5) #-#-#-#-#
18
  #. Author of the plugin/theme
19
+ #: includes/admin.php:96 includes/options-page.php:26
20
  msgid "Mailgun"
21
  msgstr ""
22
 
23
+ #: includes/admin.php:97 includes/lists-page.php:51
24
  msgid "Mailgun Lists"
25
  msgstr ""
26
 
27
+ #: includes/admin.php:145
28
  msgid ""
29
  "The Mailgun plugin configuration has changed since you last saved. Do you "
30
  "wish to test anyway?\\n\\nClick \"Cancel\" and then \"Save Changes\" if you "
31
  "wish to save your changes."
32
  msgstr ""
33
 
34
+ #: includes/admin.php:150
35
  msgid "Testing..."
36
  msgstr ""
37
 
38
+ #: includes/admin.php:160 includes/options-page.php:186
39
  msgid "Test Configuration"
40
  msgstr ""
41
 
42
+ #: includes/admin.php:169 includes/admin.php:384
43
  msgid "Failure"
44
  msgstr ""
45
 
46
+ #: includes/admin.php:192
47
  msgid ""
48
  "<div id=\"message\" class=\"updated fade\"><p>The options page for the "
49
  "<strong>Mailgun</strong> plugin cannot be displayed. The file <strong>%s</"
50
  "strong> is missing. Please reinstall the plugin.</p></div>"
51
  msgstr ""
52
 
53
+ #: includes/admin.php:206
54
  msgid ""
55
  "<div id=\"message\" class=\"updated fade\"><p>The lists page for the "
56
  "<strong>Mailgun</strong> plugin cannot be displayed. The file <strong>%s</"
57
  "strong> is missing. Please reinstall the plugin.</p></div>"
58
  msgstr ""
59
 
60
+ #: includes/admin.php:301 includes/admin.php:309
61
  msgid "Mailgun is almost ready. "
62
  msgstr ""
63
 
64
+ #: includes/admin.php:301
65
  msgid "You must <a href=\"%1$s\">configure Mailgun</a> for it to work."
66
  msgstr ""
67
 
68
+ #: includes/admin.php:309
69
+ msgid ""
70
+ "\"Override From\" option requires that \"From Name\" and \"From Address\" be "
71
+ "set to work properly! <a href=\"%1$s\">Configure Mailgun now</a>."
72
+ msgstr ""
73
+
74
+ #: includes/admin.php:325
75
  msgid "Settings"
76
  msgstr ""
77
 
78
+ #: includes/admin.php:347
79
  msgid "Unauthorized"
80
  msgstr ""
81
 
82
+ #: includes/admin.php:357
83
  msgid "HTTP API"
84
  msgstr ""
85
 
86
+ #: includes/admin.php:359
87
  msgid "Secure SMTP"
88
  msgstr ""
89
 
90
+ #: includes/admin.php:359
91
  msgid "SMTP"
92
  msgstr ""
93
 
94
+ #: includes/admin.php:365
95
  msgid "Mailgun WordPress Plugin Test"
96
  msgstr ""
97
 
98
+ #: includes/admin.php:366
99
  msgid ""
100
  "This is a test email generated by the Mailgun WordPress plugin.\n"
101
  "\n"
104
  "The method used to send this email was: %s."
105
  msgstr ""
106
 
107
+ #: includes/admin.php:374 includes/admin.php:376
108
  msgid "Success"
109
  msgstr ""
110
 
134
 
135
  #: includes/options-page.php:39 includes/options-page.php:87
136
  #: includes/options-page.php:99 includes/options-page.php:112
137
+ #: includes/options-page.php:142
138
  msgid "Yes"
139
  msgstr ""
140
 
141
  #: includes/options-page.php:40 includes/options-page.php:88
142
  #: includes/options-page.php:101 includes/options-page.php:113
143
+ #: includes/options-page.php:143
144
  msgid "No"
145
  msgstr ""
146
 
241
  msgstr ""
242
 
243
  #: includes/options-page.php:138
244
+ msgid "Override \"From\" Details"
245
+ msgstr ""
246
+
247
+ #: includes/options-page.php:145
248
+ msgid ""
249
+ "If enabled, all emails will be sent with the above \"From Name\" and \"From "
250
+ "Address\", regardless of values set by other plugins. Useful for cases where "
251
+ "other plugins don't play nice with our \"From Name\" / \"From Address\" "
252
+ "setting."
253
+ msgstr ""
254
+
255
+ #: includes/options-page.php:150
256
  msgid "Tag"
257
  msgstr ""
258
 
259
+ #: includes/options-page.php:154
260
  msgid ""
261
  "If added, this tag will exist on every outbound message. Statistics will be "
262
  "populated in the Mailgun Control Panel. Use a comma to define multiple tags."
263
  msgstr ""
264
 
265
+ #: includes/options-page.php:154
266
  msgid "Learn more about"
267
  msgstr ""
268
 
269
+ #: includes/options-page.php:154
270
  msgid "and"
271
  msgstr ""
272
 
273
+ #: includes/options-page.php:158 includes/options-page.php:175
274
  msgid "Lists"
275
  msgstr ""
276
 
277
+ #: includes/options-page.php:162
278
  msgid "Shortcode"
279
  msgstr ""
280
 
281
+ #: includes/options-page.php:169
282
  msgid ""
283
  "Use the shortcode above to associate a widget instance with a mailgun list"
284
  msgstr ""
285
 
286
+ #: includes/options-page.php:183
287
  msgid ""
288
  "Before attempting to test the configuration, please click \"Save Changes\"."
289
  msgstr ""
290
 
291
+ #: includes/options-page.php:185
292
  msgid "Save Changes"
293
  msgstr ""
294
 
mailgun.php CHANGED
@@ -1,5 +1,17 @@
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  /*
4
  * mailgun-wordpress-plugin - Sending mail from Wordpress using Mailgun
5
  * Copyright (C) 2016 Mailgun, et al.
@@ -19,17 +31,6 @@
19
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
  */
21
 
22
- /**
23
- * Plugin Name: Mailgun
24
- * Plugin URI: http://wordpress.org/extend/plugins/mailgun/
25
- * Description: Mailgun integration for WordPress
26
- * Version: 1.5.4
27
- * Author: Mailgun
28
- * Author URI: http://www.mailgun.com/
29
- * License: GPLv2 or later
30
- * Text Domain: mailgun
31
- * Domain Path: /languages/.
32
- */
33
  class Mailgun
34
  {
35
  /**
@@ -68,7 +69,7 @@ class Mailgun
68
  *
69
  * @since 0.1
70
  */
71
- public function get_option($option, $options = null)
72
  {
73
  if (is_null($options)) {
74
  $options = &$this->options;
@@ -76,7 +77,7 @@ class Mailgun
76
  if (isset($options[$option])) {
77
  return $options[$option];
78
  } else {
79
- return false;
80
  }
81
  }
82
 
1
  <?php
2
 
3
+ /**
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
11
+ * Text Domain: mailgun
12
+ * Domain Path: /languages/.
13
+ */
14
+
15
  /*
16
  * mailgun-wordpress-plugin - Sending mail from Wordpress using Mailgun
17
  * Copyright (C) 2016 Mailgun, et al.
31
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
32
  */
33
 
 
 
 
 
 
 
 
 
 
 
 
34
  class Mailgun
35
  {
36
  /**
69
  *
70
  * @since 0.1
71
  */
72
+ public function get_option($option, $options = null, $default = false)
73
  {
74
  if (is_null($options)) {
75
  $options = &$this->options;
77
  if (isset($options[$option])) {
78
  return $options[$option];
79
  } else {
80
+ return $default;
81
  }
82
  }
83
 
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.4
9
  License: GPLv2 or later
10
 
11
 
@@ -34,26 +34,26 @@ The current version of this plugin only handles sending emails, tracking and tag
34
 
35
  == Frequently Asked Questions ==
36
 
37
- - Testing the configuration fails when using the HTTP API =
38
 
39
  Your web server may not allow outbound HTTP connections. Set `Use HTTP API` to "No", and fill out the configuration options to SMTP and test again.
40
 
41
- - Testing the configuration fails when using SMTP =
42
 
43
  Your web server may not allow outbound SMTP connections on port 465 for secure connections or 587 for unsecured connections. Try changing `Use Secure SMTP` to "No" or "Yes" depending on your current configuration and testing again. If both fail, try setting `Use HTTP API` to "Yes" and testing again.
44
 
45
- - Can this be configured globally for WordPress Multisite? =
46
 
47
  Yes, using the following constants that can be placed in wp-config.php:
48
 
49
- ```
50
  MAILGUN_USEAPI Type: boolean
51
  MAILGUN_APIKEY Type: string
52
  MAILGUN_DOMAIN Type: string
53
  MAILGUN_USERNAME Type: string
54
  MAILGUN_PASSWORD Type: string
55
  MAILGUN_SECURE Type: boolean
56
- ```
57
 
58
 
59
  == Screenshots ==
@@ -68,6 +68,14 @@ MAILGUN_SECURE Type: boolean
68
 
69
  == Changelog ==
70
 
 
 
 
 
 
 
 
 
71
  = 1.5.4 (2016-12-23): =
72
  * Changed some missed bracketed array usages to `array()` syntax
73
  * Fix `wp_mail_from` / `wp_mail_from_name` not working on old PHP / WP versions
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
 
34
 
35
  == Frequently Asked Questions ==
36
 
37
+ - Testing the configuration fails when using the HTTP API
38
 
39
  Your web server may not allow outbound HTTP connections. Set `Use HTTP API` to "No", and fill out the configuration options to SMTP and test again.
40
 
41
+ - Testing the configuration fails when using SMTP
42
 
43
  Your web server may not allow outbound SMTP connections on port 465 for secure connections or 587 for unsecured connections. Try changing `Use Secure SMTP` to "No" or "Yes" depending on your current configuration and testing again. If both fail, try setting `Use HTTP API` to "Yes" and testing again.
44
 
45
+ - Can this be configured globally for WordPress Multisite?
46
 
47
  Yes, using the following constants that can be placed in wp-config.php:
48
 
49
+ `
50
  MAILGUN_USEAPI Type: boolean
51
  MAILGUN_APIKEY Type: string
52
  MAILGUN_DOMAIN Type: string
53
  MAILGUN_USERNAME Type: string
54
  MAILGUN_PASSWORD Type: string
55
  MAILGUN_SECURE Type: boolean
56
+ `
57
 
58
 
59
  == Screenshots ==
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
74
+ * Add option to override "From Name" / "From Address" setting set by other plugins
75
+ * Fix a bug causing default "From Name" / "From Address" to be always applied in some cases
76
+ * Moved plugin header up in entrypoint file (https://wordpress.org/support/topic/plugin-activation-due-to-header/#post-8598062)
77
+ * Fixed a bug causing "Override From" to be set to "yes" after upgrades
78
+
79
  = 1.5.4 (2016-12-23): =
80
  * Changed some missed bracketed array usages to `array()` syntax
81
  * Fix `wp_mail_from` / `wp_mail_from_name` not working on old PHP / WP versions