Newsletter - Version 4.5.8

Version Description

  • Edit image alt text in the composer
  • Fixed german characters problem on visual composer
  • Added new data to diagnostic panel
  • Change the export to be more compatible with specific blog installations
  • Added translations to export panel
Download this release

Release Info

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

Code changes from version 4.5.7 to 4.5.8

emails/cpreview.php CHANGED
@@ -311,7 +311,7 @@ if ($controls->is_action('test')) {
311
 
312
  <input id="options-message" name="options[message]" type="hidden">
313
 
314
- <div id="tnpc-html-editor"><?php echo htmlentities($email['message']) ?></div>
315
  <script src="<?php echo plugins_url('newsletter') ?>/js/ace/ace.js" type="text/javascript" charset="utf-8"></script>
316
  <script>
317
  var editor = ace.edit("tnpc-html-editor");
311
 
312
  <input id="options-message" name="options[message]" type="hidden">
313
 
314
+ <div id="tnpc-html-editor"><?php echo esc_html($email['message']) ?></div>
315
  <script src="<?php echo plugins_url('newsletter') ?>/js/ace/ace.js" type="text/javascript" charset="utf-8"></script>
316
  <script>
317
  var editor = ace.edit("tnpc-html-editor");
emails/tnp-composer/_css/newsletter-builder.css CHANGED
@@ -444,6 +444,7 @@
444
  .tnpc-subject input {
445
  padding: 12px 15px;
446
  margin-left: 20px;
 
447
  }
448
 
449
  .tnpc-subject a {
444
  .tnpc-subject input {
445
  padding: 12px 15px;
446
  margin-left: 20px;
447
+ width: 70%;
448
  }
449
 
450
  .tnpc-subject a {
emails/tnp-composer/_scripts/newsletter-builder.js CHANGED
@@ -13,6 +13,7 @@ jQuery.fn.hover_edit = function () {
13
  //edit image
14
  if (target.attr("data-type") == 'image') {
15
  jQuery("#tnpc-edit-image .image").val(target.find('img').attr("src"));
 
16
  jQuery("#tnpc-edit-image .url").val(target.find('a').attr("href"));
17
  jQuery("#tnpc-edit-image").fadeIn(500);
18
  jQuery("#tnpc-edit-image .tnpc-edit-box").slideDown(500);
@@ -20,6 +21,7 @@ jQuery.fn.hover_edit = function () {
20
  jQuery(this).parent().parent().parent().fadeOut(500)
21
  jQuery(this).parent().parent().slideUp(500)
22
  target.find('img').attr("src", jQuery("#tnpc-edit-image .image").val());
 
23
  target.find('a').attr("href", jQuery("#tnpc-edit-image .url").val());
24
  });
25
  }
13
  //edit image
14
  if (target.attr("data-type") == 'image') {
15
  jQuery("#tnpc-edit-image .image").val(target.find('img').attr("src"));
16
+ jQuery("#tnpc-edit-image .alt").val(target.find('img').attr("alt"));
17
  jQuery("#tnpc-edit-image .url").val(target.find('a').attr("href"));
18
  jQuery("#tnpc-edit-image").fadeIn(500);
19
  jQuery("#tnpc-edit-image .tnpc-edit-box").slideDown(500);
21
  jQuery(this).parent().parent().parent().fadeOut(500)
22
  jQuery(this).parent().parent().slideUp(500)
23
  target.find('img').attr("src", jQuery("#tnpc-edit-image .image").val());
24
+ target.find('img').attr("alt", jQuery("#tnpc-edit-image .alt").val());
25
  target.find('a').attr("href", jQuery("#tnpc-edit-image .url").val());
26
  });
27
  }
emails/tnp-composer/edit.php CHANGED
@@ -1,18 +1,20 @@
1
  <div class="tnpc-edit" id="tnpc-edit-image">
2
  <div class="tnpc-edit-box">
3
- <div class="tnpc-edit-box-title">Edit Image</div>
4
  <div class="tnpc-edit-box-content">
5
- <div class="tnpc-edit-box-content-text">SOURCE <span>(full image URL including http://)</span></div>
6
  <div class="tnpc-edit-box-content-field">
7
  <input type="text" class="tnpc-edit-box-content-field-input image"/>
8
  <input class="button select_image" value="Select or Upload Image" type="button">
9
  </div>
10
- <div class="tnpc-edit-box-content-text">LINK <span>(optional link address including http://)</span></div>
 
 
11
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input url"/></div>
12
  </div>
13
  <div class="tnpc-edit-box-buttons">
14
- <div class="tnpc-edit-box-buttons-save">Save</div>
15
- <div class="tnpc-edit-box-buttons-cancel">Cancel</div>
16
  </div>
17
  </div>
18
  </div>
@@ -47,55 +49,55 @@
47
 
48
  <div class="tnpc-edit" id="tnpc-edit-link">
49
  <div class="tnpc-edit-box">
50
- <div class="tnpc-edit-box-title">Edit Link</div>
51
 
52
  <div class="tnpc-edit-box-content">
53
- <div class="tnpc-edit-box-content-text">TITLE </div>
54
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input title"/></div>
55
- <div class="tnpc-edit-box-content-text">URL <span>(full address including http://)</span></div>
56
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input url"/></div>
57
  </div>
58
  <div class="tnpc-edit-box-buttons">
59
- <div class="tnpc-edit-box-buttons-save">Save</div>
60
- <div class="tnpc-edit-box-buttons-cancel">Cancel</div>
61
  </div>
62
  </div>
63
  </div>
64
 
65
  <div class="tnpc-edit" id="tnpc-edit-button">
66
  <div class="tnpc-edit-box">
67
- <div class="tnpc-edit-box-title">Edit Button</div>
68
 
69
  <div class="tnpc-edit-box-content">
70
- <div class="tnpc-edit-box-content-text">TITLE </div>
71
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input title"/></div>
72
- <div class="tnpc-edit-box-content-text">URL <span>(full address including http://)</span></div>
73
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input url"/></div>
74
- <div class="tnpc-edit-box-content-text">Text Color</div>
75
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input fgcolor"/></div>
76
- <div class="tnpc-edit-box-content-text">Background Color</div>
77
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input bgcolor"/></div>
78
  </div>
79
  <div class="tnpc-edit-box-buttons">
80
- <div class="tnpc-edit-box-buttons-save">Save</div>
81
- <div class="tnpc-edit-box-buttons-cancel">Cancel</div>
82
  </div>
83
  </div>
84
  </div>
85
 
86
  <div class="tnpc-edit" id="tnpc-edit-title">
87
  <div class="tnpc-edit-box">
88
- <div class="tnpc-edit-box-title">Edit Title</div>
89
 
90
  <div class="tnpc-edit-box-content">
91
- <div class="tnpc-edit-box-content-text">Title</div>
92
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input title"/></div>
93
- <div class="tnpc-edit-box-content-text">Text Color</div>
94
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input color"/></div>
95
  </div>
96
  <div class="tnpc-edit-box-buttons">
97
- <div class="tnpc-edit-box-buttons-save">Save</div>
98
- <div class="tnpc-edit-box-buttons-cancel">Cancel</div>
99
  </div>
100
  </div>
101
  </div>
@@ -103,15 +105,15 @@
103
 
104
  <div class="tnpc-edit" id="tnpc-edit-text">
105
  <div class="tnpc-edit-box">
106
- <div class="tnpc-edit-box-title">Edit Text</div>
107
 
108
  <div class="tnpc-edit-box-content">
109
- <div class="tnpc-edit-box-content-text">Text</div>
110
  <div class="tnpc-edit-box-content-field"><textarea class="tnpc-edit-box-content-field-textarea text"></textarea></div>
111
  </div>
112
  <div class="tnpc-edit-box-buttons">
113
- <div class="tnpc-edit-box-buttons-save">Save</div>
114
- <div class="tnpc-edit-box-buttons-cancel">Cancel</div>
115
  </div>
116
  </div>
117
  </div>
@@ -119,10 +121,10 @@
119
 
120
  <div class="tnpc-edit" id="tnpc-edit-icon">
121
  <div class="tnpc-edit-box">
122
- <div class="tnpc-edit-box-title">Edit Icon</div>
123
 
124
  <div class="tnpc-edit-box-content">
125
- <div class="tnpc-edit-box-content-text">Select Icon</div>
126
  <div class="tnpc-edit-box-content-icons">
127
 
128
 
@@ -1377,19 +1379,19 @@
1377
  </div>
1378
  </div>
1379
  <div class="tnpc-edit-box-buttons">
1380
- <div class="tnpc-edit-box-buttons-cancel" style="margin-left:0px;">Cancel</div>
1381
  </div>
1382
  </div>
1383
  </div>
1384
 
1385
  <div class="tnpc-edit" id="tnpc-edit-block">
1386
  <div class="tnpc-edit-box">
1387
- <div class="tnpc-edit-box-title">Edit Block</div>
1388
 
1389
  <div class="tnpc-edit-box-content">
1390
- <div class="tnpc-edit-box-content-text">Background Color</div>
1391
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input bgcolor"/></div>
1392
- <div class="tnpc-edit-box-content-text">Font Family</div>
1393
  <div class="tnpc-edit-box-content-field">
1394
  <select class="tnpc-edit-box-content-field-input font">
1395
  <optgroup label="Sans Serif Web Safe Fonts">
@@ -1412,20 +1414,20 @@
1412
  </div>
1413
  </div>
1414
  <div class="tnpc-edit-box-buttons">
1415
- <div class="tnpc-edit-box-buttons-save">Save</div>
1416
- <div class="tnpc-edit-box-buttons-cancel">Cancel</div>
1417
  </div>
1418
  </div>
1419
  </div>
1420
 
1421
  <div class="tnpc-edit" id="tnpc-edit-posts">
1422
  <div class="tnpc-edit-box">
1423
- <div class="tnpc-edit-box-title">Edit Block</div>
1424
 
1425
  <div class="tnpc-edit-box-content">
1426
- <div class="tnpc-edit-box-content-text">Background Color</div>
1427
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input bgcolor"/></div>
1428
- <div class="tnpc-edit-box-content-text">Font Family</div>
1429
  <div class="tnpc-edit-box-content-field">
1430
  <select class="tnpc-edit-box-content-field-input font">
1431
  <optgroup label="Sans Serif Web Safe Fonts">
@@ -1448,19 +1450,20 @@
1448
  </optgroup>
1449
  </select>
1450
  </div>
1451
- <div class="tnpc-edit-box-content-text">Number of Posts</div>
1452
  <div class="tnpc-edit-box-content-field"><input type="number" class="tnpc-edit-box-content-field-input number" value="3"/></div>
1453
- <div class="tnpc-edit-box-content-text">Categories</div>
1454
  <div class="tnpc-edit-box-content-field">
1455
  <!-- <input type="text" class="tnpc-edit-box-content-field-input categories"/>-->
1456
  <?php $controls->categories_group('theme_categories'); ?>
1457
  </div>
1458
- <div class="tnpc-edit-box-content-text">Tags (comma separated)</div>
1459
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input tags"/></div>
1460
  </div>
1461
  <div class="tnpc-edit-box-buttons">
1462
- <div class="tnpc-edit-box-buttons-save">Save</div>
1463
- <div class="tnpc-edit-box-buttons-cancel">Cancel</div>
 
1464
  </div>
1465
  </div>
1466
  </div>
1
  <div class="tnpc-edit" id="tnpc-edit-image">
2
  <div class="tnpc-edit-box">
3
+ <div class="tnpc-edit-box-title"><?php _e("Edit Image", "newsletter") ?></div>
4
  <div class="tnpc-edit-box-content">
5
+ <div class="tnpc-edit-box-content-text"><?php_e("SOURCE", "newsletter") ?> <span>(full image URL including http://)</span></div>
6
  <div class="tnpc-edit-box-content-field">
7
  <input type="text" class="tnpc-edit-box-content-field-input image"/>
8
  <input class="button select_image" value="Select or Upload Image" type="button">
9
  </div>
10
+ <div class="tnpc-edit-box-content-text"><?php_e("ALT TEXT", "newsletter") ?><span>(optional but recommended)</span></div>
11
+ <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input alt"/></div>
12
+ <div class="tnpc-edit-box-content-text"><?php_e("LINK", "newsletter") ?> <span>(optional link address including http://)</span></div>
13
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input url"/></div>
14
  </div>
15
  <div class="tnpc-edit-box-buttons">
16
+ <div class="tnpc-edit-box-buttons-save"><?php_e("Save", "newsletter") ?></div>
17
+ <div class="tnpc-edit-box-buttons-cancel"><?php_e("Cancel", "newsletter") ?></div>
18
  </div>
19
  </div>
20
  </div>
49
 
50
  <div class="tnpc-edit" id="tnpc-edit-link">
51
  <div class="tnpc-edit-box">
52
+ <div class="tnpc-edit-box-title"><?php_e("Edit Link", "newsletter") ?></div>
53
 
54
  <div class="tnpc-edit-box-content">
55
+ <div class="tnpc-edit-box-content-text"><?php_e("TITLE", "newsletter") ?> </div>
56
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input title"/></div>
57
+ <div class="tnpc-edit-box-content-text"><?php_e("URL", "newsletter") ?> <span>(full address including http://)</span></div>
58
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input url"/></div>
59
  </div>
60
  <div class="tnpc-edit-box-buttons">
61
+ <div class="tnpc-edit-box-buttons-save"><?php_e("Save", "newsletter") ?></div>
62
+ <div class="tnpc-edit-box-buttons-cancel"><?php_e("Cancel", "newsletter") ?></div>
63
  </div>
64
  </div>
65
  </div>
66
 
67
  <div class="tnpc-edit" id="tnpc-edit-button">
68
  <div class="tnpc-edit-box">
69
+ <div class="tnpc-edit-box-title"><?php_e("Edit Button", "newsletter") ?></div>
70
 
71
  <div class="tnpc-edit-box-content">
72
+ <div class="tnpc-edit-box-content-text"><?php_e("TITLE", "newsletter") ?> </div>
73
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input title"/></div>
74
+ <div class="tnpc-edit-box-content-text"><?php_e("URL", "newsletter") ?> <span>(full address including http://)</span></div>
75
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input url"/></div>
76
+ <div class="tnpc-edit-box-content-text"><?php_e("Text Color", "newsletter") ?></div>
77
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input fgcolor"/></div>
78
+ <div class="tnpc-edit-box-content-text"><?php_e("Background Color", "newsletter") ?></div>
79
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input bgcolor"/></div>
80
  </div>
81
  <div class="tnpc-edit-box-buttons">
82
+ <div class="tnpc-edit-box-buttons-save"><?php_e("Save", "newsletter") ?></div>
83
+ <div class="tnpc-edit-box-buttons-cancel"><?php_e("Cancel", "newsletter") ?></div>
84
  </div>
85
  </div>
86
  </div>
87
 
88
  <div class="tnpc-edit" id="tnpc-edit-title">
89
  <div class="tnpc-edit-box">
90
+ <div class="tnpc-edit-box-title"><?php_e("Edit Title", "newsletter") ?></div>
91
 
92
  <div class="tnpc-edit-box-content">
93
+ <div class="tnpc-edit-box-content-text"><?php_e("Title", "newsletter") ?></div>
94
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input title"/></div>
95
+ <div class="tnpc-edit-box-content-text"><?php_e("Text Color", "newsletter") ?></div>
96
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input color"/></div>
97
  </div>
98
  <div class="tnpc-edit-box-buttons">
99
+ <div class="tnpc-edit-box-buttons-save"><?php_e("Save", "newsletter") ?></div>
100
+ <div class="tnpc-edit-box-buttons-cancel"><?php_e("Cancel", "newsletter") ?></div>
101
  </div>
102
  </div>
103
  </div>
105
 
106
  <div class="tnpc-edit" id="tnpc-edit-text">
107
  <div class="tnpc-edit-box">
108
+ <div class="tnpc-edit-box-title"><?php_e("Edit Text", "newsletter") ?></div>
109
 
110
  <div class="tnpc-edit-box-content">
111
+ <div class="tnpc-edit-box-content-text"><?php_e("Text", "newsletter") ?></div>
112
  <div class="tnpc-edit-box-content-field"><textarea class="tnpc-edit-box-content-field-textarea text"></textarea></div>
113
  </div>
114
  <div class="tnpc-edit-box-buttons">
115
+ <div class="tnpc-edit-box-buttons-save"><?php_e("Save", "newsletter") ?></div>
116
+ <div class="tnpc-edit-box-buttons-cancel"><?php_e("Cancel", "newsletter") ?></div>
117
  </div>
118
  </div>
119
  </div>
121
 
122
  <div class="tnpc-edit" id="tnpc-edit-icon">
123
  <div class="tnpc-edit-box">
124
+ <div class="tnpc-edit-box-title"><?php_e("Edit Icon", "newsletter") ?></div>
125
 
126
  <div class="tnpc-edit-box-content">
127
+ <div class="tnpc-edit-box-content-text"><?php_e("Select Icon", "newsletter") ?></div>
128
  <div class="tnpc-edit-box-content-icons">
129
 
130
 
1379
  </div>
1380
  </div>
1381
  <div class="tnpc-edit-box-buttons">
1382
+ <div class="tnpc-edit-box-buttons-cancel" style="margin-left:0px;"><?php_e("Cancel", "newsletter") ?></div>
1383
  </div>
1384
  </div>
1385
  </div>
1386
 
1387
  <div class="tnpc-edit" id="tnpc-edit-block">
1388
  <div class="tnpc-edit-box">
1389
+ <div class="tnpc-edit-box-title"><?php_e("Edit Block", "newsletter") ?></div>
1390
 
1391
  <div class="tnpc-edit-box-content">
1392
+ <div class="tnpc-edit-box-content-text"><?php_e("_Background Color", "newsletter") ?></div>
1393
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input bgcolor"/></div>
1394
+ <div class="tnpc-edit-box-content-text"><?php_e("Font Family", "newsletter") ?></div>
1395
  <div class="tnpc-edit-box-content-field">
1396
  <select class="tnpc-edit-box-content-field-input font">
1397
  <optgroup label="Sans Serif Web Safe Fonts">
1414
  </div>
1415
  </div>
1416
  <div class="tnpc-edit-box-buttons">
1417
+ <div class="tnpc-edit-box-buttons-save"><?php_e("Save", "newsletter") ?></div>
1418
+ <div class="tnpc-edit-box-buttons-cancel"><?php_e("Cancel", "newsletter") ?></div>
1419
  </div>
1420
  </div>
1421
  </div>
1422
 
1423
  <div class="tnpc-edit" id="tnpc-edit-posts">
1424
  <div class="tnpc-edit-box">
1425
+ <div class="tnpc-edit-box-title"><?php_e("Edit Block", "newsletter") ?></div>
1426
 
1427
  <div class="tnpc-edit-box-content">
1428
+ <div class="tnpc-edit-box-content-text"><?php_e("Background Color", "newsletter") ?></div>
1429
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input bgcolor"/></div>
1430
+ <div class="tnpc-edit-box-content-text"><?php_e("Font Family", "newsletter") ?></div>
1431
  <div class="tnpc-edit-box-content-field">
1432
  <select class="tnpc-edit-box-content-field-input font">
1433
  <optgroup label="Sans Serif Web Safe Fonts">
1450
  </optgroup>
1451
  </select>
1452
  </div>
1453
+ <div class="tnpc-edit-box-content-text"><?php_e("Number of posts", "newsletter") ?></div>
1454
  <div class="tnpc-edit-box-content-field"><input type="number" class="tnpc-edit-box-content-field-input number" value="3"/></div>
1455
+ <div class="tnpc-edit-box-content-text"><?php_e("Categories", "newsletter") ?></div>
1456
  <div class="tnpc-edit-box-content-field">
1457
  <!-- <input type="text" class="tnpc-edit-box-content-field-input categories"/>-->
1458
  <?php $controls->categories_group('theme_categories'); ?>
1459
  </div>
1460
+ <div class="tnpc-edit-box-content-text"><?php_e("Tags (comma separated)", "newsletter") ?></div>
1461
  <div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input tags"/></div>
1462
  </div>
1463
  <div class="tnpc-edit-box-buttons">
1464
+ <?php _e("Any prior changes to single posts will be lost when editing these settings.", "newsletter") ?>
1465
+ <div class="tnpc-edit-box-buttons-save"><?php_e("Save", "newsletter") ?></div>
1466
+ <div class="tnpc-edit-box-buttons-cancel"><?php_e("Cancel", "newsletter") ?></div>
1467
  </div>
1468
  </div>
1469
  </div>
includes/logger.php CHANGED
@@ -1,77 +1,79 @@
1
- <?php
2
-
3
- if (!defined('NEWSLETTER_LOG_DIR')) {
4
- define('NEWSLETTER_LOG_DIR', WP_CONTENT_DIR . '/logs/newsletter/');
5
- }
6
-
7
- class NewsletterLogger {
8
-
9
- const NONE = 0;
10
- const FATAL = 1;
11
- const ERROR = 2;
12
- const INFO = 3;
13
- const DEBUG = 4;
14
-
15
- var $level;
16
- var $module;
17
- var $file;
18
-
19
- function __construct($module) {
20
- $this->module = $module;
21
- if (defined('NEWSLETTER_LOG_LEVEL')) $this->level = NEWSLETTER_LOG_LEVEL;
22
- else $this->level = get_option('newsletter_log_level', self::ERROR);
23
-
24
- $secret = get_option('newsletter_logger_secret');
25
- if (strlen($secret) < 8) {
26
- $secret = NewsletterModule::get_token(8);
27
- update_option('newsletter_logger_secret', $secret);
28
- }
29
-
30
- if (!wp_mkdir_p(NEWSLETTER_LOG_DIR)) {
31
- $this->level = self::NONE;
32
- }
33
-
34
- $this->file = NEWSLETTER_LOG_DIR . '/' . $module . '-' . $secret . '.txt';
35
- }
36
-
37
- function log($text, $level = self::ERROR) {
38
-
39
- if ($this->level < $level) return;
40
-
41
- $time = date('d-m-Y H:i:s ');
42
- switch ($level) {
43
- case self::FATAL: $time .= '- FATAL';
44
- break;
45
- case self::ERROR: $time .= '- ERROR';
46
- break;
47
- case self::INFO: $time .= '- INFO ';
48
- break;
49
- case self::DEBUG: $time .= '- DEBUG';
50
- break;
51
- }
52
- if (is_array($text) || is_object($text)) $text = print_r($text, true);
53
-
54
- // The "logs" dir is created on Newsletter constructor.
55
- $res = @file_put_contents($this->file, $time . ' - ' . size_format(memory_get_usage(), 1) . ' - ' . $text . "\n", FILE_APPEND | FILE_TEXT);
56
- if ($res === false) {
57
- $this->level = self::NONE;
58
- }
59
- }
60
-
61
- function error($text) {
62
- self::log($text, self::ERROR);
63
- }
64
-
65
- function info($text) {
66
- $this->log($text, self::INFO);
67
- }
68
-
69
- function fatal($text) {
70
- $this->log($text, self::FATAL);
71
- }
72
-
73
- function debug($text) {
74
- $this->log($text, self::DEBUG);
75
- }
76
-
77
- }
 
 
1
+ <?php
2
+
3
+ if (!defined('NEWSLETTER_LOG_DIR')) {
4
+ define('NEWSLETTER_LOG_DIR', WP_CONTENT_DIR . '/logs/newsletter/');
5
+ }
6
+
7
+ class NewsletterLogger {
8
+
9
+ const NONE = 0;
10
+ const FATAL = 1;
11
+ const ERROR = 2;
12
+ const INFO = 3;
13
+ const DEBUG = 4;
14
+
15
+ var $level;
16
+ var $module;
17
+ var $file;
18
+
19
+ function __construct($module) {
20
+ $this->module = $module;
21
+ if (defined('NEWSLETTER_LOG_LEVEL')) $this->level = NEWSLETTER_LOG_LEVEL;
22
+ else $this->level = get_option('newsletter_log_level', self::ERROR);
23
+
24
+ $secret = get_option('newsletter_logger_secret');
25
+ if (strlen($secret) < 8) {
26
+ $secret = NewsletterModule::get_token(8);
27
+ update_option('newsletter_logger_secret', $secret);
28
+ }
29
+
30
+ if (!wp_mkdir_p(NEWSLETTER_LOG_DIR)) {
31
+ $this->level = self::NONE;
32
+ }
33
+
34
+ $this->file = NEWSLETTER_LOG_DIR . '/' . $module . '-' . $secret . '.txt';
35
+ }
36
+
37
+ function log($text, $level = self::ERROR) {
38
+
39
+ if ($this->level < $level) return;
40
+
41
+ $time = date('d-m-Y H:i:s ');
42
+ switch ($level) {
43
+ case self::FATAL: $time .= '- FATAL';
44
+ break;
45
+ case self::ERROR: $time .= '- ERROR';
46
+ break;
47
+ case self::INFO: $time .= '- INFO ';
48
+ break;
49
+ case self::DEBUG: $time .= '- DEBUG';
50
+ break;
51
+ }
52
+ if (is_array($text) || is_object($text)) $text = print_r($text, true);
53
+
54
+ // The "logs" dir is created on Newsletter constructor.
55
+ $current_user_id = 0;
56
+ if (function_exists('get_current_user_id')) $current_user_id = get_current_user_id();
57
+ $res = @file_put_contents($this->file, $time . ' - m: ' . size_format(memory_get_usage(), 1) . ', u: ' . $current_user_id . ' - ' . $text . "\n", FILE_APPEND | FILE_TEXT);
58
+ if ($res === false) {
59
+ $this->level = self::NONE;
60
+ }
61
+ }
62
+
63
+ function error($text) {
64
+ self::log($text, self::ERROR);
65
+ }
66
+
67
+ function info($text) {
68
+ $this->log($text, self::INFO);
69
+ }
70
+
71
+ function fatal($text) {
72
+ $this->log($text, self::FATAL);
73
+ }
74
+
75
+ function debug($text) {
76
+ $this->log($text, self::DEBUG);
77
+ }
78
+
79
+ }
main/diagnostic.php CHANGED
@@ -234,14 +234,8 @@ if (count($calls) > 1) {
234
  <code>wp-content/logs/newsletter</code>.
235
  </p>
236
 
237
- <table class="widefat">
238
- <thead>
239
- <tr>
240
- <th>Name</th>
241
- <th>Active since</th>
242
- </tr>
243
- </thead>
244
-
245
  <tbody>
246
  <tr>
247
  <td>
@@ -256,6 +250,8 @@ if (count($calls) > 1) {
256
  Log folder
257
  </td>
258
  <td>
 
 
259
  <?php
260
  if (!is_dir(NEWSLETTER_LOG_DIR)) {
261
  echo '<span class="newsletter-error-span">The log folder does not exists, no logging possible!</span>';
@@ -265,6 +261,14 @@ if (count($calls) > 1) {
265
  ?>
266
  </td>
267
  </tr>
 
 
 
 
 
 
 
 
268
  </tbody>
269
  </table>
270
 
234
  <code>wp-content/logs/newsletter</code>.
235
  </p>
236
 
237
+ <table class="form-table">
238
+
 
 
 
 
 
 
239
  <tbody>
240
  <tr>
241
  <td>
250
  Log folder
251
  </td>
252
  <td>
253
+ <code><?php echo NEWSLETTER_LOG_DIR?></code>
254
+ <br>
255
  <?php
256
  if (!is_dir(NEWSLETTER_LOG_DIR)) {
257
  echo '<span class="newsletter-error-span">The log folder does not exists, no logging possible!</span>';
261
  ?>
262
  </td>
263
  </tr>
264
+ <tr>
265
+ <td>
266
+ Log secret
267
+ </td>
268
+ <td>
269
+ <code><?php echo get_option("newsletter_logger_secret")?></code>
270
+ </td>
271
+ </tr>
272
  </tbody>
273
  </table>
274
 
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.5.7
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.5.7');
18
 
19
  global $wpdb, $newsletter;
20
 
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.5.8
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.5.8');
18
 
19
  global $wpdb, $newsletter;
20
 
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing,automation,automated
3
  Requires at least: 3.4.0
4
  Tested up to: 4.5.3
5
- Stable tag: 4.5.7
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,14 @@ Thank you, The Newsletter Team
77
 
78
  == Changelog ==
79
 
 
 
 
 
 
 
 
 
80
  = 4.5.7 =
81
 
82
  * Fixed the total sent email in dashboard
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.5.3
5
+ Stable tag: 4.5.8
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.5.8 =
81
+
82
+ * Edit image alt text in the composer
83
+ * Fixed german characters problem on visual composer
84
+ * Added new data to diagnostic panel
85
+ * Change the export to be more compatible with specific blog installations
86
+ * Added translations to export panel
87
+
88
  = 4.5.7 =
89
 
90
  * Fixed the total sent email in dashboard
subscription/subscription.php CHANGED
@@ -1583,8 +1583,9 @@ class NewsletterSubscription extends NewsletterModule {
1583
 
1584
  function notify_admin($user, $subject) {
1585
 
1586
- if ($this->options['notify'] != 1)
1587
  return;
 
1588
 
1589
  $message = "Subscriber details:\n\n" .
1590
  "email: " . $user->email . "\n" .
@@ -1593,29 +1594,33 @@ class NewsletterSubscription extends NewsletterModule {
1593
  "gender: " . $user->sex . "\n";
1594
 
1595
  $options_profile = get_option('newsletter_profile');
 
 
 
 
 
 
 
 
1596
 
1597
  for ($i = 0; $i < NEWSLETTER_PROFILE_MAX; $i++) {
1598
- if ($options_profile['profile_' . $i] == '')
1599
  continue;
 
1600
  $field = 'profile_' . $i;
1601
  $message .= $options_profile['profile_' . $i] . ': ' . $user->$field . "\n";
1602
  }
1603
 
1604
- for ($i = 0; $i < NEWSLETTER_LIST_MAX; $i++) {
1605
- if ($options_profile['list_' . $i] == '')
1606
- continue;
1607
- $field = 'list_' . $i;
1608
- $message .= $options_profile['list_' . $i] . ': ' . $user->$field . "\n";
1609
- }
1610
 
1611
  $message .= "token: " . $user->token . "\n" .
1612
  "status: " . $user->status . "\n";
1613
  $email = trim($this->options['notify_email']);
1614
- if (empty($email))
1615
  $email = get_option('admin_email');
 
1616
  $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
1617
  Newsletter::instance()->mail($email, '[' . $blogname . '] ' . $subject, array('text'=>$message));
1618
- //wp_mail($email, '[' . $blogname . '] ' . $subject, array('text'=>$message));
1619
  }
1620
 
1621
  }
1583
 
1584
  function notify_admin($user, $subject) {
1585
 
1586
+ if ($this->options['notify'] != 1) {
1587
  return;
1588
+ }
1589
 
1590
  $message = "Subscriber details:\n\n" .
1591
  "email: " . $user->email . "\n" .
1594
  "gender: " . $user->sex . "\n";
1595
 
1596
  $options_profile = get_option('newsletter_profile');
1597
+
1598
+ for ($i = 0; $i < NEWSLETTER_LIST_MAX; $i++) {
1599
+ if (empty($options_profile['list_' . $i])) {
1600
+ continue;
1601
+ }
1602
+ $field = 'list_' . $i;
1603
+ $message .= $options_profile['list_' . $i] . ': ' . (empty($user->$field)?"NO":"YES") . "\n";
1604
+ }
1605
 
1606
  for ($i = 0; $i < NEWSLETTER_PROFILE_MAX; $i++) {
1607
+ if (empty($options_profile['profile_' . $i])) {
1608
  continue;
1609
+ }
1610
  $field = 'profile_' . $i;
1611
  $message .= $options_profile['profile_' . $i] . ': ' . $user->$field . "\n";
1612
  }
1613
 
1614
+
 
 
 
 
 
1615
 
1616
  $message .= "token: " . $user->token . "\n" .
1617
  "status: " . $user->status . "\n";
1618
  $email = trim($this->options['notify_email']);
1619
+ if (empty($email)) {
1620
  $email = get_option('admin_email');
1621
+ }
1622
  $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
1623
  Newsletter::instance()->mail($email, '[' . $blogname . '] ' . $subject, array('text'=>$message));
 
1624
  }
1625
 
1626
  }
users/export.php CHANGED
@@ -7,53 +7,53 @@ $module = NewsletterUsers::instance();
7
 
8
  $lists = array('0' => 'All');
9
  for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
10
- if (!isset($options_profile['list_' . $i]))
11
  $options_profile['list_' . $i] = '';
 
12
  $lists['' . $i] = '(' . $i . ') ' . $options_profile['list_' . $i];
13
  }
14
  ?>
15
 
16
  <div class="wrap" id="tnp-wrap">
17
-
18
  <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
19
 
20
  <div id="tnp-heading">
21
-
22
  <h2><?php _e('Export', 'newsletter') ?></h2>
23
  <p>
24
- The import and export functions <strong>ARE NOT for backup</strong>.
25
- If you want to backup you should consider to backup the
26
- wp_newsletter* tables.
27
  </p>
28
 
29
  </div>
30
- <div id="tnp-body">
31
-
32
- <form method="post" action="<?php echo plugins_url('newsletter'); ?>/users/csv.php">
33
- <?php $controls->init(); ?>
34
- <table class="form-table">
35
- <tr>
36
- <th>Fields separator</th>
37
- <td>
38
- <?php $controls->select('separator', array(';' => 'Semicolon', ',' => 'Comma', 'tab' => 'Tabulation')); ?>
39
- <p class="description">Try to change the separator if Excel does not recognize the columns.</p>
40
- </td>
41
- </tr>
42
- <tr>
43
- <th>Limit to</th>
44
- <td>
45
- <?php $controls->select('list', $lists); ?>
46
- <p class="description">Limit to the user with that preference active</p>
47
- </td>
48
- </tr>
49
- </table>
50
- <p>
51
- <?php $controls->button('export', 'Export'); ?>
52
- </p>
53
- </form>
 
 
54
 
55
- </div>
56
-
57
  <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
58
-
59
  </div>
7
 
8
  $lists = array('0' => 'All');
9
  for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
10
+ if (!isset($options_profile['list_' . $i])) {
11
  $options_profile['list_' . $i] = '';
12
+ }
13
  $lists['' . $i] = '(' . $i . ') ' . $options_profile['list_' . $i];
14
  }
15
  ?>
16
 
17
  <div class="wrap" id="tnp-wrap">
18
+
19
  <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
20
 
21
  <div id="tnp-heading">
22
+
23
  <h2><?php _e('Export', 'newsletter') ?></h2>
24
  <p>
25
+ The import and export functions <strong>ARE NOT</strong> for backup.
26
+ If you want to backup you should consider to backup the <code><?php echo $wpdb->prefix ?>newsletter*</code> tables.
 
27
  </p>
28
 
29
  </div>
30
+ <div id="tnp-body">
31
+
32
+ <form method="post" action="<?php echo admin_url('admin-ajax.php') ?>?action=newsletter_users_export">
33
+ <?php $controls->init(); ?>
34
+ <table class="form-table">
35
+ <tr>
36
+ <th><?php _e('Field separator', 'newsletter') ?></th>
37
+
38
+ <td>
39
+ <?php $controls->select('separator', array(';' => 'Semicolon', ',' => 'Comma', 'tab' => 'Tabulation')); ?>
40
+ <p class="description">Try to change the separator if Excel does not recognize the columns.</p>
41
+ </td>
42
+ </tr>
43
+ <tr>
44
+ <th><?php _e('List', 'newsletter') ?></th>
45
+ <td>
46
+ <?php $controls->select('list', $lists); ?>
47
+ </td>
48
+ </tr>
49
+ </table>
50
+ <p>
51
+ <?php $controls->button('export', __('Export', 'newsletter')); ?>
52
+ </p>
53
+ </form>
54
+
55
+ </div>
56
 
 
 
57
  <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
58
+
59
  </div>
users/users.php CHANGED
@@ -17,7 +17,28 @@ class NewsletterUsers extends NewsletterModule {
17
  }
18
 
19
  function __construct() {
20
- parent::__construct('users', '1.0.5');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  }
22
 
23
  function upgrade() {
@@ -65,8 +86,8 @@ class NewsletterUsers extends NewsletterModule {
65
  // Old problems...
66
  $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " convert to character set utf8");
67
 
68
- $this->upgrade_query("update " . NEWSLETTER_USERS_TABLE . " set sex='n' where sex='' or sex=' '");
69
-
70
  if ($this->old_version < '1.0.5') {
71
  $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column unsub_email_id int not null default 0");
72
  $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column unsub_time int not null default 0");
@@ -91,7 +112,7 @@ class NewsletterUsers extends NewsletterModule {
91
 
92
  // BOM
93
  echo "\xEF\xBB\xBF";
94
-
95
  $sep = ';';
96
  if ($options) {
97
  $sep = $options['separator'];
@@ -99,7 +120,7 @@ class NewsletterUsers extends NewsletterModule {
99
  if ($sep == 'tab') {
100
  $sep = "\t";
101
  }
102
-
103
  // CSV header
104
  echo '"Email"' . $sep . '"Name"' . $sep . '"Surname"' . $sep . '"Sex"' . $sep . '"Status"' . $sep . '"Date"' . $sep . '"Token"' . $sep;
105
 
@@ -121,7 +142,7 @@ class NewsletterUsers extends NewsletterModule {
121
  $page = 0;
122
  while (true) {
123
  $query = "select * from " . NEWSLETTER_USERS_TABLE . "";
124
- $list = (int)$_POST['options']['list'];
125
  if (!empty($list)) {
126
  $query .= " where list_" . $list . "=1";
127
  }
17
  }
18
 
19
  function __construct() {
20
+ parent::__construct('users', '1.0.6');
21
+ add_action('init', array($this, 'hook_init'));
22
+ }
23
+
24
+ function hook_init() {
25
+ if (is_admin()) {
26
+ add_action('wp_ajax_newsletter_users_export', array($this, 'hook_wp_ajax_newsletter_users_export'));
27
+ }
28
+ }
29
+
30
+ function hook_wp_ajax_newsletter_users_export() {
31
+ require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
32
+ $controls = new NewsletterControls();
33
+ if (current_user_can('manage_options') || ($newsletter->options['editor'] == 1 && current_user_can('manage_categories'))) {
34
+ $controls = new NewsletterControls();
35
+
36
+ if ($controls->is_action('export')) {
37
+ NewsletterUsers::instance()->export($controls->data);
38
+ }
39
+ } else {
40
+ die('Not allowed.');
41
+ }
42
  }
43
 
44
  function upgrade() {
86
  // Old problems...
87
  $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " convert to character set utf8");
88
 
89
+ $this->upgrade_query("update " . NEWSLETTER_USERS_TABLE . " set sex='n' where sex='' or sex=' '");
90
+
91
  if ($this->old_version < '1.0.5') {
92
  $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column unsub_email_id int not null default 0");
93
  $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column unsub_time int not null default 0");
112
 
113
  // BOM
114
  echo "\xEF\xBB\xBF";
115
+
116
  $sep = ';';
117
  if ($options) {
118
  $sep = $options['separator'];
120
  if ($sep == 'tab') {
121
  $sep = "\t";
122
  }
123
+
124
  // CSV header
125
  echo '"Email"' . $sep . '"Name"' . $sep . '"Surname"' . $sep . '"Sex"' . $sep . '"Status"' . $sep . '"Date"' . $sep . '"Token"' . $sep;
126
 
142
  $page = 0;
143
  while (true) {
144
  $query = "select * from " . NEWSLETTER_USERS_TABLE . "";
145
+ $list = (int) $_POST['options']['list'];
146
  if (!empty($list)) {
147
  $query .= " where list_" . $list . "=1";
148
  }