Newsletter - Version 5.8.3

Version Description

Download this release

Release Info

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

Code changes from version 5.8.2 to 5.8.3

emails/{themes → images}/composer.gif RENAMED
File without changes
emails/theme.php CHANGED
@@ -68,7 +68,7 @@ $themes = $module->themes->get_all_with_data();
68
  <div class="tnp-theme-preview">
69
  <p><?php echo _e('Responsive Drag & Drop Composer', 'newsletter') ?></p>
70
  <a href="<?php echo $module->get_admin_page_url('composer'); ?>" style="margin-right: 20px; margin-bottom: 20px">
71
- <img src="<?php echo plugins_url('newsletter') . '/emails/themes/composer.gif' ?>" width="420" height="200">
72
  </a>
73
  </div>
74
 
68
  <div class="tnp-theme-preview">
69
  <p><?php echo _e('Responsive Drag & Drop Composer', 'newsletter') ?></p>
70
  <a href="<?php echo $module->get_admin_page_url('composer'); ?>" style="margin-right: 20px; margin-bottom: 20px">
71
+ <img src="<?php echo plugins_url('newsletter') . '/emails/images/composer.gif' ?>" width="420" height="200">
72
  </a>
73
  </div>
74
 
emails/tnp-composer/_css/newsletter-builder.css CHANGED
@@ -266,7 +266,7 @@ iframe#tnp-mobile-preview {
266
  height: 100vh;
267
  width: 100vw;
268
  /*position: fixed;*/
269
- z-index: 2;
270
  display: none;
271
  background-image: url(../_assets/background.png);
272
  background-repeat: repeat;
266
  height: 100vh;
267
  width: 100vw;
268
  /*position: fixed;*/
269
+ z-index: 10;
270
  display: none;
271
  background-image: url(../_assets/background.png);
272
  background-repeat: repeat;
includes/controls.php CHANGED
@@ -755,7 +755,7 @@ class NewsletterControls {
755
  echo esc_attr($value);
756
  echo '"/>';
757
  }
758
-
759
  function hidden($name) {
760
  $value = $this->get_value($name);
761
  echo '<input name="options[' . $name . ']" type="hidden" value="';
@@ -1037,6 +1037,11 @@ class NewsletterControls {
1037
  echo '</div>';
1038
  }
1039
  }
 
 
 
 
 
1040
 
1041
  /**
1042
  * Creates a set of checkboxes all names $name[] and the preference number as value
@@ -1055,9 +1060,9 @@ class NewsletterControls {
1055
  echo '</div>';
1056
  }
1057
  echo '<div style="clear: both"></div>';
1058
- echo '<a href="https://www.thenewsletterplugin.com/plugins/newsletter/newsletter-preferences" target="_blank">'
1059
- . 'Click here to read more about preferences.'
1060
- . '</a> They can be configured on Subscription Form - Profile fields panel.';
1061
  echo '</div>';
1062
  }
1063
 
755
  echo esc_attr($value);
756
  echo '"/>';
757
  }
758
+
759
  function hidden($name) {
760
  $value = $this->get_value($name);
761
  echo '<input name="options[' . $name . ']" type="hidden" value="';
1037
  echo '</div>';
1038
  }
1039
  }
1040
+
1041
+ function lists_checkboxes($name = 'lists')
1042
+ {
1043
+ $this->preferences_group($name);
1044
+ }
1045
 
1046
  /**
1047
  * Creates a set of checkboxes all names $name[] and the preference number as value
1060
  echo '</div>';
1061
  }
1062
  echo '<div style="clear: both"></div>';
1063
+ echo '<a href="https://www.thenewsletterplugin.com/documentation/newsletter-lists" target="_blank">'
1064
+ . 'Click here to read more about lists.'
1065
+ . '</a>';
1066
  echo '</div>';
1067
  }
1068
 
includes/module.php CHANGED
@@ -9,7 +9,7 @@ defined('ABSPATH') || exit;
9
  * @property int $status When and how the list is visible to the subscriber - see constants
10
  * @property bool $checked If it must be pre-checked on subscription form
11
  * @property array $languages The list of language used to pre-assign this list
12
- * */
13
  abstract class TNP_List {
14
 
15
  const STATUS_PRIVATE = 0;
@@ -19,6 +19,20 @@ abstract class TNP_List {
19
 
20
  }
21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  /**
23
  * @property int $id The subscriber unique identifier
24
  * @property string $email The subscriber email
@@ -648,11 +662,15 @@ class NewsletterModule {
648
  add_submenu_page('newsletter_main_index', $title, $title, $capability, $name, array($this, 'menu_page'));
649
  }
650
 
651
- function add_admin_page($page, $title) {
652
- global $newsletter;
 
 
 
 
653
  $name = 'newsletter_' . $this->module . '_' . $page;
654
  $name = apply_filters('newsletter_admin_page', $name);
655
- add_submenu_page(null, $title, $title, ($newsletter->options['editor'] == 1) ? 'manage_categories' : 'manage_options', $name, array($this, 'menu_page'));
656
  }
657
 
658
  function sanitize_file_name($name) {
@@ -957,6 +975,31 @@ class NewsletterModule {
957
  }
958
  return $user;
959
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
960
 
961
  /**
962
  * @param string $language The language for the list labels (it does not affect the lists returned)
9
  * @property int $status When and how the list is visible to the subscriber - see constants
10
  * @property bool $checked If it must be pre-checked on subscription form
11
  * @property array $languages The list of language used to pre-assign this list
12
+ */
13
  abstract class TNP_List {
14
 
15
  const STATUS_PRIVATE = 0;
19
 
20
  }
21
 
22
+ /**
23
+ * @property int $id The list unique identifier
24
+ * @property string $name The list name
25
+ * @property int $status When and how the list is visible to the subscriber - see constants
26
+ */
27
+ abstract class TNP_Profile {
28
+
29
+ const STATUS_PRIVATE = 0;
30
+ const STATUS_PUBLIC = 2;
31
+ const STATUS_PROFILE_ONLY = 1;
32
+ const STATUS_HIDDEN = 3; // Public but never show (can be set with a hidden form field)
33
+
34
+ }
35
+
36
  /**
37
  * @property int $id The subscriber unique identifier
38
  * @property string $email The subscriber email
662
  add_submenu_page('newsletter_main_index', $title, $title, $capability, $name, array($this, 'menu_page'));
663
  }
664
 
665
+ function add_admin_page($page, $title, $capability = '') {
666
+ if (empty($capability)) {
667
+ $newsletter = Newsletter::instance();
668
+ $capability = ($newsletter->options['editor'] == 1) ? 'manage_categories' : 'manage_options';
669
+ }
670
+
671
  $name = 'newsletter_' . $this->module . '_' . $page;
672
  $name = apply_filters('newsletter_admin_page', $name);
673
+ add_submenu_page(null, $title, $title, $capability, $name, array($this, 'menu_page'));
674
  }
675
 
676
  function sanitize_file_name($name) {
975
  }
976
  return $user;
977
  }
978
+
979
+ /**
980
+ * @param string $language The language for the list labels (it does not affect the lists returned)
981
+ * @return TNP_Profile[]
982
+ */
983
+ function get_profiles($language = '') {
984
+ static $profiles = array();
985
+ if (isset($profiles[$language])) {
986
+ return $profiles[$language];
987
+ }
988
+
989
+ $profiles[$language] = array();
990
+ $data = NewsletterSubscription::instance()->get_options('profile', $language);
991
+ for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) {
992
+ if (empty($data['profile_' . $i])) {
993
+ continue;
994
+ }
995
+ $profile = new stdClass();
996
+ $profile->name = $data['profile_' . $i];
997
+ $profile->id = $i;
998
+ $profile->status = (int) $data['profile_' . $i . '_status'];
999
+ $profiles[$language][] = $profile;
1000
+ }
1001
+ return $profiles[$language];
1002
+ }
1003
 
1004
  /**
1005
  * @param string $language The language for the list labels (it does not affect the lists returned)
main/status.php CHANGED
@@ -192,7 +192,6 @@ $speed = Newsletter::$instance->options['scheduler_max'];
192
  </td>
193
 
194
  </tr>
195
- get_filesystem_method
196
  <tr>
197
  <td>Delivering</td>
198
  <td>
192
  </td>
193
 
194
  </tr>
 
195
  <tr>
196
  <td>Delivering</td>
197
  <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.8.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.
@@ -29,7 +29,7 @@
29
  */
30
 
31
  // Used as dummy parameter on css and js links
32
- define('NEWSLETTER_VERSION', '5.8.2');
33
 
34
  global $newsletter, $wpdb;
35
 
@@ -346,7 +346,7 @@ class Newsletter extends NewsletterModule {
346
  $this->add_menu_page('main', 'Settings and More', 'manage_options');
347
 
348
 
349
- $this->add_admin_page('smtp', 'SMTP');
350
  $this->add_admin_page('status', 'Status', 'manage_options');
351
  $this->add_admin_page('info', 'Company info');
352
  }
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.8.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.
29
  */
30
 
31
  // Used as dummy parameter on css and js links
32
+ define('NEWSLETTER_VERSION', '5.8.3');
33
 
34
  global $newsletter, $wpdb;
35
 
346
  $this->add_menu_page('main', 'Settings and More', 'manage_options');
347
 
348
 
349
+ $this->add_admin_page('smtp', 'SMTP', 'manage_options');
350
  $this->add_admin_page('status', 'Status', 'manage_options');
351
  $this->add_admin_page('info', 'Company info');
352
  }
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing,automation,automated,mailing list
3
  Requires at least: 3.4.0
4
  Tested up to: 5.0.0
5
- Stable tag: 5.8.2
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
@@ -120,6 +120,9 @@ Thank you, The Newsletter Team
120
  = NEXT =
121
 
122
  * Fixed a debug notice with PHP 7.2
 
 
 
123
 
124
  = 5.8.2 =
125
 
2
  Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing,automation,automated,mailing list
3
  Requires at least: 3.4.0
4
  Tested up to: 5.0.0
5
+ Stable tag: 5.8.3
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
120
  = NEXT =
121
 
122
  * Fixed a debug notice with PHP 7.2
123
+ * Status, SMTP and main settings limited to the administrators
124
+ * Fixed buttons overlapping on composer text block
125
+ * Support for the advanced import addons
126
 
127
  = 5.8.2 =
128
 
statistics/css/tnp-statistics.css CHANGED
@@ -125,21 +125,6 @@
125
 
126
  }
127
 
128
- /* Urls Clicked */
129
-
130
- .widefat th {
131
- font-family: "Montserrat", sans-serif;
132
- color: #2C3E50;
133
- text-transform: uppercase;
134
- font-size: 13px;
135
- letter-spacing: 0.1em;
136
- }
137
-
138
- .widefat {
139
- padding: 0px 10px;
140
- }
141
-
142
-
143
  /* Retarget Table Layout */
144
 
145
  .tnp-retarget .tnp-retarget-table {
125
 
126
  }
127
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  /* Retarget Table Layout */
129
 
130
  .tnp-retarget .tnp-retarget-table {
tnp-header.php CHANGED
@@ -99,14 +99,20 @@ $warning |= empty($status_options['mail']);
99
  </li>
100
  <li><a href="#"><i class="fa fa-cog"></i> <?php _e('Settings', 'newsletter') ?> <i class="fa fa-chevron-down"></i></a>
101
  <ul>
102
- <li><a href="?page=newsletter_main_main"><i class="fa fa-cogs"></i> <?php _e('General Settings', 'newsletter') ?>
103
- <small><?php _e('Delivery speed, sender details, ...', 'newsletter') ?></small></a></li>
 
 
 
 
 
104
  <li><a href="?page=newsletter_main_info"><i class="fa fa-info"></i> <?php _e('Company Info', 'newsletter') ?>
105
  <small><?php _e('Social, address, logo and general info', 'newsletter') ?></small></a></li>
106
  <li>
107
  <a href="?page=newsletter_subscription_template"><i class="fa fa-file-text-o"></i> <?php _e('Messages Template', 'newsletter') ?>
108
  <small><?php _e('Change the look of your service emails', 'newsletter') ?></small></a>
109
  </li>
 
110
  <?php if (!class_exists('NewsletterSmtp')) { ?>
111
  <li>
112
  <a href="?page=newsletter_main_smtp"><i class="fa fa-envelope-o"></i> <?php _e('SMTP', 'newsletter') ?>
@@ -114,6 +120,7 @@ $warning |= empty($status_options['mail']);
114
  </a>
115
  </li>
116
  <?php } ?>
 
117
 
118
  <?php
119
  newsletter_print_entries('settings');
@@ -121,6 +128,7 @@ $warning |= empty($status_options['mail']);
121
  </ul>
122
  </li>
123
 
 
124
  <li>
125
  <a href="?page=newsletter_main_status"><i class="fa fa-thermometer"></i> <?php _e('Status', 'newsletter') ?>
126
  <?php if ($warning) { ?>
@@ -128,6 +136,7 @@ $warning |= empty($status_options['mail']);
128
  <?php } ?>
129
  </a>
130
  </li>
 
131
 
132
  <?php
133
  if (empty(Newsletter::instance()->options['contract_key']) && !defined('NEWSLETTER_LICENSE_KEY')) {
99
  </li>
100
  <li><a href="#"><i class="fa fa-cog"></i> <?php _e('Settings', 'newsletter') ?> <i class="fa fa-chevron-down"></i></a>
101
  <ul>
102
+ <?php if (current_user_can('manage_options')) { ?>
103
+ <li>
104
+ <a href="?page=newsletter_main_main"><i class="fa fa-cogs"></i> <?php _e('General Settings', 'newsletter') ?>
105
+ <small><?php _e('Delivery speed, sender details, ...', 'newsletter') ?></small></a>
106
+ </li>
107
+ <?php } ?>
108
+
109
  <li><a href="?page=newsletter_main_info"><i class="fa fa-info"></i> <?php _e('Company Info', 'newsletter') ?>
110
  <small><?php _e('Social, address, logo and general info', 'newsletter') ?></small></a></li>
111
  <li>
112
  <a href="?page=newsletter_subscription_template"><i class="fa fa-file-text-o"></i> <?php _e('Messages Template', 'newsletter') ?>
113
  <small><?php _e('Change the look of your service emails', 'newsletter') ?></small></a>
114
  </li>
115
+ <?php if (current_user_can('manage_options')) { ?>
116
  <?php if (!class_exists('NewsletterSmtp')) { ?>
117
  <li>
118
  <a href="?page=newsletter_main_smtp"><i class="fa fa-envelope-o"></i> <?php _e('SMTP', 'newsletter') ?>
120
  </a>
121
  </li>
122
  <?php } ?>
123
+ <?php } ?>
124
 
125
  <?php
126
  newsletter_print_entries('settings');
128
  </ul>
129
  </li>
130
 
131
+ <?php if (current_user_can('manage_options')) { ?>
132
  <li>
133
  <a href="?page=newsletter_main_status"><i class="fa fa-thermometer"></i> <?php _e('Status', 'newsletter') ?>
134
  <?php if ($warning) { ?>
136
  <?php } ?>
137
  </a>
138
  </li>
139
+ <?php } ?>
140
 
141
  <?php
142
  if (empty(Newsletter::instance()->options['contract_key']) && !defined('NEWSLETTER_LICENSE_KEY')) {
users/users.php CHANGED
@@ -30,10 +30,10 @@ class NewsletterUsers extends NewsletterModule {
30
  }
31
 
32
  function hook_wp_ajax_newsletter_users_export() {
33
- require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
34
- $controls = new NewsletterControls();
35
  $newsletter = Newsletter::instance();
36
  if (current_user_can('manage_options') || ($newsletter->options['editor'] == 1 && current_user_can('manage_categories'))) {
 
37
  $controls = new NewsletterControls();
38
 
39
  if ($controls->is_action('export')) {
@@ -91,7 +91,6 @@ class NewsletterUsers extends NewsletterModule {
91
  $sql .= "PRIMARY KEY (`id`),\nUNIQUE KEY `email` (`email`),\nKEY `wp_user_id` (`wp_user_id`)\n) $charset_collate;";
92
 
93
  dbDelta($sql);
94
-
95
  }
96
 
97
  function admin_menu() {
30
  }
31
 
32
  function hook_wp_ajax_newsletter_users_export() {
33
+
 
34
  $newsletter = Newsletter::instance();
35
  if (current_user_can('manage_options') || ($newsletter->options['editor'] == 1 && current_user_can('manage_categories'))) {
36
+ require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
37
  $controls = new NewsletterControls();
38
 
39
  if ($controls->is_action('export')) {
91
  $sql .= "PRIMARY KEY (`id`),\nUNIQUE KEY `email` (`email`),\nKEY `wp_user_id` (`wp_user_id`)\n) $charset_collate;";
92
 
93
  dbDelta($sql);
 
94
  }
95
 
96
  function admin_menu() {