Newsletter - Version 7.2.6

Version Description

  • Fixed links on test emails sent to a free email address
  • Added attachment explanation
  • Added link to explain the use of the snippet
Download this release

Release Info

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

Code changes from version 7.2.5 to 7.2.6

emails/emails.php CHANGED
@@ -1318,7 +1318,7 @@ class NewsletterEmails extends NewsletterModule {
1318
 
1319
  private function make_dummy_subscriber() {
1320
  $dummy_user = new TNP_User();
1321
- $dummy_user->id = - 1;
1322
  $dummy_user->email = 'john.doe@example.org';
1323
  $dummy_user->name = 'John';
1324
  $dummy_user->surname = 'Doe';
1318
 
1319
  private function make_dummy_subscriber() {
1320
  $dummy_user = new TNP_User();
1321
+ $dummy_user->id = 0;
1322
  $dummy_user->email = 'john.doe@example.org';
1323
  $dummy_user->name = 'John';
1324
  $dummy_user->surname = 'Doe';
emails/tnp-composer/_css/newsletter-builder-v2.css CHANGED
@@ -128,6 +128,14 @@
128
  color: #FFF;
129
  }
130
 
 
 
 
 
 
 
 
 
131
  #test-newsletter-button {
132
  background-color: #2b2f3a;
133
  }
128
  color: #FFF;
129
  }
130
 
131
+ .composer-actions .button-primary {
132
+ background-color: #2b2f3a;
133
+ }
134
+
135
+ .composer-actions .button-primary:hover {
136
+ background-color: #3c434a;
137
+ }
138
+
139
  #test-newsletter-button {
140
  background-color: #2b2f3a;
141
  }
emails/tnp-composer/index-v2.php CHANGED
@@ -67,7 +67,9 @@ $rev_dir = is_rtl() ? 'ltr' : 'rlt';
67
  </td>
68
  </tr>
69
  <tr>
70
- <th dir="<?php echo $dir ?>"><span title="<?php esc_attr_e('Shown by some email clients as excerpt', 'newsletter')?>"><?php _e('Snippet', 'newsletter') ?></span></th>
 
 
71
  <td dir="<?php echo $dir ?>"><?php $this->text('preheader') ?></td>
72
  </tr>
73
  </table>
@@ -80,24 +82,29 @@ $rev_dir = is_rtl() ? 'ltr' : 'rlt';
80
  </div>
81
 
82
  <div class="composer-actions">
83
- <div id="test-newsletter-button"
84
- class="button-primary"
85
- data-tnp-modal-target="#test-newsletter-modal">
 
 
 
86
  <i class="fas fa-paper-plane"></i> <?php _e( 'Test', 'newsletter' ) ?>
87
  </div>
 
88
  <div class="composer-view-mode">
89
- <span class="composer-view-mode__item"
90
- data-view-mode="desktop">
91
  <i class="fas fa-desktop"></i>
92
  </span>
93
- <span class="composer-view-mode__item"
94
- data-view-mode="mobile">
95
  <i class="fas fa-mobile"></i>
96
  <span>
97
  </div>
 
98
  </div>
99
 
100
  <?php include NEWSLETTER_DIR . '/emails/tnp-composer/modal/test-newsletter.php' ?>
 
101
 
102
  </div>
103
  <?php } ?>
@@ -115,13 +122,6 @@ $rev_dir = is_rtl() ? 'ltr' : 'rlt';
115
  <div class="tnpc-tabs">
116
  <button class="tablinks" onclick="openTab(event, 'tnpc-blocks')" data-tab-id='tnpc-blocks' id="defaultOpen"><?php _e('Blocks', 'newsletter') ?></button>
117
  <button class="tablinks" onclick="openTab(event, 'tnpc-global-styles')" data-tab-id='tnpc-global-styles'><?php _e('Settings', 'newsletter') ?></button>
118
- <!--
119
- <button class="tablinks" onclick="openTab(event, 'tnpc-mobile-tab')" data-tab-id='tnpc-mobile-tab'><i class="fas fa-mobile"></i> <?php _e('Mobile', 'newsletter') ?></button>
120
- -->
121
- <?php if (false && $show_test) { ?>
122
- <button class="tablinks" onclick="openTab(event, 'tnpc-test-tab')" data-tab-id='tnpc-test-tab'><i class="fas fa-paper-plane"></i> <?php _e('Test', 'newsletter') ?></button>
123
- <?php } ?>
124
-
125
  </div>
126
 
127
  <div id="tnpc-blocks" class="tabcontent">
@@ -141,8 +141,6 @@ $rev_dir = is_rtl() ? 'ltr' : 'rlt';
141
 
142
  <form id="tnpc-global-styles-form">
143
 
144
- <?php //$fields->section('Colors') ?>
145
-
146
  <div class="tnp-field-row">
147
  <div class="tnp-field-col-2">
148
  <?php $fields->color('options_composer_background', __('Main background', 'newsletter')) ?>
@@ -152,7 +150,6 @@ $rev_dir = is_rtl() ? 'ltr' : 'rlt';
152
  </div>
153
  </div>
154
 
155
- <?php //$fields->section('Fonts are applied to new blocks or when refreshed') ?>
156
  <?php $fields->font('options_composer_title_font', __('Titles font', 'newsletter')) ?>
157
  <?php $fields->font('options_composer_text_font', __('Text font', 'newsletter')) ?>
158
  <?php $fields->button_style('options_composer_button', __('Button style', 'newsletter')); ?>
@@ -163,28 +160,6 @@ $rev_dir = is_rtl() ? 'ltr' : 'rlt';
163
 
164
  </div>
165
 
166
-
167
- <div id="tnpc-mobile-tab" class="tabcontent">
168
-
169
- <iframe id="tnpc-mobile-preview"></iframe>
170
-
171
- </div>
172
-
173
- <div id="tnpc-test-tab" class="tabcontent">
174
-
175
- <p><?php _e("Test subscribers:") ?></p>
176
- <ul>
177
- <?php foreach (NewsletterUsers::instance()->get_test_users() AS $user) { ?>
178
- <li><?php echo $user->email ?></li>
179
- <?php } ?>
180
- </ul>
181
- <button class="button-secondary" onclick="tnpc_test()"><?php _e("Send a test", 'newsletter') ?></button>
182
- <p>
183
- <a href="https://www.thenewsletterplugin.com/documentation/subscribers#test" target="_blank">
184
- <?php _e('Read more about test subscribers', 'newsletter') ?></a>
185
- </p>
186
- </div>
187
-
188
  <!-- Block options container (dynamically loaded -->
189
  <div id="tnpc-block-options">
190
  <div id="tnpc-block-options-buttons">
67
  </td>
68
  </tr>
69
  <tr>
70
+ <th dir="<?php echo $dir ?>"><span title="<?php esc_attr_e('Shown by some email clients as excerpt', 'newsletter')?>"><?php _e('Snippet', 'newsletter') ?></span>
71
+ <?php $this->field_help('https://www.thenewsletterplugin.com/documentation/newsletters/composer/#subject') ?>
72
+ </th>
73
  <td dir="<?php echo $dir ?>"><?php $this->text('preheader') ?></td>
74
  </tr>
75
  </table>
82
  </div>
83
 
84
  <div class="composer-actions">
85
+
86
+ <div id="attachment-newsletter-button" class="button-primary" data-tnp-modal-target="#attachment-modal">
87
+ <i class="fas fa-paperclip"></i>
88
+ </div>
89
+
90
+ <div id="test-newsletter-button" class="button-primary" data-tnp-modal-target="#test-newsletter-modal">
91
  <i class="fas fa-paper-plane"></i> <?php _e( 'Test', 'newsletter' ) ?>
92
  </div>
93
+
94
  <div class="composer-view-mode">
95
+ <span class="composer-view-mode__item" data-view-mode="desktop">
 
96
  <i class="fas fa-desktop"></i>
97
  </span>
98
+
99
+ <span class="composer-view-mode__item" data-view-mode="mobile">
100
  <i class="fas fa-mobile"></i>
101
  <span>
102
  </div>
103
+
104
  </div>
105
 
106
  <?php include NEWSLETTER_DIR . '/emails/tnp-composer/modal/test-newsletter.php' ?>
107
+ <?php include NEWSLETTER_DIR . '/emails/tnp-composer/modal/attachment.php' ?>
108
 
109
  </div>
110
  <?php } ?>
122
  <div class="tnpc-tabs">
123
  <button class="tablinks" onclick="openTab(event, 'tnpc-blocks')" data-tab-id='tnpc-blocks' id="defaultOpen"><?php _e('Blocks', 'newsletter') ?></button>
124
  <button class="tablinks" onclick="openTab(event, 'tnpc-global-styles')" data-tab-id='tnpc-global-styles'><?php _e('Settings', 'newsletter') ?></button>
 
 
 
 
 
 
 
125
  </div>
126
 
127
  <div id="tnpc-blocks" class="tabcontent">
141
 
142
  <form id="tnpc-global-styles-form">
143
 
 
 
144
  <div class="tnp-field-row">
145
  <div class="tnp-field-col-2">
146
  <?php $fields->color('options_composer_background', __('Main background', 'newsletter')) ?>
150
  </div>
151
  </div>
152
 
 
153
  <?php $fields->font('options_composer_title_font', __('Titles font', 'newsletter')) ?>
154
  <?php $fields->font('options_composer_text_font', __('Text font', 'newsletter')) ?>
155
  <?php $fields->button_style('options_composer_button', __('Button style', 'newsletter')); ?>
160
 
161
  </div>
162
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  <!-- Block options container (dynamically loaded -->
164
  <div id="tnpc-block-options">
165
  <div id="tnpc-block-options-buttons">
emails/tnp-composer/modal/attachment.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="tnp-modal2" id="attachment-modal" aria-hidden="true">
2
+ <div class="tnp-modal2__content" role="dialog" style="width: 600px">
3
+ <header class="tnp-modal2__header">
4
+
5
+ <h2><?php _e("Attachments", 'newsletter') ?></h2>
6
+ <span class="tnp-modal2__close" data-tnp-modal-close aria-label="Close modal"></span>
7
+ </header>
8
+
9
+ <div class="tnp-modal2__body">
10
+
11
+ <p>
12
+ The Newsletter plugin does not support attachments.
13
+ <a href="https://www.thenewsletterplugin.com/documentation/adding-attachments-to-newsletters/" target="_blank">Please read more in our documentation</a>.
14
+ </p>
15
+
16
+ </div>
17
+
18
+ </div>
19
+ </div>
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: 7.2.5
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.
@@ -37,7 +37,7 @@ if (version_compare(phpversion(), '5.6', '<')) {
37
  return;
38
  }
39
 
40
- define('NEWSLETTER_VERSION', '7.2.5');
41
 
42
  global $newsletter, $wpdb;
43
 
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: 7.2.6
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.
37
  return;
38
  }
39
 
40
+ define('NEWSLETTER_VERSION', '7.2.6');
41
 
42
  global $newsletter, $wpdb;
43
 
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === Newsletter ===
2
  Tags: newsletter, email marketing, welcome email, signup forms, contact, lead generation, marketing automation
3
  Tested up to: 5.8.1
4
- Stable tag: 7.2.5
5
  Contributors: satollo,webagile,michael-travan
6
  License: GPLv2 or later
7
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -118,6 +118,12 @@ Thank you, The Newsletter Team
118
 
119
  == Changelog ==
120
 
 
 
 
 
 
 
121
  = 7.2.5 =
122
 
123
  * Fixed subject not saved under specific circumstance
1
  === Newsletter ===
2
  Tags: newsletter, email marketing, welcome email, signup forms, contact, lead generation, marketing automation
3
  Tested up to: 5.8.1
4
+ Stable tag: 7.2.6
5
  Contributors: satollo,webagile,michael-travan
6
  License: GPLv2 or later
7
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
118
 
119
  == Changelog ==
120
 
121
+ = 7.2.6 =
122
+
123
+ * Fixed links on test emails sent to a free email address
124
+ * Added attachment explanation
125
+ * Added link to explain the use of the snippet
126
+
127
  = 7.2.5 =
128
 
129
  * Fixed subject not saved under specific circumstance
statistics/statistics.php CHANGED
@@ -44,7 +44,7 @@ class NewsletterStatistics extends NewsletterModule {
44
  // The remaining elements are the url splitted when it contains
45
  $url = implode(';', $parts);
46
 
47
- if (empty($user_id) || empty($url)) {
48
  $this->dienow('Invalid link', 'The tracking link contains invalid data (missing subscriber or original URL)', 404);
49
  }
50
 
@@ -56,17 +56,19 @@ class NewsletterStatistics extends NewsletterModule {
56
  $this->dienow('Invalid link', 'The link signature (which grants a valid redirection and protects from redirect attacks) is not valid.', 404);
57
  }
58
 
59
- $user = Newsletter::instance()->get_user($user_id);
60
- if (!$user) {
61
- $this->dienow(__('Subscriber not found', 'newsletter'), 'This tracking link contains a reference to a subscriber no more present', 404);
62
- }
63
-
64
- // Test emails
65
- if (empty($email_id)) {
66
  header('Location: ' . esc_url_raw($url));
67
  die();
68
  }
69
 
 
 
 
 
 
 
 
70
  $email = $this->get_email($email_id);
71
  if (!$email) {
72
  $this->dienow('Invalid newsletter', 'The link originates from a newsletter not found (it could have been deleted)', 404);
@@ -90,7 +92,6 @@ class NewsletterStatistics extends NewsletterModule {
90
  }
91
  $this->reset_stats_time($email_id);
92
 
93
-
94
  $this->update_user_ip($user, $ip);
95
  $this->update_user_last_activity($user);
96
 
@@ -157,8 +158,8 @@ class NewsletterStatistics extends NewsletterModule {
157
  global $wpdb, $charset_collate;
158
 
159
  parent::upgrade();
160
-
161
- $sql = "CREATE TABLE `" . $wpdb->prefix . "newsletter_stats` (
162
  `id` int(11) NOT NULL AUTO_INCREMENT,
163
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
164
  `url` varchar(255) NOT NULL DEFAULT '',
@@ -170,7 +171,7 @@ class NewsletterStatistics extends NewsletterModule {
170
  KEY `user_id` (`user_id`)
171
  ) $charset_collate;";
172
 
173
- dbDelta($sql);
174
 
175
  if (empty($this->options['key'])) {
176
  $this->options['key'] = md5($_SERVER['REMOTE_ADDR'] . rand(100000, 999999) . time());
@@ -251,17 +252,16 @@ class NewsletterStatistics extends NewsletterModule {
251
  $page = apply_filters('newsletter_statistics_view', 'newsletter_statistics_view');
252
  return 'admin.php?page=' . $page . '&amp;id=' . $email_id;
253
  }
254
-
255
  function echo_statistics_button($email_id) {
256
  echo '<a class="button-primary" href="', $this->get_statistics_url($email_id), '"><i class="fas fa-chart-bar"></i></a>';
257
-
258
  }
259
 
260
  function get_index_url() {
261
  $page = apply_filters('newsletter_statistics_index', 'newsletter_statistics_index');
262
  return 'admin.php?page=' . $page;
263
  }
264
-
265
  /**
266
  * @deprecated
267
  *
@@ -272,7 +272,7 @@ class NewsletterStatistics extends NewsletterModule {
272
  $report = $this->get_statistics($email_id);
273
  return $report->total;
274
  }
275
-
276
  /**
277
  * @deprecated
278
  *
@@ -283,7 +283,7 @@ class NewsletterStatistics extends NewsletterModule {
283
  $report = $this->get_statistics($email_id);
284
  return $report->open_count;
285
  }
286
-
287
  /**
288
  * @deprecated
289
  *
@@ -292,8 +292,8 @@ class NewsletterStatistics extends NewsletterModule {
292
  */
293
  function get_error_count($email_id) {
294
  return 0;
295
- }
296
-
297
  /**
298
  * @deprecated
299
  *
@@ -303,7 +303,7 @@ class NewsletterStatistics extends NewsletterModule {
303
  function get_click_count($email_id) {
304
  $report = $this->get_statistics($email_id);
305
  return $report->click_count;
306
- }
307
 
308
  /**
309
  * @deprecated
@@ -399,7 +399,7 @@ class NewsletterStatistics extends NewsletterModule {
399
  }
400
 
401
  $report = new TNP_Statistics();
402
-
403
  $report->email_id = $email->id;
404
 
405
  if ($email->status != 'new') {
44
  // The remaining elements are the url splitted when it contains
45
  $url = implode(';', $parts);
46
 
47
+ if (empty($url)) {
48
  $this->dienow('Invalid link', 'The tracking link contains invalid data (missing subscriber or original URL)', 404);
49
  }
50
 
56
  $this->dienow('Invalid link', 'The link signature (which grants a valid redirection and protects from redirect attacks) is not valid.', 404);
57
  }
58
 
59
+ // Test emails, anyway the link was signed
60
+ if (empty($email_id) || empty($user_id)) {
 
 
 
 
 
61
  header('Location: ' . esc_url_raw($url));
62
  die();
63
  }
64
 
65
+ if ($user_id) {
66
+ $user = Newsletter::instance()->get_user($user_id);
67
+ if (!$user) {
68
+ $this->dienow(__('Subscriber not found', 'newsletter'), 'This tracking link contains a reference to a subscriber no more present', 404);
69
+ }
70
+ }
71
+
72
  $email = $this->get_email($email_id);
73
  if (!$email) {
74
  $this->dienow('Invalid newsletter', 'The link originates from a newsletter not found (it could have been deleted)', 404);
92
  }
93
  $this->reset_stats_time($email_id);
94
 
 
95
  $this->update_user_ip($user, $ip);
96
  $this->update_user_last_activity($user);
97
 
158
  global $wpdb, $charset_collate;
159
 
160
  parent::upgrade();
161
+
162
+ $sql = "CREATE TABLE `" . $wpdb->prefix . "newsletter_stats` (
163
  `id` int(11) NOT NULL AUTO_INCREMENT,
164
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
165
  `url` varchar(255) NOT NULL DEFAULT '',
171
  KEY `user_id` (`user_id`)
172
  ) $charset_collate;";
173
 
174
+ dbDelta($sql);
175
 
176
  if (empty($this->options['key'])) {
177
  $this->options['key'] = md5($_SERVER['REMOTE_ADDR'] . rand(100000, 999999) . time());
252
  $page = apply_filters('newsletter_statistics_view', 'newsletter_statistics_view');
253
  return 'admin.php?page=' . $page . '&amp;id=' . $email_id;
254
  }
255
+
256
  function echo_statistics_button($email_id) {
257
  echo '<a class="button-primary" href="', $this->get_statistics_url($email_id), '"><i class="fas fa-chart-bar"></i></a>';
 
258
  }
259
 
260
  function get_index_url() {
261
  $page = apply_filters('newsletter_statistics_index', 'newsletter_statistics_index');
262
  return 'admin.php?page=' . $page;
263
  }
264
+
265
  /**
266
  * @deprecated
267
  *
272
  $report = $this->get_statistics($email_id);
273
  return $report->total;
274
  }
275
+
276
  /**
277
  * @deprecated
278
  *
283
  $report = $this->get_statistics($email_id);
284
  return $report->open_count;
285
  }
286
+
287
  /**
288
  * @deprecated
289
  *
292
  */
293
  function get_error_count($email_id) {
294
  return 0;
295
+ }
296
+
297
  /**
298
  * @deprecated
299
  *
303
  function get_click_count($email_id) {
304
  $report = $this->get_statistics($email_id);
305
  return $report->click_count;
306
+ }
307
 
308
  /**
309
  * @deprecated
399
  }
400
 
401
  $report = new TNP_Statistics();
402
+
403
  $report->email_id = $email->id;
404
 
405
  if ($email->status != 'new') {