Newsletter - Version 5.4.5

Version Description

  • Fixed tested up version value in readme.txt
  • Added support for the WP privacy url
  • Added initialization values for company info on first installation
  • Fixed few debug notices
  • Added button in lists panel to dissociate the list from every subscriber (list clean up)
  • Fix of messages on profile editing panel
Download this release

Release Info

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

Code changes from version 5.4.4 to 5.4.5

includes/module.php CHANGED
@@ -1203,12 +1203,9 @@ class NewsletterModule {
1203
  return;
1204
  }
1205
 
1206
- $options_profile = get_option('newsletter_profile', array());
1207
- for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
1208
- if ($options_profile['list_' . $i . '_status'] == 0) {
1209
- continue;
1210
- }
1211
- $field_name = 'list_' . $i;
1212
  $data[$field_name] = $user->$field_name;
1213
  }
1214
  $data['status'] = $user->status;
1203
  return;
1204
  }
1205
 
1206
+ $lists = $this->get_lists_public();
1207
+ foreach ($lists as $list) {
1208
+ $field_name = 'list_' . $list->id;
 
 
 
1209
  $data[$field_name] = $user->$field_name;
1210
  }
1211
  $data['status'] = $user->status;
main/defaults-info.php CHANGED
@@ -1,6 +1,20 @@
1
  <?php
2
 
3
  $options = array(
 
4
  'header_title' => get_bloginfo('name'),
5
- 'header_sub' => get_bloginfo('description')
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  );
1
  <?php
2
 
3
  $options = array(
4
+ 'header_logo' => '',
5
  'header_title' => get_bloginfo('name'),
6
+ 'header_sub' => get_bloginfo('description'),
7
+ 'footer_title' => '',
8
+ 'footer_contact' => '',
9
+ 'footer_legal' => '',
10
+ 'facebook_url' => '',
11
+ 'twitter_url' => '',
12
+ 'instagram_url' => '',
13
+ 'googleplus_url' => '',
14
+ 'pinterest_url' => '',
15
+ 'linkedin_url' => '',
16
+ 'tumblr_url' => '',
17
+ 'youtube_url' => '',
18
+ 'vimeo_url' => '',
19
+ 'soundcloud_url' => ''
20
  );
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: 5.4.4
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', '5.4.4');
18
 
19
  global $wpdb, $newsletter;
20
 
@@ -160,7 +160,7 @@ class Newsletter extends NewsletterModule {
160
  add_action('admin_menu', array($this, 'add_extensions_menu'), 90);
161
  }
162
  }
163
-
164
  function update_cron_stats() {
165
  if (defined('DOING_CRON') && DOING_CRON) {
166
  $calls = get_option('newsletter_diagnostic_cron_calls', array());
@@ -296,14 +296,14 @@ class Newsletter extends NewsletterModule {
296
  wp_schedule_event(time() + 30, 'daily', 'newsletter_extension_versions');
297
 
298
  $subscription_options = get_option('newsletter', array());
299
-
300
  // Settings migration
301
  if (empty($this->options['page'])) {
302
  if (isset($subscription_options['page']))
303
  $this->options['page'] = $subscription_options['page'];
304
  $this->save_options($this->options);
305
  }
306
-
307
  if (empty($this->options['css']) && !empty($subscription_options['css'])) {
308
  $this->options['css'] = $subscription_options['css'];
309
  $this->save_options($this->options);
@@ -467,6 +467,12 @@ class Newsletter extends NewsletterModule {
467
  delete_option('newsletter_show_welcome');
468
  wp_redirect(admin_url('admin.php?page=newsletter_main_welcome'));
469
  }
 
 
 
 
 
 
470
  }
471
 
472
  function hook_admin_head() {
@@ -1214,7 +1220,7 @@ class Newsletter extends NewsletterModule {
1214
  if (!$url) {
1215
  if (!empty($this->options['page'])) {
1216
  $url = get_permalink($this->options['page']);
1217
- }
1218
  if (!$url) {
1219
  $url = self::get_home_url() . '?na=m';
1220
  }
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.4.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.
14
  */
15
 
16
  // Used as dummy parameter on css and js links
17
+ define('NEWSLETTER_VERSION', '5.4.5');
18
 
19
  global $wpdb, $newsletter;
20
 
160
  add_action('admin_menu', array($this, 'add_extensions_menu'), 90);
161
  }
162
  }
163
+
164
  function update_cron_stats() {
165
  if (defined('DOING_CRON') && DOING_CRON) {
166
  $calls = get_option('newsletter_diagnostic_cron_calls', array());
296
  wp_schedule_event(time() + 30, 'daily', 'newsletter_extension_versions');
297
 
298
  $subscription_options = get_option('newsletter', array());
299
+
300
  // Settings migration
301
  if (empty($this->options['page'])) {
302
  if (isset($subscription_options['page']))
303
  $this->options['page'] = $subscription_options['page'];
304
  $this->save_options($this->options);
305
  }
306
+
307
  if (empty($this->options['css']) && !empty($subscription_options['css'])) {
308
  $this->options['css'] = $subscription_options['css'];
309
  $this->save_options($this->options);
467
  delete_option('newsletter_show_welcome');
468
  wp_redirect(admin_url('admin.php?page=newsletter_main_welcome'));
469
  }
470
+
471
+ // https://developer.wordpress.org/plugins/privacy/suggesting-text-for-the-site-privacy-policy/
472
+ // https://make.wordpress.org/core/2018/05/17/4-9-6-update-guide/
473
+ if (function_exists('wp_add_privacy_policy_content')) {
474
+ //wp_add_privacy_policy_content('Newsletter', wp_kses_post( wpautop( $content, false )));
475
+ }
476
  }
477
 
478
  function hook_admin_head() {
1220
  if (!$url) {
1221
  if (!empty($this->options['page'])) {
1222
  $url = get_permalink($this->options['page']);
1223
+ }
1224
  if (!$url) {
1225
  $url = self::get_home_url() . '?na=m';
1226
  }
profile/profile.php CHANGED
@@ -356,7 +356,7 @@ class NewsletterProfile extends NewsletterModule {
356
  $tmp = $this->get_user($email);
357
  if ($tmp != null && $tmp->id != $user->id) {
358
  // TODO: Move the label on profile setting panel
359
- $user->alert = $subscription_module->options['profile_error'];
360
  return $user;
361
  }
362
  $data['status'] = Newsletter::STATUS_NOT_CONFIRMED;
@@ -408,14 +408,14 @@ class NewsletterProfile extends NewsletterModule {
408
  if ($email_changed && $subscription_module->is_double_optin()) {
409
  $subscription_module->send_activation_email($user);
410
  // TODO: Move this option on new profile configuration panel
411
- $alert = $subscription_module->options['profile_email_changed'];
412
  }
413
 
414
  if (isset($alert)) {
415
  $user->alert = $alert;
416
  } else {
417
  // TODO: Move this label on profile settings panel
418
- $user->alert = $subscription_module->options['profile_saved'];
419
  }
420
  return $user;
421
  }
356
  $tmp = $this->get_user($email);
357
  if ($tmp != null && $tmp->id != $user->id) {
358
  // TODO: Move the label on profile setting panel
359
+ $user->alert = $this->options['error'];
360
  return $user;
361
  }
362
  $data['status'] = Newsletter::STATUS_NOT_CONFIRMED;
408
  if ($email_changed && $subscription_module->is_double_optin()) {
409
  $subscription_module->send_activation_email($user);
410
  // TODO: Move this option on new profile configuration panel
411
+ $alert = $this->options['profile_email_changed'];
412
  }
413
 
414
  if (isset($alert)) {
415
  $user->alert = $alert;
416
  } else {
417
  // TODO: Move this label on profile settings panel
418
+ $user->alert = $this->options['saved'];
419
  }
420
  return $user;
421
  }
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.9.9
5
- Stable tag: 5.4.4
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
@@ -12,6 +12,18 @@ Add a real newsletter system to your blog. For free. With unlimited newsletters
12
  Newsletter is a **real newsletter system** for your WordPress blog: perfect for list building, you can easily create,
13
  send and track e-mails, headache-free. It just works out of box!
14
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  = Main Features =
16
 
17
  * **Unlimited subscribers** with statistics
@@ -90,6 +102,15 @@ Thank you, The Newsletter Team
90
 
91
  == Changelog ==
92
 
 
 
 
 
 
 
 
 
 
93
  = 5.4.4 =
94
 
95
  * Fixed warning on default option init
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.9.6
5
+ Stable tag: 5.4.5
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
12
  Newsletter is a **real newsletter system** for your WordPress blog: perfect for list building, you can easily create,
13
  send and track e-mails, headache-free. It just works out of box!
14
 
15
+ = GDPR =
16
+
17
+ The Newsletter Plugin provides all the technical tools needed to achieve GDPR compliancy and
18
+ we're continuously working to improve them and to give support even for specific
19
+ use cases.
20
+
21
+ The plugin does not collect users’ own subscribers data, nor it has any access to those data:
22
+ hence, we are not a data processor, so a data processing agreement is not needed.
23
+
24
+ Anyway if you configure the plugin to use external services (usually an external mail
25
+ delivery service) you should check with that service if some sort of agreement is required.
26
+
27
  = Main Features =
28
 
29
  * **Unlimited subscribers** with statistics
102
 
103
  == Changelog ==
104
 
105
+ = 5.4.5 =
106
+
107
+ * Fixed tested up version value in readme.txt
108
+ * Added support for the WP privacy url
109
+ * Added initialization values for company info on first installation
110
+ * Fixed few debug notices
111
+ * Added button in lists panel to dissociate the list from every subscriber (list clean up)
112
+ * Fix of messages on profile editing panel
113
+
114
  = 5.4.4 =
115
 
116
  * Fixed warning on default option init
subscription/lists.php CHANGED
@@ -6,14 +6,16 @@ $controls = new NewsletterControls();
6
  $module = NewsletterSubscription::instance();
7
 
8
  if (!$controls->is_action()) {
9
- $controls->data = $module->get_options('profile');
10
  } else {
11
  if ($controls->is_action('save')) {
12
- $module->merge_options($controls->data, 'profile');
13
- // In the near future
14
  $module->save_options($controls->data, 'lists');
15
  $controls->add_message_saved();
16
  }
 
 
 
 
17
  }
18
 
19
  for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
@@ -61,6 +63,7 @@ $status = array(0 => 'Disabled/Private use', 1 => 'Only on profile page', 2 => '
61
  <th><?php _e('Pre-checked', 'newsletter')?></th>
62
  <th><?php _e('Pre-assigned', 'newsletter')?></th>
63
  <th><?php _e('Subscribers', 'newsletter')?></th>
 
64
  <th><?php _e('Notes', 'newsletter') ?></th>
65
  </tr>
66
  </thead>
@@ -72,6 +75,7 @@ $status = array(0 => 'Disabled/Private use', 1 => 'Only on profile page', 2 => '
72
  <td><?php $controls->select('list_' . $i . '_checked', array(0 => 'No', 1 => 'Yes')); ?></td>
73
  <td><?php $controls->select('list_' . $i . '_forced', array(0 => 'No', 1 => 'Yes')); ?></td>
74
  <td><?php echo $wpdb->get_var("select count(*) from " . NEWSLETTER_USERS_TABLE . " where list_" . $i . "=1 and status='C'"); ?></td>
 
75
  <td>
76
  <?php $notes = apply_filters('newsletter_lists_notes', array(), $i); ?>
77
  <?php
6
  $module = NewsletterSubscription::instance();
7
 
8
  if (!$controls->is_action()) {
9
+ $controls->data = $module->get_options('lists');
10
  } else {
11
  if ($controls->is_action('save')) {
 
 
12
  $module->save_options($controls->data, 'lists');
13
  $controls->add_message_saved();
14
  }
15
+ if ($controls->is_action('dissociate')) {
16
+ $wpdb->query("update " . NEWSLETTER_USERS_TABLE . " set list_" . ((int)$controls->button_data) . "=0");
17
+ $controls->add_message_done();
18
+ }
19
  }
20
 
21
  for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
63
  <th><?php _e('Pre-checked', 'newsletter')?></th>
64
  <th><?php _e('Pre-assigned', 'newsletter')?></th>
65
  <th><?php _e('Subscribers', 'newsletter')?></th>
66
+ <th>&nbsp;</th>
67
  <th><?php _e('Notes', 'newsletter') ?></th>
68
  </tr>
69
  </thead>
75
  <td><?php $controls->select('list_' . $i . '_checked', array(0 => 'No', 1 => 'Yes')); ?></td>
76
  <td><?php $controls->select('list_' . $i . '_forced', array(0 => 'No', 1 => 'Yes')); ?></td>
77
  <td><?php echo $wpdb->get_var("select count(*) from " . NEWSLETTER_USERS_TABLE . " where list_" . $i . "=1 and status='C'"); ?></td>
78
+ <td><?php $controls->button_confirm('dissociate', __('Dissociate everyone', 'newsletter'), '', $i); ?></td>
79
  <td>
80
  <?php $notes = apply_filters('newsletter_lists_notes', array(), $i); ?>
81
  <?php
subscription/profile.php CHANGED
@@ -137,7 +137,11 @@ $rules = array(0 => __('Optional', 'newsletter'), 1 => __('Required', 'newslette
137
  <table class="newsletter-option-grid">
138
  <tr><th>Enabled?</th><td><?php $controls->select('privacy_status', array(0=>'No', 1=>'Yes', 2=>'Only the notice')); ?></td></tr>
139
  <tr><th>Label</th><td><?php $controls->text('privacy', 50); ?></td></tr>
140
- <tr><th>Privacy URL</th><td><?php $controls->text('privacy_url', 50); ?></td></tr>
 
 
 
 
141
  <tr><th>Error message</th><td><?php $controls->text('privacy_error', 50); ?></td></tr>
142
  </table>
143
  <p class="description">
137
  <table class="newsletter-option-grid">
138
  <tr><th>Enabled?</th><td><?php $controls->select('privacy_status', array(0=>'No', 1=>'Yes', 2=>'Only the notice')); ?></td></tr>
139
  <tr><th>Label</th><td><?php $controls->text('privacy', 50); ?></td></tr>
140
+ <tr><th>Privacy URL</th><td>
141
+ <?php $controls->checkbox('privacy_use_wp_url', __('User WordPress privacy URL', 'newsletter')); ?>
142
+ <br>
143
+ <?php $controls->text('privacy_url', 50); ?>
144
+ </td></tr>
145
  <tr><th>Error message</th><td><?php $controls->text('privacy_error', 50); ?></td></tr>
146
  </table>
147
  <p class="description">
subscription/subscription.php CHANGED
@@ -27,7 +27,7 @@ class NewsletterSubscription extends NewsletterModule {
27
 
28
  function __construct() {
29
 
30
- parent::__construct('subscription', '2.1.4', null, array('lists', 'template', 'profile'));
31
  $this->options_profile = $this->get_options('profile');
32
  $this->options_lists = $this->get_options('lists');
33
 
@@ -435,6 +435,13 @@ class NewsletterSubscription extends NewsletterModule {
435
  }
436
 
437
  for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
 
 
 
 
 
 
 
438
  if (!isset($profile_options['list_' . $i . '_forced'])) {
439
  $profile_options['list_' . $i . '_forced'] = empty($this->options['preferences_' . $i]) ? 0 : 1;
440
  $lists_options['list_' . $i . '_forced'] = empty($this->options['preferences_' . $i]) ? 0 : 1;
@@ -843,29 +850,25 @@ class NewsletterSubscription extends NewsletterModule {
843
  * @return stdClass
844
  */
845
  function confirm($user_id = null, $emails = true) {
846
- $newsletter = Newsletter::instance();
847
  if ($user_id == null) {
848
- $user = $this->get_user_from_request();
849
- if ($user) {
850
- // Is there any temporary data from a subscription to be confirmed?
851
- $data = get_transient($this->get_user_key($user));
852
- if ($data !== false) {
853
- $_REQUEST = $data;
854
- // Update the user profile since it's now confirmed
855
- $user = $this->update_user_from_request((array) $user);
856
- $user = $this->save_user($user);
857
- delete_transient($this->get_user_key($user));
858
- // Forced a fake status so the welcome email is sent
859
- $user->status = Newsletter::STATUS_NOT_CONFIRMED;
860
- }
861
- }
862
  } else {
863
- $user = $newsletter->get_user($user_id);
864
- }
865
-
866
- if ($user == null) {
867
- $this->logger->debug('Not found');
868
- die('No subscriber found.');
869
  }
870
 
871
  $this->update_user_last_activity($user);
@@ -878,12 +881,6 @@ class NewsletterSubscription extends NewsletterModule {
878
  return $user;
879
  }
880
 
881
- // if ($user->status != 'S') {
882
- // $this->logger->debug('Was not in status S');
883
- // $user->status = 'E';
884
- // return $user;
885
- // }
886
-
887
  $this->set_user_status($user->id, Newsletter::STATUS_CONFIRMED);
888
 
889
  $user = $this->get_user($user->id);
@@ -1047,8 +1044,11 @@ class NewsletterSubscription extends NewsletterModule {
1047
  static $url = false;
1048
 
1049
  if (!$url) {
1050
- $url = $this->options_profile['privacy_url'];
1051
- // TODO: Fine the new WP privacy page
 
 
 
1052
  }
1053
  return $url;
1054
  }
@@ -1381,7 +1381,7 @@ class NewsletterSubscription extends NewsletterModule {
1381
  }
1382
 
1383
  $buffer .= "</label>";
1384
-
1385
  return $buffer;
1386
  }
1387
 
@@ -1680,7 +1680,7 @@ class NewsletterSubscription extends NewsletterModule {
1680
  $form = '';
1681
  $form .= '<div class="tnp tnp-subscription-minimal ' . $attrs['class'] . '">';
1682
  $form .= '<form action="' . esc_attr(home_url('/')) . '?na=s" method="post">';
1683
- if (isset($attrs['lists'])) {
1684
  $arr = explode(',', $attrs['lists']);
1685
  foreach ($arr as $a) {
1686
  $form .= "<input type='hidden' name='nl[]' value='" . ((int) trim($a)) . "'>\n";
27
 
28
  function __construct() {
29
 
30
+ parent::__construct('subscription', '2.1.5', null, array('lists', 'template', 'profile'));
31
  $this->options_profile = $this->get_options('profile');
32
  $this->options_lists = $this->get_options('lists');
33
 
435
  }
436
 
437
  for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
438
+ // Options migration to the new set
439
+ if (!empty($profile_options['list_' . $i]) && empty($lists_options['list_' . $i])) {
440
+ $lists_options['list_' . $i] = $profile_options['list_' . $i];
441
+ $lists_options['list_' . $i . '_checked'] = $profile_options['list_' . $i . '_checked'];
442
+ $lists_options['list_' . $i . '_forced'] = $profile_options['list_' . $i . '_forced'];
443
+ }
444
+
445
  if (!isset($profile_options['list_' . $i . '_forced'])) {
446
  $profile_options['list_' . $i . '_forced'] = empty($this->options['preferences_' . $i]) ? 0 : 1;
447
  $lists_options['list_' . $i . '_forced'] = empty($this->options['preferences_' . $i]) ? 0 : 1;
850
  * @return stdClass
851
  */
852
  function confirm($user_id = null, $emails = true) {
853
+
854
  if ($user_id == null) {
855
+ $user = $this->get_user_from_request(true);
856
+ // Is there any temporary data from a subscription to be confirmed?
857
+ $data = get_transient($this->get_user_key($user));
858
+ if ($data !== false) {
859
+ $_REQUEST = $data;
860
+ // Update the user profile since it's now confirmed
861
+ $user = $this->update_user_from_request((array) $user);
862
+ $user = $this->save_user($user);
863
+ delete_transient($this->get_user_key($user));
864
+ // Forced a fake status so the welcome email is sent
865
+ $user->status = Newsletter::STATUS_NOT_CONFIRMED;
866
+ }
 
 
867
  } else {
868
+ $user = $this->get_user($user_id);
869
+ if ($user == null) {
870
+ die('No subscriber found.');
871
+ }
 
 
872
  }
873
 
874
  $this->update_user_last_activity($user);
881
  return $user;
882
  }
883
 
 
 
 
 
 
 
884
  $this->set_user_status($user->id, Newsletter::STATUS_CONFIRMED);
885
 
886
  $user = $this->get_user($user->id);
1044
  static $url = false;
1045
 
1046
  if (!$url) {
1047
+ if ($this->options_profile['privacy_use_wp_url'] && function_exists('get_privacy_policy_url')) {
1048
+ $url = get_privacy_policy_url();
1049
+ } else {
1050
+ $url = $this->options_profile['privacy_url'];
1051
+ }
1052
  }
1053
  return $url;
1054
  }
1381
  }
1382
 
1383
  $buffer .= "</label>";
1384
+
1385
  return $buffer;
1386
  }
1387
 
1680
  $form = '';
1681
  $form .= '<div class="tnp tnp-subscription-minimal ' . $attrs['class'] . '">';
1682
  $form .= '<form action="' . esc_attr(home_url('/')) . '?na=s" method="post">';
1683
+ if (isset($attrs['lists'])) {
1684
  $arr = explode(',', $attrs['lists']);
1685
  foreach ($arr as $a) {
1686
  $form .= "<input type='hidden' name='nl[]' value='" . ((int) trim($a)) . "'>\n";
widget/standard.php CHANGED
@@ -21,7 +21,7 @@ class NewsletterWidget extends WP_Widget {
21
  $instance['nl'] = array();
22
 
23
  $instance = array_merge(array('lists_layout' => '',
24
- 'lists_field_empty_label' => '',
25
  'lists_field_label' => ''), $instance);
26
 
27
  $options_profile = get_option('newsletter_profile');
21
  $instance['nl'] = array();
22
 
23
  $instance = array_merge(array('lists_layout' => '',
24
+ 'lists_empty_label' => '',
25
  'lists_field_label' => ''), $instance);
26
 
27
  $options_profile = get_option('newsletter_profile');