Newsletter - Version 4.7.6

Version Description

  • New status panel
Download this release

Release Info

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

Code changes from version 4.7.5 to 4.7.6

admin.css CHANGED
@@ -1,7 +1,7 @@
1
 
2
  @import url(//fonts.googleapis.com/css?family=Montserrat:400,700);
3
  @import url(//fonts.googleapis.com/css?family=Source+Sans+Pro:700);
4
- @import url(//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css);
5
  @import url(css/dropdown.css);
6
  @import url(css/jquery-ui/jquery-ui.css);
7
  @import url(statistics/css/tnp-statistics.css);
@@ -106,6 +106,10 @@
106
  border-bottom: 1px solid #ddd;
107
  }
108
 
 
 
 
 
109
  /* HEADER *********************************************************************/
110
  #tnp-header {
111
  text-align: left;
@@ -717,7 +721,7 @@ p.description {
717
  }
718
 
719
  #tnp-body h3 {
720
- margin-top: 15px;
721
  clear: both;
722
  }
723
 
@@ -1122,4 +1126,85 @@ span.wp-media-buttons-icon:before {
1122
 
1123
  .tnp-chart {
1124
  border: 1px solid #eee;
1125
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
2
  @import url(//fonts.googleapis.com/css?family=Montserrat:400,700);
3
  @import url(//fonts.googleapis.com/css?family=Source+Sans+Pro:700);
4
+ @import url(//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css);
5
  @import url(css/dropdown.css);
6
  @import url(css/jquery-ui/jquery-ui.css);
7
  @import url(statistics/css/tnp-statistics.css);
106
  border-bottom: 1px solid #ddd;
107
  }
108
 
109
+ .ui-tabs-panel {
110
+ padding: 15px!important;
111
+ }
112
+
113
  /* HEADER *********************************************************************/
114
  #tnp-header {
115
  text-align: left;
721
  }
722
 
723
  #tnp-body h3 {
724
+ margin-top: 25px;
725
  clear: both;
726
  }
727
 
1126
 
1127
  .tnp-chart {
1128
  border: 1px solid #eee;
1129
+ }
1130
+
1131
+ .tnp-db-table {
1132
+ width: auto;
1133
+ background-color: #fff;
1134
+ }
1135
+
1136
+ .tnp-db-table thead {
1137
+ border-bottom: 1px solid #eee;
1138
+ }
1139
+
1140
+ .tnp-db-table th {
1141
+ font-weight: bold;
1142
+ }
1143
+
1144
+ .tnp-db-table td, .tnp-db-table th {
1145
+ padding: 3px;
1146
+ font-family: monospace;
1147
+ border: 0;
1148
+ }
1149
+
1150
+ /* STATUS PANEL */
1151
+
1152
+ .tnp-main-status h3, .tnp-main-status h4 {
1153
+ color: #fff;
1154
+ }
1155
+
1156
+ #tnp-status-table .tnp-ok {
1157
+ font-weight: bold;
1158
+ color: white;
1159
+ font-size: 14px;
1160
+ background-color: #27AE60;
1161
+ padding: 2px 10px;
1162
+ border-radius: 10px;
1163
+ }
1164
+
1165
+ #tnp-status-table .tnp-ko {
1166
+ font-weight: bold;
1167
+ color: white;
1168
+ font-size: 14px;
1169
+ background-color: #E74C41;
1170
+ padding: 2px 10px;
1171
+ border-radius: 10px;
1172
+ }
1173
+
1174
+ #tnp-status-table .tnp-maybe {
1175
+ font-weight: bold;
1176
+ color: white;
1177
+ font-size: 14px;
1178
+ background-color: #F1C40F;
1179
+ padding: 2px 10px;
1180
+ border-radius: 10px;
1181
+ }
1182
+
1183
+ .tnp-main-status .tnp-log-files li {
1184
+ padding-left: 15px;
1185
+ }
1186
+
1187
+ .tnp-main-status .tnp-log-files li, .tnp-main-status .tnp-log-files li a {
1188
+ color: #fff;
1189
+ }
1190
+
1191
+ .tnp-main-status .tnp-log-files .tnp-log-size {
1192
+ font-style: italic;
1193
+ }
1194
+
1195
+ table.widefat {
1196
+ border: 0;
1197
+ box-shadow: none;
1198
+ }
1199
+
1200
+ #tnp-status-table tbody tr:nth-child(2n+1) {
1201
+ background-color: #ECF0F1;
1202
+ border-radius: 2px;
1203
+ margin: 5px;
1204
+ }
1205
+
1206
+ #tnp-parameters-table tbody tr:nth-child(2n+1) {
1207
+ background-color: #ECF0F1;
1208
+ border-radius: 2px;
1209
+ margin: 5px;
1210
+ }
css/dropdown.css CHANGED
@@ -2,8 +2,9 @@
2
  margin: 0; padding: 0; border: 0;
3
  }
4
 
 
5
  .tnp-drowpdown li {
6
- min-width: 150px;
7
  }
8
 
9
  .tnp-drowpdown {
2
  margin: 0; padding: 0; border: 0;
3
  }
4
 
5
+ /* Removed by Stefano */
6
  .tnp-drowpdown li {
7
+ /*min-width: 150px;*/
8
  }
9
 
10
  .tnp-drowpdown {
emails/themes/default/theme.php CHANGED
@@ -49,11 +49,11 @@ if (isset($theme_options['theme_posts'])) {
49
  }
50
  </style>
51
  </head>
52
- <body style="background-color: #ddd; font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color: #666; margin: 0 auto; padding: 0;">
53
  <br>
54
  <table align="center">
55
  <tr>
56
- <td valign="top" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color: #666;">
57
  <div style="text-align: left; background-color: #fff; max-width: 500px;">
58
  <div style="text-align: center">
59
  <?php //HEADER
49
  }
50
  </style>
51
  </head>
52
+ <body style="background-color: #ECF2F6; font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color: #666; margin: 0 auto; padding: 0;">
53
  <br>
54
  <table align="center">
55
  <tr>
56
+ <td valign="top" width="500" bgcolor="#ffffff" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color: #666;">
57
  <div style="text-align: left; background-color: #fff; max-width: 500px;">
58
  <div style="text-align: center">
59
  <?php //HEADER
includes/logger.php CHANGED
@@ -32,7 +32,7 @@ class NewsletterLogger {
32
  $this->level = self::NONE;
33
  }
34
 
35
- $this->file = NEWSLETTER_LOG_DIR . '/' . $module . '-' . $secret . '.txt';
36
  }
37
 
38
  function log($text, $level = self::ERROR) {
32
  $this->level = self::NONE;
33
  }
34
 
35
+ $this->file = NEWSLETTER_LOG_DIR . '/' . $module . '-' . date('Y-m') . '-' . $secret . '.txt';
36
  }
37
 
38
  function log($text, $level = self::ERROR) {
main/diagnostic.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
 
3
 
4
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
5
  $module = Newsletter::instance();
@@ -196,11 +197,11 @@ if (count($send_calls)) {
196
  if ($send_max < $send_mean) {
197
  $send_max = $send_mean;
198
  }
199
- if ($send_calls[$i][3]) $send_completed++;
 
200
  }
201
  $send_mean = $send_total_time / $send_total_emails;
202
  }
203
-
204
  ?>
205
 
206
  <div class="wrap" id="tnp-wrap">
@@ -228,14 +229,10 @@ if (count($send_calls)) {
228
  <div id="tabs">
229
 
230
  <ul>
231
- <li><a href="#tabs-tests"><?php _e('Tests', 'newsletter')?></a></li>
232
- <li><a href="#tabs-2"><?php _e('Scheduler', 'newsletter')?></a></li>
233
- <li><a href="#tabs-logging"><?php _e('Logging', 'newsletter')?></a></li>
234
- <li><a href="#tabs-4"><?php _e('System', 'newsletter')?></a></li>
235
- <li><a href="#tabs-upgrade"><?php _e('Maintenance', 'newsletter')?></a></li>
236
- <?php if (isset($_GET['debug'])) { ?>
237
- <li><a href="#tabs-debug">Debug Data</a></li>
238
- <?php } ?>
239
  </ul>
240
 
241
  <!-- TESTS -->
@@ -269,7 +266,7 @@ if (count($send_calls)) {
269
  </p>
270
 
271
  <table class="form-table">
272
-
273
  <tbody>
274
  <tr>
275
  <td>
@@ -284,7 +281,7 @@ if (count($send_calls)) {
284
  Log folder
285
  </td>
286
  <td>
287
- <code><?php echo NEWSLETTER_LOG_DIR?></code>
288
  <br>
289
  <?php
290
  if (!is_dir(NEWSLETTER_LOG_DIR)) {
@@ -295,14 +292,8 @@ if (count($send_calls)) {
295
  ?>
296
  </td>
297
  </tr>
298
- <tr>
299
- <td>
300
- Log secret
301
- </td>
302
- <td>
303
- <code><?php echo esc_html(get_option("newsletter_logger_secret"))?></code>
304
- </td>
305
- </tr>
306
  </tbody>
307
  </table>
308
 
@@ -312,8 +303,8 @@ if (count($send_calls)) {
312
  <!-- SEMAPHORES -->
313
  <div id="tabs-2">
314
 
315
- <h3>Crons</h3>
316
- <table class="widefat">
317
  <thead>
318
  <tr>
319
  <th>Function</th>
@@ -322,121 +313,34 @@ if (count($send_calls)) {
322
  </thead>
323
 
324
  <tbody>
325
- <tr>
326
- <td>Average scheduler activation interval</td>
327
- <td>
328
- <?php
329
- if (count($calls) > 10) {
330
- echo (int) $mean . ' seconds/' . count($calls) . ' samples';
331
- if ($mean < NEWSLETTER_CRON_INTERVAL * 1.2) {
332
- echo ' (<span style="color: green; font-weight: bold">OK</span>)';
333
- } else {
334
- echo ' (<span style="color: red; font-weight: bold">KO</span>)';
335
- }
336
- } else {
337
- echo 'Still not enough data. It requires few hours to collect a relevant data set.';
338
- }
339
- ?>
340
-
341
- <?php $controls->button('reset_stats', 'Reset'); ?>
342
 
343
- <p class="description">
344
- Should be less than <?php echo esc_html(NEWSLETTER_CRON_INTERVAL) ?> seconds.
345
- <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-delivery-engine" target="_blank">Read more</a>.
346
- </p>
347
 
348
- </td>
349
- </tr>
350
- <tr>
351
- <td>
352
- WordPress Cron System
353
- </td>
354
- <td>
355
- <?php
356
- if (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON)
357
- echo 'DISABLED. (can be a problem, see the <a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-delivery-engine" target="_tab">delivery engine documentation</a>)';
358
- else
359
- echo "ENABLED. (it's ok)";
360
- ?>
361
- </td>
362
- </tr>
363
 
364
- <tr>
365
- <td>
366
- WordPress schedules
367
- </td>
368
- <td>
369
- <?php
370
- $schedules = wp_get_schedules();
371
- if (empty($schedules)) {
372
- echo 'Really bad, no schedules found, missing even the WordPress default schedules!';
373
- } else {
374
- $found = false;
375
 
376
- foreach ($schedules as $key => $data) {
377
- if ($key == 'newsletter')
378
- $found = true;
379
- echo esc_html($key . ' - ' . $data['interval']) . ' s<br>';
380
- }
381
-
382
- if (!$found) {
383
- echo 'The "newsletter" schedule was not found, email delivery won\'t work.';
384
- }
385
- }
386
- ?>
387
- </td>
388
- </tr>
389
 
390
- <tr>
391
- <td>
392
- Delivery Engine
393
- </td>
394
- <td>
395
- <?php echo NewsletterModule::format_scheduler_time('newsletter'); ?>
396
- <?php $controls->button('trigger', 'Trigger now'); ?>
397
- <p class="description">
398
- If inactive or always in "running now" status your blog has a problem: <a href="http://www.thenewsletterplugin.com/how-to-make-the-wordpress-cron-work" target="_blank">read more here</a>.
399
- </p>
400
- </td>
401
- </tr>
402
-
403
  <tr>
404
  <td>Sending statistics</td>
405
  <td>
406
-
407
  <?php if (!$send_calls) { ?>
408
- <em>Still not enough data.</em>
409
  <?php } else { ?>
410
- Average time to send an email: <?php echo sprintf("%.2f", $send_mean) ?> seconds<br>
411
- Max mean time measured: <?php echo $send_max ?> seconds<br>
412
- Min mean time measured: <?php echo $send_min ?> seconds<br>
413
- Total emails: <?php echo $send_total_emails ?><br>
414
- Batches prematurely interrupted: <?php echo sprintf("%.2f", (count($send_calls)-$send_completed)*100.0/count($send_calls)) ?>%<br>
415
- Collected batch samples: <?php echo count($send_calls); ?><br>
416
  <?php } ?>
417
  </td>
418
  </tr>
419
- <tr>
420
- <td>WP transients</td>
421
- <td>
422
- <?php
423
- $result = true;
424
- set_transient('newsletter_transient_test', 1, 300);
425
- delete_transient('newsletter_transient_test');
426
- if (get_transient('newsletter_transient_test')){
427
- echo 'Transients cannot be delete!';
428
- } else {
429
- echo 'OK';
430
- }
431
- ?>
432
- </td>
433
- </tr>
434
-
435
  </tbody>
436
  </table>
437
-
438
  <h3>Semaphores</h3>
439
- <table class="widefat">
440
  <thead>
441
  <tr>
442
  <th>Name</th>
@@ -462,135 +366,8 @@ if (count($send_calls)) {
462
  </tr>
463
  </tbody>
464
  </table>
465
- </div>
466
-
467
- <!-- SYSTEM -->
468
- <div id="tabs-4">
469
-
470
- <table class="widefat">
471
- <thead>
472
- <tr>
473
- <th>Parameter</th>
474
- <th>Value</th>
475
- </tr>
476
- </thead>
477
- <tbody>
478
- <tr>
479
- <td>PHP Version</td>
480
- <td>
481
- <?php echo phpversion(); ?>
482
- </td>
483
- </tr>
484
- <tr>
485
- <td>Database Wait Timeout</td>
486
- <td>
487
- <?php $wait_timeout = $wpdb->get_var("select @@wait_timeout"); ?>
488
- <?php echo $wait_timeout; ?> (seconds)
489
- </td>
490
- </tr>
491
- <tr>
492
- <td>PHP Execution Time</td>
493
- <td>
494
- <?php echo ini_get('max_execution_time'); ?> (seconds)
495
- </td>
496
- </tr>
497
- <tr>
498
- <td>NEWSLETTER_MAX_EXECUTION_TIME</td>
499
- <td>
500
- <?php
501
- if (defined('NEWSLETTER_MAX_EXECUTION_TIME')) {
502
- echo NEWSLETTER_MAX_EXECUTION_TIME . ' (seconds)';
503
- } else {
504
- echo 'Not set';
505
- }
506
- ?>
507
- </td>
508
- </tr>
509
- <tr>
510
- <td>NEWSLETTER_CRON_INTERVAL</td>
511
- <td>
512
- <?php echo NEWSLETTER_CRON_INTERVAL . ' (seconds)'; ?>
513
- </td>
514
- </tr>
515
- <tr>
516
- <td>PHP Memory Limit</td>
517
- <td>
518
- <?php echo @ini_get('memory_limit'); ?>
519
- </td>
520
- </tr>
521
- <tr>
522
- <td>WordPress plugin url</td>
523
- <td>
524
- <?php echo WP_PLUGIN_URL; ?>
525
- <br>
526
- Filters:
527
-
528
- <?php
529
- $filters = $wp_filter['plugins_url'];
530
- if (!is_array($filters))
531
- echo 'no filters attached to "plugin_urls"';
532
- else {
533
- echo '<ul>';
534
- foreach ($filters as &$filter) {
535
- foreach ($filter as &$entry) {
536
- echo '<li>';
537
- if (is_array($entry['function']))
538
- echo esc_html(get_class($entry['function'][0]) . '->' . $entry['function'][1]);
539
- else
540
- echo esc_html($entry['function']);
541
- echo '</li>';
542
- }
543
- }
544
- echo '</ul>';
545
- }
546
- ?>
547
- <p class="description">
548
- This value should contains the full URL to your plugin folder. If there are filters
549
- attached, the value can be different from the original generated by WordPress and sometime worng.
550
- </p>
551
- </td>
552
- </tr>
553
- <tr>
554
- <td>Blog Charset</td>
555
- <td>
556
- <?php echo get_option('blog_charset'); ?>
557
- </td>
558
- </tr>
559
- <tr>
560
- <td>WordPress Memory limit</td>
561
- <td>
562
- <?php echo WP_MEMORY_LIMIT; ?>
563
- </td>
564
- </tr>
565
- <tr>
566
- <td>WP_DEBUG</td>
567
- <td>
568
- <?php echo WP_DEBUG ? 'true' : 'false'; ?>
569
- </td>
570
- </tr>
571
- <tr>
572
- <td>Absolute path</td>
573
- <td>
574
- <?php echo esc_html(ABSPATH); ?>
575
- </td>
576
- </tr>
577
- <tr>
578
- <td>Tables Prefix</td>
579
- <td>
580
- <?php echo $wpdb->prefix; ?>
581
- </td>
582
- </tr>
583
- <tr>
584
- <td>Database Charset and Collate</td>
585
- <td>
586
- <?php echo DB_CHARSET; ?> <?php echo DB_COLLATE; ?>
587
- </td>
588
- </tr>
589
- </tbody>
590
- </table>
591
-
592
- </div>
593
-
594
  <div id="tabs-upgrade">
595
  <p>
596
  Plugin and modules are able to upgrade them self when needed. If you urgently need to try to force an upgrade, press the
@@ -620,21 +397,10 @@ if (count($send_calls)) {
620
  </p>
621
  </div>
622
 
623
- <?php if (isset($_GET['debug'])) { ?>
624
- <div id="tabs-debug">
625
- <h3>Extension versions data</h3>
626
- <pre style="font-size: 11px"><?php echo esc_html(print_r(get_option('newsletter_extension_versions'), true)); ?></pre>
627
-
628
- <h3>Update plugins data</h3>
629
- <pre style="font-size: 11px"><?php echo esc_html(print_r(get_site_transient('update_plugins'), true)); ?></pre>
630
- </div>
631
- <?php } ?>
632
- </div>
633
-
634
  </form>
635
 
636
  </div>
637
 
638
  <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
639
 
640
- </div>
1
  <?php
2
+ if (!defined('ABSPATH'))
3
+ exit;
4
 
5
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
6
  $module = Newsletter::instance();
197
  if ($send_max < $send_mean) {
198
  $send_max = $send_mean;
199
  }
200
+ if (isset($send_calls[$i][3]))
201
+ $send_completed++;
202
  }
203
  $send_mean = $send_total_time / $send_total_emails;
204
  }
 
205
  ?>
206
 
207
  <div class="wrap" id="tnp-wrap">
229
  <div id="tabs">
230
 
231
  <ul>
232
+ <li><a href="#tabs-tests"><?php _e('Tests', 'newsletter') ?></a></li>
233
+ <li><a href="#tabs-2"><?php _e('Scheduler', 'newsletter') ?></a></li>
234
+ <li><a href="#tabs-logging"><?php _e('Logging', 'newsletter') ?></a></li>
235
+ <li><a href="#tabs-upgrade"><?php _e('Maintenance', 'newsletter') ?></a></li>
 
 
 
 
236
  </ul>
237
 
238
  <!-- TESTS -->
266
  </p>
267
 
268
  <table class="form-table">
269
+
270
  <tbody>
271
  <tr>
272
  <td>
281
  Log folder
282
  </td>
283
  <td>
284
+ <code><?php echo NEWSLETTER_LOG_DIR ?></code>
285
  <br>
286
  <?php
287
  if (!is_dir(NEWSLETTER_LOG_DIR)) {
292
  ?>
293
  </td>
294
  </tr>
295
+
296
+
 
 
 
 
 
 
297
  </tbody>
298
  </table>
299
 
303
  <!-- SEMAPHORES -->
304
  <div id="tabs-2">
305
 
306
+ <h3>Scheduler</h3>
307
+ <table class="widefat" style="width: auto; margin: 0">
308
  <thead>
309
  <tr>
310
  <th>Function</th>
313
  </thead>
314
 
315
  <tbody>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
316
 
 
 
 
 
317
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
318
 
 
 
 
 
 
 
 
 
 
 
 
319
 
 
 
 
 
 
 
 
 
 
 
 
 
 
320
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
  <tr>
322
  <td>Sending statistics</td>
323
  <td>
324
+
325
  <?php if (!$send_calls) { ?>
326
+ <em>Still not enough data.</em>
327
  <?php } else { ?>
328
+ Average time to send an email: <?php echo sprintf("%.2f", $send_mean) ?> seconds<br>
329
+ Max mean time measured: <?php echo $send_max ?> seconds<br>
330
+ Min mean time measured: <?php echo $send_min ?> seconds<br>
331
+ Total emails: <?php echo $send_total_emails ?><br>
332
+ Batches prematurely interrupted: <?php echo sprintf("%.2f", (count($send_calls) - $send_completed) * 100.0 / count($send_calls)) ?>%<br>
333
+ Collected batch samples: <?php echo count($send_calls); ?><br>
334
  <?php } ?>
335
  </td>
336
  </tr>
337
+
338
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
339
  </tbody>
340
  </table>
341
+
342
  <h3>Semaphores</h3>
343
+ <table class="widefat" style="width: auto; margin: 0">
344
  <thead>
345
  <tr>
346
  <th>Name</th>
366
  </tr>
367
  </tbody>
368
  </table>
369
+
370
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
371
  <div id="tabs-upgrade">
372
  <p>
373
  Plugin and modules are able to upgrade them self when needed. If you urgently need to try to force an upgrade, press the
397
  </p>
398
  </div>
399
 
 
 
 
 
 
 
 
 
 
 
 
400
  </form>
401
 
402
  </div>
403
 
404
  <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
405
 
406
+ </div>
main/main.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
 
3
 
4
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
5
  $controls = new NewsletterControls();
@@ -47,13 +48,16 @@ if (!$controls->is_action()) {
47
  if (!$newsletter->is_email($controls->data['reply_to'], true)) {
48
  $controls->errors .= __('Reply to email is not correct.', 'newsletter') . '<br>';
49
  }
50
-
51
  $controls->data['contract_key'] = trim($controls->data['contract_key']);
52
-
53
  if (empty($controls->errors)) {
54
  $module->merge_options($controls->data);
55
  $controls->messages .= __('Saved.', 'newsletter');
56
  }
 
 
 
57
  $module->hook_newsletter_extension_versions(true);
58
  }
59
  }
@@ -78,6 +82,19 @@ if (!empty($controls->data['contract_key'])) {
78
  $module->merge_options($controls->data);
79
  }
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  ?>
82
 
83
  <div class="wrap" id="tnp-wrap">
@@ -226,6 +243,25 @@ if (!empty($controls->data['contract_key'])) {
226
  </td>
227
  </tr>
228
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  <tr valign="top">
230
  <th>API key</th>
231
  <td>
1
  <?php
2
+ if (!defined('ABSPATH'))
3
+ exit;
4
 
5
  @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
6
  $controls = new NewsletterControls();
48
  if (!$newsletter->is_email($controls->data['reply_to'], true)) {
49
  $controls->errors .= __('Reply to email is not correct.', 'newsletter') . '<br>';
50
  }
51
+
52
  $controls->data['contract_key'] = trim($controls->data['contract_key']);
53
+
54
  if (empty($controls->errors)) {
55
  $module->merge_options($controls->data);
56
  $controls->messages .= __('Saved.', 'newsletter');
57
  }
58
+
59
+ update_option('newsletter_log_level', $controls->data['log_level']);
60
+
61
  $module->hook_newsletter_extension_versions(true);
62
  }
63
  }
82
  $module->merge_options($controls->data);
83
  }
84
 
85
+
86
+ $return_path = $module->options['return_path'];
87
+ if (!empty($return_path)) {
88
+ list($return_path_local, $return_path_domain) = explode('@', $return_path);
89
+
90
+ $sender = $module->options['sender_email'];
91
+ list($sender_local, $sender_domain) = explode('@', $sender);
92
+
93
+
94
+ if ($sender_domain != $return_path_domain) {
95
+ $controls->messages .= '<br><br>Your Return Path domain is different from your Sender domain. Providers may require them to be identical';
96
+ }
97
+ }
98
  ?>
99
 
100
  <div class="wrap" id="tnp-wrap">
243
  </td>
244
  </tr>
245
 
246
+ <tr>
247
+ <td>
248
+ Log level
249
+ </td>
250
+ <td>
251
+ <?php $controls->log_level('log_level'); ?>
252
+ </td>
253
+ </tr>
254
+
255
+ <tr valign="top">
256
+ <th>Debug mode</th>
257
+ <td>
258
+ <?php $controls->yesno('debug', 40); ?>
259
+ <p class="description">
260
+ In debug mode Newsletter intercepts PHP errors. To be used only by the support team.
261
+ </p>
262
+ </td>
263
+ </tr>
264
+
265
  <tr valign="top">
266
  <th>API key</th>
267
  <td>
main/status.php ADDED
@@ -0,0 +1,887 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH'))
3
+ exit;
4
+
5
+ @include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
6
+ $module = Newsletter::instance();
7
+ $controls = new NewsletterControls();
8
+ /* @var $wpdb wpdb */
9
+
10
+
11
+ $wp_cron_calls = get_option('newsletter_diagnostic_cron_calls', array());
12
+ if (count($wp_cron_calls) > 20) {
13
+ $total = 0;
14
+ $wp_cron_calls_max = 0;
15
+ $wp_cron_calls_min = 0;
16
+ for ($i = 1; $i < count($wp_cron_calls); $i++) {
17
+ $diff = $wp_cron_calls[$i] - $wp_cron_calls[$i - 1];
18
+ $total += $diff;
19
+ if ($wp_cron_calls_min == 0 || $wp_cron_calls_min > $diff) {
20
+ $wp_cron_calls_min = $diff;
21
+ }
22
+ if ($wp_cron_calls_max < $diff) {
23
+ $wp_cron_calls_max = $diff;
24
+ }
25
+ }
26
+ $wp_cron_calls_avg = (int) ($total / (count($wp_cron_calls) - 1));
27
+ }
28
+
29
+ if ($controls->is_action('delete_logs')) {
30
+ $files = glob(WP_CONTENT_DIR . '/logs/newsletter/*.txt');
31
+ foreach ($files as $file) {
32
+ if (is_file($file))
33
+ unlink($file);
34
+ }
35
+ $secret = NewsletterModule::get_token(8);
36
+ update_option('newsletter_logger_secret', $secret);
37
+ $controls->messages = 'Logs deleted';
38
+ }
39
+
40
+ if ($controls->is_action('test')) {
41
+
42
+ if (!NewsletterModule::is_email($controls->data['test_email'])) {
43
+ $controls->errors = 'The test email address is not set or is not correct.';
44
+ }
45
+
46
+ if (empty($controls->errors)) {
47
+
48
+ $options = $controls->data;
49
+
50
+ if ($controls->data['test_email'] == $module->options['sender_email']) {
51
+ $controls->messages .= '<strong>Warning:</strong> you are using as test email the same address configured as sender in main configuration. Test can fail because of that.<br>';
52
+ }
53
+
54
+ // Newsletter mail
55
+ $text = array();
56
+ $text['html'] = '<p>This is an <b>HTML</b> test email sent using the sender data set on Newsletter main setting. <a href="http://www.thenewsletterplugin.com">This is a link to an external site</a>.</p>';
57
+ $text['text'] = 'This is a textual test email part sent using the sender data set on Newsletter main setting.';
58
+ $r = $module->mail($controls->data['test_email'], 'Newsletter test email at ' . date(DATE_ISO8601), $text);
59
+
60
+ $controls->messages .= 'Email sent with Newsletter';
61
+ if ($module->mail_method) {
62
+ $controls->messages .= ' (with a mail delivery extension)';
63
+ } else {
64
+ $smtp_options = $module->get_smtp_options();
65
+
66
+ if (!empty($smtp_options['enabled'])) {
67
+ $controls->messages .= ' (with an SMTP)';
68
+ }
69
+ }
70
+ $controls->messages .= ': ';
71
+
72
+ if ($r) {
73
+ $options['mail'] = 1;
74
+ $controls->messages .= '<strong>SUCCESS</strong><br>';
75
+ } else {
76
+ $options['mail'] = 0;
77
+ $options['mail_error'] = $module->mail_last_error;
78
+
79
+ $controls->messages .= '<strong>FAILED</strong> (' . $module->mail_last_error . ')<br>';
80
+
81
+ if ($module->mail_method) {
82
+ $controls->messages .= '- You are using a mail delivery extension. Check and test its configuration.<br>';
83
+ } else {
84
+ $smtp_options = $module->get_smtp_options();
85
+ if (!empty($smtp_options['enabled'])) {
86
+ $controls->messages .= '- You are using an SMTP (' . $smtp_options['host'] . '). Check its configuration on main configuration or on SMTP Newsletter extensions if used.<br>';
87
+ }
88
+ }
89
+
90
+ if (!empty($module->options['return_path'])) {
91
+ $controls->messages .= '- Try to remove the return path on main settings.<br>';
92
+ }
93
+
94
+ $parts = explode('@', $module->options['sender_email']);
95
+ $sitename = strtolower($_SERVER['SERVER_NAME']);
96
+ if (substr($sitename, 0, 4) == 'www.') {
97
+ $sitename = substr($sitename, 4);
98
+ }
99
+ if (strtolower($sitename) != strtolower($parts[1])) {
100
+ $controls->messages .= '- Try to set on main setting a sender address with the same domain of your blog: ' . $sitename . ' (you are using ' . $module->options['sender_email'] . ')<br>';
101
+ }
102
+ }
103
+ $module->save_options($options, 'status');
104
+ }
105
+ }
106
+
107
+ $options = $module->get_options('status');
108
+ ?>
109
+
110
+ <div class="wrap tnp-main-status" id="tnp-wrap">
111
+
112
+ <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
113
+
114
+ <div id="tnp-heading">
115
+
116
+ <h2><?php _e('System Status', 'newsletter') ?></h2>
117
+
118
+ </div>
119
+
120
+ <div id="tnp-body">
121
+
122
+ <form method="post" action="">
123
+ <?php $controls->init(); ?>
124
+
125
+ <h3>General checks</h3>
126
+ <table class="widefat" id="tnp-status-table">
127
+
128
+ <thead>
129
+ <tr>
130
+ <th>Parameter</th>
131
+ <th><?php _e('Status', 'newsletter') ?></th>
132
+ <th>Action</th>
133
+ </tr>
134
+ </thead>
135
+
136
+ <tbody>
137
+ <?php
138
+ ?>
139
+ <tr>
140
+ <td>Mailing</td>
141
+ <td>
142
+ <?php if (empty($options['mail'])) { ?>
143
+ <span class="tnp-ko">KO</span>
144
+ <?php } else { ?>
145
+ <span class="tnp-ok">OK</span>
146
+ <?php } ?>
147
+
148
+ </td>
149
+ <td>
150
+ <?php if (empty($options['mail'])) { ?>
151
+ <?php if (empty($options['mail_error'])) { ?>
152
+ A test has never run.
153
+ <?php } else { ?>
154
+ Last test failed with error "<?php echo esc_html($options['mail_error']) ?>".
155
+ <?php } ?>
156
+ <?php } else { ?>
157
+ Last test was successful. If you dind't receive the test email:
158
+ <ol>
159
+ <li>If you set the Newsletter SMTP, do a test from that panel</li>
160
+ <li>If you're using a integration extension do a test from its configuration panel</li>
161
+ <li>If previous points do not apply to you, ask for support to your provider reporting the emails from your blog are not delivered</li>
162
+ </ol>
163
+ <?php } ?>
164
+ <br>
165
+ Email: <?php $controls->text_email('test_email') ?> <?php $controls->button('test', __('Send a test message')) ?>
166
+ </td>
167
+
168
+ </tr>
169
+
170
+ <?php
171
+ $return_path = $module->options['return_path'];
172
+ if (!empty($return_path)) {
173
+ list($return_path_local, $return_path_domain) = explode('@', $return_path);
174
+ }
175
+ $sender = $module->options['sender_email'];
176
+ if (!empty($sender)) {
177
+ list($sender_local, $sender_domain) = explode('@', $sender);
178
+ }
179
+ ?>
180
+ <tr>
181
+ <td>Return path</td>
182
+ <td>
183
+ <?php if (empty($return_path)) { ?>
184
+ <span class="tnp-ok">OK</span>
185
+ <?php } else { ?>
186
+ <?php if ($sender_domain != $return_path_domain) { ?>
187
+ <span class="tnp-maybe">MAYBE</span>
188
+ <?php } else { ?>
189
+ <span class="tnp-ok">OK</span>
190
+ <?php } ?>
191
+ <?php } ?>
192
+
193
+ </td>
194
+ <td>
195
+ <?php if (!empty($return_path)) { ?>
196
+ Some providers require the return path domain <code><?php echo esc_html($return_path_domain) ?></code> to be identical
197
+ to the sender domain <code><?php echo esc_html($sender_domain) ?></code>. See the main settings.
198
+ <?php } else { ?>
199
+ <?php } ?>
200
+ </td>
201
+
202
+ </tr>
203
+
204
+
205
+ <tr>
206
+ <td>Blog Charset</td>
207
+ <td>
208
+ <?php if (get_option('blog_charset') == 'UTF-8') { ?>
209
+ <span class="tnp-ok">OK</span>
210
+ <?php } else { ?>
211
+ <span class="tnp-ko">KO</span>
212
+ <?php } ?>
213
+ </td>
214
+ <td>
215
+ Charset: <?php echo esc_html(get_option('blog_charset')) ?>
216
+ <br>
217
+
218
+ <?php if (get_option('blog_charset') == 'UTF-8') { ?>
219
+
220
+ <?php } else { ?>
221
+ Your blog charset is <?php echo esc_html(get_option('blog_charset')) ?> but it is recommended to use
222
+ the <code>UTF-8</code> charset but the <a href="https://codex.wordpress.org/Converting_Database_Character_Sets" target="_blank">conversion</a>
223
+ could be tricky. If you're not experiencing problem, leave things as is.
224
+ <?php } ?>
225
+ </td>
226
+ </tr>
227
+
228
+ <tr>
229
+ <td>PHP version</td>
230
+ <td>
231
+ <?php if (version_compare(phpversion(), '5.3', '<')) { ?>
232
+ <span class="tnp-ko">KO</span>
233
+ <?php } else { ?>
234
+ <span class="tnp-ok">OK</span>
235
+ <?php } ?>
236
+
237
+ </td>
238
+ <td>
239
+ Your PHP version is <?php echo phpversion() ?><br>
240
+ <?php if (version_compare(phpversion(), '5.3', '<')) { ?>
241
+ Newsletter plugin works correctly with PHP version 5.3 or greater. Ask your provider to upgrade your PHP. Your version is
242
+ unsupported even by the PHP community.
243
+ <?php } ?>
244
+ </td>
245
+
246
+ </tr>
247
+
248
+ <?php
249
+ $value = (int) ini_get('max_execution_time');
250
+ if ($value != 0 && $value < NEWSLETTER_CRON_INTERVAL) {
251
+ $res = set_time_limit(NEWSLETTER_CRON_INTERVAL * 1.2);
252
+ }
253
+ ?>
254
+
255
+ <tr>
256
+ <td>PHP execution time limit</td>
257
+ <td>
258
+ <?php if ($res) { ?>
259
+ <span class="tnp-ok">OK</span>
260
+ <?php } else { ?>
261
+ <span class="tnp-ko">KO</span>
262
+ <?php } ?>
263
+
264
+ </td>
265
+ <td>
266
+ <?php if (!$res) { ?>
267
+ Your PHP execution time limit is <?php echo $value ?> seconds and cannot be changed or
268
+ is too lower to grant the maximum delivery rate of Newsletter.
269
+ <?php } else { ?>
270
+ Your PHP execution time limit is <?php echo $value ?> seconds and can be eventually changed by Newsletter<br>
271
+ <?php } ?>
272
+
273
+ </td>
274
+
275
+ </tr>
276
+
277
+ <tr>
278
+ <td>Database Charset</td>
279
+ <td>
280
+ <?php if (DB_CHARSET != 'utf8' && DB_CHARSET != 'utf8mb4') { ?>
281
+ <span class="tnp-ko">KO</span>
282
+ <?php } else { ?>
283
+ <span class="tnp-ok">OK</span>
284
+ <?php } ?>
285
+
286
+ </td>
287
+ <td>
288
+ Charset: <?php echo DB_CHARSET; ?>
289
+ <br>
290
+ <?php if (DB_CHARSET != 'utf8' && DB_CHARSET != 'utf8mb4') { ?>
291
+ The recommended charset for your database is <code>utf8</code> or <code>utf8mb4</code>
292
+ but the <a href="https://codex.wordpress.org/Converting_Database_Character_Sets" target="_blank">conversion</a>
293
+ could be tricky. If you're not experiencing problem, leave things as is.
294
+ <?php } else { ?>
295
+
296
+ <?php } ?>
297
+ </td>
298
+ </tr>
299
+
300
+
301
+ <?php $wait_timeout = $wpdb->get_var("select @@wait_timeout"); ?>
302
+ <tr>
303
+ <td>Database wait timeout</td>
304
+ <td>
305
+ <?php if ($wait_timeout < 300) { ?>
306
+ <span class="tnp-ko">KO</span>
307
+ <?php } else { ?>
308
+ <span class="tnp-ok">OK</span>
309
+ <?php } ?>
310
+
311
+ </td>
312
+ <td>
313
+ Your database wait timeout is <?php echo $wait_timeout; ?> seconds<br>
314
+ <?php if ($wait_timeout < 300) { ?>
315
+ That value is low and could produce database connection errors while sending emails. Ask the provider to raise it
316
+ at least to 300 seconds.
317
+ <?php } ?>
318
+ </td>
319
+ </tr>
320
+
321
+ <?php
322
+ $res = $wpdb->query("drop table if exists {$wpdb->prefix}newsletter_test");
323
+ $res = $wpdb->query("create table if not exists {$wpdb->prefix}newsletter_test (id int(20))");
324
+ ?>
325
+ <tr>
326
+ <td>Database table creation</td>
327
+ <td>
328
+ <?php if ($res === false) { ?>
329
+ <span class="tnp-ko">KO</span>
330
+ <?php } else { ?>
331
+ <span class="tnp-ok">OK</span>
332
+ <?php } ?>
333
+ </td>
334
+ <td>
335
+ <?php if ($res === false) { ?>
336
+ Check the privileges of the user you use to connect to the database, it seems it cannot create tables.<br>
337
+ (<?php echo esc_html($wpdb->last_error) ?>)
338
+ <?php } else { ?>
339
+ <?php } ?>
340
+ </td>
341
+ </tr>
342
+
343
+ <?php
344
+ $res = $wpdb->query("alter table {$wpdb->prefix}newsletter_test add column id1 int(20)");
345
+ ?>
346
+ <tr>
347
+ <td>Database table change</td>
348
+ <td>
349
+ <?php if ($res === false) { ?>
350
+ <span class="tnp-ko">KO</span>
351
+ <?php } else { ?>
352
+ <span class="tnp-ok">OK</span>
353
+ <?php } ?>
354
+ </td>
355
+ <td>
356
+ <?php if ($res === false) { ?>
357
+ Check the privileges of the user you use to connect to the database, it seems it cannot change the tables. It's require to update the
358
+ plugin.<br>
359
+ (<?php echo esc_html($wpdb->last_error) ?>)
360
+ <?php } else { ?>
361
+ <?php } ?>
362
+ </td>
363
+ </tr>
364
+
365
+ <?php
366
+ // Clean up
367
+ $res = $wpdb->query("drop table if exists {$wpdb->prefix}newsletter_test");
368
+ ?>
369
+
370
+ <?php
371
+ set_transient('newsletter_transient_test', 1, 300);
372
+ delete_transient('newsletter_transient_test');
373
+ $res = get_transient('newsletter_transient_test');
374
+ ?>
375
+ <tr>
376
+ <td>WordPress transients</td>
377
+ <td>
378
+ <?php if ($res !== false) { ?>
379
+ <span class="tnp-ko">KO</span>
380
+ <?php } else { ?>
381
+ <span class="tnp-ok">OK</span>
382
+ <?php } ?>
383
+ </td>
384
+ <td>
385
+ <?php if ($res !== false) { ?>
386
+ Transients cannot be delete. This can block the delivery engine. Usually it is due to a not well coded plugin installed.
387
+ <?php } else { ?>
388
+ <?php } ?>
389
+ </td>
390
+ </tr>
391
+
392
+ <?php
393
+ $time = wp_next_scheduled('newsletter');
394
+ $res = true;
395
+ if ($time === false) {
396
+ $res = false;
397
+ }
398
+ $delta = $time - time();
399
+ if ($delta <= -600) {
400
+ $res = false;
401
+ }
402
+ ?>
403
+ <tr>
404
+ <td>Newsletter schedule timing</td>
405
+ <td>
406
+ <?php if ($res === false) { ?>
407
+ <span class="tnp-ko">KO</span>
408
+ <?php } else { ?>
409
+ <span class="tnp-ok">OK</span>
410
+ <?php } ?>
411
+ </td>
412
+ <td>
413
+ <?php if ($res === false) { ?>
414
+ No next execution is planned.
415
+ <?php } else { ?>
416
+ Next execution is planned in <?php echo $delta ?> seconds (negative values are ok).
417
+ <?php } ?>
418
+ </td>
419
+ </tr>
420
+
421
+ <?php
422
+ $schedules = wp_get_schedules();
423
+ $res = false;
424
+ if (!empty($schedules)) {
425
+ foreach ($schedules as $key => $data) {
426
+ if ($key == 'newsletter') {
427
+ $res = true;
428
+ break;
429
+ }
430
+ }
431
+ }
432
+ ?>
433
+
434
+ <tr>
435
+ <td>
436
+ Newsletter schedule
437
+ </td>
438
+ <td>
439
+ <?php if ($res === false) { ?>
440
+ <span class="tnp-ko">KO</span>
441
+ <?php } else { ?>
442
+ <span class="tnp-ok">OK</span>
443
+ <?php } ?>
444
+ </td>
445
+ <td>
446
+ <?php if ($res === false) { ?>
447
+ The Newsletter schedule is not present probably another plugin is interfering with the starndard WordPress schuling system.<br>
448
+ <?php } else { ?>
449
+ <?php } ?>
450
+
451
+ WordPress registsred schedules:<br>
452
+ <?php
453
+ if (!empty($schedules)) {
454
+ foreach ($schedules as $key => $data) {
455
+ echo esc_html($key . ' - ' . $data['interval']) . ' seconds<br>';
456
+ }
457
+ }
458
+ ?>
459
+ </td>
460
+ </tr>
461
+
462
+ <tr>
463
+ <td>
464
+ WordPress scheduler auto trigger
465
+ </td>
466
+ <td>
467
+ <?php if (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON) { ?>
468
+ <span class="tnp-maybe">MAYBE</span>
469
+ <?php } else { ?>
470
+ <span class="tnp-ok">OK</span>
471
+ <?php } ?>
472
+ </td>
473
+ <td>
474
+ <?php if (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON) { ?>
475
+ The constant DISABLE_WP_CRON is set to true (probably in wp-config.php). That disables the scheduler auto triggering and it's
476
+ good ONLY if you setup an external trigger.
477
+ <?php } else { ?>
478
+
479
+ <?php } ?>
480
+ </td>
481
+ </tr>
482
+
483
+ <?php
484
+ $res = true;
485
+ $response = wp_remote_post(home_url('/') . '?na=test');
486
+ if (is_wp_error($response)) {
487
+ $res = false;
488
+ $message = $reponse->get_error_message();
489
+ } else {
490
+ if (wp_remote_retrieve_response_code($response) != 200) {
491
+ $res = false;
492
+ $message = wp_remote_retrieve_response_message($response);
493
+ }
494
+ }
495
+ ?>
496
+ <tr>
497
+ <td>
498
+ Action call
499
+ </td>
500
+ <td>
501
+ <?php if (!$res) { ?>
502
+ <span class="tnp-ko">KO</span>
503
+ <?php } else { ?>
504
+ <span class="tnp-ok">OK</span>
505
+ <?php } ?>
506
+ </td>
507
+ <td>
508
+ <?php if (!$res) { ?>
509
+ The blog is not responding to Newsletter URLs: ask the provider or your IT consultant to check this problem. Report the URL and error blow<br>
510
+ Error: <?php echo esc_html($message) ?><br>
511
+ <?php } else { ?>
512
+
513
+ <?php } ?>
514
+ Url: <?php echo esc_html(home_url('/') . '?na=test') ?><br>
515
+ </td>
516
+ </tr>
517
+
518
+ <?php
519
+ $res = true;
520
+ $response = wp_remote_get(site_url('/wp-cron.php') . '?' . time());
521
+ if (is_wp_error($response)) {
522
+ $res = false;
523
+ $message = $reponse->get_error_message();
524
+ } else {
525
+ if (wp_remote_retrieve_response_code($response) != 200) {
526
+ $res = false;
527
+ $message = wp_remote_retrieve_response_message($response);
528
+ }
529
+ }
530
+ ?>
531
+ <tr>
532
+ <td>
533
+ WordPress scheduler auto trigger call
534
+ </td>
535
+ <td>
536
+ <?php if (!$res) { ?>
537
+ <span class="tnp-ko">KO</span>
538
+ <?php } else { ?>
539
+ <span class="tnp-ok">OK</span>
540
+ <?php } ?>
541
+ </td>
542
+ <td>
543
+ <?php if (!$res) { ?>
544
+ The blog cannot autotrigger the internal scheduler, if an external trigger is used this could not be a real problem.<br>
545
+ Error: <?php echo esc_html($message) ?><br>
546
+ <?php } else { ?>
547
+
548
+ <?php } ?>
549
+ Url: <?php echo esc_html(site_url('/wp-cron.php')) ?><br>
550
+ </td>
551
+ </tr>
552
+
553
+ <?php
554
+ $res = true;
555
+ $response = wp_remote_get('http://www.thenewsletterplugin.com/wp-content/versions/all.txt');
556
+ if (is_wp_error($response)) {
557
+ $res = false;
558
+ $message = $reponse->get_error_message();
559
+ } else {
560
+ if (wp_remote_retrieve_response_code($response) != 200) {
561
+ $res = false;
562
+ $message = wp_remote_retrieve_response_message($response);
563
+ }
564
+ }
565
+ ?>
566
+ <tr>
567
+ <td>
568
+ Extension version check
569
+ </td>
570
+ <td>
571
+ <?php if (!$res) { ?>
572
+ <span class="tnp-ko">KO</span>
573
+ <?php } else { ?>
574
+ <span class="tnp-ok">OK</span>
575
+ <?php } ?>
576
+ </td>
577
+ <td>
578
+ <?php if (!$res) { ?>
579
+ The blog cannot contact www.thenewsletterplugin.com to check the license or the extension versions.<br>
580
+ Error: <?php echo esc_html($message) ?><br>
581
+ <?php } else { ?>
582
+
583
+ <?php } ?>
584
+ </td>
585
+ </tr>
586
+
587
+ <tr>
588
+ <td>
589
+ WordPress debug mode
590
+ </td>
591
+ <td>
592
+ <?php if (defined('WP_DEBUG') && WP_DEBUG) { ?>
593
+ <span class="tnp-maybe">MAYBE</span>
594
+ <?php } else { ?>
595
+ <span class="tnp-ok">OK</span>
596
+ <?php } ?>
597
+ </td>
598
+ <td>
599
+ <?php if (defined('WP_DEBUG') && WP_DEBUG) { ?>
600
+ WordPress is in debug mode it is not recommended on a production system. See the constant WP_DEBUG insde the wp-config.php.
601
+ <?php } else { ?>
602
+
603
+ <?php } ?>
604
+ </td>
605
+ </tr>
606
+
607
+
608
+
609
+ <?php
610
+ $memory = intval(WP_MEMORY_LIMIT);
611
+ if (false !== strpos(WP_MEMORY_LIMIT, 'G'))
612
+ $memory *= 1024;
613
+ ?>
614
+ <tr>
615
+ <td>
616
+ PHP memory limit
617
+ </td>
618
+ <td>
619
+ <?php if ($memory < 64) { ?>
620
+ <span class="tnp-ko">KO</span>
621
+ <?php } else if ($memory < 128) { ?>
622
+ <span class="tnp-maybe">MAYBE</span>
623
+ <?php } else { ?>
624
+ <span class="tnp-ok">OK</span>
625
+ <?php } ?>
626
+ </td>
627
+ <td>
628
+ Your memory limit is set to <?php echo $memory ?> megabyte<br>
629
+ <?php if ($memory < 64) { ?>
630
+ This value is too low you should increase it adding <code>define('WP_MEMORY_LIMIT', '64M');</code> to your wp-config.php.
631
+ <?php } else if ($memory < 128) { ?>
632
+ The value should be fine, it depends on how many plugin you're running and how many resource are required by your theme.
633
+ Blank pages are usually syntoms of low memory. Eventually increase it adding <code>define('WP_MEMORY_LIMIT', '128M');</code>
634
+ to your wp-config.php.
635
+ <?php } else { ?>
636
+
637
+ <?php } ?>
638
+
639
+ </td>
640
+ </tr>
641
+
642
+ <?php
643
+ $ip = gethostbyname($_SERVER['HTTP_HOST']);
644
+ $name = gethostbyaddr($ip);
645
+ $res = true;
646
+ if (strpos($name, '.secureserver.net') !== false) {
647
+ //$smtp = get_option('newsletter_main_smtp');
648
+ //if (!empty($smtp['enabled']))
649
+ $res = false;
650
+ $message = 'If you\'re hosted with GoDaddy, be sure to set their SMTP (relay-hosting.secureserver.net, without username and password) to send emails
651
+ on Newsletter SMTP panel.
652
+ Remember they limits you to 250 emails per day. Open them a ticket for more details.';
653
+ }
654
+ if (strpos($name, '.aruba.it') !== false) {
655
+ $res = false;
656
+ $message = 'If you\'re hosted with Aruba consider to use an external SMTP (Sendgrid, Mailjet, Mailgun, Amazon SES, Elasticemail, Sparkpost, ...)
657
+ since their mail service is not good. If you have your personal email with them, you can try to use the SMTP of your
658
+ pesonal account. Ask the support for the SMTP parameters and configure them on Newsletter SMTP panel.';
659
+ }
660
+ ?>
661
+ <tr>
662
+ <td>Your Server</td>
663
+ <td>
664
+ <?php if ($res === false) { ?>
665
+ <span class="tnp-maybe">MAYBE</span>
666
+ <?php } else { ?>
667
+ <span class="tnp-ok">OK</span>
668
+ <?php } ?>
669
+
670
+
671
+ </td>
672
+ <td>
673
+ <?php if ($res === false) { ?>
674
+ <?php echo $message ?>
675
+ <?php } else { ?>
676
+
677
+ <?php } ?>
678
+ IP: <?php echo $ip ?><br>
679
+ Name: <?php echo $name ?><br>
680
+ </td>
681
+ </tr>
682
+
683
+ <?php
684
+ wp_mkdir_p(NEWSLETTER_LOG_DIR);
685
+ $res = is_dir(NEWSLETTER_LOG_DIR);
686
+ if ($res) {
687
+ file_put_contents(NEWSLETTER_LOG_DIR . '/test.txt', "");
688
+ $res = is_file(NEWSLETTER_LOG_DIR . '/test.txt');
689
+ if ($res) {
690
+ @unlink(NEWSLETTER_LOG_DIR . '/test.txt');
691
+ }
692
+ }
693
+ ?>
694
+ <tr>
695
+ <td>
696
+ Log folder
697
+ </td>
698
+ <td>
699
+ <?php if (!$res) { ?>
700
+ <span class="tnp-ko">KO</span>
701
+ <?php } else { ?>
702
+ <span class="tnp-ok">OK</span>
703
+ <?php } ?>
704
+ </td>
705
+ <td>
706
+ The log folder is <?php echo esc_html(NEWSLETTER_LOG_DIR) ?><br>
707
+ <?php if (!$res) { ?>
708
+ Cannot create the folder or it is not writable.
709
+ <?php } else { ?>
710
+
711
+ <?php } ?>
712
+ </td>
713
+ </tr>
714
+ </tbody>
715
+ </table>
716
+
717
+
718
+
719
+ <h3>General parameters</h3>
720
+ <table class="widefat" id="tnp-parameters-table">
721
+ <thead>
722
+ <tr>
723
+ <th>Parameter</th>
724
+ <th>Value</th>
725
+ </tr>
726
+ </thead>
727
+ <tbody>
728
+
729
+ <tr>
730
+ <td>NEWSLETTER_MAX_EXECUTION_TIME</td>
731
+ <td>
732
+ <?php
733
+ if (defined('NEWSLETTER_MAX_EXECUTION_TIME')) {
734
+ echo NEWSLETTER_MAX_EXECUTION_TIME . ' (seconds)';
735
+ } else {
736
+ echo 'Not set';
737
+ }
738
+ ?>
739
+ </td>
740
+ </tr>
741
+ <tr>
742
+ <td>NEWSLETTER_CRON_INTERVAL</td>
743
+ <td>
744
+ <?php echo NEWSLETTER_CRON_INTERVAL . ' (seconds)'; ?>
745
+ </td>
746
+ </tr>
747
+
748
+ <tr>
749
+ <td>WordPress plugin url</td>
750
+ <td>
751
+ <?php echo WP_PLUGIN_URL; ?>
752
+ <br>
753
+ Filters:
754
+
755
+ <?php
756
+ $filters = $wp_filter['plugins_url'];
757
+ if (!is_array($filters))
758
+ echo 'no filters attached to "plugin_urls"';
759
+ else {
760
+ echo '<ul>';
761
+ foreach ($filters as &$filter) {
762
+ foreach ($filter as &$entry) {
763
+ echo '<li>';
764
+ if (is_array($entry['function']))
765
+ echo esc_html(get_class($entry['function'][0]) . '->' . $entry['function'][1]);
766
+ else
767
+ echo esc_html($entry['function']);
768
+ echo '</li>';
769
+ }
770
+ }
771
+ echo '</ul>';
772
+ }
773
+ ?>
774
+ <p class="description">
775
+ This value should contains the full URL to your plugin folder. If there are filters
776
+ attached, the value can be different from the original generated by WordPress and sometime worng.
777
+ </p>
778
+ </td>
779
+ </tr>
780
+
781
+
782
+ <tr>
783
+ <td>Absolute path</td>
784
+ <td>
785
+ <?php echo esc_html(ABSPATH); ?>
786
+ </td>
787
+ </tr>
788
+ <tr>
789
+ <td>Tables Prefix</td>
790
+ <td>
791
+ <?php echo $wpdb->prefix; ?>
792
+ </td>
793
+ </tr>
794
+ </tbody>
795
+ </table>
796
+
797
+ <h3>Log files</h3>
798
+
799
+ <ul class="tnp-log-files">
800
+ <?php
801
+ $files = glob(WP_CONTENT_DIR . '/logs/newsletter/*.txt'); // get all file names
802
+ foreach ($files as $file) { // iterate files
803
+ echo '<li><a href="' . WP_CONTENT_URL . '/logs/newsletter/' . basename($file) . '" target="_blank">' . basename($file) . '</a>';
804
+ echo ' <span class="tnp-log-size">(' . size_format(filesize($file)) . ')</span>';
805
+ echo '</li>';
806
+ }
807
+ ?>
808
+ </ul>
809
+
810
+ <?php $controls->button('delete_logs', 'Delete all'); ?>
811
+
812
+
813
+ <?php if (isset($_GET['debug'])) { ?>
814
+
815
+
816
+ <h3>Database Tables</h3>
817
+ <h4><?php echo $wpdb->prefix ?>newsletter</h4>
818
+ <?php
819
+ $rs = $wpdb->get_results("describe {$wpdb->prefix}newsletter");
820
+ ?>
821
+ <table class="tnp-db-table">
822
+ <thead>
823
+ <tr>
824
+ <th>Field</th>
825
+ <th>Type</th>
826
+ <th>Null</th>
827
+ <th>Key</th>
828
+ <th>Default</th>
829
+ <th>Extra</th>
830
+ </tr>
831
+ </thead>
832
+ <tbody>
833
+ <?php foreach ($rs as $r) { ?>
834
+ <tr>
835
+ <td><?php echo esc_html($r->Field) ?></td>
836
+ <td><?php echo esc_html($r->Type) ?></td>
837
+ <td><?php echo esc_html($r->Null) ?></td>
838
+ <td><?php echo esc_html($r->Key) ?></td>
839
+ <td><?php echo esc_html($r->Default) ?></td>
840
+ <td><?php echo esc_html($r->Extra) ?></td>
841
+ </tr>
842
+ <?php } ?>
843
+ </tbody>
844
+ </table>
845
+
846
+ <h4><?php echo $wpdb->prefix ?>newsletter_emails</h4>
847
+ <?php
848
+ $rs = $wpdb->get_results("describe {$wpdb->prefix}newsletter_emails");
849
+ ?>
850
+ <table class="tnp-db-table">
851
+ <thead>
852
+ <tr>
853
+ <th>Field</th>
854
+ <th>Type</th>
855
+ <th>Null</th>
856
+ <th>Key</th>
857
+ <th>Default</th>
858
+ <th>Extra</th>
859
+ </tr>
860
+ </thead>
861
+ <tbody>
862
+ <?php foreach ($rs as $r) { ?>
863
+ <tr>
864
+ <td><?php echo esc_html($r->Field) ?></td>
865
+ <td><?php echo esc_html($r->Type) ?></td>
866
+ <td><?php echo esc_html($r->Null) ?></td>
867
+ <td><?php echo esc_html($r->Key) ?></td>
868
+ <td><?php echo esc_html($r->Default) ?></td>
869
+ <td><?php echo esc_html($r->Extra) ?></td>
870
+ </tr>
871
+ <?php } ?>
872
+ </tbody>
873
+ </table>
874
+
875
+
876
+ <h3>Extensions</h3>
877
+ <pre style="font-size: 11px; font-family: monospace; background-color: #efefef; color: #444"><?php echo esc_html(print_r(get_option('newsletter_extension_versions'), true)); ?></pre>
878
+
879
+ <h3>Update plugins data</h3>
880
+ <pre style="font-size: 11px; font-family: monospace; background-color: #efefef; color: #444"><?php echo esc_html(print_r(get_site_transient('update_plugins'), true)); ?></pre>
881
+
882
+ <?php } ?>
883
+ </div>
884
+
885
+ <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
886
+
887
+ </div>
plugin.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Newsletter
5
  Plugin URI: http://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="http://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
7
- Version: 4.7.5
8
  Author: Stefano Lissa & The Newsletter Team
9
  Author URI: http://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', '4.7.5');
18
 
19
  global $wpdb, $newsletter;
20
 
@@ -369,6 +369,7 @@ class Newsletter extends NewsletterModule {
369
  $this->add_menu_page('index', 'Dashboard');
370
  $this->add_menu_page('main', 'Settings and More');
371
  $this->add_admin_page('smtp', 'SMTP');
 
372
  $this->add_admin_page('info', 'Company info');
373
  $this->add_admin_page('diagnostic', 'Diagnostic');
374
  $this->add_admin_page('startup', 'Quick Startup');
@@ -401,6 +402,11 @@ class Newsletter extends NewsletterModule {
401
 
402
  function hook_init() {
403
  global $cache_stop, $hyper_cache_stop, $wpdb;
 
 
 
 
 
404
 
405
  if (is_admin()) {
406
  if ($this->is_admin_page()) {
@@ -443,6 +449,11 @@ class Newsletter extends NewsletterModule {
443
  $this->message = $options_followup['unsubscribed_text'];
444
  return;
445
  }
 
 
 
 
 
446
  }
447
 
448
  function is_admin_page() {
4
  Plugin Name: Newsletter
5
  Plugin URI: http://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="http://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
7
+ Version: 4.7.6
8
  Author: Stefano Lissa & The Newsletter Team
9
  Author URI: http://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', '4.7.6');
18
 
19
  global $wpdb, $newsletter;
20
 
369
  $this->add_menu_page('index', 'Dashboard');
370
  $this->add_menu_page('main', 'Settings and More');
371
  $this->add_admin_page('smtp', 'SMTP');
372
+ $this->add_admin_page('status', 'Status');
373
  $this->add_admin_page('info', 'Company info');
374
  $this->add_admin_page('diagnostic', 'Diagnostic');
375
  $this->add_admin_page('startup', 'Quick Startup');
402
 
403
  function hook_init() {
404
  global $cache_stop, $hyper_cache_stop, $wpdb;
405
+
406
+ if (isset($this->options['debug']) && $this->options['debug'] == 1) {
407
+ ini_set('log_errors', 1);
408
+ ini_set('error_log', WP_CONTENT_DIR . '/logs/newsletter/php-' . date('Y-m') . '-' . get_option('newsletter_logger_secret') . '.txt');
409
+ }
410
 
411
  if (is_admin()) {
412
  if ($this->is_admin_page()) {
449
  $this->message = $options_followup['unsubscribed_text'];
450
  return;
451
  }
452
+
453
+ if ($action == 'test') {
454
+ echo 'ok';
455
+ die();
456
+ }
457
  }
458
 
459
  function is_admin_page() {
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.7
5
- Stable tag: 4.7.5
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
@@ -77,6 +77,10 @@ Thank you, The Newsletter Team
77
 
78
  == Changelog ==
79
 
 
 
 
 
80
  = 4.7.5 =
81
 
82
  * Removed references to old css
@@ -85,6 +89,8 @@ Thank you, The Newsletter Team
85
  = 4.7.4 =
86
 
87
  * Improved widget CSS
 
 
88
 
89
  = 4.7.3 =
90
 
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.7.1
5
+ Stable tag: 4.7.6
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
77
 
78
  == Changelog ==
79
 
80
+ = 4.7.6 =
81
+
82
+ * New status panel
83
+
84
  = 4.7.5 =
85
 
86
  * Removed references to old css
89
  = 4.7.4 =
90
 
91
  * Improved widget CSS
92
+ * Added Instagram to social icons
93
+ * Little style improvements
94
 
95
  = 4.7.3 =
96
 
subscription/style.css CHANGED
@@ -1,3 +1,11 @@
 
 
 
 
 
 
 
 
1
  .tnp-subscription {
2
  font-size: 13px;
3
  display: block;
@@ -234,12 +242,12 @@ tnp-profile form .tnp-field label {
234
  color: #444;
235
  font-size: 14px;
236
  box-sizing: border-box;
 
237
  }
238
 
239
  .tnp-subscription-minimal input.tnp-submit {
240
  width: 29%;
241
  box-sizing: border-box;
242
- padding: 10px;
243
  display: inline-block;
244
  border: 1px;
245
  border-color: #ddd;
@@ -247,6 +255,7 @@ tnp-profile form .tnp-field label {
247
  color: #fff;
248
  font-size: 14px;
249
  box-sizing: border-box;
 
250
  }
251
 
252
 
1
+ /*
2
+
3
+ THIS FILE IS OVERWRITTEN EVERY TIME YOU UPDATE THE PLUGIN.
4
+ USE THE CUSOTM CSS OPTION IN THE SUBSCRIPTION SETTING PANEL FOR YOUR
5
+ CUSTOM CSS RULES.
6
+
7
+ */
8
+
9
  .tnp-subscription {
10
  font-size: 13px;
11
  display: block;
242
  color: #444;
243
  font-size: 14px;
244
  box-sizing: border-box;
245
+ border-radius: 0px;
246
  }
247
 
248
  .tnp-subscription-minimal input.tnp-submit {
249
  width: 29%;
250
  box-sizing: border-box;
 
251
  display: inline-block;
252
  border: 1px;
253
  border-color: #ddd;
255
  color: #fff;
256
  font-size: 14px;
257
  box-sizing: border-box;
258
+ border-radius: 0px;
259
  }
260
 
261
 
subscription/subscription.php CHANGED
@@ -1324,7 +1324,11 @@ class NewsletterSubscription extends NewsletterModule {
1324
  }
1325
 
1326
  if ($referrer != 'widget') {
1327
- $buffer .= '<div class="tnp tnp-subscription">' . "\n";
 
 
 
 
1328
  }
1329
  $buffer .= '<form method="post" action="' . esc_attr($action) . '" onsubmit="return newsletter_check(this)">' . "\n\n";
1330
 
1324
  }
1325
 
1326
  if ($referrer != 'widget') {
1327
+ if (isset($attrs['class'])) {
1328
+ $buffer .= '<div class="tnp tnp-subscription ' . $attrs['class'] . '">' . "\n";
1329
+ } else {
1330
+ $buffer .= '<div class="tnp tnp-subscription">' . "\n";
1331
+ }
1332
  }
1333
  $buffer .= '<form method="post" action="' . esc_attr($action) . '" onsubmit="return newsletter_check(this)">' . "\n\n";
1334
 
tnp-header.php CHANGED
@@ -24,6 +24,7 @@ function newsletter_print_entries($group) {
24
  }
25
  }
26
  }
 
27
  ?>
28
 
29
  <div class="tnp-drowpdown" id="tnp-header">
@@ -52,7 +53,7 @@ function newsletter_print_entries($group) {
52
  <small><?php _e('The subscription process in detail', 'newsletter') ?></small></a></li>
53
  <li><a href="?page=newsletter_wp_index"><i class="fa fa-wordpress"></i> <?php _e('WP Registration', 'newsletter') ?>
54
  <small><?php _e('Subscribe on WP registration', 'newsletter') ?></small></a></li>
55
- <li><a href="?page=newsletter_subscription_profile"><i class="fa fa-check-square-o"></i> <?php _e('Subscription Form Fields', 'newsletter') ?>
56
  <small><?php _e('When and what data to collect', 'newsletter') ?></small></a></li>
57
  <li><a href="?page=newsletter_subscription_lists"><i class="fa fa-th-list"></i> <?php _e('Lists', 'newsletter') ?>
58
  <small><?php _e('Profile the subscribers for a better targeting', 'newsletter') ?></small></a></li>
@@ -97,6 +98,7 @@ function newsletter_print_entries($group) {
97
  ?>
98
  </ul>
99
  </li>
 
100
  <?php
101
  if (empty(Newsletter::instance()->options['contract_key'])) {
102
  ?>
24
  }
25
  }
26
  }
27
+
28
  ?>
29
 
30
  <div class="tnp-drowpdown" id="tnp-header">
53
  <small><?php _e('The subscription process in detail', 'newsletter') ?></small></a></li>
54
  <li><a href="?page=newsletter_wp_index"><i class="fa fa-wordpress"></i> <?php _e('WP Registration', 'newsletter') ?>
55
  <small><?php _e('Subscribe on WP registration', 'newsletter') ?></small></a></li>
56
+ <li><a href="?page=newsletter_subscription_profile"><i class="fa fa-check-square-o"></i> <?php _e('Subscription Form Fields, Buttons, Labels', 'newsletter') ?>
57
  <small><?php _e('When and what data to collect', 'newsletter') ?></small></a></li>
58
  <li><a href="?page=newsletter_subscription_lists"><i class="fa fa-th-list"></i> <?php _e('Lists', 'newsletter') ?>
59
  <small><?php _e('Profile the subscribers for a better targeting', 'newsletter') ?></small></a></li>
98
  ?>
99
  </ul>
100
  </li>
101
+ <li><a href="?page=newsletter_main_status"><i class="fa fa-thermometer"></i> <?php _e('Status', 'newsletter') ?></a></li>
102
  <?php
103
  if (empty(Newsletter::instance()->options['contract_key'])) {
104
  ?>