Newsletter - Version 6.6.3

Version Description

  • Changed the administration script enqueuing
  • Improved the status page
  • Added notice on page list to highlight the Newsletter dedicated page
Download this release

Release Info

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

Code changes from version 6.6.1 to 6.6.3

admin.css CHANGED
@@ -1,10 +1,3 @@
1
- @import url('https://use.typekit.net/jlj2wjy.css');
2
- @import url('vendor/fa/css/all.min.css?ver=6.6.0');
3
- @import url('css/dropdown.css?ver=6.6.0');
4
- @import url('vendor/jquery-ui/jquery-ui.min.css?ver=6.6.0');
5
- @import url('css/fields.css?ver=6.6.0');
6
- @import url('css/widgets.css?ver=6.6.0');
7
-
8
  /* Bootstrap like */
9
 
10
  #tnp-wrap * {
 
 
 
 
 
 
 
1
  /* Bootstrap like */
2
 
3
  #tnp-wrap * {
css/fields.css CHANGED
@@ -68,7 +68,7 @@
68
  margin-bottom: 10px;
69
  }
70
 
71
- .tnp-field label.tnp-label {
72
  display: block;
73
  font-size: 12px;
74
  font-weight: 300;
@@ -80,6 +80,11 @@
80
  color: #868686;
81
  }
82
 
 
 
 
 
 
83
  .tnp-field.tnp-checkbox label {
84
  display: inline;
85
  }
@@ -93,6 +98,10 @@ tnp-field.tnp-font {
93
  width: 100%;
94
  }
95
 
 
 
 
 
96
  .tnp-field.tnp-size input {
97
  width: 60px;
98
  display: inline;
68
  margin-bottom: 10px;
69
  }
70
 
71
+ .tnp-field label.tnp-label, .tnp-field-row label.tnp-row-label {
72
  display: block;
73
  font-size: 12px;
74
  font-weight: 300;
80
  color: #868686;
81
  }
82
 
83
+ /* Compesate the negative row margin */
84
+ .tnp-field-row label.tnp-row-label {
85
+ margin-left: 10px;
86
+ }
87
+
88
  .tnp-field.tnp-checkbox label {
89
  display: inline;
90
  }
98
  width: 100%;
99
  }
100
 
101
+ .tnp-field input[type=number] {
102
+ width: 100px;
103
+ }
104
+
105
  .tnp-field.tnp-size input {
106
  width: 60px;
107
  display: inline;
emails/blocks/posts/options.php CHANGED
@@ -4,7 +4,14 @@
4
  /* @var $controls NewsletterControls */
5
  /* @var $fields NewsletterFields */
6
 
 
 
 
 
7
  ?>
 
 
 
8
 
9
  <?php if ($context['type'] == 'automated') { ?>
10
 
@@ -26,9 +33,8 @@
26
 
27
  <?php $fields->font('font', __('Excerpt font', 'newsletter')) ?>
28
 
29
- <div class="tnp-field">
30
- <label class="tnp-label"><?php _e('Dates and images', 'newsletter')?></label>
31
  <div class="tnp-field-row">
 
32
  <div class="tnp-field-col-2">
33
  <?php $fields->checkbox('show_image', __('Show image', 'newsletter')) ?>
34
  </div>
@@ -37,7 +43,6 @@
37
  </div>
38
  <div style="clear: both"></div>
39
  </div>
40
- </div>
41
 
42
  <div class="tnp-field-row">
43
  <div class="tnp-field-col-2">
4
  /* @var $controls NewsletterControls */
5
  /* @var $fields NewsletterFields */
6
 
7
+ $extensions_url = '?page=newsletter_main_extension';
8
+ if (class_exists('NewsletterExtensions')) {
9
+ $extensions_url = '?page=newsletter_extensions_index';
10
+ }
11
  ?>
12
+ <p>
13
+ Custom post types can be added using our <a href="<?php echo $extensions_url?>" target="_blank">Advanced Composer Blocks Addon</a>.
14
+ </p>
15
 
16
  <?php if ($context['type'] == 'automated') { ?>
17
 
33
 
34
  <?php $fields->font('font', __('Excerpt font', 'newsletter')) ?>
35
 
 
 
36
  <div class="tnp-field-row">
37
+ <label class="tnp-row-label"><?php _e('Dates and images', 'newsletter')?></label>
38
  <div class="tnp-field-col-2">
39
  <?php $fields->checkbox('show_image', __('Show image', 'newsletter')) ?>
40
  </div>
43
  </div>
44
  <div style="clear: both"></div>
45
  </div>
 
46
 
47
  <div class="tnp-field-row">
48
  <div class="tnp-field-col-2">
includes/mailer.php CHANGED
@@ -250,7 +250,7 @@ class NewsletterMailMethodWrapper extends NewsletterMailer {
250
  return new WP_Error(self::ERROR_GENERIC, 'Unreported error');
251
  }
252
  } else {
253
- $message->error = 'Mail mathod not available';
254
  return new WP_Error(self::ERROR_FATAL, 'Mail method not available');
255
  }
256
  return true;
250
  return new WP_Error(self::ERROR_GENERIC, 'Unreported error');
251
  }
252
  } else {
253
+ $message->error = 'Mail method not available';
254
  return new WP_Error(self::ERROR_FATAL, 'Mail method not available');
255
  }
256
  return true;
main/status.php CHANGED
@@ -1,4 +1,6 @@
1
  <?php
 
 
2
  defined('ABSPATH') || exit;
3
 
4
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
@@ -168,7 +170,7 @@ function tnp_status_print_flag($condition) {
168
 
169
  <form method="post" action="">
170
  <?php $controls->init(); ?>
171
-
172
  <h3>Mailing test</h3>
173
  <table class="widefat" id="tnp-status-table">
174
 
@@ -181,7 +183,7 @@ function tnp_status_print_flag($condition) {
181
  </thead>
182
 
183
  <tbody>
184
- <tr>
185
  <td>Mailing</td>
186
  <td>
187
  <?php if (empty($options['mail'])) { ?>
@@ -216,7 +218,7 @@ function tnp_status_print_flag($condition) {
216
  </tr>
217
  </tbody>
218
  </table>
219
-
220
  <h3>General checks</h3>
221
  <table class="widefat" id="tnp-status-table">
222
 
@@ -226,10 +228,74 @@ function tnp_status_print_flag($condition) {
226
  <th><?php _e('Status', 'newsletter') ?></th>
227
  <th>Action</th>
228
  </tr>
229
-
230
  </thead>
231
 
232
  <tbody>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
  <?php
234
  $method = '';
235
  if (function_exists('get_filesystem_method')) {
@@ -298,7 +364,7 @@ function tnp_status_print_flag($condition) {
298
  </td>
299
  </tr>
300
 
301
-
302
 
303
 
304
 
@@ -677,11 +743,11 @@ function tnp_status_print_flag($condition) {
677
 
678
  <?php
679
  wp_mkdir_p(NEWSLETTER_LOG_DIR);
680
- $res = is_dir(NEWSLETTER_LOG_DIR) && is_writable(NEWSLETTER_LOG_DIR);
681
- if ($res) {
682
  @file_put_contents(NEWSLETTER_LOG_DIR . '/test.txt', "");
683
- $res = is_file(NEWSLETTER_LOG_DIR . '/test.txt');
684
- if ($res) {
685
  @unlink(NEWSLETTER_LOG_DIR . '/test.txt');
686
  }
687
  }
@@ -691,18 +757,12 @@ function tnp_status_print_flag($condition) {
691
  Log folder
692
  </td>
693
  <td>
694
- <?php if (!$res) { ?>
695
- <span class="tnp-ko">KO</span>
696
- <?php } else { ?>
697
- <span class="tnp-ok">OK</span>
698
- <?php } ?>
699
  </td>
700
  <td>
701
  The log folder is <?php echo esc_html(NEWSLETTER_LOG_DIR) ?><br>
702
  <?php if (!$res) { ?>
703
  Cannot create the folder or it is not writable.
704
- <?php } else { ?>
705
-
706
  <?php } ?>
707
  </td>
708
  </tr>
@@ -734,8 +794,6 @@ function tnp_status_print_flag($condition) {
734
  <?php if ($condition == 2) { ?>
735
  The constant <code>DISABLE_WP_CRON</code> is set to true (probably in <code>wp-config.php</code>). That disables the scheduler auto triggering and it's
736
  good ONLY if you setup an external trigger.
737
- <?php } else { ?>
738
-
739
  <?php } ?>
740
  </td>
741
  </tr>
@@ -749,8 +807,6 @@ function tnp_status_print_flag($condition) {
749
  <td>
750
  <?php if (defined('ALTERNATE_WP_CRON') && ALTERNATE_WP_CRON) { ?>
751
  Using the alternate cron trigger.
752
- <?php } else { ?>
753
-
754
  <?php } ?>
755
  </td>
756
  </tr>
@@ -768,9 +824,6 @@ function tnp_status_print_flag($condition) {
768
  <td>
769
  <?php if ($condition == 0) { ?>
770
  The blog cron system is NOT triggered enough often.
771
-
772
- <?php } else { ?>
773
-
774
  <?php } ?>
775
  <br>
776
  Trigger interval: average <?php echo $wp_cron_calls_avg ?>&nbsp;s, max <?php echo $wp_cron_calls_max ?>&nbsp;s, min <?php echo $wp_cron_calls_min ?>&nbsp;s
@@ -841,7 +894,7 @@ function tnp_status_print_flag($condition) {
841
  </td>
842
  <td>
843
  <?php if (defined('WP_DEBUG') && WP_DEBUG) { ?>
844
- WordPress is in debug mode it is not recommended on a production system. See the constant <code>WP_DEBUG</code> inside the <code>wp-config.php</code>.
845
  <?php } else { ?>
846
 
847
  <?php } ?>
@@ -987,10 +1040,9 @@ function tnp_status_print_flag($condition) {
987
  </td>
988
  <td>
989
  <?php if (!$res) { ?>
990
- Your PHP execution time limit is <?php echo $value ?> seconds and cannot be changed or
991
- is too lower to grant the maximum delivery rate of Newsletter.
992
  <?php } else { ?>
993
- Your PHP execution time limit is <?php echo $value ?> seconds and can be eventually changed by Newsletter<br>
994
  <?php } ?>
995
 
996
  </td>
1
  <?php
2
+ /* @var $this Newsletter */
3
+
4
  defined('ABSPATH') || exit;
5
 
6
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
170
 
171
  <form method="post" action="">
172
  <?php $controls->init(); ?>
173
+
174
  <h3>Mailing test</h3>
175
  <table class="widefat" id="tnp-status-table">
176
 
183
  </thead>
184
 
185
  <tbody>
186
+ <tr>
187
  <td>Mailing</td>
188
  <td>
189
  <?php if (empty($options['mail'])) { ?>
218
  </tr>
219
  </tbody>
220
  </table>
221
+
222
  <h3>General checks</h3>
223
  <table class="widefat" id="tnp-status-table">
224
 
228
  <th><?php _e('Status', 'newsletter') ?></th>
229
  <th>Action</th>
230
  </tr>
231
+
232
  </thead>
233
 
234
  <tbody>
235
+
236
+ <tr>
237
+ <?php
238
+ $page_id = $this->get_newsletter_page_id();
239
+ $page = $this->get_newsletter_page();
240
+ $condition = 1;
241
+ if ($page_id) {
242
+ if (!$page || $page->post_status !== 'publish') {
243
+ $condition = 0;
244
+ }
245
+ } else {
246
+ $condition = 2;
247
+ }
248
+ ?>
249
+ <td>
250
+ Dedicated page<br>
251
+ <small>The blog page Newsletter uses for messages</small>
252
+ </td>
253
+ <td>
254
+ <?php tnp_status_print_flag($condition) ?>
255
+ </td>
256
+ <td>
257
+ <?php if ($condition == 2) { ?>
258
+ Newsletter is using a neutral page to show messages, if you want to use a dedicated page, configure it on
259
+ <a href="?page=newsletter_main_main">main settings</a>.
260
+ <?php } else if ($condition == 0) { ?>
261
+ A dedicated page is set but it is no more available or no more published. Review the dedicated page on
262
+ <a href="?page=newsletter_main_main">main settings</a>.
263
+ <?php } ?>
264
+ </td>
265
+ </tr>
266
+
267
+ <tr>
268
+ <?php
269
+ $page_id = $this->get_newsletter_page_id();
270
+ $page = $this->get_newsletter_page();
271
+ $condition = 1;
272
+ if ($page_id) {
273
+ if (!$page) {
274
+ $condition = 0;
275
+ } else {
276
+ $content = $page->post_content;
277
+ if (strpos($content, '[newsletter]') === false && strpos($content, '[newsletter ') === false) {
278
+ $condition = 2;
279
+ }
280
+ }
281
+ }
282
+ ?>
283
+ <td>
284
+ Dedicated page content<br>
285
+ </td>
286
+ <td>
287
+ <?php tnp_status_print_flag($condition) ?>
288
+ </td>
289
+ <td>
290
+ <?php if ($condition == 2) { ?>
291
+ The page seems to not contain the <code>[newsletter]</code>, but sometime it cannot be detected if you use
292
+ a visual composer. <a href="post.php?post=<?php echo $page->ID ?>&action=edit" target="_blank">Please, check the page</a>.
293
+ <?php } else if ($condition == 0) { ?>
294
+ The dedicated page seems to not be available.
295
+ <?php } ?>
296
+ </td>
297
+ </tr>
298
+
299
  <?php
300
  $method = '';
301
  if (function_exists('get_filesystem_method')) {
364
  </td>
365
  </tr>
366
 
367
+
368
 
369
 
370
 
743
 
744
  <?php
745
  wp_mkdir_p(NEWSLETTER_LOG_DIR);
746
+ $condition = is_dir(NEWSLETTER_LOG_DIR) && is_writable(NEWSLETTER_LOG_DIR) ? 1 : 0;
747
+ if ($condition) {
748
  @file_put_contents(NEWSLETTER_LOG_DIR . '/test.txt', "");
749
+ $condition = is_file(NEWSLETTER_LOG_DIR . '/test.txt') ? 1 : 0;
750
+ if ($condition) {
751
  @unlink(NEWSLETTER_LOG_DIR . '/test.txt');
752
  }
753
  }
757
  Log folder
758
  </td>
759
  <td>
760
+ <?php tnp_status_print_flag($condition) ?>
 
 
 
 
761
  </td>
762
  <td>
763
  The log folder is <?php echo esc_html(NEWSLETTER_LOG_DIR) ?><br>
764
  <?php if (!$res) { ?>
765
  Cannot create the folder or it is not writable.
 
 
766
  <?php } ?>
767
  </td>
768
  </tr>
794
  <?php if ($condition == 2) { ?>
795
  The constant <code>DISABLE_WP_CRON</code> is set to true (probably in <code>wp-config.php</code>). That disables the scheduler auto triggering and it's
796
  good ONLY if you setup an external trigger.
 
 
797
  <?php } ?>
798
  </td>
799
  </tr>
807
  <td>
808
  <?php if (defined('ALTERNATE_WP_CRON') && ALTERNATE_WP_CRON) { ?>
809
  Using the alternate cron trigger.
 
 
810
  <?php } ?>
811
  </td>
812
  </tr>
824
  <td>
825
  <?php if ($condition == 0) { ?>
826
  The blog cron system is NOT triggered enough often.
 
 
 
827
  <?php } ?>
828
  <br>
829
  Trigger interval: average <?php echo $wp_cron_calls_avg ?>&nbsp;s, max <?php echo $wp_cron_calls_max ?>&nbsp;s, min <?php echo $wp_cron_calls_min ?>&nbsp;s
894
  </td>
895
  <td>
896
  <?php if (defined('WP_DEBUG') && WP_DEBUG) { ?>
897
+ WordPress is in debug mode it is not recommended on a production system. See the constant <code>WP_DEBUG</code> inside the <code>wp-config.php</code>.
898
  <?php } else { ?>
899
 
900
  <?php } ?>
1040
  </td>
1041
  <td>
1042
  <?php if (!$res) { ?>
1043
+ Your PHP execution time limit is <?php echo $value ?> seconds. It cannot be changed and it is too lower to grant the maximum delivery rate of Newsletter.
 
1044
  <?php } else { ?>
1045
+ Your PHP execution time limit is <?php echo $value ?> seconds and can be eventually changed by Newsletter.<br>
1046
  <?php } ?>
1047
 
1048
  </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: 6.6.1
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.
@@ -35,7 +35,7 @@ if (version_compare(phpversion(), '5.6', '<')) {
35
  return;
36
  }
37
 
38
- define('NEWSLETTER_VERSION', '6.6.1');
39
 
40
  global $newsletter, $wpdb;
41
 
@@ -182,7 +182,12 @@ class Newsletter extends NewsletterModule {
182
 
183
  add_filter( 'display_post_states', array( $this, 'add_notice_to_chosen_profile_page_hook' ), 10, 2 );
184
 
 
 
 
 
185
  }
 
186
  }
187
 
188
  function hook_init() {
@@ -222,23 +227,6 @@ class Newsletter extends NewsletterModule {
222
  add_action('in_admin_header', array($this, 'hook_in_admin_header'), 1000);
223
 
224
  if ($this->is_admin_page()) {
225
- $newsletter_url = plugins_url('newsletter');
226
- wp_enqueue_script('jquery-ui-tabs');
227
- wp_enqueue_script('jquery-ui-tooltip');
228
- wp_enqueue_media();
229
- wp_enqueue_style('tnp-admin', $newsletter_url . '/admin.css', array(), filemtime(NEWSLETTER_DIR . '/admin.css'));
230
- wp_enqueue_script('tnp-admin', $newsletter_url . '/admin.js', array('jquery'), time());
231
-
232
- wp_enqueue_style('wp-color-picker');
233
- wp_enqueue_script('wp-color-picker');
234
-
235
- wp_enqueue_style('tnp-select2', $newsletter_url . '/vendor/select2/select2.css');
236
- wp_enqueue_script('tnp-select2', $newsletter_url . '/vendor/select2/select2.min.js');
237
- wp_enqueue_script('tnp-jquery-vmap', $newsletter_url . '/vendor/jqvmap/jquery.vmap.min.js', array('jquery'));
238
- wp_enqueue_script('tnp-jquery-vmap-world', $newsletter_url . '/vendor/jqvmap/jquery.vmap.world.js', array('tnp-jquery-vmap'));
239
- wp_enqueue_style('tnp-jquery-vmap', $newsletter_url . '/vendor/jqvmap/jqvmap.min.css');
240
-
241
- wp_register_script('tnp-chart', $newsletter_url . '/vendor/chartjs/Chart.min.js', array('jquery'));
242
 
243
  $dismissed = get_option('newsletter_dismissed', array());
244
 
@@ -506,6 +494,44 @@ class Newsletter extends NewsletterModule {
506
  }
507
  }
508
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
509
  function shortcode_newsletter_replace($attrs, $content) {
510
  $content = do_shortcode($content);
511
  $content = $this->replace($content, $this->get_user_from_request(), $this->get_email_from_request());
@@ -532,7 +558,7 @@ class Newsletter extends NewsletterModule {
532
  // https://developer.wordpress.org/plugins/privacy/suggesting-text-for-the-site-privacy-policy/
533
  // https://make.wordpress.org/core/2018/05/17/4-9-6-update-guide/
534
  //if (function_exists('wp_add_privacy_policy_content')) {
535
- //wp_add_privacy_policy_content('Newsletter', wp_kses_post( wpautop( $content, false )));
536
  //}
537
  }
538
 
@@ -1187,6 +1213,22 @@ class Newsletter extends NewsletterModule {
1187
  return !empty($this->options['contract_key']);
1188
  }
1189
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1190
  /**
1191
  * Returns the Newsletter dedicated page URL or an alternative URL if that page if not
1192
  * configured or not available.
@@ -1194,28 +1236,25 @@ class Newsletter extends NewsletterModule {
1194
  * @staticvar string $url
1195
  * @return string
1196
  */
1197
- var $newsletter_page_url = false;
1198
-
1199
  function get_newsletter_page_url($language = '') {
1200
 
1201
- // TODO: Reintroduce the cache
1202
- //if (!$this->newsletter_page_url) {
1203
- if (!empty($this->options['page'])) {
1204
- $this->newsletter_page_url = get_permalink($this->options['page']);
1205
- if ($language && $this->newsletter_page_url) {
1206
- if (class_exists('SitePress')) {
1207
- $this->newsletter_page_url = apply_filters('wpml_permalink', $this->newsletter_page_url, $language, true);
1208
- }
1209
- if (function_exists('pll_get_post')) {
1210
- $this->newsletter_page_url = get_permalink(pll_get_post($this->options['page']));
1211
- }
1212
- }
1213
  }
1214
- if (!$this->newsletter_page_url) {
1215
- $this->newsletter_page_url = $this->build_action_url('m');
 
 
 
 
 
 
 
1216
  }
1217
- //}
1218
- return $this->newsletter_page_url;
1219
  }
1220
 
1221
  function get_license_key() {
@@ -1286,7 +1325,8 @@ class Newsletter extends NewsletterModule {
1286
  }
1287
 
1288
  $timeout = 24 * 7 * 3600;
1289
- if ($data->expire < time() + $timeout) $timeout = $data->expire;
 
1290
  set_transient('newsletter_license_data', $data, $timeout);
1291
 
1292
  return $data;
@@ -1313,14 +1353,14 @@ class Newsletter extends NewsletterModule {
1313
  }
1314
  }
1315
 
1316
- function add_notice_to_chosen_profile_page_hook( $post_states, $post ) {
1317
 
1318
- if ( $post->ID == $this->options['page'] ) {
1319
- $post_states[] = __( 'Newsletter subscriber profile page', 'newsletter' );
1320
- }
1321
 
1322
- return $post_states;
1323
- }
1324
 
1325
  }
1326
 
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: 6.6.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.
35
  return;
36
  }
37
 
38
+ define('NEWSLETTER_VERSION', '6.6.3');
39
 
40
  global $newsletter, $wpdb;
41
 
182
 
183
  add_filter( 'display_post_states', array( $this, 'add_notice_to_chosen_profile_page_hook' ), 10, 2 );
184
 
185
+ if ( $this->is_admin_page() ) {
186
+ add_action( 'admin_enqueue_scripts', array( $this, 'hook_wp_admin_enqueue_scripts' ) );
187
+ }
188
+
189
  }
190
+
191
  }
192
 
193
  function hook_init() {
227
  add_action('in_admin_header', array($this, 'hook_in_admin_header'), 1000);
228
 
229
  if ($this->is_admin_page()) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
 
231
  $dismissed = get_option('newsletter_dismissed', array());
232
 
494
  }
495
  }
496
 
497
+ function hook_wp_admin_enqueue_scripts() {
498
+
499
+ $newsletter_url = plugins_url('newsletter');
500
+ wp_enqueue_script('jquery-ui-tabs');
501
+ wp_enqueue_script('jquery-ui-tooltip');
502
+ wp_enqueue_media();
503
+
504
+ wp_enqueue_style( 'tnp-admin-font', 'https://use.typekit.net/jlj2wjy.css' );
505
+ wp_enqueue_style( 'tnp-admin-fontawesome', $newsletter_url . '/vendor/fa/css/all.min.css', [], '6.6.0' );
506
+ wp_enqueue_style( 'tnp-admin-jquery-ui', $newsletter_url . '/vendor/jquery-ui/jquery-ui.min.css', [], '6.6.0' );
507
+ wp_enqueue_style( 'tnp-admin-dropdown', $newsletter_url . '/css/dropdown.css', [], '6.6.0' );
508
+ wp_enqueue_style( 'tnp-admin-fields', $newsletter_url . '/css/fields.css', [], '6.6.0' );
509
+ wp_enqueue_style( 'tnp-admin-widgets', $newsletter_url . '/css/widgets.css', [], '6.6.0' );
510
+ wp_enqueue_style( 'tnp-admin', $newsletter_url . '/admin.css',
511
+ array(
512
+ 'tnp-admin-font',
513
+ 'tnp-admin-fontawesome',
514
+ 'tnp-admin-jquery-ui',
515
+ 'tnp-admin-dropdown',
516
+ 'tnp-admin-fields',
517
+ 'tnp-admin-widgets'
518
+ ), filemtime( NEWSLETTER_DIR . '/admin.css' ) );
519
+
520
+ wp_enqueue_script( 'tnp-admin', $newsletter_url . '/admin.js', array( 'jquery' ), time() );
521
+
522
+ wp_enqueue_style('wp-color-picker');
523
+ wp_enqueue_script('wp-color-picker');
524
+
525
+ wp_enqueue_style('tnp-select2', $newsletter_url . '/vendor/select2/select2.css');
526
+ wp_enqueue_script('tnp-select2', $newsletter_url . '/vendor/select2/select2.min.js');
527
+ wp_enqueue_script('tnp-jquery-vmap', $newsletter_url . '/vendor/jqvmap/jquery.vmap.min.js', array('jquery'));
528
+ wp_enqueue_script('tnp-jquery-vmap-world', $newsletter_url . '/vendor/jqvmap/jquery.vmap.world.js', array('tnp-jquery-vmap'));
529
+ wp_enqueue_style('tnp-jquery-vmap', $newsletter_url . '/vendor/jqvmap/jqvmap.min.css');
530
+
531
+ wp_register_script('tnp-chart', $newsletter_url . '/vendor/chartjs/Chart.min.js', array('jquery'));
532
+
533
+ }
534
+
535
  function shortcode_newsletter_replace($attrs, $content) {
536
  $content = do_shortcode($content);
537
  $content = $this->replace($content, $this->get_user_from_request(), $this->get_email_from_request());
558
  // https://developer.wordpress.org/plugins/privacy/suggesting-text-for-the-site-privacy-policy/
559
  // https://make.wordpress.org/core/2018/05/17/4-9-6-update-guide/
560
  //if (function_exists('wp_add_privacy_policy_content')) {
561
+ //wp_add_privacy_policy_content('Newsletter', wp_kses_post( wpautop( $content, false )));
562
  //}
563
  }
564
 
1213
  return !empty($this->options['contract_key']);
1214
  }
1215
 
1216
+ /**
1217
+ *
1218
+ * @return int
1219
+ */
1220
+ function get_newsletter_page_id() {
1221
+ return (int) $this->options['page'];
1222
+ }
1223
+
1224
+ /**
1225
+ *
1226
+ * @return WP_Post
1227
+ */
1228
+ function get_newsletter_page() {
1229
+ return get_post($this->get_newsletter_page_id());
1230
+ }
1231
+
1232
  /**
1233
  * Returns the Newsletter dedicated page URL or an alternative URL if that page if not
1234
  * configured or not available.
1236
  * @staticvar string $url
1237
  * @return string
1238
  */
 
 
1239
  function get_newsletter_page_url($language = '') {
1240
 
1241
+ $page = $this->get_newsletter_page();
1242
+
1243
+ if (!$page || $page->post_status !== 'publish') {
1244
+ return $this->build_action_url('m');
 
 
 
 
 
 
 
 
1245
  }
1246
+
1247
+ $newsletter_page_url = get_permalink($page->ID);
1248
+ if ($language && $this->newsletter_page_url) {
1249
+ if (class_exists('SitePress')) {
1250
+ $newsletter_page_url = apply_filters('wpml_permalink', $newsletter_page_url, $language, true);
1251
+ }
1252
+ if (function_exists('pll_get_post')) {
1253
+ $newsletter_page_url = get_permalink(pll_get_post($page->ID));
1254
+ }
1255
  }
1256
+
1257
+ return $newsletter_page_url;
1258
  }
1259
 
1260
  function get_license_key() {
1325
  }
1326
 
1327
  $timeout = 24 * 7 * 3600;
1328
+ if ($data->expire < time() + $timeout)
1329
+ $timeout = $data->expire;
1330
  set_transient('newsletter_license_data', $data, $timeout);
1331
 
1332
  return $data;
1353
  }
1354
  }
1355
 
1356
+ function add_notice_to_chosen_profile_page_hook($post_states, $post) {
1357
 
1358
+ if ($post->ID == $this->options['page']) {
1359
+ $post_states[] = __('Newsletter subscriber profile page', 'newsletter');
1360
+ }
1361
 
1362
+ return $post_states;
1363
+ }
1364
 
1365
  }
1366
 
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Tags: email, email marketing, newsletter, newsletter subscribers, welcome email, signup forms, contact, lead generation, popup, marketing automation
3
  Requires at least: 3.4.0
4
  Tested up to: 5.4
5
- Stable tag: 6.6.1
6
  Requires PHP: 5.6
7
  Contributors: satollo,webagile,michael-travan
8
 
@@ -109,6 +109,16 @@ Thank you, The Newsletter Team
109
 
110
  == Changelog ==
111
 
 
 
 
 
 
 
 
 
 
 
112
  = 6.6.1 =
113
 
114
  * Improved WMPL permalink filter (not working with custom slugs and old WPML releases)
2
  Tags: email, email marketing, newsletter, newsletter subscribers, welcome email, signup forms, contact, lead generation, popup, marketing automation
3
  Requires at least: 3.4.0
4
  Tested up to: 5.4
5
+ Stable tag: 6.6.3
6
  Requires PHP: 5.6
7
  Contributors: satollo,webagile,michael-travan
8
 
109
 
110
  == Changelog ==
111
 
112
+ = 6.6.3 =
113
+
114
+ * Changed the administration script enqueuing
115
+ * Improved the status page
116
+ * Added notice on page list to highlight the Newsletter dedicated page
117
+
118
+ = 6.6.2 =
119
+
120
+ * Fixed incomplete blocks package on previous release
121
+
122
  = 6.6.1 =
123
 
124
  * Improved WMPL permalink filter (not working with custom slugs and old WPML releases)
subscription/page.php CHANGED
@@ -81,6 +81,13 @@ if (is_file(WP_CONTENT_DIR . '/extensions/newsletter/subscription/page.php')) {
81
  #message {
82
  line-height: 1.6em;
83
  }
 
 
 
 
 
 
 
84
  </style>
85
  </head>
86
 
@@ -91,6 +98,12 @@ if (is_file(WP_CONTENT_DIR . '/extensions/newsletter/subscription/page.php')) {
91
  </script>
92
  <?php } ?>
93
  <div id="container">
 
 
 
 
 
 
94
  <h1><?php echo get_option('blogname'); ?></h1>
95
  <div id="message">
96
  <?php echo $message; ?>
81
  #message {
82
  line-height: 1.6em;
83
  }
84
+
85
+ #missing {
86
+ padding: 20px;
87
+ font-weight: bold;
88
+ border: 1px solid #999;
89
+ margin: 20px 0;
90
+ }
91
  </style>
92
  </head>
93
 
98
  </script>
99
  <?php } ?>
100
  <div id="container">
101
+ <?php if (current_user_can('administrator')) { ?>
102
+ <div id="missing">
103
+ This message is shown only to administrators. Newsletter is using this page to show its messages because
104
+ the dedicated page (on main settings) is not set or the configured page has been deleted or unpublished.
105
+ </div>
106
+ <?php } ?>
107
  <h1><?php echo get_option('blogname'); ?></h1>
108
  <div id="message">
109
  <?php echo $message; ?>
subscription/subscription.php CHANGED
@@ -272,7 +272,7 @@ class NewsletterSubscription extends NewsletterModule {
272
  if ($this->is_flood($email, $ip)) {
273
  $antibot_logger->fatal($email . ' - ' . $ip . ' - Antiflood triggered');
274
  header("HTTP/1.0 404 Not Found");
275
- die('Too quick');
276
  }
277
  }
278
 
272
  if ($this->is_flood($email, $ip)) {
273
  $antibot_logger->fatal($email . ' - ' . $ip . ' - Antiflood triggered');
274
  header("HTTP/1.0 404 Not Found");
275
+ die('Too quick. Check the antiflood on security page.');
276
  }
277
  }
278