Newsletter - Version 5.5.3

Version Description

  • Updated tinyMCE for Edge compatibility
  • Debug mode notification
  • Fix debug notice on profile page
Download this release

Release Info

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

Code changes from version 5.5.2 to 5.5.3

emails/edit-editor.php CHANGED
@@ -1,4 +1,4 @@
1
- <script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.7.12/tinymce.min.js"></script>
2
  <script type="text/javascript">
3
 
4
  // https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols
1
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.7.13/tinymce.min.js"></script>
2
  <script type="text/javascript">
3
 
4
  // https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols
emails/tnp-composer/index.php CHANGED
@@ -99,7 +99,7 @@ $block_options = get_option('newsletter_main');
99
  TNP_HOME_URL = "<?php echo home_url('/', is_ssl() ? 'https' : 'http') ?>";
100
  </script>
101
  <script type="text/javascript" src="<?php echo plugins_url('newsletter'); ?>/emails/tnp-composer/_scripts/newsletter-builder.js?ver=<?php echo time() ?>"></script>
102
- <script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.7.12/tinymce.min.js"></script>
103
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.nicescroll/3.6.8-fix/jquery.nicescroll.min.js"></script>
104
  <script>
105
  jQuery(function () {
99
  TNP_HOME_URL = "<?php echo home_url('/', is_ssl() ? 'https' : 'http') ?>";
100
  </script>
101
  <script type="text/javascript" src="<?php echo plugins_url('newsletter'); ?>/emails/tnp-composer/_scripts/newsletter-builder.js?ver=<?php echo time() ?>"></script>
102
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.7.13/tinymce.min.js"></script>
103
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.nicescroll/3.6.8-fix/jquery.nicescroll.min.js"></script>
104
  <script>
105
  jQuery(function () {
includes/module.php CHANGED
@@ -612,10 +612,13 @@ class NewsletterModule {
612
 
613
  }
614
 
615
- function add_menu_page($page, $title) {
616
  global $newsletter;
617
  $name = 'newsletter_' . $this->module . '_' . $page;
618
- add_submenu_page('newsletter_main_index', $title, $title, ($newsletter->options['editor'] == 1) ? 'manage_categories' : 'manage_options', $name, array($this, 'menu_page'));
 
 
 
619
  }
620
 
621
  function add_admin_page($page, $title) {
612
 
613
  }
614
 
615
+ function add_menu_page($page, $title, $capability = '') {
616
  global $newsletter;
617
  $name = 'newsletter_' . $this->module . '_' . $page;
618
+ if (empty($capability)) {
619
+ $capability = ($newsletter->options['editor'] == 1) ? 'manage_categories' : 'manage_options';
620
+ }
621
+ add_submenu_page('newsletter_main_index', $title, $title, $capability, $name, array($this, 'menu_page'));
622
  }
623
 
624
  function add_admin_page($page, $title) {
main/defaults-info.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  $options = array(
4
- 'header_logo' => '',
5
  'header_title' => get_bloginfo('name'),
6
  'header_sub' => get_bloginfo('description'),
7
  'footer_title' => '',
1
  <?php
2
 
3
  $options = array(
4
+ 'header_logo' => array('id'=>0),
5
  'header_title' => get_bloginfo('name'),
6
  'header_sub' => get_bloginfo('description'),
7
  'footer_title' => '',
main/defaults.php CHANGED
@@ -19,6 +19,8 @@ $options = array(
19
  'css'=>'',
20
  'css_disabled'=>0,
21
  'ip'=>'',
 
 
22
 
23
  'header_logo' => '',
24
  'header_title' => get_bloginfo('name'),
19
  'css'=>'',
20
  'css_disabled'=>0,
21
  'ip'=>'',
22
+ 'page'=>0,
23
+ 'disable_cron_notice'=>0,
24
 
25
  'header_logo' => '',
26
  'header_title' => get_bloginfo('name'),
main/main.php CHANGED
@@ -275,7 +275,16 @@ if (!empty($return_path)) {
275
  <?php $controls->log_level('log_level'); ?>
276
  </td>
277
  </tr>
278
-
 
 
 
 
 
 
 
 
 
279
  <tr>
280
  <th><?php _e('IP addresses', 'newsletter')?></th>
281
  <td>
275
  <?php $controls->log_level('log_level'); ?>
276
  </td>
277
  </tr>
278
+ <!--
279
+ <tr>
280
+ <th>
281
+ <?php _e('Disable the scheduler notice', 'newsletter') ?>
282
+ </th>
283
+ <td>
284
+ <?php $controls->yesno('disable_cron_notice'); ?>
285
+ </td>
286
+ </tr>
287
+ -->
288
  <tr>
289
  <th><?php _e('IP addresses', 'newsletter')?></th>
290
  <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: 5.5.2
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.5.2');
18
 
19
  global $newsletter, $wpdb;
20
 
@@ -325,14 +325,14 @@ class Newsletter extends NewsletterModule {
325
 
326
  $this->add_menu_page('index', 'Dashboard');
327
  $this->add_menu_page('welcome', 'Welcome');
328
- $this->add_menu_page('main', 'Settings and More');
329
 
330
 
331
  $this->add_admin_page('smtp', 'SMTP');
332
- $this->add_admin_page('status', 'Status');
333
  $this->add_admin_page('info', 'Company info');
334
- $this->add_admin_page('diagnostic', 'Diagnostic');
335
- $this->add_admin_page('startup', 'Quick Startup');
336
  }
337
 
338
  function add_extensions_menu() {
@@ -431,16 +431,22 @@ class Newsletter extends NewsletterModule {
431
  }
432
  }
433
 
 
 
 
 
434
  $x = wp_next_scheduled('newsletter');
435
  if ($x === false) {
436
  echo '<div class="notice notice-error"><p>The Newsletter delivery engine is off (it should never be off). Deactivate and reactivate the Newsletter plugin.</p></div>';
437
  } else if (time() - $x > 900) {
438
  echo '<div class="notice notice-error"><p>The WP scheduler doesn\'t seem to be running correctly for Newsletter. <a href="https://www.thenewsletterplugin.com/documentation/newsletter-delivery-engine#cron" target="_blank"><strong>Read this page to solve the problem</strong></a>.</p></div>';
439
  } else {
440
- $cron_data = get_option('newsletter_diagnostic_cron_data');
441
- if ($cron_data && $cron_data['mean'] > 500) {
442
- echo '<div class="notice notice-error"><p>The WP scheduler doesn\'t seem to be triggered enough often for Newsletter. <a href="https://www.thenewsletterplugin.com/documentation/newsletter-delivery-engine#cron" target="_blank"><strong>Read this page to solve the problem</strong></a>.</p></div>';
443
- }
 
 
444
  }
445
  }
446
 
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.5.3
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.5.3');
18
 
19
  global $newsletter, $wpdb;
20
 
325
 
326
  $this->add_menu_page('index', 'Dashboard');
327
  $this->add_menu_page('welcome', 'Welcome');
328
+ $this->add_menu_page('main', 'Settings and More', 'manage_options');
329
 
330
 
331
  $this->add_admin_page('smtp', 'SMTP');
332
+ $this->add_admin_page('status', 'Status', 'manage_options');
333
  $this->add_admin_page('info', 'Company info');
334
+ //$this->add_admin_page('diagnostic', 'Diagnostic');
335
+ //$this->add_admin_page('startup', 'Quick Startup');
336
  }
337
 
338
  function add_extensions_menu() {
431
  }
432
  }
433
 
434
+ if (isset($this->options['debug']) && $this->options['debug'] == 1) {
435
+ echo '<div class="notice notice-warning"><p>The Newsletter plugin is in <strong>debug mode</strong>. When done change it on Newsletter <a href="admin.php?page=newsletter_main_main"><strong>main settings</strong></a>. Do not keep the debug mode active on production sites.</p></div>';
436
+ }
437
+
438
  $x = wp_next_scheduled('newsletter');
439
  if ($x === false) {
440
  echo '<div class="notice notice-error"><p>The Newsletter delivery engine is off (it should never be off). Deactivate and reactivate the Newsletter plugin.</p></div>';
441
  } else if (time() - $x > 900) {
442
  echo '<div class="notice notice-error"><p>The WP scheduler doesn\'t seem to be running correctly for Newsletter. <a href="https://www.thenewsletterplugin.com/documentation/newsletter-delivery-engine#cron" target="_blank"><strong>Read this page to solve the problem</strong></a>.</p></div>';
443
  } else {
444
+ // if (empty($this->options['disable_cron_notice'])) {
445
+ // $cron_data = get_option('newsletter_diagnostic_cron_data');
446
+ // if ($cron_data && $cron_data['mean'] > 500) {
447
+ // echo '<div class="notice notice-error"><p>The WP scheduler doesn\'t seem to be triggered enough often for Newsletter. <a href="https://www.thenewsletterplugin.com/documentation/newsletter-delivery-engine#cron" target="_blank"><strong>Read this page to solve the problem</strong></a> or disable this notice on <a href="admin.php?page=newsletter_main_main"><strong>main settings</strong></a>.</p></div>';
448
+ // }
449
+ // }
450
  }
451
  }
452
 
profile/defaults.php CHANGED
@@ -14,4 +14,5 @@ $options['save_label'] = __('Save', 'newsletter');
14
  $options['privacy_label'] = __('Read our privacy note', 'newsletter');
15
  $options['saved'] = __('Profile saved.', 'newsletter');
16
  $options['export_newsletters'] = 0;
 
17
 
14
  $options['privacy_label'] = __('Read our privacy note', 'newsletter');
15
  $options['saved'] = __('Profile saved.', 'newsletter');
16
  $options['export_newsletters'] = 0;
17
+ $options['url'] = '';
18
 
readme.txt CHANGED
@@ -2,7 +2,7 @@
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.5.2
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
@@ -18,7 +18,7 @@ The Newsletter Plugin provides all the technical tools needed to achieve GDPR co
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
@@ -102,6 +102,12 @@ Thank you, The Newsletter Team
102
 
103
  == Changelog ==
104
 
 
 
 
 
 
 
105
  = 5.5.2 =
106
 
107
  * Fixed the multiple dedicated page creation on Welcome screen
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.5.3
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
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
102
 
103
  == Changelog ==
104
 
105
+ = 5.5.3 =
106
+
107
+ * Updated tinyMCE for Edge compatibility
108
+ * Debug mode notification
109
+ * Fix debug notice on profile page
110
+
111
  = 5.5.2 =
112
 
113
  * Fixed the multiple dedicated page creation on Welcome screen
subscription/subscription.php CHANGED
@@ -12,12 +12,12 @@ class NewsletterSubscription extends NewsletterModule {
12
  const OPTIN_SINGLE = 1;
13
 
14
  static $instance;
15
-
16
  /**
17
  * @var array
18
  */
19
  var $options_profile;
20
-
21
  /**
22
  * @var array
23
  */
@@ -443,7 +443,7 @@ class NewsletterSubscription extends NewsletterModule {
443
  $lists_options['list_' . $i . '_checked'] = $profile_options['list_' . $i . '_checked'];
444
  $lists_options['list_' . $i . '_forced'] = $profile_options['list_' . $i . '_forced'];
445
  }
446
-
447
  if (!isset($profile_options['list_' . $i . '_forced'])) {
448
  $profile_options['list_' . $i . '_forced'] = empty($this->options['preferences_' . $i]) ? 0 : 1;
449
  $lists_options['list_' . $i . '_forced'] = empty($this->options['preferences_' . $i]) ? 0 : 1;
@@ -742,7 +742,7 @@ class NewsletterSubscription extends NewsletterModule {
742
  * @return array The filled array representing a subscriber
743
  */
744
  function update_user_from_request($user) {
745
-
746
  if (isset($_REQUEST['nn'])) {
747
  $user['name'] = $this->normalize_name(stripslashes($_REQUEST['nn']));
748
  }
@@ -871,7 +871,7 @@ class NewsletterSubscription extends NewsletterModule {
871
  delete_transient($this->get_user_key($user));
872
  // Forced a fake status so the welcome email is sent
873
  $user->status = Newsletter::STATUS_NOT_CONFIRMED;
874
- }
875
  } else {
876
  $user = $this->get_user($user_id);
877
  if ($user == null) {
@@ -913,9 +913,11 @@ class NewsletterSubscription extends NewsletterModule {
913
  * @param type $user
914
  */
915
  function send_message($type, $user, $force = false) {
916
- if (!$force && !empty($this->options[$type . '_disabled']))
 
917
  return true;
918
-
 
919
  $message = $this->options[$type . '_message'];
920
  if ($user->status == Newsletter::STATUS_NOT_CONFIRMED) {
921
  $message = $this->add_microdata($message);
@@ -940,7 +942,7 @@ class NewsletterSubscription extends NewsletterModule {
940
  $this->set_user_status($user, TNP_User::STATUS_UNSUBSCRIBED);
941
 
942
  $user = $this->get_user($user);
943
-
944
  $this->add_user_log($user, 'unsubscribe');
945
 
946
  do_action('newsletter_unsubscribed', $user);
@@ -988,7 +990,7 @@ class NewsletterSubscription extends NewsletterModule {
988
  */
989
  function show_message($key, $user, $alert = '', $email = null) {
990
  $url = '';
991
-
992
  if (isset($_REQUEST['ncu'])) {
993
  $url = $_REQUEST['ncu'];
994
  } else {
@@ -999,7 +1001,7 @@ class NewsletterSubscription extends NewsletterModule {
999
 
1000
  $url = Newsletter::instance()->build_message_url($url, $key, $user, $email, $alert);
1001
  wp_redirect($url);
1002
-
1003
  die();
1004
  }
1005
 
@@ -1021,6 +1023,7 @@ class NewsletterSubscription extends NewsletterModule {
1021
  }
1022
 
1023
  var $privacy_url = false;
 
1024
  function get_privacy_url() {
1025
  if (!$this->privacy_url) {
1026
  if ($this->options_profile['privacy_use_wp_url'] && function_exists('get_privacy_policy_url')) {
12
  const OPTIN_SINGLE = 1;
13
 
14
  static $instance;
15
+
16
  /**
17
  * @var array
18
  */
19
  var $options_profile;
20
+
21
  /**
22
  * @var array
23
  */
443
  $lists_options['list_' . $i . '_checked'] = $profile_options['list_' . $i . '_checked'];
444
  $lists_options['list_' . $i . '_forced'] = $profile_options['list_' . $i . '_forced'];
445
  }
446
+
447
  if (!isset($profile_options['list_' . $i . '_forced'])) {
448
  $profile_options['list_' . $i . '_forced'] = empty($this->options['preferences_' . $i]) ? 0 : 1;
449
  $lists_options['list_' . $i . '_forced'] = empty($this->options['preferences_' . $i]) ? 0 : 1;
742
  * @return array The filled array representing a subscriber
743
  */
744
  function update_user_from_request($user) {
745
+
746
  if (isset($_REQUEST['nn'])) {
747
  $user['name'] = $this->normalize_name(stripslashes($_REQUEST['nn']));
748
  }
871
  delete_transient($this->get_user_key($user));
872
  // Forced a fake status so the welcome email is sent
873
  $user->status = Newsletter::STATUS_NOT_CONFIRMED;
874
+ }
875
  } else {
876
  $user = $this->get_user($user_id);
877
  if ($user == null) {
913
  * @param type $user
914
  */
915
  function send_message($type, $user, $force = false) {
916
+ if (!$force && !empty($this->options[$type . '_disabled'])) {
917
+ $this->logger->debug("Message of type '$type' is disabled");
918
  return true;
919
+ }
920
+
921
  $message = $this->options[$type . '_message'];
922
  if ($user->status == Newsletter::STATUS_NOT_CONFIRMED) {
923
  $message = $this->add_microdata($message);
942
  $this->set_user_status($user, TNP_User::STATUS_UNSUBSCRIBED);
943
 
944
  $user = $this->get_user($user);
945
+
946
  $this->add_user_log($user, 'unsubscribe');
947
 
948
  do_action('newsletter_unsubscribed', $user);
990
  */
991
  function show_message($key, $user, $alert = '', $email = null) {
992
  $url = '';
993
+
994
  if (isset($_REQUEST['ncu'])) {
995
  $url = $_REQUEST['ncu'];
996
  } else {
1001
 
1002
  $url = Newsletter::instance()->build_message_url($url, $key, $user, $email, $alert);
1003
  wp_redirect($url);
1004
+
1005
  die();
1006
  }
1007
 
1023
  }
1024
 
1025
  var $privacy_url = false;
1026
+
1027
  function get_privacy_url() {
1028
  if (!$this->privacy_url) {
1029
  if ($this->options_profile['privacy_use_wp_url'] && function_exists('get_privacy_policy_url')) {