Newsletter - Version 5.5.8

Version Description

  • Fixed multilanguage text on profile page
  • Fix the image resizer for small images
  • Page message url based on subscriber language if available
Download this release

Release Info

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

Code changes from version 5.5.7 to 5.5.8

includes/helper.php CHANGED
@@ -88,8 +88,7 @@ function tnp_media_resize($media_id, $size) {
88
  $resized = $editor->resize($width, $height, $crop);
89
 
90
  if (is_wp_error($resized)) {
91
- return $resized;
92
- //return $uploads['baseurl'] . '/' . $relative_file;
93
  }
94
 
95
  $saved = $editor->save($absolute_thumb);
88
  $resized = $editor->resize($width, $height, $crop);
89
 
90
  if (is_wp_error($resized)) {
91
+ return $uploads['baseurl'] . '/' . $relative_file;
 
92
  }
93
 
94
  $saved = $editor->save($absolute_thumb);
includes/module.php CHANGED
@@ -1167,7 +1167,7 @@ class NewsletterModule {
1167
  $user = $this->get_user($user);
1168
  }
1169
  $params .= '&nk=' . urlencode($this->get_user_key($user));
1170
- $language = $this->get_user_language($user->language);
1171
  }
1172
 
1173
  if ($email) {
1167
  $user = $this->get_user($user);
1168
  }
1169
  $params .= '&nk=' . urlencode($this->get_user_key($user));
1170
+ $language = $this->get_user_language($user);
1171
  }
1172
 
1173
  if ($email) {
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: 5.5.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.
@@ -14,7 +14,7 @@
14
  */
15
 
16
  // Used as dummy parameter on css and js links
17
- define('NEWSLETTER_VERSION', '5.5.7');
18
 
19
  global $newsletter, $wpdb;
20
 
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: 5.5.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.
14
  */
15
 
16
  // Used as dummy parameter on css and js links
17
+ define('NEWSLETTER_VERSION', '5.5.8');
18
 
19
  global $newsletter, $wpdb;
20
 
profile/profile.php CHANGED
@@ -30,7 +30,7 @@ class NewsletterProfile extends NewsletterModule {
30
  add_action('wp_ajax_newsletter_users_export', array($this, 'hook_wp_ajax_newsletter_users_export'));
31
  }
32
  add_filter('newsletter_replace', array($this, 'hook_newsletter_replace'), 10, 3);
33
- add_filter('newsletter_page_text', array($this, 'hook_newsletter_page_text'), 10, 2);
34
  }
35
 
36
  function hook_wp_loaded() {
@@ -102,9 +102,10 @@ class NewsletterProfile extends NewsletterModule {
102
  return $text;
103
  }
104
 
105
- function hook_newsletter_page_text($text, $key) {
106
  if ($key == 'profile') {
107
- return $this->options['text'];
 
108
  }
109
  return $text;
110
  }
30
  add_action('wp_ajax_newsletter_users_export', array($this, 'hook_wp_ajax_newsletter_users_export'));
31
  }
32
  add_filter('newsletter_replace', array($this, 'hook_newsletter_replace'), 10, 3);
33
+ add_filter('newsletter_page_text', array($this, 'hook_newsletter_page_text'), 10, 3);
34
  }
35
 
36
  function hook_wp_loaded() {
102
  return $text;
103
  }
104
 
105
+ function hook_newsletter_page_text($text, $key, $user) {
106
  if ($key == 'profile') {
107
+ $options = $this->get_options('main', $this->get_current_language($user));
108
+ return $options['text'];
109
  }
110
  return $text;
111
  }
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.9.7
5
- Stable tag: 5.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.
@@ -107,6 +107,12 @@ Thank you, The Newsletter Team
107
 
108
  == Changelog ==
109
 
 
 
 
 
 
 
110
  = 5.5.7 =
111
 
112
  * Fixed the unsubscription multilanguage messages using even the user language
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.9.7
5
+ Stable tag: 5.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.
107
 
108
  == Changelog ==
109
 
110
+ = 5.5.8 =
111
+
112
+ * Fixed multilanguage text on profile page
113
+ * Fix the image resizer for small images
114
+ * Page message url based on subscriber language if available
115
+
116
  = 5.5.7 =
117
 
118
  * Fixed the unsubscription multilanguage messages using even the user language
unsubscription/unsubscription.php CHANGED
@@ -82,14 +82,12 @@ class NewsletterUnsubscription extends NewsletterModule {
82
  */
83
  function unsubscribe() {
84
  $user = $this->get_user_from_request(true);
85
-
86
- if ($user->status == 'U') {
87
  return $user;
88
  }
89
 
90
- $this->set_user_status($user, TNP_User::STATUS_UNSUBSCRIBED);
91
-
92
- $user = $this->get_user($user);
93
 
94
  $this->add_user_log($user, 'unsubscribe');
95
 
@@ -102,12 +100,24 @@ class NewsletterUnsubscription extends NewsletterModule {
102
  $wpdb->update(NEWSLETTER_USERS_TABLE, array('unsub_email_id' => (int) $email_id, 'unsub_time' => time()), array('id' => $user->id));
103
  }
104
 
105
- NewsletterSubscription::instance()->send_message('unsubscribed', $user);
106
 
107
  NewsletterSubscription::instance()->notify_admin($user, 'Newsletter unsubscription');
108
 
109
  return $user;
110
  }
 
 
 
 
 
 
 
 
 
 
 
 
111
 
112
  /**
113
  * Reactivate the subscriber extracted from the request setting his status
82
  */
83
  function unsubscribe() {
84
  $user = $this->get_user_from_request(true);
85
+
86
+ if ($user->status == TNP_User::STATUS_UNSUBSCRIBED) {
87
  return $user;
88
  }
89
 
90
+ $user = $this->set_user_status($user, TNP_User::STATUS_UNSUBSCRIBED);
 
 
91
 
92
  $this->add_user_log($user, 'unsubscribe');
93
 
100
  $wpdb->update(NEWSLETTER_USERS_TABLE, array('unsub_email_id' => (int) $email_id, 'unsub_time' => time()), array('id' => $user->id));
101
  }
102
 
103
+ $this->send_unsubscribed_email($user);
104
 
105
  NewsletterSubscription::instance()->notify_admin($user, 'Newsletter unsubscription');
106
 
107
  return $user;
108
  }
109
+
110
+ function send_unsubscribed_email($user, $force = false) {
111
+ $options = $this->get_options('', $this->get_user_language($user));
112
+ if (!$force && !empty($options['unsubscribed_disabled'])) {
113
+ return true;
114
+ }
115
+
116
+ $message = $options['unsubscribed_message'];
117
+ $subject = $options['unsubscribed_subject'];
118
+
119
+ return NewsletterSubscription::instance()->mail($user->email, $this->replace($subject, $user), $this->replace($message, $user));
120
+ }
121
 
122
  /**
123
  * Reactivate the subscriber extracted from the request setting his status