Newsletter - Version 6.9.9

Version Description

  • Not specified gender fix
  • Labels translation
  • Added "newsletter_message" filter to act on the whole message before sending
  • Removed X-Mailer when sending with the internal SMTP
  • Added referrer field on subscriber editing page
  • Fixed button label control on composer
Download this release

Release Info

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

Code changes from version 6.9.8 to 6.9.9

includes/fields.php CHANGED
@@ -2,8 +2,6 @@
2
 
3
  class NewsletterFields {
4
 
5
- static $field_open = '<div>';
6
- static $field_close = '</div>';
7
  /* @var NewsletterControls */
8
  var $controls;
9
 
@@ -23,6 +21,7 @@ class NewsletterFields {
23
  if (empty($text)) {
24
  return;
25
  }
 
26
  echo '<label class="tnp-label">', $text, '</label>';
27
  }
28
 
@@ -68,6 +67,7 @@ class NewsletterFields {
68
  * @param string $title
69
  */
70
  public function section($title = '') {
 
71
  echo '<h3 class="tnp-section">', $title, '</h3>';
72
  }
73
 
@@ -199,6 +199,15 @@ class NewsletterFields {
199
  $this->_close();
200
  }
201
 
 
 
 
 
 
 
 
 
 
202
  public function select($name, $label = '', $options = [], $attrs = []) {
203
  $attrs = $this->_merge_attrs($attrs, ['reload' => false, 'after-rendering' => '']);
204
  $this->_open();
@@ -213,20 +222,19 @@ class NewsletterFields {
213
  echo ' data-after-rendering="', $attrs['after-rendering'], '"';
214
  }
215
  echo '>';
216
- if (!empty($first)) {
217
- echo '<option value="">', esc_html($first), '</option>';
218
- }
219
- $label = esc_html($label);
220
- foreach ($options as $key => $label) {
221
  echo '<option value="', esc_attr($key), '"';
222
  if ($value == $key) {
223
  echo ' selected';
224
  }
225
- echo '>', $label, '</option>';
226
  }
227
  echo '</select>';
228
 
229
- //$this->controls->select($name, $options);
230
  $this->_description($attrs);
231
  $this->_close();
232
  }
@@ -249,9 +257,14 @@ class NewsletterFields {
249
  $this->_close();
250
  }
251
 
252
- /** General field to collect a dimension */
 
 
 
 
 
253
  public function size($name, $label = '', $attrs = []) {
254
- $attrs = $this->_merge_attrs($attrs, [array('description' => '', 'placeholder' => '', 'size' => 0, 'label_after' => 'px')]);
255
  $this->_open('tnp-size');
256
  $this->_label($label);
257
  $value = $this->controls->get_value($name);
@@ -264,7 +277,9 @@ class NewsletterFields {
264
  $this->_close();
265
  }
266
 
267
- /** Collects a color in HEX format with a picker. */
 
 
268
  public function color($name, $label, $attrs = []) {
269
  $this->_open('tnp-color');
270
  $this->_label($label);
@@ -273,7 +288,14 @@ class NewsletterFields {
273
  $this->_close();
274
  }
275
 
276
- /** Configuration for a simple button with label and color */
 
 
 
 
 
 
 
277
  public function button($name, $label = '', $attrs = []) {
278
  $attrs = $this->_merge_attrs($attrs, ['placeholder' => 'Label...', 'url_placeholder' => 'https://...', 'url' => true, 'weight' => true]);
279
  $this->_open('tnp-button');
@@ -282,7 +304,7 @@ class NewsletterFields {
282
  $name_esc = esc_attr($name);
283
  echo '<div class="tnp-field-row">';
284
  echo '<div class="tnp-field-col-2">';
285
- echo '<input id="', $this->_id($name), '" placeholder="', esc_attr($attrs['placeholder']), '" name="', $name_esc, '_label]" type="text"';
286
  echo ' style="width: 100%"';
287
  echo ' value="', esc_attr($value), '">';
288
  echo '</div>';
@@ -296,14 +318,21 @@ class NewsletterFields {
296
  }
297
  echo '<div style="clear: both"></div>';
298
  echo '</div>';
299
- $this->controls->css_font($name . '_font', array('weight' => $attrs['weight']));
300
  $this->controls->color($name . '_background');
301
  $this->_close();
302
  }
303
 
 
 
 
 
 
 
 
304
  public function url($name, $label = '', $attrs = []) {
305
- $attrs = array_merge(array('description' => '', 'placeholder' => 'https://...'), $attrs);
306
- $this->_open();
307
  $this->_label($label);
308
  $this->controls->text_url($name);
309
  $this->_description($attrs);
@@ -322,7 +351,7 @@ class NewsletterFields {
322
  $post_types = get_post_types(['public' => true], 'objects', 'and');
323
 
324
  $attrs = array_merge(['description' => ''], $attrs);
325
- $this->_open();
326
  $this->_label($label);
327
 
328
  $options = ['post' => 'Standard post'];
@@ -335,9 +364,9 @@ class NewsletterFields {
335
  $value = $this->controls->get_value($name);
336
 
337
  echo '<select id="', $this->_id($name), '" name="options[' . esc_attr($name) . ']" onchange="tnpc_reload_options(event); return false;">';
338
- if (!empty($first)) {
339
- echo '<option value="">' . esc_html($first) . '</option>';
340
- }
341
  $label = esc_html($label);
342
  foreach ($options as $key => $label) {
343
  echo '<option value="' . esc_attr($key) . '"';
@@ -399,14 +428,17 @@ class NewsletterFields {
399
  /**
400
  * Media selector using the WP media library (for images and files.
401
  * The field to use it the {$name}_id which contains the media id.
 
 
 
402
  *
403
- * @param type $name
404
- * @param type $label
405
- * @param type $attrs
406
  */
407
  public function media($name, $label = '', $attrs = []) {
408
- $attrs = $this->_merge_attrs($attrs, array('alt' => false));
409
- $this->_open();
410
  $this->_label($label);
411
  $this->controls->media($name);
412
  if ($attrs['alt']) {
@@ -417,8 +449,9 @@ class NewsletterFields {
417
  }
418
 
419
  public function categories($name = 'categories', $label = '', $attrs = []) {
420
- if (empty($label))
421
  $label = __('Categories', 'newsletter');
 
422
  $attrs = $this->_merge_attrs($attrs);
423
  $this->_open('tnp-categories');
424
  $this->_label($label);
2
 
3
  class NewsletterFields {
4
 
 
 
5
  /* @var NewsletterControls */
6
  var $controls;
7
 
21
  if (empty($text)) {
22
  return;
23
  }
24
+ // Do not escape, HTML allowed
25
  echo '<label class="tnp-label">', $text, '</label>';
26
  }
27
 
67
  * @param string $title
68
  */
69
  public function section($title = '') {
70
+ // Do not escape, HTML allowed
71
  echo '<h3 class="tnp-section">', $title, '</h3>';
72
  }
73
 
199
  $this->_close();
200
  }
201
 
202
+ /**
203
+ * Attributes:
204
+ * - realod: when true is forces a submit of the form (used to change the form fields or values for example when changing layout or color scheme)
205
+ *
206
+ * @param type $name
207
+ * @param type $label
208
+ * @param type $options
209
+ * @param type $attrs
210
+ */
211
  public function select($name, $label = '', $options = [], $attrs = []) {
212
  $attrs = $this->_merge_attrs($attrs, ['reload' => false, 'after-rendering' => '']);
213
  $this->_open();
222
  echo ' data-after-rendering="', $attrs['after-rendering'], '"';
223
  }
224
  echo '>';
225
+ // if (!empty($first)) {
226
+ // echo '<option value="">', esc_html($first), '</option>';
227
+ // }
228
+
229
+ foreach ($options as $key => $text) {
230
  echo '<option value="', esc_attr($key), '"';
231
  if ($value == $key) {
232
  echo ' selected';
233
  }
234
+ echo '>', esc_html($text), '</option>';
235
  }
236
  echo '</select>';
237
 
 
238
  $this->_description($attrs);
239
  $this->_close();
240
  }
257
  $this->_close();
258
  }
259
 
260
+ /**
261
+ * General field to collect an element dimension in pixels
262
+ *
263
+ * Attributes:
264
+ * - size: field width in pixels
265
+ */
266
  public function size($name, $label = '', $attrs = []) {
267
+ $attrs = $this->_merge_attrs($attrs, ['description' => '', 'placeholder' => '', 'size' => 0, 'label_after' => 'px']);
268
  $this->_open('tnp-size');
269
  $this->_label($label);
270
  $value = $this->controls->get_value($name);
277
  $this->_close();
278
  }
279
 
280
+ /**
281
+ * Collects a color in HEX format with a picker.
282
+ */
283
  public function color($name, $label, $attrs = []) {
284
  $this->_open('tnp-color');
285
  $this->_label($label);
288
  $this->_close();
289
  }
290
 
291
+ /**
292
+ * Configuration for a simple button with label and color
293
+ *
294
+ * Attributes:
295
+ * - weight: if true (default) shows the font weight selector
296
+ * - url_paceholder: the placeholder for the URL field
297
+ * - url: if true (default) shows the URL field (sometime the URL is produced elsewhere, for example on post list)
298
+ */
299
  public function button($name, $label = '', $attrs = []) {
300
  $attrs = $this->_merge_attrs($attrs, ['placeholder' => 'Label...', 'url_placeholder' => 'https://...', 'url' => true, 'weight' => true]);
301
  $this->_open('tnp-button');
304
  $name_esc = esc_attr($name);
305
  echo '<div class="tnp-field-row">';
306
  echo '<div class="tnp-field-col-2">';
307
+ echo '<input id="', $this->_id($name . '_label'), '" placeholder="', esc_attr($attrs['placeholder']), '" name="options[', $name_esc, '_label]" type="text"';
308
  echo ' style="width: 100%"';
309
  echo ' value="', esc_attr($value), '">';
310
  echo '</div>';
318
  }
319
  echo '<div style="clear: both"></div>';
320
  echo '</div>';
321
+ $this->controls->css_font($name . '_font', ['weight' => $attrs['weight']]);
322
  $this->controls->color($name . '_background');
323
  $this->_close();
324
  }
325
 
326
+ /**
327
+ * URL input field
328
+ *
329
+ * @param string $name
330
+ * @param string $label
331
+ * @param array $attrs
332
+ */
333
  public function url($name, $label = '', $attrs = []) {
334
+ $attrs = $this->_merge_attrs($attrs, ['placeholder' => 'https://...']);
335
+ $this->_open('tnp-url');
336
  $this->_label($label);
337
  $this->controls->text_url($name);
338
  $this->_description($attrs);
351
  $post_types = get_post_types(['public' => true], 'objects', 'and');
352
 
353
  $attrs = array_merge(['description' => ''], $attrs);
354
+ $this->_open('tnp-post-type');
355
  $this->_label($label);
356
 
357
  $options = ['post' => 'Standard post'];
364
  $value = $this->controls->get_value($name);
365
 
366
  echo '<select id="', $this->_id($name), '" name="options[' . esc_attr($name) . ']" onchange="tnpc_reload_options(event); return false;">';
367
+ // if (!empty($first)) {
368
+ // echo '<option value="">' . esc_html($first) . '</option>';
369
+ // }
370
  $label = esc_html($label);
371
  foreach ($options as $key => $label) {
372
  echo '<option value="' . esc_attr($key) . '"';
428
  /**
429
  * Media selector using the WP media library (for images and files.
430
  * The field to use it the {$name}_id which contains the media id.
431
+ *
432
+ * Attributes:
433
+ * - alt: if true shows the alternate text field for the "alt" attribute
434
  *
435
+ * @param string $name
436
+ * @param string $label
437
+ * @param array $attrs
438
  */
439
  public function media($name, $label = '', $attrs = []) {
440
+ $attrs = $this->_merge_attrs($attrs, ['alt' => false]);
441
+ $this->_open('tnp-media');
442
  $this->_label($label);
443
  $this->controls->media($name);
444
  if ($attrs['alt']) {
449
  }
450
 
451
  public function categories($name = 'categories', $label = '', $attrs = []) {
452
+ if (empty($label)) {
453
  $label = __('Categories', 'newsletter');
454
+ }
455
  $attrs = $this->_merge_attrs($attrs);
456
  $this->_open('tnp-categories');
457
  $this->_label($label);
includes/mailer.php CHANGED
@@ -217,7 +217,6 @@ class TNP_Mailer_Message {
217
 
218
  }
219
 
220
-
221
  /**
222
  * Wrapper mailer for old addons registering the "mail" method (ultra deprecated).
223
  */
@@ -327,16 +326,16 @@ class NewsletterDefaultMailer extends NewsletterMailer {
327
  if (is_null($this->current_message)) {
328
  return;
329
  }
330
-
331
  $newsletter = Newsletter::instance();
332
  if (isset($this->current_message->encoding)) {
333
  $mailer->Encoding = $this->current_message->encoding;
334
  } else {
335
- if (!empty($newsletter->options['content_transfer_encoding'])) {
336
- $mailer->Encoding = $newsletter->options['content_transfer_encoding'];
337
- } else {
338
- $mailer->Encoding = 'base64';
339
- }
340
  }
341
 
342
  /* @var $mailer PHPMailer */
@@ -491,8 +490,10 @@ class NewsletterDefaultSMTPMailer extends NewsletterMailer {
491
  $logger = $this->get_logger();
492
  $logger->debug('Setting up PHP mailer');
493
 
494
- require_once 'PHPMailerLoader.php';
495
- $this->mailer = PHPMailerLoader::make_instance();
 
 
496
 
497
  $this->mailer->IsSMTP();
498
  $this->mailer->Host = $this->options['host'];
@@ -544,5 +545,3 @@ class NewsletterDefaultSMTPMailer extends NewsletterMailer {
544
  }
545
 
546
  }
547
-
548
-
217
 
218
  }
219
 
 
220
  /**
221
  * Wrapper mailer for old addons registering the "mail" method (ultra deprecated).
222
  */
326
  if (is_null($this->current_message)) {
327
  return;
328
  }
329
+
330
  $newsletter = Newsletter::instance();
331
  if (isset($this->current_message->encoding)) {
332
  $mailer->Encoding = $this->current_message->encoding;
333
  } else {
334
+ if (!empty($newsletter->options['content_transfer_encoding'])) {
335
+ $mailer->Encoding = $newsletter->options['content_transfer_encoding'];
336
+ } else {
337
+ $mailer->Encoding = 'base64';
338
+ }
339
  }
340
 
341
  /* @var $mailer PHPMailer */
490
  $logger = $this->get_logger();
491
  $logger->debug('Setting up PHP mailer');
492
 
493
+ require_once 'PHPMailerLoader.php';
494
+ $this->mailer = PHPMailerLoader::make_instance();
495
+
496
+ $this->mailer->XMailer = ' '; // A space!
497
 
498
  $this->mailer->IsSMTP();
499
  $this->mailer->Host = $this->options['host'];
545
  }
546
 
547
  }
 
 
plugin.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Newsletter
5
  Plugin URI: https://www.thenewsletterplugin.com/plugins/newsletter
6
  Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="https://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
7
- Version: 6.9.8
8
  Author: Stefano Lissa & The Newsletter Team
9
  Author URI: https://www.thenewsletterplugin.com
10
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
@@ -35,7 +35,7 @@ if (version_compare(phpversion(), '5.6', '<')) {
35
  return;
36
  }
37
 
38
- define('NEWSLETTER_VERSION', '6.9.8');
39
 
40
  global $newsletter, $wpdb;
41
 
@@ -846,7 +846,7 @@ class Newsletter extends NewsletterModule {
846
  $message->email_id = $email->id;
847
  $message->user_id = $user->id;
848
 
849
- return $message;
850
  }
851
 
852
  /**
4
  Plugin Name: Newsletter
5
  Plugin URI: https://www.thenewsletterplugin.com/plugins/newsletter
6
  Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="https://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
7
+ Version: 6.9.9
8
  Author: Stefano Lissa & The Newsletter Team
9
  Author URI: https://www.thenewsletterplugin.com
10
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
35
  return;
36
  }
37
 
38
+ define('NEWSLETTER_VERSION', '6.9.9');
39
 
40
  global $newsletter, $wpdb;
41
 
846
  $message->email_id = $email->id;
847
  $message->user_id = $user->id;
848
 
849
+ return apply_filters('newsletter_message', $message, $email, $user);
850
  }
851
 
852
  /**
profile/profile.php CHANGED
@@ -242,10 +242,17 @@ class NewsletterProfile extends NewsletterModule {
242
  if ($options['sex_status'] >= 1) {
243
  $buffer .= '<div class="tnp-field tnp-field-gender">';
244
  $buffer .= '<label>' . esc_html($options['sex']) . '</label>';
245
- $buffer .= '<select name="nx" class="tnp-gender">';
 
 
 
 
 
 
 
 
246
  $buffer .= '<option value="f"' . ($user->sex == 'f' ? ' selected' : '') . '>' . esc_html($options['sex_female']) . '</option>';
247
  $buffer .= '<option value="m"' . ($user->sex == 'm' ? ' selected' : '') . '>' . esc_html($options['sex_male']) . '</option>';
248
- $buffer .= '<option value="n"' . ($user->sex == 'n' ? ' selected' : '') . '>' . esc_html($options['sex_none']) . '</option>';
249
  $buffer .= '</select>';
250
  $buffer .= "</div>\n";
251
  }
242
  if ($options['sex_status'] >= 1) {
243
  $buffer .= '<div class="tnp-field tnp-field-gender">';
244
  $buffer .= '<label>' . esc_html($options['sex']) . '</label>';
245
+ $buffer .= '<select name="nx" class="tnp-gender"';
246
+ if ($options['sex_rules']) {
247
+ $buffer .= ' required ';
248
+ }
249
+ $buffer .= '>';
250
+ if ($options['sex_rules']) {
251
+ $buffer .= '<option value=""></option>';
252
+ }
253
+ $buffer .= '<option value="n"' . ($user->sex == 'n' ? ' selected' : '') . '>' . esc_html($options['sex_none']) . '</option>';
254
  $buffer .= '<option value="f"' . ($user->sex == 'f' ? ' selected' : '') . '>' . esc_html($options['sex_female']) . '</option>';
255
  $buffer .= '<option value="m"' . ($user->sex == 'm' ? ' selected' : '') . '>' . esc_html($options['sex_male']) . '</option>';
 
256
  $buffer .= '</select>';
257
  $buffer .= "</div>\n";
258
  }
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Tags: email, email marketing, newsletter, newsletter subscribers, welcome email, signup forms, contact, lead generation, popup, marketing automation
3
  Requires at least: 3.4.0
4
  Tested up to: 5.5.3
5
- Stable tag: 6.9.8
6
  Requires PHP: 5.6
7
  Contributors: satollo,webagile,michael-travan
8
  License: GPLv2 or later
@@ -53,14 +53,16 @@ Improve The Newsletter Plugin with these free addons:
53
  * [Archive](https://www.thenewsletterplugin.com/documentation/archive-extension) - creates a simple blog page which lists all your sent newsletters
54
  * [Locked Content](https://www.thenewsletterplugin.com/documentation/locked-content-extension) - open up your premium content only after subscription
55
  * [Newsletter REST API](https://www.thenewsletterplugin.com/documentation/developers/newsletter-api-2/) - adds a tier of REST api to integrate with the Newsletter core services
56
- * [BuddyPress integration](https://wordpress.org/plugins/newsletter-buddypress/) - subscription opt-in inside BuddyPress signup form
57
  * [Sendinblue integration](https://www.thenewsletterplugin.com/documentation/addons/delivery-addons/sendinblue-extension/) - deliver your newsletters with Sendinblue
58
- * [RSS Composer Block](https://wordpress.org/plugins/newsletter-rss-block/) - (3rd party) a composer block which builds its content form an RSS feed
59
- * [Popup Maker Integration](https://wordpress.org/plugins/newsletter-popupmaker/) - (3rd party) integration of Newsletter forms with Popup Maker plugin
60
 
 
61
 
 
62
 
63
- (*easily add them from our [Addons panel](https://www.thenewsletterplugin.com/documentation/install-extensions)*)
 
 
 
64
 
65
  = Professional Addons =
66
 
@@ -81,10 +83,6 @@ Need *more power*? Feel *something's missing*? The Newsletter Plugin features ca
81
  * [Subscribe on Comment](https://www.thenewsletterplugin.com/documentation/comments-extension) - adds the subscription option to your blog comment form
82
  * [Geolocation](https://www.thenewsletterplugin.com/documentation/geolocation-extension) - adds geolocation capability to target subscribers by location
83
 
84
- = (NEW!) Third Party Addons =
85
-
86
- * [WP User Manager addon for Newsletter](https://wordpress.org/plugins/wpum-newsletter/) - adds the subscription option on registration forms
87
-
88
  = GDPR =
89
 
90
  The Newsletter Plugin provides all the technical tools needed to achieve GDPR compliancy and we're continuously working to improve them and to give support even for specific use cases.
@@ -120,6 +118,15 @@ Thank you, The Newsletter Team
120
 
121
  == Changelog ==
122
 
 
 
 
 
 
 
 
 
 
123
  = 6.9.8 =
124
 
125
  * New color picker
2
  Tags: email, email marketing, newsletter, newsletter subscribers, welcome email, signup forms, contact, lead generation, popup, marketing automation
3
  Requires at least: 3.4.0
4
  Tested up to: 5.5.3
5
+ Stable tag: 6.9.9
6
  Requires PHP: 5.6
7
  Contributors: satollo,webagile,michael-travan
8
  License: GPLv2 or later
53
  * [Archive](https://www.thenewsletterplugin.com/documentation/archive-extension) - creates a simple blog page which lists all your sent newsletters
54
  * [Locked Content](https://www.thenewsletterplugin.com/documentation/locked-content-extension) - open up your premium content only after subscription
55
  * [Newsletter REST API](https://www.thenewsletterplugin.com/documentation/developers/newsletter-api-2/) - adds a tier of REST api to integrate with the Newsletter core services
 
56
  * [Sendinblue integration](https://www.thenewsletterplugin.com/documentation/addons/delivery-addons/sendinblue-extension/) - deliver your newsletters with Sendinblue
 
 
57
 
58
+ (*easily add them from our [Addons panel](https://www.thenewsletterplugin.com/documentation/install-extensions)*)
59
 
60
+ = Addons on WordPress.org =
61
 
62
+ * [RSS Composer Block](https://wordpress.org/plugins/newsletter-rss-block/) - (3rd party) a composer block which builds its content form an RSS feed
63
+ * [Popup Maker Integration](https://wordpress.org/plugins/newsletter-popupmaker/) - (3rd party) integration of Newsletter forms with Popup Maker plugin
64
+ * [BuddyPress integration](https://wordpress.org/plugins/newsletter-buddypress/) - subscription opt-in inside BuddyPress signup form
65
+ * [WP User Manager addon for Newsletter](https://wordpress.org/plugins/wpum-newsletter/) - adds the subscription option on registration forms
66
 
67
  = Professional Addons =
68
 
83
  * [Subscribe on Comment](https://www.thenewsletterplugin.com/documentation/comments-extension) - adds the subscription option to your blog comment form
84
  * [Geolocation](https://www.thenewsletterplugin.com/documentation/geolocation-extension) - adds geolocation capability to target subscribers by location
85
 
 
 
 
 
86
  = GDPR =
87
 
88
  The Newsletter Plugin provides all the technical tools needed to achieve GDPR compliancy and we're continuously working to improve them and to give support even for specific use cases.
118
 
119
  == Changelog ==
120
 
121
+ = 6.9.9 =
122
+
123
+ * Not specified gender fix
124
+ * Labels translation
125
+ * Added "newsletter_message" filter to act on the whole message before sending
126
+ * Removed X-Mailer when sending with the internal SMTP
127
+ * Added referrer field on subscriber editing page
128
+ * Fixed button label control on composer
129
+
130
  = 6.9.8 =
131
 
132
  * New color picker
subscription/profile.php CHANGED
@@ -42,7 +42,7 @@ $extra_type = array('text' => __('Text', 'newsletter'), 'select' => __('List', '
42
  <h2><?php _e('Subscription Form Fields and Layout', 'newsletter') ?></h2>
43
 
44
  <p>
45
- <a href="?page=newsletter_subscription_forms">HTML samples and hand coded forms</a>
46
  </p>
47
 
48
  </div>
@@ -55,21 +55,21 @@ $extra_type = array('text' => __('Text', 'newsletter'), 'select' => __('List', '
55
  <div id="tabs">
56
 
57
  <ul>
58
- <li><a href="#tabs-2">Main profile fields</a></li>
59
- <li><a href="#tabs-3">Extra profile fields</a></li>
60
  </ul>
61
 
62
  <div id="tabs-2">
63
 
64
- <p>The main subscriber fields. Only the email field is, of course, mandatory.</p>
65
 
66
  <table class="form-table">
67
  <tr>
68
  <th>Email</th>
69
  <td>
70
  <table class="newsletter-option-grid">
71
- <tr><th>Field label</th><td><?php $controls->text('email', 50); ?></td></tr>
72
- <tr><th>Error message</th><td><?php $controls->text('email_error', 50); ?></td></tr>
73
  </table>
74
  </td>
75
  </tr>
@@ -77,15 +77,14 @@ $extra_type = array('text' => __('Text', 'newsletter'), 'select' => __('List', '
77
  <th><?php _e('First name', 'newsletter') ?></th>
78
  <td>
79
  <table class="newsletter-option-grid">
80
- <tr><th>Field label</th><td><?php $controls->text('name', 50); ?></td></tr>
81
  <?php if ($is_all_languages) { ?>
82
- <tr><th>When to show</th><td><?php $controls->select('name_status', $status); ?></td></tr>
83
- <tr><th>Rules</th><td><?php $controls->select('name_rules', $rules); ?></td></tr>
84
  <?php } ?>
85
  </table>
86
  <p class="description">
87
- If you want to collect only a generic "name", use only this field and not the
88
- last name field.
89
  </p>
90
  </td>
91
  </tr>
@@ -93,10 +92,10 @@ $extra_type = array('text' => __('Text', 'newsletter'), 'select' => __('List', '
93
  <th><?php _e('Last name', 'newsletter') ?></th>
94
  <td>
95
  <table class="newsletter-option-grid">
96
- <tr><th>Field label</th><td><?php $controls->text('surname', 50); ?></td></tr>
97
  <?php if ($is_all_languages) { ?>
98
- <tr><th>When to show</th><td><?php $controls->select('surname_status', $status); ?></td></tr>
99
- <tr><th>Rules</th><td><?php $controls->select('surname_rules', $rules); ?></td></tr>
100
  <?php } ?>
101
  </table>
102
  </td>
@@ -105,34 +104,30 @@ $extra_type = array('text' => __('Text', 'newsletter'), 'select' => __('List', '
105
  <th><?php _e('Gender', 'newsletter') ?></th>
106
  <td>
107
  <table class="newsletter-option-grid">
108
- <tr><th>Field label</th><td><?php $controls->text('sex', 50); ?></td></tr>
109
  <?php if ($is_all_languages) { ?>
110
- <tr><th>When to show</th><td><?php $controls->select('sex_status', $status); ?></td></tr>
111
- <tr><th>Rules</th><td><?php $controls->select('sex_rules', $rules); ?></td></tr>
112
  <?php } ?>
113
  <tr>
114
- <th>Value labels</th>
115
  <td>
116
- female: <?php $controls->text('sex_female'); ?>
117
- male: <?php $controls->text('sex_male'); ?>
118
- not specified: <?php $controls->text('sex_none'); ?>
119
  </td>
120
  </tr>
121
-
122
-
123
  <tr>
124
- <th>Salutation titles</th>
125
  <td>
126
-
127
- for males: <?php $controls->text('title_male'); ?> (ex. "Mr")<br>
128
- for females: <?php $controls->text('title_female'); ?> (ex. "Mrs")<br>
129
- for others: <?php $controls->text('title_none'); ?>
130
  </td>
131
  </tr>
132
  </table>
133
  <p class="description">
134
- Salutation titles are inserted in emails message when the tag {title} is used. For example
135
- "Good morning {title} {surname} {name}".
136
  </p>
137
  </td>
138
  </tr>
@@ -143,24 +138,24 @@ $extra_type = array('text' => __('Text', 'newsletter'), 'select' => __('List', '
143
  <?php $controls->text('subscribe', 40); ?>
144
 
145
  <p class="description">
146
- You can use an image URL (http://...).
147
  </p>
148
  </td>
149
  </tr>
150
 
151
  <tr>
152
- <th>Privacy checkbox/notice</th>
153
  <td>
154
  <table class="newsletter-option-grid">
155
  <?php if ($is_all_languages) { ?>
156
- <tr><th>Enabled?</th><td><?php $controls->select('privacy_status', array(0 => 'No', 1 => 'Yes', 2 => 'Only the notice')); ?></td></tr>
157
  <?php } ?>
158
- <tr><th>Label</th><td><?php $controls->text('privacy', 50); ?></td></tr>
159
  <tr>
160
  <th>Privacy URL</th>
161
  <td>
162
  <?php if (!$is_all_languages && !empty($controls->data['privacy_use_wp_url'])) { ?>
163
- The "all language" setting is set to use the WordPress default privacy page. Please translate that page.
164
  <?php } else { ?>
165
  <?php if ($is_all_languages) { ?>
166
  <?php if (function_exists('get_privacy_policy_url') && get_privacy_policy_url()) { ?>
@@ -170,7 +165,7 @@ $extra_type = array('text' => __('Text', 'newsletter'), 'select' => __('List', '
170
  <?php } ?>
171
  <?php } ?>
172
  <?php if (!$is_all_languages) { ?>
173
- To use the WordPress privacy page, switch to "all language" and activate it.<br>
174
  <?php } ?>
175
  <?php $controls->text_url('privacy_url', 50); ?>
176
  <?php } ?>
@@ -178,8 +173,7 @@ $extra_type = array('text' => __('Text', 'newsletter'), 'select' => __('List', '
178
  </tr>
179
  </table>
180
  <p class="description">
181
- The privacy acceptance checkbox (required in many Europen countries) forces the subscriber to
182
- check it before proceeding. If an URL is specified the label becomes a link.
183
  </p>
184
  </td>
185
  </tr>
@@ -190,26 +184,26 @@ $extra_type = array('text' => __('Text', 'newsletter'), 'select' => __('List', '
190
 
191
  <div id="tabs-3">
192
  <p>
193
- Generic textual profile fields that can be collected during the subscription. Field formats can be one line text
194
  or selection list. Fields of type "list" must be configured with a set of options, comma separated
195
- like: "first option, second option, third option".
196
  </p>
197
  <p>
198
- The placeholder works only on HTML 5 compliant browsers.
199
  </p>
200
 
201
  <table class="widefat">
202
  <thead>
203
  <tr>
204
- <th>Field</th>
205
- <th>Name/Label</th>
206
- <th>Placeholder</th>
207
 
208
- <th>When/Where</th>
209
- <th>Type</th>
210
- <th>Rule</th>
211
 
212
- <th>List values comma separated</th>
213
  </tr>
214
  </thead>
215
  <?php for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) { ?>
42
  <h2><?php _e('Subscription Form Fields and Layout', 'newsletter') ?></h2>
43
 
44
  <p>
45
+ <a href="?page=newsletter_subscription_forms"><?php _e('HTML samples and hand coded forms', 'newsletter') ?></a>
46
  </p>
47
 
48
  </div>
55
  <div id="tabs">
56
 
57
  <ul>
58
+ <li><a href="#tabs-2"><?php _e('Main profile fields', 'newsletter') ?></a></li>
59
+ <li><a href="#tabs-3"><?php _e('Extra profile fields', 'newsletter') ?></a></li>
60
  </ul>
61
 
62
  <div id="tabs-2">
63
 
64
+ <p><?php _e('The main subscriber fields. Only the email field is, of course, mandatory.', 'newsletter') ?></p>
65
 
66
  <table class="form-table">
67
  <tr>
68
  <th>Email</th>
69
  <td>
70
  <table class="newsletter-option-grid">
71
+ <tr><th><?php _e('Field label', 'newsletter') ?></th><td><?php $controls->text('email', 50); ?></td></tr>
72
+ <tr><th><?php _e('Error message', 'newsletter') ?></th><td><?php $controls->text('email_error', 50); ?></td></tr>
73
  </table>
74
  </td>
75
  </tr>
77
  <th><?php _e('First name', 'newsletter') ?></th>
78
  <td>
79
  <table class="newsletter-option-grid">
80
+ <tr><th><?php _e('Field label', 'newsletter') ?></th><td><?php $controls->text('name', 50); ?></td></tr>
81
  <?php if ($is_all_languages) { ?>
82
+ <tr><th><?php _e('When to show', 'newsletter') ?></th><td><?php $controls->select('name_status', $status); ?></td></tr>
83
+ <tr><th><?php _e('Rules', 'newsletter') ?></th><td><?php $controls->select('name_rules', $rules); ?></td></tr>
84
  <?php } ?>
85
  </table>
86
  <p class="description">
87
+ <?php _e('If you want to collect only a generic "name", use only this field and not the last name field.', 'newsletter') ?>
 
88
  </p>
89
  </td>
90
  </tr>
92
  <th><?php _e('Last name', 'newsletter') ?></th>
93
  <td>
94
  <table class="newsletter-option-grid">
95
+ <tr><th><?php _e('Field label', 'newsletter') ?></th><td><?php $controls->text('surname', 50); ?></td></tr>
96
  <?php if ($is_all_languages) { ?>
97
+ <tr><th><?php _e('When to show', 'newsletter') ?></th><td><?php $controls->select('surname_status', $status); ?></td></tr>
98
+ <tr><th><?php _e('Rules', 'newsletter') ?></th><td><?php $controls->select('surname_rules', $rules); ?></td></tr>
99
  <?php } ?>
100
  </table>
101
  </td>
104
  <th><?php _e('Gender', 'newsletter') ?></th>
105
  <td>
106
  <table class="newsletter-option-grid">
107
+ <tr><th><?php _e('Field label', 'newsletter') ?></th><td><?php $controls->text('sex', 50); ?></td></tr>
108
  <?php if ($is_all_languages) { ?>
109
+ <tr><th><?php _e('When to show', 'newsletter') ?></th><td><?php $controls->select('sex_status', $status); ?></td></tr>
110
+ <tr><th><?php _e('Rules', 'newsletter') ?></th><td><?php $controls->select('sex_rules', $rules); ?></td></tr>
111
  <?php } ?>
112
  <tr>
113
+ <th><?php _e('Value labels', 'newsletter') ?></th>
114
  <td>
115
+ <?php _e('not specified', 'newsletter') ?>: <?php $controls->text('sex_none'); ?>
116
+ <?php _e('female', 'newsletter') ?>: <?php $controls->text('sex_female'); ?>
117
+ <?php _e('male', 'newsletter') ?>: <?php $controls->text('sex_male'); ?>
118
  </td>
119
  </tr>
 
 
120
  <tr>
121
+ <th><?php _e('Salutation titles', 'newsletter') ?></th>
122
  <td>
123
+ <?php _e('not specified', 'newsletter') ?>: <?php $controls->text('title_none'); ?><br>
124
+ <?php _e('for females', 'newsletter') ?>: <?php $controls->text('title_female'); ?> (ex. "Mrs")<br>
125
+ <?php _e('for males', 'newsletter') ?>: <?php $controls->text('title_male'); ?> (ex. "Mr")
 
126
  </td>
127
  </tr>
128
  </table>
129
  <p class="description">
130
+ <?php _e('Salutation titles are inserted in emails message when the tag {title} is used. For example "Good morning {title} {surname} {name}".', 'newsletter') ?>
 
131
  </p>
132
  </td>
133
  </tr>
138
  <?php $controls->text('subscribe', 40); ?>
139
 
140
  <p class="description">
141
+ <?php _e('You can use an image URL', 'newsletter') ?> (http://...).
142
  </p>
143
  </td>
144
  </tr>
145
 
146
  <tr>
147
+ <th><?php _e('Privacy checkbox/notice', 'newsletter') ?></th>
148
  <td>
149
  <table class="newsletter-option-grid">
150
  <?php if ($is_all_languages) { ?>
151
+ <tr><th><?php _e('Enabled?', 'newsletter') ?></th><td><?php $controls->select('privacy_status', array(0 => __('No', 'newsletter'), 1 => __('Yes', 'newsletter'), 2 => __('Only the notice', 'newsletter'))); ?></td></tr>
152
  <?php } ?>
153
+ <tr><th><?php _e('Label', 'newsletter') ?></th><td><?php $controls->text('privacy', 50); ?></td></tr>
154
  <tr>
155
  <th>Privacy URL</th>
156
  <td>
157
  <?php if (!$is_all_languages && !empty($controls->data['privacy_use_wp_url'])) { ?>
158
+ <?php _e('The "all language" setting is set to use the WordPress default privacy page. Please translate that page.', 'newsletter') ?>
159
  <?php } else { ?>
160
  <?php if ($is_all_languages) { ?>
161
  <?php if (function_exists('get_privacy_policy_url') && get_privacy_policy_url()) { ?>
165
  <?php } ?>
166
  <?php } ?>
167
  <?php if (!$is_all_languages) { ?>
168
+ <?php _e('To use the WordPress privacy page, switch to "all language" and activate it.', 'newsletter') ?><br>
169
  <?php } ?>
170
  <?php $controls->text_url('privacy_url', 50); ?>
171
  <?php } ?>
173
  </tr>
174
  </table>
175
  <p class="description">
176
+ <?php _e('The privacy acceptance checkbox (required in many Europen countries) forces the subscriber to check it before proceeding. If an URL is specified the label becomes a link.', 'newsletter') ?>
 
177
  </p>
178
  </td>
179
  </tr>
184
 
185
  <div id="tabs-3">
186
  <p>
187
+ <?php _e('Generic textual profile fields that can be collected during the subscription. Field formats can be one line text
188
  or selection list. Fields of type "list" must be configured with a set of options, comma separated
189
+ like: "first option, second option, third option".', 'newsletter') ?>
190
  </p>
191
  <p>
192
+ <?php _e('The placeholder works only on HTML 5 compliant browsers.', 'newsletter') ?>
193
  </p>
194
 
195
  <table class="widefat">
196
  <thead>
197
  <tr>
198
+ <th><?php _e('Field', 'newsletter') ?></th>
199
+ <th><?php _e('Name/Label', 'newsletter') ?></th>
200
+ <th><?php _e('Placeholder', 'newsletter') ?></th>
201
 
202
+ <th><?php _e('When/Where', 'newsletter') ?></th>
203
+ <th><?php _e('Type', 'newsletter') ?></th>
204
+ <th><?php _e('Rule', 'newsletter') ?></th>
205
 
206
+ <th><?php _e('List values comma separated', 'newsletter') ?></th>
207
  </tr>
208
  </thead>
209
  <?php for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) { ?>
subscription/subscription.php CHANGED
@@ -1415,14 +1415,21 @@ class NewsletterSubscription extends NewsletterModule {
1415
  return $buffer;
1416
  }
1417
 
1418
- // TODO: add the "not specified"
1419
  if ($name == 'sex' || $name == 'gender') {
1420
  $buffer .= '<div class="tnp-field tnp-field-gender">';
1421
  $buffer .= $this->_shortcode_label('sex', $attrs);
1422
 
1423
- $buffer .= '<select name="nx" class="tnp-gender" id="tnp-gender">';
1424
- $buffer .= '<option value="m">' . esc_html($this->form_options['sex_male']) . '</option>';
 
 
 
 
 
 
 
1425
  $buffer .= '<option value="f">' . esc_html($this->form_options['sex_female']) . '</option>';
 
1426
  $buffer .= '</select>';
1427
  $buffer .= "</div>\n";
1428
  return $buffer;
1415
  return $buffer;
1416
  }
1417
 
 
1418
  if ($name == 'sex' || $name == 'gender') {
1419
  $buffer .= '<div class="tnp-field tnp-field-gender">';
1420
  $buffer .= $this->_shortcode_label('sex', $attrs);
1421
 
1422
+ $buffer .= '<select name="nx" class="tnp-gender" id="tnp-gender"';
1423
+ if ($this->form_options['sex_rules']) {
1424
+ $buffer .= ' required ';
1425
+ }
1426
+ $buffer .= '>';
1427
+ if ($this->form_options['sex_rules']) {
1428
+ $buffer .= '<option value=""></option>';
1429
+ }
1430
+ $buffer .= '<option value="n">' . esc_html($this->form_options['sex_none']) . '</option>';
1431
  $buffer .= '<option value="f">' . esc_html($this->form_options['sex_female']) . '</option>';
1432
+ $buffer .= '<option value="m">' . esc_html($this->form_options['sex_male']) . '</option>';
1433
  $buffer .= '</select>';
1434
  $buffer .= "</div>\n";
1435
  return $buffer;
unsubscription/index.php CHANGED
@@ -47,11 +47,12 @@ if (!$controls->is_action()) {
47
  <?php $controls->button_reset() ?>
48
  </p>
49
  <div id="tabs">
 
50
  <ul>
51
  <li><a href="#tabs-cancellation"><?php _e('Cancellation', 'newsletter') ?></a></li>
52
  <li><a href="#tabs-reactivation"><?php _e('Reactivation', 'newsletter') ?></a></li>
53
-
54
  </ul>
 
55
  <div id="tabs-cancellation">
56
  <table class="form-table">
57
  <tr>
@@ -81,6 +82,7 @@ if (!$controls->is_action()) {
81
  </p>
82
  </td>
83
  </tr>
 
84
  <tr>
85
  <th><?php _e('On error', 'newsletter') ?></th>
86
  <td>
@@ -90,10 +92,10 @@ if (!$controls->is_action()) {
90
  </p>
91
  </td>
92
  </tr>
93
-
94
  </table>
95
 
96
- <h3>Advanced</h3>
 
97
  <?php if ($is_all_languages) { ?>
98
  <table class="form-table">
99
  <tr>
@@ -113,7 +115,7 @@ if (!$controls->is_action()) {
113
  </td>
114
  </tr>
115
  <tr>
116
- <th><?php _e('Notify admin on unsubscription', 'newsletter') ?></th>
117
  <td>
118
  <?php $controls->yesno('notify_admin_on_unsubscription'); ?>
119
  </td>
47
  <?php $controls->button_reset() ?>
48
  </p>
49
  <div id="tabs">
50
+
51
  <ul>
52
  <li><a href="#tabs-cancellation"><?php _e('Cancellation', 'newsletter') ?></a></li>
53
  <li><a href="#tabs-reactivation"><?php _e('Reactivation', 'newsletter') ?></a></li>
 
54
  </ul>
55
+
56
  <div id="tabs-cancellation">
57
  <table class="form-table">
58
  <tr>
82
  </p>
83
  </td>
84
  </tr>
85
+
86
  <tr>
87
  <th><?php _e('On error', 'newsletter') ?></th>
88
  <td>
92
  </p>
93
  </td>
94
  </tr>
 
95
  </table>
96
 
97
+ <h3><?php _e('Advanced', 'newsletter')?></h3>
98
+
99
  <?php if ($is_all_languages) { ?>
100
  <table class="form-table">
101
  <tr>
115
  </td>
116
  </tr>
117
  <tr>
118
+ <th><?php _e('Notify admin on cancellation', 'newsletter') ?></th>
119
  <td>
120
  <?php $controls->yesno('notify_admin_on_unsubscription'); ?>
121
  </td>
users/edit.php CHANGED
@@ -226,6 +226,12 @@ function percentValue($value, $total) {
226
  <?php echo $controls->print_date(strtotime($controls->data['created'])); ?>
227
  </td>
228
  </tr>
 
 
 
 
 
 
229
  <tr>
230
  <th><?php _e('Last activity', 'newsletter') ?></th>
231
  <td>
226
  <?php echo $controls->print_date(strtotime($controls->data['created'])); ?>
227
  </td>
228
  </tr>
229
+ <tr>
230
+ <th><?php _e('Referrer', 'newsletter') ?></th>
231
+ <td>
232
+ <?php echo $controls->value('referrer'); ?>
233
+ </td>
234
+ </tr>
235
  <tr>
236
  <th><?php _e('Last activity', 'newsletter') ?></th>
237
  <td>