Newsletter - Version 5.0.0

Version Description

=

  • Added wp user identifier on subscriber details panel
  • Fixed a notice on subscriber list panel
  • Added the Auto-Submit header
  • Added the X-Auto-Response-Suppress header
  • Added microdata markup for native confirmation button on email clients
  • Fixed url checking with ending spaces
  • Fix for sites with forced relative content url
  • Fix debug notices on vimeo theme

=

Download this release

Release Info

Developer satollo
Plugin Icon 128x128 Newsletter
Version 5.0.0
Comparing to
See all releases

Code changes from version 4.9.9 to 5.0.0

emails/emails.php CHANGED
@@ -76,7 +76,13 @@ class NewsletterEmails extends NewsletterModule {
76
 
77
  $data = '';
78
  foreach ($options as $key => $value) {
79
- $data .= 'options[' . $key . ']=' . urlencode($value) . '&';
 
 
 
 
 
 
80
  }
81
 
82
  if (isset($_POST['full'])) {
@@ -170,17 +176,18 @@ class NewsletterEmails extends NewsletterModule {
170
  echo file_get_contents(__DIR__ . '/tnp-composer/css/newsletter.css');
171
  $dirs = apply_filters('newsletter_blocks_dir', array());
172
  foreach ($dirs as $dir) {
173
-
174
  $list = NewsletterEmails::instance()->scan_blocks_dir($dir);
175
 
176
  foreach ($list as $key => $data) {
177
- if (!file_exists($data['dir'] . '/style.css')) continue;
 
178
  echo "\n\n";
179
  echo "/* ", $data['name'], " */\n";
180
  echo file_get_contents($data['dir'] . '/style.css');
181
  }
182
  }
183
-
184
  die();
185
  break;
186
 
@@ -440,6 +447,7 @@ class NewsletterEmails extends NewsletterModule {
440
  $dirs = apply_filters('newsletter_blocks_dir', array());
441
 
442
  foreach ($dirs as $dir) {
 
443
  $list = $this->scan_blocks_dir($dir);
444
  $blocks = array_merge($blocks, $list);
445
  }
76
 
77
  $data = '';
78
  foreach ($options as $key => $value) {
79
+ // if (!is_array($value)) {
80
+ $data .= 'options[' . $key . ']=' . urlencode($value) . '&';
81
+ // } else {
82
+ // foreach ($value as $v) {
83
+ // $data .= 'options[' . $key . '][]=' . urlencode($v) . '&';
84
+ // }
85
+ // }
86
  }
87
 
88
  if (isset($_POST['full'])) {
176
  echo file_get_contents(__DIR__ . '/tnp-composer/css/newsletter.css');
177
  $dirs = apply_filters('newsletter_blocks_dir', array());
178
  foreach ($dirs as $dir) {
179
+ $dir = str_replace('\\', '/', $dir);
180
  $list = NewsletterEmails::instance()->scan_blocks_dir($dir);
181
 
182
  foreach ($list as $key => $data) {
183
+ if (!file_exists($data['dir'] . '/style.css'))
184
+ continue;
185
  echo "\n\n";
186
  echo "/* ", $data['name'], " */\n";
187
  echo file_get_contents($data['dir'] . '/style.css');
188
  }
189
  }
190
+
191
  die();
192
  break;
193
 
447
  $dirs = apply_filters('newsletter_blocks_dir', array());
448
 
449
  foreach ($dirs as $dir) {
450
+ $dir = str_replace('\\', '/', $dir);
451
  $list = $this->scan_blocks_dir($dir);
452
  $blocks = array_merge($blocks, $list);
453
  }
emails/themes/default/theme-options.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
- if (!defined('ABSPATH'))
3
- exit;
4
  ?>
5
 
6
  <table class="form-table">
1
  <?php
2
+ defined('ABSPATH') || exit;
 
3
  ?>
4
 
5
  <table class="form-table">
emails/themes/vimeo-like/theme-defaults.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined('ABSPATH') || exit;
4
+
5
+ $theme_defaults = array(
6
+ 'theme_max_posts' => 10,
7
+ 'theme_read_more' => __('Read More', 'newsletter'),
8
+ 'theme_pre_message' => 'This email has been sent to {email} because subscribed and confirmed on ' . get_option('blogname') . '. <a href="{profile_url}">Click here to modify you subscription or unsubscribe</a>.',
9
+ 'theme_footer_message' => 'To change your subscription, <a target="_blank" href="{profile_url}">click here</a>.',
10
+ 'theme_categories' => array()
11
+ );
12
+
emails/themes/vimeo-like/theme-options.php CHANGED
@@ -15,50 +15,57 @@
15
  * a decent system will be implemented.
16
  */
17
 
18
- if (!defined('ABSPATH'))
19
- exit;
20
 
21
- $theme_defaults = array(
22
- 'theme_max_posts'=>5,
23
- 'theme_read_more'=>'Read More',
24
- 'theme_pre_message'=>'This email has been sent to {email} because subscribed and confirmed on ' . get_option('blogname') . '. <a href="{profile_url}">Click here to modify you subscription or unsubscribe</a>.',
25
- 'theme_categories'=>array()
26
- );
27
-
28
- // Mandatory!
29
- $controls->merge_defaults($theme_defaults);
30
  ?>
 
 
 
 
 
31
 
32
- <table class="form-table">
33
- <tr valign="top">
34
- <th>Max new posts to include</th>
35
- <td>
36
- <?php $controls->text('theme_max_posts', 5); ?> (it defaults to 10 if empty or invalid)
37
- </td>
38
- </tr>
39
- <tr valign="top">
40
- <th>Categories to include</th>
41
- <td><?php $controls->categories_group('theme_categories'); ?></td>
42
- </tr>
43
- <tr>
44
- <th>Post types</th>
45
- <td>
46
- <?php $controls->post_types('theme_post_types'); ?>
47
- <p class="description">Leave all uncheck for a default behavior.</p>
48
- </td>
49
- </tr>
50
- <tr valign="top">
51
- <th>Pre message</th>
52
- <td>
53
- <?php $controls->text('theme_pre_message', 70); ?>
54
- </td>
55
- </tr>
56
- <tr valign="top">
57
- <th>Read more label</th>
58
- <td>
59
- <?php $controls->text('theme_read_more'); ?>
60
- </td>
61
- </tr>
62
- </table>
63
 
64
- <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  * a decent system will be implemented.
16
  */
17
 
18
+ /* @var $controls NewsletterControls */
 
19
 
20
+ defined('ABSPATH') || exit;
 
 
 
 
 
 
 
 
21
  ?>
22
+ <div id="tabs">
23
+ <ul>
24
+ <li><a href="#tabs-a"><?php _e('General', 'newsletter') ?></a></li>
25
+ <li><a href="#tabs-b"><?php _e('Social', 'newsletter') ?></a></li>
26
+ </ul>
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
+ <div id="tabs-a">
30
+ <table class="form-table">
31
+ <tr valign="top">
32
+ <th>Max new posts to include</th>
33
+ <td>
34
+ <?php $controls->select_number('theme_max_posts', 1, 50); ?>
35
+ </td>
36
+ </tr>
37
+ <tr valign="top">
38
+ <th>Categories to include</th>
39
+ <td><?php $controls->categories_group('theme_categories'); ?></td>
40
+ </tr>
41
+ <tr>
42
+ <th>Post types</th>
43
+ <td>
44
+ <?php $controls->post_types('theme_post_types'); ?>
45
+ <p class="description">Leave all uncheck for a default behavior.</p>
46
+ </td>
47
+ </tr>
48
+ <tr valign="top">
49
+ <th>Pre header message</th>
50
+ <td>
51
+ <?php $controls->textarea_fixed('theme_pre_message', '100%', 120); ?>
52
+ </td>
53
+ </tr>
54
+ <tr valign="top">
55
+ <th>Footer message</th>
56
+ <td>
57
+ <?php $controls->textarea_fixed('theme_footer_message', '100%', 120); ?>
58
+ </td>
59
+ </tr>
60
+ <tr valign="top">
61
+ <th>Read more label</th>
62
+ <td>
63
+ <?php $controls->text('theme_read_more'); ?>
64
+ </td>
65
+ </tr>
66
+ </table>
67
+ </div>
68
+ <div id="tabs-b">
69
+ <?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social-options.php'; ?>
70
+ </div>
71
+ </div>
emails/themes/vimeo-like/theme.php CHANGED
@@ -44,31 +44,20 @@ if (!empty($theme_options['theme_post_types'])) {
44
  // Retrieve the posts asking them to WordPress
45
  $posts = get_posts($filters);
46
 
47
- // Styles
48
- $color = $theme_options['theme_color'];
49
- if (empty($color))
50
- $color = '#777';
51
-
52
- $font = $theme_options['theme_font'];
53
- $font_size = $theme_options['theme_font_size'];
54
  ?>
55
  <!DOCTYPE html>
56
  <html>
57
  <head>
58
  <title></title>
59
- <style>
60
- * {
61
- font-family: <?php echo $font; ?>;
62
- font-size: <?php echo $font_size; ?>;
63
- }
64
- </style>
65
  </head>
66
  <body style="font:normal 11px helvetica,sans-serif;">
67
 
68
- <table style="background:#ffffff" width="600" align="center" border="0" cellpadding="0" cellspacing="0">
69
 
70
  <tr>
71
- <td style="color:#9ab;font:normal 11px helvetica,sans-serif;text-align:center;padding:10px 0 20px 0"><?php echo $theme_options['theme_pre_message']; ?></td>
 
 
72
  </tr>
73
 
74
  <tr>
@@ -79,15 +68,11 @@ $font_size = $theme_options['theme_font_size'];
79
 
80
  <td style="border:1px dotted #e1e2e3;border-top:none;border-bottom:3px solid #e1e2e3;background:#ffffff">
81
 
82
-
83
-
84
  <table width="100%" align="center" border="0" cellpadding="20" cellspacing="0">
85
 
86
  <tr>
87
  <td style="background:#ffffff">
88
 
89
-
90
-
91
  <p style="color:#456;font-family:arial,sans-serif;font-size:24px;line-height:1.2;margin:15px 0;padding:0"><a target="_tab" href="<?php echo get_option('home'); ?>" style="color:#28c;text-decoration:none" target="_blank"><?php echo get_option('blogname'); ?></a></p>
92
 
93
 
@@ -132,7 +117,7 @@ $font_size = $theme_options['theme_font_size'];
132
 
133
  <br><br>
134
  <p style="color:#456;font-family:arial,sans-serif;font-size:12px;line-height:1.6em;font-style:italic;margin:0 0 15px 0;padding:0">
135
- To change your subscription, <a target="_blank" href="{profile_url}">click here</a>.
136
  </p>
137
  </td>
138
  </tr>
44
  // Retrieve the posts asking them to WordPress
45
  $posts = get_posts($filters);
46
 
 
 
 
 
 
 
 
47
  ?>
48
  <!DOCTYPE html>
49
  <html>
50
  <head>
51
  <title></title>
 
 
 
 
 
 
52
  </head>
53
  <body style="font:normal 11px helvetica,sans-serif;">
54
 
55
+ <table style="background:#ffffff; max-width: 100%" width="600" align="center" border="0" cellpadding="0" cellspacing="0">
56
 
57
  <tr>
58
+ <td style="color:#9ab;font:normal 12px helvetica,sans-serif;text-align:center;padding:10px 0 20px 0">
59
+ <?php echo $theme_options['theme_pre_message']; ?>
60
+ </td>
61
  </tr>
62
 
63
  <tr>
68
 
69
  <td style="border:1px dotted #e1e2e3;border-top:none;border-bottom:3px solid #e1e2e3;background:#ffffff">
70
 
 
 
71
  <table width="100%" align="center" border="0" cellpadding="20" cellspacing="0">
72
 
73
  <tr>
74
  <td style="background:#ffffff">
75
 
 
 
76
  <p style="color:#456;font-family:arial,sans-serif;font-size:24px;line-height:1.2;margin:15px 0;padding:0"><a target="_tab" href="<?php echo get_option('home'); ?>" style="color:#28c;text-decoration:none" target="_blank"><?php echo get_option('blogname'); ?></a></p>
77
 
78
 
117
 
118
  <br><br>
119
  <p style="color:#456;font-family:arial,sans-serif;font-size:12px;line-height:1.6em;font-style:italic;margin:0 0 15px 0;padding:0">
120
+ <?php echo $theme_options['theme_footer_message']; ?>
121
  </p>
122
  </td>
123
  </tr>
emails/tnp-composer/blocks/content-03-text.block.php CHANGED
@@ -4,7 +4,7 @@
4
  <td bgcolor="#ffffff" align="center" style="padding: 20px 15px 20px 15px; font-family: Helvetica, Arial, sans-serif;" class="section-padding edit-block">
5
  <table border="0" cellpadding="0" cellspacing="0" class="responsive-table" style="width: 100%!important">
6
  <tr>
7
- <td align="center" style="padding: 0 0 0 0; font-size: 16px; line-height: 25px; color: #666666;" class="padding-copy tnpc-row-edit" data-type="text">The judge, by the way, was the King; and as he wore his crown over the wig, (look at the frontispiece if you want to see how he did it,) he did not look at all comfortable, and it was certainly not becoming.</td>
8
  </tr>
9
  </table>
10
  </td>
4
  <td bgcolor="#ffffff" align="center" style="padding: 20px 15px 20px 15px; font-family: Helvetica, Arial, sans-serif;" class="section-padding edit-block">
5
  <table border="0" cellpadding="0" cellspacing="0" class="responsive-table" style="width: 100%!important">
6
  <tr>
7
+ <td align="center" width="500" style="padding: 0 0 0 0; font-size: 16px; line-height: 25px; color: #666666;" class="padding-copy tnpc-row-edit" data-type="text">The judge, by the way, was the King; and as he wore his crown over the wig, (look at the frontispiece if you want to see how he did it,) he did not look at all comfortable, and it was certainly not becoming.</td>
8
  </tr>
9
  </table>
10
  </td>
emails/tnp-composer/edit.php CHANGED
@@ -44,6 +44,9 @@ if (!defined('ABSPATH')) exit;
44
  attachment = file_frame.state().get('selection').first().toJSON();
45
  // Do something with attachment.id and/or attachment.url here
46
  // Patch for plugins which remove the protocol (not good for a newsletter...)
 
 
 
47
  if (attachment.url.indexOf("http") !== 0) attachment.url = "http:" + attachment.url;
48
  jQuery('#tnpc-edit-image .image').val(attachment.url);
49
  });
44
  attachment = file_frame.state().get('selection').first().toJSON();
45
  // Do something with attachment.id and/or attachment.url here
46
  // Patch for plugins which remove the protocol (not good for a newsletter...)
47
+ if (attachment.url.substring(0, 0) == "/") {
48
+ attachment.url = "<?php echo site_url('/') ?>" + attachment.url;
49
+ }
50
  if (attachment.url.indexOf("http") !== 0) attachment.url = "http:" + attachment.url;
51
  jQuery('#tnpc-edit-image .image').val(attachment.url);
52
  });
emails/tnp-composer/index.php CHANGED
@@ -17,6 +17,7 @@ foreach ($files as $file) {
17
  $dirs = apply_filters('newsletter_blocks_dir', array());
18
 
19
  foreach ($dirs as $dir) {
 
20
 
21
  $list = NewsletterEmails::instance()->scan_blocks_dir($dir);
22
 
17
  $dirs = apply_filters('newsletter_blocks_dir', array());
18
 
19
  foreach ($dirs as $dir) {
20
+ $dir = str_replace('\\', '/', $dir);
21
 
22
  $list = NewsletterEmails::instance()->scan_blocks_dir($dir);
23
 
includes/controls.php CHANGED
@@ -516,6 +516,14 @@ class NewsletterControls {
516
 
517
  $this->select($name, $options);
518
  }
 
 
 
 
 
 
 
 
519
 
520
  function page($name = 'page', $first = null) {
521
  $pages = get_pages();
516
 
517
  $this->select($name, $options);
518
  }
519
+
520
+ function select_number($name, $min, $max) {
521
+ $options = array();
522
+ for ($i=$min; $i<=$max; $i++) {
523
+ $options['' . $i] = $i;
524
+ }
525
+ $this->select($name, $options);
526
+ }
527
 
528
  function page($name = 'page', $first = null) {
529
  $pages = get_pages();
includes/module.php CHANGED
@@ -748,7 +748,7 @@ class NewsletterModule {
748
  $matches = array();
749
  // "s" skips line breaks
750
  $styles = preg_match('|<style>(.*?)</style>|s', $content, $matches);
751
- if ($matches[1]) {
752
  $style = str_replace(array("\n", "\r"), '', $matches[1]);
753
  $rules = array();
754
  preg_match_all('|\s*\.(.*?)\{(.*?)\}\s*|s', $style, $rules);
748
  $matches = array();
749
  // "s" skips line breaks
750
  $styles = preg_match('|<style>(.*?)</style>|s', $content, $matches);
751
+ if (isset($matches[1])) {
752
  $style = str_replace(array("\n", "\r"), '', $matches[1]);
753
  $rules = array();
754
  preg_match_all('|\s*\.(.*?)\{(.*?)\}\s*|s', $style, $rules);
includes/themes.php CHANGED
@@ -160,7 +160,14 @@ class NewsletterThemes {
160
  $options = get_option('newsletter_' . $this->module . '_theme_' . $theme);
161
  // To avoid merge problems.
162
  if (!is_array($options)) {
163
- return array();
 
 
 
 
 
 
 
164
  }
165
  return $options;
166
  }
160
  $options = get_option('newsletter_' . $this->module . '_theme_' . $theme);
161
  // To avoid merge problems.
162
  if (!is_array($options)) {
163
+ $options = array();
164
+ }
165
+ $file = $this->get_file_path($theme, 'theme-defaults.php');
166
+ if (is_file($file)) {
167
+ @include $file;
168
+ }
169
+ if (is_array($theme_defaults)) {
170
+ $options = array_merge($theme_defaults, $options);
171
  }
172
  return $options;
173
  }
main/extensions.php CHANGED
@@ -19,7 +19,7 @@ if ($controls->is_action('install')) {
19
  $id = $extension->id;
20
  $slug = $extension->slug;
21
 
22
- $source = 'https://www.thenewsletterplugin.com/wp-content/plugins/file-commerce-pro/get.php?f=' . $id .
23
  '&k=' . urlencode(Newsletter::instance()->options['contract_key']);
24
 
25
  if (!class_exists('Plugin_Upgrader', false)) {
19
  $id = $extension->id;
20
  $slug = $extension->slug;
21
 
22
+ $source = 'http://www.thenewsletterplugin.com/wp-content/plugins/file-commerce-pro/get.php?f=' . $id .
23
  '&k=' . urlencode(Newsletter::instance()->options['contract_key']);
24
 
25
  if (!class_exists('Plugin_Upgrader', false)) {
main/main.php CHANGED
@@ -64,7 +64,7 @@ if (!$controls->is_action()) {
64
  }
65
 
66
  if (!empty($controls->data['contract_key'])) {
67
- $response = wp_remote_get('https://www.thenewsletterplugin.com/wp-content/plugins/file-commerce-pro/check.php?k=' . $controls->data['contract_key'], array('sslverify'=>false));
68
  if (is_wp_error($response)) {
69
  /* @var $response WP_Error */
70
  $controls->errors .= 'It seems that your blog cannot contact the license validator. Ask your provider to unlock the HTTP/HTTPS connections to www.thenewsletterplugin.com<br>';
64
  }
65
 
66
  if (!empty($controls->data['contract_key'])) {
67
+ $response = wp_remote_get('http://www.thenewsletterplugin.com/wp-content/plugins/file-commerce-pro/check.php?k=' . $controls->data['contract_key'], array('sslverify'=>false));
68
  if (is_wp_error($response)) {
69
  /* @var $response WP_Error */
70
  $controls->errors .= 'It seems that your blog cannot contact the license validator. Ask your provider to unlock the HTTP/HTTPS connections to www.thenewsletterplugin.com<br>';
main/status.php CHANGED
@@ -307,6 +307,29 @@ $options = $module->get_options('status');
307
  </td>
308
 
309
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
 
311
  <tr>
312
  <td>Database Charset</td>
307
  </td>
308
 
309
  </tr>
310
+
311
+ <tr>
312
+ <td>WP_CONTENT_URL</td>
313
+ <td>
314
+ <?php if (strpos(WP_CONTENT_URL, 'http') !== 0) { ?>
315
+ <span class="tnp-ko">KO</span>
316
+ <?php } else { ?>
317
+ <span class="tnp-ok">OK</span>
318
+ <?php } ?>
319
+
320
+ </td>
321
+ <td>
322
+ Value: <?php echo WP_CONTENT_URL; ?>
323
+ <br>
324
+ <?php if (strpos(WP_CONTENT_URL, 'http') !== 0) { ?>
325
+ Your content URL is not absolute, emails require absolute URLs when they have images inside.
326
+ Newsletter tries to deal with this problem but when a problem with images persists, you should try to remove
327
+ from your wp-config.php the WP_CONTENT_URL define and check again.
328
+ <?php } else { ?>
329
+
330
+ <?php } ?>
331
+ </td>
332
+ </tr>
333
 
334
  <tr>
335
  <td>Database Charset</td>
plugin.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Newsletter
5
  Plugin URI: https://www.thenewsletterplugin.com/plugins/newsletter
6
  Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="https://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
7
- Version: 4.9.9
8
  Author: Stefano Lissa & The Newsletter Team
9
  Author URI: https://www.thenewsletterplugin.com
10
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
@@ -14,7 +14,7 @@
14
  */
15
 
16
  // Used as dummy parameter on css and js links
17
- define('NEWSLETTER_VERSION', '4.9.9');
18
 
19
  global $wpdb, $newsletter;
20
 
@@ -198,11 +198,11 @@ class Newsletter extends NewsletterModule {
198
  add_action('admin_head', array($this, 'hook_admin_head'));
199
 
200
  // Protection against strange schedule removal on some installations
201
- if (!wp_next_scheduled('newsletter') && (!defined('WP_INSTALLING') || !WP_INSTALLING)) {
202
  wp_schedule_event(time() + 30, 'newsletter', 'newsletter');
203
  }
204
 
205
-
206
 
207
  add_action('admin_menu', array($this, 'add_extensions_menu'), 90);
208
  }
@@ -220,7 +220,7 @@ class Newsletter extends NewsletterModule {
220
  if (!wp_next_scheduled('newsletter')) {
221
  wp_schedule_event(time() + 30, 'newsletter', 'newsletter');
222
  }
223
-
224
  $install_time = get_option('newsletter_install_time');
225
  if (!$install_time) {
226
  update_option('newsletter_install_time', time(), false);
@@ -269,7 +269,7 @@ class Newsletter extends NewsletterModule {
269
  $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " drop column name");
270
  $this->upgrade_query("drop table if exists " . $wpdb->prefix . "newsletter_work");
271
  $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " convert to character set utf8");
272
-
273
  if ('utf8mb4' === $wpdb->charset) {
274
  $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " convert to character set utf8mb4");
275
  }
@@ -297,7 +297,6 @@ class Newsletter extends NewsletterModule {
297
  // maybe_convert_table_to_utf8mb4(NEWSLETTER_EMAILS_TABLE);
298
  // }
299
  // }
300
-
301
  // Some setting check to avoid the common support request for mis-configurations
302
  $options = $this->get_options();
303
 
@@ -413,15 +412,15 @@ class Newsletter extends NewsletterModule {
413
  wp_enqueue_media();
414
  wp_enqueue_style('tnp-admin', plugins_url('newsletter') . '/admin.css', array(), time());
415
  wp_enqueue_script('tnp-admin', plugins_url('newsletter') . '/admin.js', array(), time());
416
-
417
  wp_enqueue_style('tnp-select2', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css');
418
  wp_enqueue_script('tnp-select2', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js');
419
  wp_enqueue_script('tnp-jquery-vmap', 'https://cdnjs.cloudflare.com/ajax/libs/jqvmap/1.5.1/jquery.vmap.min.js');
420
  wp_enqueue_script('tnp-jquery-vmap-world', 'https://cdnjs.cloudflare.com/ajax/libs/jqvmap/1.5.1/maps/jquery.vmap.world.js', array('tnp-jquery-vmap'));
421
  wp_enqueue_style('tnp-jquery-vmap', 'https://cdnjs.cloudflare.com/ajax/libs/jqvmap/1.5.1/jqvmap.min.css');
422
-
423
  wp_register_script('tnp-chart', 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js');
424
-
425
  $dismissed = get_option('newsletter_dismissed', array());
426
 
427
  if (isset($_GET['dismiss'])) {
@@ -533,45 +532,46 @@ class Newsletter extends NewsletterModule {
533
  */
534
  function send($email, $users = null) {
535
  global $wpdb;
536
-
537
  ignore_user_abort(true);
538
 
539
  if (is_array($email)) {
540
  $email = (object) $email;
541
  }
542
-
543
  $this->logger->debug('send> Email ID: ' . $email->id);
544
 
545
  // This stops the update of last_id and sent fields since it's not a scheduled delivery but a test or something else (like an autoresponder)
546
  $test = $users != null;
547
 
548
  if ($users == null) {
549
-
550
  $skip_this_run = apply_filters('newsletter_send_skip', false, $email);
551
- if ($skip_this_run) return false;
552
-
 
553
  if (empty($email->query)) {
554
  $email->query = "select * from " . NEWSLETTER_USERS_TABLE . " where status='C'";
555
  }
556
-
557
  $email->options = maybe_unserialize($email->options);
558
  $max_emails = apply_filters('newsletter_send_max_emails', $this->max_emails, $email);
559
-
560
  $this->logger->debug('send> Max emails per run: ' . $max_emails);
561
-
562
  if (empty($max_emails)) {
563
  $this->logger->error('send> Max emails empty after the filter');
564
  $max_emails = $this->max_emails;
565
  }
566
-
567
  //$query = apply_filters('newsletter_send_query', $email->query, $email);
568
  $query = $email->query;
569
  $query .= " and id>" . $email->last_id . " order by id limit " . $max_emails;
570
-
571
  $this->logger->debug('send> Query: ' . $query);
572
-
573
  $users = $wpdb->get_results($query);
574
-
575
  $this->logger->debug('send> Loaded users: ' . count($users));
576
 
577
  // If there was a database error, do nothing
@@ -580,15 +580,14 @@ class Newsletter extends NewsletterModule {
580
  $this->logger->fatal($wpdb->last_query);
581
  return;
582
  }
583
-
584
  if (empty($users)) {
585
  $this->logger->info('send> No more users, set as sent');
586
  $wpdb->query("update " . NEWSLETTER_EMAILS_TABLE . " set status='sent', total=sent where id=" . $email->id . " limit 1");
587
  return true;
588
  }
589
-
590
- //$users = apply_filters('newsletter_send_users', $users, $email);
591
 
 
592
  }
593
 
594
  $start_time = microtime(true);
@@ -615,7 +614,7 @@ class Newsletter extends NewsletterModule {
615
 
616
  $m = $this->replace($email->message, $user, $email->id);
617
  $mt = $this->replace($email->message_text, $user, $email->id);
618
-
619
  $m = apply_filters('newsletter_message_html', $m, $email, $user);
620
 
621
  if ($email->track == 1) {
@@ -757,6 +756,12 @@ class Newsletter extends NewsletterModule {
757
  $this->logger->error('mail> Subject empty, skipped');
758
  return true;
759
  }
 
 
 
 
 
 
760
 
761
  // Message carrige returns and line feeds clean up
762
  if (!is_array($message)) {
@@ -789,32 +794,40 @@ class Newsletter extends NewsletterModule {
789
  if ($this->mailer == null) {
790
  // If still null, we need to use wp_mail()...
791
 
792
- $headers = array();
793
- $headers[] = 'From: ' . $this->options['sender_name'] . ' <' . $this->options['sender_email'] . '>';
 
794
 
795
  if (!empty($this->options['return_path'])) {
796
- $headers[] = 'Return-Path: ' . $this->options['return_path'];
797
  }
798
  if (!empty($this->options['reply_to'])) {
799
- $headers[] = 'Reply-To: ' . $this->options['reply_to'];
800
  }
801
 
802
  if (!is_array($message)) {
803
- $headers[] = 'Content-Type: text/html;charset=UTF-8';
804
  $body = $message;
805
  } else {
806
  // Only html is present?
807
  if (!empty($message['html'])) {
808
- $headers[] = 'Content-Type: text/html;charset=UTF-8';
809
 
810
  $body = $message['html'];
811
  } else if (!empty($message['text'])) {
812
- $headers[] = 'Content-Type: text/plain;charset=UTF-8';
813
  //$this->mailer->IsHTML(false);
814
  $body = $message['text'];
815
  }
816
  }
817
- $r = wp_mail($to, $subject, $body, $headers);
 
 
 
 
 
 
 
818
  if (!$r) {
819
  $last_error = error_get_last();
820
  if (is_array($last_error)) {
@@ -1258,13 +1271,14 @@ class Newsletter extends NewsletterModule {
1258
  if (is_object($email)) {
1259
  $email = (array) $email;
1260
  }
1261
-
1262
  if (isset($email['subject'])) {
1263
  if (mb_strlen($email['subject'], 'UTF-8') > 250) {
1264
  $email['subject'] = mb_substr($email['subject'], 0, 250, 'UTF-8');
1265
  }
1266
  }
1267
- if (isset($email['options']) && is_array($email['options'])) $email['options'] = serialize($email['options']);
 
1268
  return $this->store->save(NEWSLETTER_EMAILS_TABLE, $email, $return_format);
1269
  }
1270
 
@@ -1398,10 +1412,10 @@ class Newsletter extends NewsletterModule {
1398
  $value->response[$extension->plugin] = $plugin;
1399
 
1400
  if (defined('NEWSLETTER_LICENSE_KEY')) {
1401
- $value->response[$extension->plugin]->package = 'https://www.thenewsletterplugin.com/wp-content/plugins/file-commerce-pro/get.php?f=' . $extension->id .
1402
  '&k=' . NEWSLETTER_LICENSE_KEY;
1403
  } else {
1404
- $value->response[$extension->plugin]->package = 'https://www.thenewsletterplugin.com/wp-content/plugins/file-commerce-pro/get.php?f=' . $extension->id .
1405
  '&k=' . Newsletter::instance()->options['contract_key'];
1406
  }
1407
 
@@ -1419,7 +1433,7 @@ class Newsletter extends NewsletterModule {
1419
  if (false === $extensions_json) {
1420
  $url = "https://www.thenewsletterplugin.com/wp-content/extensions.json";
1421
  if (!empty($this->options['contract_key'])) {
1422
- $url = "https://www.thenewsletterplugin.com/wp-content/plugins/file-commerce-pro/extensions.php?k=" . $this->options['contract_key'];
1423
  }
1424
 
1425
  $extensions_response = wp_remote_get($url);
4
  Plugin Name: Newsletter
5
  Plugin URI: https://www.thenewsletterplugin.com/plugins/newsletter
6
  Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="https://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
7
+ Version: 5.0.0
8
  Author: Stefano Lissa & The Newsletter Team
9
  Author URI: https://www.thenewsletterplugin.com
10
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
14
  */
15
 
16
  // Used as dummy parameter on css and js links
17
+ define('NEWSLETTER_VERSION', '5.0.0');
18
 
19
  global $wpdb, $newsletter;
20
 
198
  add_action('admin_head', array($this, 'hook_admin_head'));
199
 
200
  // Protection against strange schedule removal on some installations
201
+ if (!wp_next_scheduled('newsletter') && (!defined('WP_INSTALLING') || !WP_INSTALLING)) {
202
  wp_schedule_event(time() + 30, 'newsletter', 'newsletter');
203
  }
204
 
205
+
206
 
207
  add_action('admin_menu', array($this, 'add_extensions_menu'), 90);
208
  }
220
  if (!wp_next_scheduled('newsletter')) {
221
  wp_schedule_event(time() + 30, 'newsletter', 'newsletter');
222
  }
223
+
224
  $install_time = get_option('newsletter_install_time');
225
  if (!$install_time) {
226
  update_option('newsletter_install_time', time(), false);
269
  $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " drop column name");
270
  $this->upgrade_query("drop table if exists " . $wpdb->prefix . "newsletter_work");
271
  $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " convert to character set utf8");
272
+
273
  if ('utf8mb4' === $wpdb->charset) {
274
  $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " convert to character set utf8mb4");
275
  }
297
  // maybe_convert_table_to_utf8mb4(NEWSLETTER_EMAILS_TABLE);
298
  // }
299
  // }
 
300
  // Some setting check to avoid the common support request for mis-configurations
301
  $options = $this->get_options();
302
 
412
  wp_enqueue_media();
413
  wp_enqueue_style('tnp-admin', plugins_url('newsletter') . '/admin.css', array(), time());
414
  wp_enqueue_script('tnp-admin', plugins_url('newsletter') . '/admin.js', array(), time());
415
+
416
  wp_enqueue_style('tnp-select2', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css');
417
  wp_enqueue_script('tnp-select2', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js');
418
  wp_enqueue_script('tnp-jquery-vmap', 'https://cdnjs.cloudflare.com/ajax/libs/jqvmap/1.5.1/jquery.vmap.min.js');
419
  wp_enqueue_script('tnp-jquery-vmap-world', 'https://cdnjs.cloudflare.com/ajax/libs/jqvmap/1.5.1/maps/jquery.vmap.world.js', array('tnp-jquery-vmap'));
420
  wp_enqueue_style('tnp-jquery-vmap', 'https://cdnjs.cloudflare.com/ajax/libs/jqvmap/1.5.1/jqvmap.min.css');
421
+
422
  wp_register_script('tnp-chart', 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js');
423
+
424
  $dismissed = get_option('newsletter_dismissed', array());
425
 
426
  if (isset($_GET['dismiss'])) {
532
  */
533
  function send($email, $users = null) {
534
  global $wpdb;
535
+
536
  ignore_user_abort(true);
537
 
538
  if (is_array($email)) {
539
  $email = (object) $email;
540
  }
541
+
542
  $this->logger->debug('send> Email ID: ' . $email->id);
543
 
544
  // This stops the update of last_id and sent fields since it's not a scheduled delivery but a test or something else (like an autoresponder)
545
  $test = $users != null;
546
 
547
  if ($users == null) {
548
+
549
  $skip_this_run = apply_filters('newsletter_send_skip', false, $email);
550
+ if ($skip_this_run)
551
+ return false;
552
+
553
  if (empty($email->query)) {
554
  $email->query = "select * from " . NEWSLETTER_USERS_TABLE . " where status='C'";
555
  }
556
+
557
  $email->options = maybe_unserialize($email->options);
558
  $max_emails = apply_filters('newsletter_send_max_emails', $this->max_emails, $email);
559
+
560
  $this->logger->debug('send> Max emails per run: ' . $max_emails);
561
+
562
  if (empty($max_emails)) {
563
  $this->logger->error('send> Max emails empty after the filter');
564
  $max_emails = $this->max_emails;
565
  }
566
+
567
  //$query = apply_filters('newsletter_send_query', $email->query, $email);
568
  $query = $email->query;
569
  $query .= " and id>" . $email->last_id . " order by id limit " . $max_emails;
570
+
571
  $this->logger->debug('send> Query: ' . $query);
572
+
573
  $users = $wpdb->get_results($query);
574
+
575
  $this->logger->debug('send> Loaded users: ' . count($users));
576
 
577
  // If there was a database error, do nothing
580
  $this->logger->fatal($wpdb->last_query);
581
  return;
582
  }
583
+
584
  if (empty($users)) {
585
  $this->logger->info('send> No more users, set as sent');
586
  $wpdb->query("update " . NEWSLETTER_EMAILS_TABLE . " set status='sent', total=sent where id=" . $email->id . " limit 1");
587
  return true;
588
  }
 
 
589
 
590
+ //$users = apply_filters('newsletter_send_users', $users, $email);
591
  }
592
 
593
  $start_time = microtime(true);
614
 
615
  $m = $this->replace($email->message, $user, $email->id);
616
  $mt = $this->replace($email->message_text, $user, $email->id);
617
+
618
  $m = apply_filters('newsletter_message_html', $m, $email, $user);
619
 
620
  if ($email->track == 1) {
756
  $this->logger->error('mail> Subject empty, skipped');
757
  return true;
758
  }
759
+
760
+ if (!$headers) {
761
+ $headers = array();
762
+ }
763
+
764
+ $headers['X-Auto-Response-Suppress'] = 'OOF, AutoReply';
765
 
766
  // Message carrige returns and line feeds clean up
767
  if (!is_array($message)) {
794
  if ($this->mailer == null) {
795
  // If still null, we need to use wp_mail()...
796
 
797
+ $wp_mail_headers = array();
798
+
799
+ $wp_mail_headers[] = 'From: ' . $this->options['sender_name'] . ' <' . $this->options['sender_email'] . '>';
800
 
801
  if (!empty($this->options['return_path'])) {
802
+ $wp_mail_headers[] = 'Return-Path: ' . $this->options['return_path'];
803
  }
804
  if (!empty($this->options['reply_to'])) {
805
+ $wp_mail_headers[] = 'Reply-To: ' . $this->options['reply_to'];
806
  }
807
 
808
  if (!is_array($message)) {
809
+ $wp_mail_headers[] = 'Content-Type: text/html;charset=UTF-8';
810
  $body = $message;
811
  } else {
812
  // Only html is present?
813
  if (!empty($message['html'])) {
814
+ $wp_mail_headers[] = 'Content-Type: text/html;charset=UTF-8';
815
 
816
  $body = $message['html'];
817
  } else if (!empty($message['text'])) {
818
+ $wp_mail_headers[] = 'Content-Type: text/plain;charset=UTF-8';
819
  //$this->mailer->IsHTML(false);
820
  $body = $message['text'];
821
  }
822
  }
823
+
824
+ if (is_array($headers)) {
825
+ foreach ($headers as $key => $value) {
826
+ $wp_mail_headers[] = $key . ': ' . $value;
827
+ }
828
+ }
829
+
830
+ $r = wp_mail($to, $subject, $body, $wp_mail_headers);
831
  if (!$r) {
832
  $last_error = error_get_last();
833
  if (is_array($last_error)) {
1271
  if (is_object($email)) {
1272
  $email = (array) $email;
1273
  }
1274
+
1275
  if (isset($email['subject'])) {
1276
  if (mb_strlen($email['subject'], 'UTF-8') > 250) {
1277
  $email['subject'] = mb_substr($email['subject'], 0, 250, 'UTF-8');
1278
  }
1279
  }
1280
+ if (isset($email['options']) && is_array($email['options']))
1281
+ $email['options'] = serialize($email['options']);
1282
  return $this->store->save(NEWSLETTER_EMAILS_TABLE, $email, $return_format);
1283
  }
1284
 
1412
  $value->response[$extension->plugin] = $plugin;
1413
 
1414
  if (defined('NEWSLETTER_LICENSE_KEY')) {
1415
+ $value->response[$extension->plugin]->package = 'http://www.thenewsletterplugin.com/wp-content/plugins/file-commerce-pro/get.php?f=' . $extension->id .
1416
  '&k=' . NEWSLETTER_LICENSE_KEY;
1417
  } else {
1418
+ $value->response[$extension->plugin]->package = 'http://www.thenewsletterplugin.com/wp-content/plugins/file-commerce-pro/get.php?f=' . $extension->id .
1419
  '&k=' . Newsletter::instance()->options['contract_key'];
1420
  }
1421
 
1433
  if (false === $extensions_json) {
1434
  $url = "https://www.thenewsletterplugin.com/wp-content/extensions.json";
1435
  if (!empty($this->options['contract_key'])) {
1436
+ $url = "http://www.thenewsletterplugin.com/wp-content/plugins/file-commerce-pro/extensions.php?k=" . $this->options['contract_key'];
1437
  }
1438
 
1439
  $extensions_response = wp_remote_get($url);
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === Newsletter ===
2
  Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing,automation,automated
3
  Requires at least: 3.4.0
4
- Tested up to: 4.8.0
5
- Stable tag: 4.9.9
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
@@ -85,6 +85,17 @@ Thank you, The Newsletter Team
85
 
86
  == Changelog ==
87
 
 
 
 
 
 
 
 
 
 
 
 
88
  == 4.9.9 ==
89
 
90
  * Fixed action URL for hand written forms in the subscription text
1
  === Newsletter ===
2
  Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing,automation,automated
3
  Requires at least: 3.4.0
4
+ Tested up to: 4.8
5
+ Stable tag: 5.0.0
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
85
 
86
  == Changelog ==
87
 
88
+ == 5.0.0 ==
89
+
90
+ * Added wp user identifier on subscriber details panel
91
+ * Fixed a notice on subscriber list panel
92
+ * Added the Auto-Submit header
93
+ * Added the X-Auto-Response-Suppress header
94
+ * Added microdata markup for native confirmation button on email clients
95
+ * Fixed url checking with ending spaces
96
+ * Fix for sites with forced relative content url
97
+ * Fix debug notices on vimeo theme
98
+
99
  == 4.9.9 ==
100
 
101
  * Fixed action URL for hand written forms in the subscription text
statistics/statistics.php CHANGED
@@ -50,7 +50,7 @@ class NewsletterStatistics extends NewsletterModule {
50
  $signature = array_pop($parts);
51
  $anchor = array_pop($parts); // No more used
52
  // The remaining elements are the url splitted when it contains
53
- $url = esc_url_raw(implode(';', $parts));
54
 
55
  //list($email_id, $user_id, $url, $anchor, $signature) = explode(';', base64_decode($_GET['nltr']), 5);
56
  //$url = esc_url_raw($url);
@@ -82,7 +82,7 @@ class NewsletterStatistics extends NewsletterModule {
82
 
83
  // Test emails
84
  if (empty($email_id)) {
85
- header('Location: ' . $url);
86
  die();
87
  }
88
 
@@ -224,7 +224,7 @@ class NewsletterStatistics extends NewsletterModule {
224
  }
225
 
226
  function relink_callback($matches) {
227
- $href = str_replace('&amp;', '&', $matches[2]);
228
 
229
  // Do not replace the tracking or subscription/unsubscription links.
230
  if (strpos($href, '/newsletter/') !== false) {
50
  $signature = array_pop($parts);
51
  $anchor = array_pop($parts); // No more used
52
  // The remaining elements are the url splitted when it contains
53
+ $url = implode(';', $parts);
54
 
55
  //list($email_id, $user_id, $url, $anchor, $signature) = explode(';', base64_decode($_GET['nltr']), 5);
56
  //$url = esc_url_raw($url);
82
 
83
  // Test emails
84
  if (empty($email_id)) {
85
+ header('Location: ' . esc_url_raw($url));
86
  die();
87
  }
88
 
224
  }
225
 
226
  function relink_callback($matches) {
227
+ $href = trim(str_replace('&amp;', '&', $matches[2]));
228
 
229
  // Do not replace the tracking or subscription/unsubscription links.
230
  if (strpos($href, '/newsletter/') !== false) {
subscription/subscription.php CHANGED
@@ -362,7 +362,7 @@ class NewsletterSubscription extends NewsletterModule {
362
  // TODO: This is always empty!
363
  //$message_text = $options[$prefix . 'message_text'];
364
  $subject = $options[$prefix . 'subject'];
365
-
366
  $this->mail($user->email, $newsletter->replace($subject, $user), $newsletter->replace($message, $user));
367
  }
368
 
@@ -426,6 +426,10 @@ class NewsletterSubscription extends NewsletterModule {
426
 
427
  if (empty($options[$prefix . 'disabled'])) {
428
  $message = $options[$prefix . 'message'];
 
 
 
 
429
 
430
  // TODO: This is always empty!
431
  //$message_text = $options[$prefix . 'message_text'];
@@ -435,6 +439,10 @@ class NewsletterSubscription extends NewsletterModule {
435
  }
436
  return $user;
437
  }
 
 
 
 
438
 
439
  function update_user_from_request($user) {
440
  $newsletter = Newsletter::instance();
@@ -466,6 +474,8 @@ class NewsletterSubscription extends NewsletterModule {
466
  } else if (isset($_SERVER['HTTP_REFERER'])) {
467
  $user['http_referer'] = strip_tags(trim($_SERVER['HTTP_REFERER']));
468
  }
 
 
469
 
470
  // New profiles
471
  for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) {
@@ -531,9 +541,11 @@ class NewsletterSubscription extends NewsletterModule {
531
  include NEWSLETTER_DIR . '/subscription/email.php';
532
  $message = ob_get_clean();
533
  }
 
 
534
 
535
  $message = Newsletter::instance()->replace($message);
536
- return Newsletter::instance()->mail($to, $subject, $message);
537
  }
538
 
539
  /**
362
  // TODO: This is always empty!
363
  //$message_text = $options[$prefix . 'message_text'];
364
  $subject = $options[$prefix . 'subject'];
365
+ $message = $this->add_microdata($message);
366
  $this->mail($user->email, $newsletter->replace($subject, $user), $newsletter->replace($message, $user));
367
  }
368
 
426
 
427
  if (empty($options[$prefix . 'disabled'])) {
428
  $message = $options[$prefix . 'message'];
429
+
430
+ if ($user->status == 'S') {
431
+ $message = $this->add_microdata($message);
432
+ }
433
 
434
  // TODO: This is always empty!
435
  //$message_text = $options[$prefix . 'message_text'];
439
  }
440
  return $user;
441
  }
442
+
443
+ function add_microdata($message) {
444
+ return $message . '<span itemscope itemtype="http://schema.org/EmailMessage"><span itemprop="description" content="Email address confirmation"></span><span itemprop="action" itemscope itemtype="http://schema.org/ConfirmAction"><meta itemprop="name" content="Confirm Subscription"><span itemprop="handler" itemscope itemtype="http://schema.org/HttpActionHandler"><meta itemprop="url" content="{subscription_confirm_url}"><link itemprop="method" href="http://schema.org/HttpRequestMethod/POST"></span></span></span>';
445
+ }
446
 
447
  function update_user_from_request($user) {
448
  $newsletter = Newsletter::instance();
474
  } else if (isset($_SERVER['HTTP_REFERER'])) {
475
  $user['http_referer'] = strip_tags(trim($_SERVER['HTTP_REFERER']));
476
  }
477
+
478
+ if (strlen($user['http_referer']) > 200) $user['http_referer'] = substr($user['http_referer'], 0, 200);
479
 
480
  // New profiles
481
  for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) {
541
  include NEWSLETTER_DIR . '/subscription/email.php';
542
  $message = ob_get_clean();
543
  }
544
+
545
+ $headers = array('Auto-Submitted'=>'auto-generated');
546
 
547
  $message = Newsletter::instance()->replace($message);
548
+ return Newsletter::instance()->mail($to, $subject, $message, $headers);
549
  }
550
 
551
  /**
users/edit.php CHANGED
@@ -224,17 +224,23 @@ function percentValue($value, $total) {
224
  </div>
225
  <table class="form-table">
226
  <tr valign="top">
227
- <th>Subscriber ID</th>
228
  <td>
229
  <?php $controls->value('id'); ?>
230
  </td>
231
  </tr>
232
  <tr valign="top">
233
- <th>Created</th>
234
  <td>
235
  <?php $controls->value('created'); ?>
236
  </td>
237
  </tr>
 
 
 
 
 
 
238
  <tr valign="top">
239
  <th>From IP address</th>
240
  <td>
224
  </div>
225
  <table class="form-table">
226
  <tr valign="top">
227
+ <th>ID</th>
228
  <td>
229
  <?php $controls->value('id'); ?>
230
  </td>
231
  </tr>
232
  <tr valign="top">
233
+ <th><?php _e('Created', 'newsletter')?></th>
234
  <td>
235
  <?php $controls->value('created'); ?>
236
  </td>
237
  </tr>
238
+ <tr valign="top">
239
+ <th><?php _e('WP user ID', 'newsletter')?></th>
240
+ <td>
241
+ <?php $controls->text('wp_user_id'); ?>
242
+ </td>
243
+ </tr>
244
  <tr valign="top">
245
  <th>From IP address</th>
246
  <td>
users/index.php CHANGED
@@ -225,6 +225,7 @@ $controls->data['search_page']++;
225
  <small>
226
  <?php
227
  for ($i=1; $i<=NEWSLETTER_LIST_MAX; $i++) {
 
228
  $l = 'list_' . $i;
229
  if ($s->$l == 1) echo esc_html($lists['' . $i]) . '<br />';
230
  }
225
  <small>
226
  <?php
227
  for ($i=1; $i<=NEWSLETTER_LIST_MAX; $i++) {
228
+ if (!isset($lists['' . $i])) continue;
229
  $l = 'list_' . $i;
230
  if ($s->$l == 1) echo esc_html($lists['' . $i]) . '<br />';
231
  }