Newsletter - Version 6.9.7

Version Description

  • Fixed country filter
  • Fixed tag replacements for server with TR-tr locale
Download this release

Release Info

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

Code changes from version 6.9.6 to 6.9.7

emails/edit.php CHANGED
@@ -136,6 +136,11 @@ if ($controls->is_action('test') || $controls->is_action('save') || $controls->i
136
  for ($i = 1; $i <= 20; $i ++) {
137
  unset($email['options']["profile_$i"]);
138
  }
 
 
 
 
 
139
 
140
  foreach ($controls->data as $name => $value) {
141
  if (strpos($name, 'options_') === 0) {
136
  for ($i = 1; $i <= 20; $i ++) {
137
  unset($email['options']["profile_$i"]);
138
  }
139
+
140
+ // Patch for Geo addon to be solved with a filter
141
+ unset($email['options']['countries']);
142
+ unset($email['options']['regions']);
143
+ unset($email['options']['cities']);
144
 
145
  foreach ($controls->data as $name => $value) {
146
  if (strpos($name, 'options_') === 0) {
includes/module.php CHANGED
@@ -1914,15 +1914,16 @@ class NewsletterModule {
1914
 
1915
  $text = apply_filters('newsletter_replace', $text, $user, $email, $esc_html);
1916
 
1917
- $text = $this->replace_url($text, 'BLOG_URL', $home_url);
1918
- $text = $this->replace_url($text, 'HOME_URL', $home_url);
1919
 
1920
  $text = str_replace('{blog_title}', html_entity_decode(get_bloginfo('name')), $text);
1921
  $text = str_replace('{blog_description}', get_option('blogdescription'), $text);
1922
 
1923
  $text = $this->replace_date($text);
1924
-
1925
  if ($user) {
 
1926
  $nk = $this->get_user_key($user);
1927
  $options_profile = NewsletterSubscription::instance()->get_options('profile', $this->get_user_language($user));
1928
  $text = str_replace('{email}', $user->email, $text);
@@ -1974,8 +1975,8 @@ class NewsletterModule {
1974
  $base = (empty($this->options_main['url']) ? get_option('home') : $this->options_main['url']);
1975
  $id_token = '&amp;ni=' . $user->id . '&amp;nt=' . $user->token;
1976
 
1977
- $text = $this->replace_url($text, 'SUBSCRIPTION_CONFIRM_URL', $this->build_action_url('c', $user));
1978
- $text = $this->replace_url($text, 'ACTIVATION_URL', $this->build_action_url('c', $user));
1979
 
1980
  // Obsolete.
1981
  $text = $this->replace_url($text, 'FOLLOWUP_SUBSCRIPTION_URL', self::add_qs($base, 'nm=fs' . $id_token));
@@ -1983,20 +1984,23 @@ class NewsletterModule {
1983
 
1984
  $text = $this->replace_url($text, 'UNLOCK_URL', $this->build_action_url('ul', $user));
1985
  } else {
1986
- $text = $this->replace_url($text, 'SUBSCRIPTION_CONFIRM_URL', '#');
1987
- $text = $this->replace_url($text, 'ACTIVATION_URL', '#');
 
1988
  }
1989
 
1990
  if ($email) {
 
1991
  $nek = $this->get_email_key($email);
1992
  $text = str_replace('{email_id}', $email->id, $text);
1993
  $text = str_replace('{email_key}', $nek, $text);
1994
  $text = str_replace('{email_subject}', $email->subject, $text);
1995
  // Deprecated
1996
  $text = str_replace('{subject}', $email->subject, $text);
1997
- $text = $this->replace_url($text, 'EMAIL_URL', $this->build_action_url('v', $user) . '&id=' . $email->id);
1998
  } else {
1999
- $text = $this->replace_url($text, 'EMAIL_URL', '#');
 
2000
  }
2001
 
2002
  if (strpos($text, '{subscription_form}') !== false) {
1914
 
1915
  $text = apply_filters('newsletter_replace', $text, $user, $email, $esc_html);
1916
 
1917
+ $text = $this->replace_url($text, 'blog_url', $home_url);
1918
+ $text = $this->replace_url($text, 'home_url', $home_url);
1919
 
1920
  $text = str_replace('{blog_title}', html_entity_decode(get_bloginfo('name')), $text);
1921
  $text = str_replace('{blog_description}', get_option('blogdescription'), $text);
1922
 
1923
  $text = $this->replace_date($text);
1924
+
1925
  if ($user) {
1926
+ //$this->logger->debug('Replace with user ' . $user->id);
1927
  $nk = $this->get_user_key($user);
1928
  $options_profile = NewsletterSubscription::instance()->get_options('profile', $this->get_user_language($user));
1929
  $text = str_replace('{email}', $user->email, $text);
1975
  $base = (empty($this->options_main['url']) ? get_option('home') : $this->options_main['url']);
1976
  $id_token = '&amp;ni=' . $user->id . '&amp;nt=' . $user->token;
1977
 
1978
+ $text = $this->replace_url($text, 'subscription_confirm_url', $this->build_action_url('c', $user));
1979
+ $text = $this->replace_url($text, 'activation_url', $this->build_action_url('c', $user));
1980
 
1981
  // Obsolete.
1982
  $text = $this->replace_url($text, 'FOLLOWUP_SUBSCRIPTION_URL', self::add_qs($base, 'nm=fs' . $id_token));
1984
 
1985
  $text = $this->replace_url($text, 'UNLOCK_URL', $this->build_action_url('ul', $user));
1986
  } else {
1987
+ //$this->logger->debug('Replace without user');
1988
+ $text = $this->replace_url($text, 'subscription_confirm_url', '#');
1989
+ $text = $this->replace_url($text, 'activation_url', '#');
1990
  }
1991
 
1992
  if ($email) {
1993
+ //$this->logger->debug('Replace with email ' . $email->id);
1994
  $nek = $this->get_email_key($email);
1995
  $text = str_replace('{email_id}', $email->id, $text);
1996
  $text = str_replace('{email_key}', $nek, $text);
1997
  $text = str_replace('{email_subject}', $email->subject, $text);
1998
  // Deprecated
1999
  $text = str_replace('{subject}', $email->subject, $text);
2000
+ $text = $this->replace_url($text, 'email_url', $this->build_action_url('v', $user) . '&id=' . $email->id);
2001
  } else {
2002
+ //$this->logger->debug('Replace without email');
2003
+ $text = $this->replace_url($text, 'email_url', '#');
2004
  }
2005
 
2006
  if (strpos($text, '{subscription_form}') !== false) {
main/diagnostic.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @var $this Newsletter */
3
+ /* @var $wpdb wpdb */
4
+
5
+ defined('ABSPATH') || exit;
6
+
7
+ include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
8
+ $controls = new NewsletterControls();
9
+
10
+ function tnp_get_hook_functions($tag) {
11
+ global $wp_filter;
12
+ if (isset($wp_filter)) {
13
+ $b = '';
14
+ foreach ($wp_filter[$tag]->callbacks as $priority => $functions) {
15
+
16
+ foreach ($functions as $function) {
17
+ //var_dump($function);
18
+ $b .= '[' . $priority . '] ';
19
+ if (is_array($function['function'])) {
20
+ if (is_object($function['function'][0])) {
21
+ $b .= get_class($function['function'][0]) . '::' . $function['function'][1];
22
+ } else {
23
+ $b .= $function['function'][0] . '::' . $function['function'][1];
24
+ }
25
+ } else {
26
+ if (is_object($function['function'])) {
27
+ $fn = new ReflectionFunction($function['function']);
28
+ $b .= get_class($fn->getClosureThis()) . '(closure)';
29
+ } else {
30
+ $b .= $function['function'];
31
+ }
32
+ }
33
+ $b .= "<br>";
34
+ }
35
+ }
36
+ }
37
+ return $b;
38
+ }
39
+ ?>
40
+
41
+ <div class="wrap tnp-main-diagnostic" id="tnp-wrap">
42
+
43
+ <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
44
+
45
+ <div id="tnp-heading">
46
+
47
+ <h2><?php _e('Diagnostic', 'newsletter') ?></h2>
48
+
49
+ </div>
50
+
51
+ <div id="tnp-body">
52
+
53
+ <form method="post" action="">
54
+ <?php $controls->init(); ?>
55
+
56
+ <h3>Hooks</h3>
57
+ <table class="widefat" id="tnp-status-table">
58
+
59
+ <thead>
60
+ <tr>
61
+ <th>Parameter</th>
62
+ <th><?php _e('Status', 'newsletter') ?></th>
63
+ <th>Action</th>
64
+ </tr>
65
+ </thead>
66
+
67
+ <tbody>
68
+ <tr>
69
+ <td>Filter "newsletter_replace"</td>
70
+ <td>
71
+ </td>
72
+ <td>
73
+ <?php echo tnp_get_hook_functions('newsletter_replace') ?>
74
+ </td>
75
+
76
+ </tr>
77
+ </tbody>
78
+ </table>
79
+ </form>
80
+ </div>
81
+
82
+ <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
83
+
84
+ </div>
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.6
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.6');
39
 
40
  global $newsletter, $wpdb;
41
 
@@ -464,6 +464,7 @@ class Newsletter extends NewsletterModule {
464
  $this->add_menu_page('main', __('Settings and More', 'newsletter'));
465
  $this->add_admin_page('smtp', 'SMTP');
466
  $this->add_admin_page('status', __('Status', 'newsletter'));
 
467
  $this->add_admin_page('test', __('Test', 'newsletter'));
468
  }
469
  }
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.7
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.7');
39
 
40
  global $newsletter, $wpdb;
41
 
464
  $this->add_menu_page('main', __('Settings and More', 'newsletter'));
465
  $this->add_admin_page('smtp', 'SMTP');
466
  $this->add_admin_page('status', __('Status', 'newsletter'));
467
+ $this->add_admin_page('diagnostic', __('Diagnostic', 'newsletter'));
468
  $this->add_admin_page('test', __('Test', 'newsletter'));
469
  }
470
  }
profile/profile.php CHANGED
@@ -92,10 +92,10 @@ class NewsletterProfile extends NewsletterModule {
92
 
93
  // Profile edit page URL and link
94
  $url = $this->get_profile_url($user, $email);
95
- $text = $this->replace_url($text, 'PROFILE_URL', $url);
96
  // Profile export URL and link
97
  $url = $this->get_profile_export_url($user);
98
- $text = $this->replace_url($text, 'PROFILE_EXPORT_URL', $url);
99
 
100
  if (strpos($text, '{profile_form}') !== false) {
101
  $text = str_replace('{profile_form}', $this->get_profile_form($user), $text);
92
 
93
  // Profile edit page URL and link
94
  $url = $this->get_profile_url($user, $email);
95
+ $text = $this->replace_url($text, 'profile_url', $url);
96
  // Profile export URL and link
97
  $url = $this->get_profile_export_url($user);
98
+ $text = $this->replace_url($text, 'profile_export_url', $url);
99
 
100
  if (strpos($text, '{profile_form}') !== false) {
101
  $text = str_replace('{profile_form}', $this->get_profile_form($user), $text);
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.6
6
  Requires PHP: 5.6
7
  Contributors: satollo,webagile,michael-travan
8
  License: GPLv2 or later
@@ -117,6 +117,11 @@ Thank you, The Newsletter Team
117
 
118
  == Changelog ==
119
 
 
 
 
 
 
120
  = 6.9.6 =
121
 
122
  * Added 3 months option for inactive subscriber selection
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.7
6
  Requires PHP: 5.6
7
  Contributors: satollo,webagile,michael-travan
8
  License: GPLv2 or later
117
 
118
  == Changelog ==
119
 
120
+ = 6.9.7 =
121
+
122
+ * Fixed country filter
123
+ * Fixed tag replacements for server with TR-tr locale
124
+
125
  = 6.9.6 =
126
 
127
  * Added 3 months option for inactive subscriber selection
unsubscription/unsubscription.php CHANGED
@@ -142,12 +142,12 @@ class NewsletterUnsubscription extends NewsletterModule {
142
  function hook_newsletter_replace($text, $user, $email, $html = true) {
143
 
144
  if ($user) {
145
- $text = $this->replace_url($text, 'UNSUBSCRIPTION_CONFIRM_URL', $this->build_action_url('uc', $user, $email));
146
- $text = $this->replace_url($text, 'UNSUBSCRIPTION_URL', $this->build_action_url('u', $user, $email));
147
- $text = $this->replace_url($text, 'REACTIVATE_URL', $this->build_action_url('reactivate', $user, $email));
148
  } else {
149
- $text = $this->replace_url($text, 'UNSUBSCRIPTION_CONFIRM_URL', $this->build_action_url('nul'));
150
- $text = $this->replace_url($text, 'UNSUBSCRIPTION_URL', $this->build_action_url('nul'));
151
  }
152
 
153
  return $text;
142
  function hook_newsletter_replace($text, $user, $email, $html = true) {
143
 
144
  if ($user) {
145
+ $text = $this->replace_url($text, 'unsubscription_confirm_url', $this->build_action_url('uc', $user, $email));
146
+ $text = $this->replace_url($text, 'unsubscription_url', $this->build_action_url('u', $user, $email));
147
+ $text = $this->replace_url($text, 'reactivate_url', $this->build_action_url('reactivate', $user, $email));
148
  } else {
149
+ $text = $this->replace_url($text, 'unsubscription_confirm_url', $this->build_action_url('nul'));
150
+ $text = $this->replace_url($text, 'unsubscription_url', $this->build_action_url('nul'));
151
  }
152
 
153
  return $text;
widget/standard.php CHANGED
@@ -17,8 +17,9 @@ class NewsletterWidget extends WP_Widget {
17
  static function get_widget_form($instance) {
18
 
19
  $field_wrapper_tag = 'div';
20
- if (!isset($instance['nl']) || !is_array($instance['nl']))
21
  $instance['nl'] = array();
 
22
 
23
  $instance = array_merge(array('lists_layout' => '',
24
  'lists_empty_label' => '',
@@ -31,7 +32,7 @@ class NewsletterWidget extends WP_Widget {
31
  'referrer'=>'widget',
32
  'before'=>'<div class="tnp tnp-widget">',
33
  'after'=>'</div>',
34
- 'list' => implode(',', $instance['nl']),
35
  'lists_field_layout' => $instance['lists_layout'],
36
  'lists_field_empty_label' => $instance['lists_empty_label'],
37
  'lists_field_label' => $instance['lists_field_label'],
17
  static function get_widget_form($instance) {
18
 
19
  $field_wrapper_tag = 'div';
20
+ if (!isset($instance['nl']) || !is_array($instance['nl'])) {
21
  $instance['nl'] = array();
22
+ }
23
 
24
  $instance = array_merge(array('lists_layout' => '',
25
  'lists_empty_label' => '',
32
  'referrer'=>'widget',
33
  'before'=>'<div class="tnp tnp-widget">',
34
  'after'=>'</div>',
35
+ 'lists' => implode(',', $instance['nl']),
36
  'lists_field_layout' => $instance['lists_layout'],
37
  'lists_field_empty_label' => $instance['lists_empty_label'],
38
  'lists_field_label' => $instance['lists_field_label'],