Newsletter - Version 3.2.8

Version Description

  • Fixed the newsletter_replace filter
  • Added the person title for salutation
  • Changed the profile field panel
  • Fixed the massive deletion of unsubscribed users
Download this release

Release Info

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

Code changes from version 3.2.7 to 3.2.8

admin.css CHANGED
@@ -914,4 +914,18 @@ table.clicks {
914
  margin-bottom: 5px;
915
  }
916
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
917
 
914
  margin-bottom: 5px;
915
  }
916
 
917
+ .newsletter-option-grid th {
918
+ text-align: right;
919
+ width: auto;
920
+ border: 0;
921
+ padding: 3px;
922
+ font-weight: normal;
923
+ vertical-align: top;
924
+ padding-right: 15px;
925
+ }
926
+ .newsletter-option-grid td {
927
+ border: 0;
928
+ padding: 3px;
929
+ vertical-align: top;
930
+ }
931
 
plugin.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Newsletter
5
  Plugin URI: http://www.satollo.net/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.satollo.net/plugins/newsletter#update">this page</a> to know what's changed.</strong>
7
- Version: 3.2.7
8
  Author: Stefano Lissa
9
  Author URI: http://www.satollo.net
10
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
@@ -13,7 +13,7 @@
13
  */
14
 
15
  // Useed as dummy parameter on css and js links
16
- define('NEWSLETTER_VERSION', '3.2.7');
17
 
18
  global $wpdb, $newsletter;
19
 
@@ -128,7 +128,7 @@ class Newsletter extends NewsletterModule {
128
 
129
  add_action('init', array($this, 'hook_init'));
130
  add_action('newsletter', array($this, 'hook_newsletter'), 1);
131
-
132
 
133
  // This specific event is created by "Feed by mail" panel on configuration
134
  add_action('shutdown', array($this, 'hook_shutdown'));
@@ -343,7 +343,7 @@ class Newsletter extends NewsletterModule {
343
  function relink($text, $email_id, $user_id) {
344
  return NewsletterStatistics::instance()->relink($text, $email_id, $user_id);
345
  }
346
-
347
  /**
348
  * Runs every 5 minutes and look for emails that need to be processed.
349
  */
@@ -736,19 +736,26 @@ class Newsletter extends NewsletterModule {
736
  $user = $this->get_user($user['id']);
737
  }
738
 
739
- $text = apply_filters('newsletter_replace', $text, $user_id, $email_id);
 
 
 
 
 
740
 
741
  //$text = str_replace('{home_url}', get_option('home'), $text);
742
  //$text = str_replace('{blog_url}', get_option('home'), $text);
743
  $text = $this->replace_url($text, 'BLOG_URL', get_option('home'));
744
  $text = $this->replace_url($text, 'HOME_URL', get_option('home'));
745
-
746
  $text = str_replace('{blog_title}', get_option('blogname'), $text);
747
  $text = str_replace('{blog_description}', get_option('blogdescription'), $text);
748
 
749
  $text = $this->replace_date($text);
750
 
751
  if ($user != null) {
 
 
752
  $text = str_replace('{email}', $user->email, $text);
753
  if (empty($user->name)) {
754
  $text = str_replace(' {name}', '', $text);
@@ -756,6 +763,17 @@ class Newsletter extends NewsletterModule {
756
  } else {
757
  $text = str_replace('{name}', $user->name, $text);
758
  }
 
 
 
 
 
 
 
 
 
 
 
759
  $text = str_replace('{surname}', $user->surname, $text);
760
  $text = str_replace('{token}', $user->token, $text);
761
  $text = str_replace('%7Btoken%7D', $user->token, $text);
@@ -797,7 +815,7 @@ class Newsletter extends NewsletterModule {
797
  $text = $this->replace_url($text, 'FEED_SUBSCRIPTION_URL', self::add_qs($base, 'nm=es' . $id_token));
798
  $text = $this->replace_url($text, 'FEED_UNSUBSCRIPTION_URL', self::add_qs($base, 'nm=eu' . $id_token));
799
 
800
- $options_profile = get_option('newsletter_profile');
801
  if (empty($options_profile['profile_url']))
802
  $text = $this->replace_url($text, 'PROFILE_URL', plugins_url('newsletter/do/profile.php') . '?nk=' . $nk);
803
  else
4
  Plugin Name: Newsletter
5
  Plugin URI: http://www.satollo.net/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.satollo.net/plugins/newsletter#update">this page</a> to know what's changed.</strong>
7
+ Version: 3.2.8
8
  Author: Stefano Lissa
9
  Author URI: http://www.satollo.net
10
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
13
  */
14
 
15
  // Useed as dummy parameter on css and js links
16
+ define('NEWSLETTER_VERSION', '3.2.8');
17
 
18
  global $wpdb, $newsletter;
19
 
128
 
129
  add_action('init', array($this, 'hook_init'));
130
  add_action('newsletter', array($this, 'hook_newsletter'), 1);
131
+
132
 
133
  // This specific event is created by "Feed by mail" panel on configuration
134
  add_action('shutdown', array($this, 'hook_shutdown'));
343
  function relink($text, $email_id, $user_id) {
344
  return NewsletterStatistics::instance()->relink($text, $email_id, $user_id);
345
  }
346
+
347
  /**
348
  * Runs every 5 minutes and look for emails that need to be processed.
349
  */
736
  $user = $this->get_user($user['id']);
737
  }
738
 
739
+ $email = null;
740
+ if (is_numeric($email_id)) {
741
+ $email = $this->get_email($email_id);
742
+ }
743
+
744
+ $text = apply_filters('newsletter_replace', $text, $user, $email);
745
 
746
  //$text = str_replace('{home_url}', get_option('home'), $text);
747
  //$text = str_replace('{blog_url}', get_option('home'), $text);
748
  $text = $this->replace_url($text, 'BLOG_URL', get_option('home'));
749
  $text = $this->replace_url($text, 'HOME_URL', get_option('home'));
750
+
751
  $text = str_replace('{blog_title}', get_option('blogname'), $text);
752
  $text = str_replace('{blog_description}', get_option('blogdescription'), $text);
753
 
754
  $text = $this->replace_date($text);
755
 
756
  if ($user != null) {
757
+ $options_profile = get_option('newsletter_profile');
758
+
759
  $text = str_replace('{email}', $user->email, $text);
760
  if (empty($user->name)) {
761
  $text = str_replace(' {name}', '', $text);
763
  } else {
764
  $text = str_replace('{name}', $user->name, $text);
765
  }
766
+
767
+ switch ($user->sex) {
768
+ case 'm': $text = str_replace('{title}', $options_profile['title_male'], $text);
769
+ break;
770
+ case 'f': $text = str_replace('{title}', $options_profile['title_female'], $text);
771
+ break;
772
+ case 'n': $text = str_replace('{title}', $options_profile['title_none'], $text);
773
+ break;
774
+ }
775
+
776
+
777
  $text = str_replace('{surname}', $user->surname, $text);
778
  $text = str_replace('{token}', $user->token, $text);
779
  $text = str_replace('%7Btoken%7D', $user->token, $text);
815
  $text = $this->replace_url($text, 'FEED_SUBSCRIPTION_URL', self::add_qs($base, 'nm=es' . $id_token));
816
  $text = $this->replace_url($text, 'FEED_UNSUBSCRIPTION_URL', self::add_qs($base, 'nm=eu' . $id_token));
817
 
818
+
819
  if (empty($options_profile['profile_url']))
820
  $text = $this->replace_url($text, 'PROFILE_URL', plugins_url('newsletter/do/profile.php') . '?nk=' . $nk);
821
  else
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing
3
  Requires at least: 3.3.0
4
  Tested up to: 3.5.1
5
- Stable tag: 3.2.7
6
  Donate link: http://www.satollo.net/donations
7
 
8
  Add a real newsletter to your blog. In seconds. For free. With unlimited emails and subscribers.
@@ -55,6 +55,13 @@ No screen shots are available at this time.
55
 
56
  == Changelog ==
57
 
 
 
 
 
 
 
 
58
  = 3.2.7 =
59
 
60
  * Added a controls for the Reports module version 1.0.4
2
  Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing
3
  Requires at least: 3.3.0
4
  Tested up to: 3.5.1
5
+ Stable tag: 3.2.8
6
  Donate link: http://www.satollo.net/donations
7
 
8
  Add a real newsletter to your blog. In seconds. For free. With unlimited emails and subscribers.
55
 
56
  == Changelog ==
57
 
58
+ = 3.2.8 =
59
+
60
+ * Fixed the newsletter_replace filter
61
+ * Added the person title for salutation
62
+ * Changed the profile field panel
63
+ * Fixed the massive deletion of unsubscribed users
64
+
65
  = 3.2.7 =
66
 
67
  * Added a controls for the Reports module version 1.0.4
subscription/menu.inc.php CHANGED
@@ -1,6 +1,6 @@
1
  <h5>Subscription Module</h5>
2
  <div id="newsletter-nav">
3
- <a class="button" href="<?php echo $module->get_admin_page_url('options'); ?>">Subscription and unsubscription</a>
4
- <a class="button" href="<?php echo $module->get_admin_page_url('profile'); ?>">Form fields and layout</a>
5
  <a class="button" href="<?php echo $module->get_admin_page_url('forms'); ?>">Alternative forms</a>
6
  </div>
1
  <h5>Subscription Module</h5>
2
  <div id="newsletter-nav">
3
+ <a class="button" href="<?php echo $module->get_admin_page_url('options'); ?>">Subscription steps</a>
4
+ <a class="button" href="<?php echo $module->get_admin_page_url('profile'); ?>">Form fields and translation</a>
5
  <a class="button" href="<?php echo $module->get_admin_page_url('forms'); ?>">Alternative forms</a>
6
  </div>
subscription/profile.php CHANGED
@@ -20,7 +20,7 @@ else {
20
  }
21
  }
22
 
23
- $status = array(0=>'Disabled/Private', 1=>'Only on profile page', 2=>'Even on subscription forms');
24
  $rules = array(0=>'Optional', 1=>'Required');
25
  ?>
26
  <script type="text/javascript" src="<?php echo get_option('siteurl'); ?>/wp-content/plugins/newsletter/tiny_mce/tiny_mce.js"></script>
@@ -73,79 +73,94 @@ $rules = array(0=>'Optional', 1=>'Required');
73
  </ul>
74
 
75
  <div id="tabs-2">
76
- <table class="form-table">
77
- <tr>
78
- <th>User's data/fields</th>
79
- <td>
80
- <table class="widefat">
81
- <thead>
82
- <tr>
83
- <th width="150">Field</th>
84
- <th>Where to ask</th>
85
- <th>Rules</th>
86
- <th>Configuration</th>
87
- </tr>
88
- </thead>
89
- <tr>
90
- <td>Email</td>
91
- <td>&nbsp;</td>
92
- <td>&nbsp;</td>
93
- <td>
94
- <label>label</label> <?php $controls->text('email', 50); ?><br/>
95
- <label>if wrong</label> <?php $controls->text('email_error', 50); ?>
96
- </td>
97
- </tr>
98
- <tr>
99
- <td>First Name</td>
100
- <td><?php $controls->select('name_status', $status); ?></td>
101
- <td><?php $controls->select('name_rules', $rules); ?></td>
102
- <td>
103
- <label>label</label> <?php $controls->text('name', 50); ?>
104
- <label>if missing</label> <?php $controls->text('name_error', 50); ?>
105
- </td>
106
- </tr>
107
- <tr>
108
- <td>Last Name</td>
109
- <td><?php $controls->select('surname_status', $status); ?></td>
110
- <td><?php $controls->select('surname_rules', $rules); ?></td>
111
- <td>
112
- <label>label</label> <?php $controls->text('surname', 50); ?><br />
113
- <label>if missing</label> <?php $controls->text('surname_error', 50); ?>
114
- </td>
115
- </tr>
116
- <tr>
117
- <td>Sex</td>
118
- <td><?php $controls->select('sex_status', $status); ?></td>
119
- <td>
120
- label: <?php $controls->text('sex'); ?>
121
- "female": <?php $controls->text('sex_female'); ?>
122
- "male": <?php $controls->text('sex_male'); ?>
123
- "not specified": <?php $controls->text('sex_none'); ?>
124
- </td>
125
- </tr>
126
- <tr><td>Privacy checkbox</td><td><?php $controls->yesno('privacy_status'); ?></td>
127
- <td>
128
- <label>text</label> <?php $controls->text('privacy', 50); ?><br />
129
- <label>unchecked warning</label> <?php $controls->text('privacy_error', 50); ?>
130
- <label>privacy link</label> <?php $controls->text('privacy_url', 50); ?>
 
 
 
 
 
 
 
131
  </td>
132
  </tr>
133
- </table>
 
 
 
 
 
 
 
134
  <div class="hints">
135
- If sex field is disabled subscribers will be stored with unspecified sex. Privacy is applied only on subscription and is
136
- a checkbox the use must check to proceed with subscription.
137
  </div>
138
  </td>
139
  </tr>
140
  <tr>
141
- <th>Buttons</th>
142
- <td>
143
- "subscribe": <?php $controls->text('subscribe'); ?> "profile save": <?php $controls->text('save'); ?>
144
- <div class="hints">
145
- For "subscribe" insert an URL to an image (http://...) to use it as a graphical button.
146
- </div>
147
- </td>
148
- </tr>
 
 
149
 
150
  </table>
151
  </div>
20
  }
21
  }
22
 
23
+ $status = array(0=>'Disabled/Private use', 1=>'Only on profile page', 2=>'Even on subscription forms');
24
  $rules = array(0=>'Optional', 1=>'Required');
25
  ?>
26
  <script type="text/javascript" src="<?php echo get_option('siteurl'); ?>/wp-content/plugins/newsletter/tiny_mce/tiny_mce.js"></script>
73
  </ul>
74
 
75
  <div id="tabs-2">
76
+ <div class="tab-preamble">
77
+ <p>The main subscriber fields. Only the email field is, of course, mandatory.</p>
78
+ </div>
79
+ <table class="form-table">
80
+ <tr>
81
+ <th>Email</th>
82
+ <td>
83
+ <table class="newsletter-option-grid">
84
+ <tr><th>Field label</th><td><?php $controls->text('email', 50); ?></td></tr>
85
+ <tr><th>Error message</th><td><?php $controls->text('email_error', 50); ?></td></tr>
86
+ </table>
87
+ </td>
88
+ </tr>
89
+ <tr>
90
+ <th>Name or first name</th>
91
+ <td>
92
+ <table class="newsletter-option-grid">
93
+ <tr><th>Field label</th><td><?php $controls->text('name', 50); ?></td></tr>
94
+ <tr><th>When to show</th><td><?php $controls->select('name_status', $status); ?></td></tr>
95
+ <tr><th>Rules</th><td><?php $controls->select('surname_rules', $rules); ?></td></tr>
96
+ <tr><th>Error message</th><td><?php $controls->text('name_error', 50); ?></td></tr>
97
+ </table>
98
+ <div class="hints">
99
+ If you want to collect only a generic "name", use only this field and not the
100
+ last name field.
101
+ </div>
102
+ </td>
103
+ </tr>
104
+ <tr>
105
+ <th>Last name</th>
106
+ <td>
107
+ <table class="newsletter-option-grid">
108
+ <tr><th>Field label</th><td><?php $controls->text('surname', 50); ?></td></tr>
109
+ <tr><th>When to show</th><td><?php $controls->select('surname_status', $status); ?></td></tr>
110
+ <tr><th>Rules</th><td><?php $controls->select('surname_rules', $rules); ?></td></tr>
111
+ <tr><th>Error message</th><td><?php $controls->text('surname_error', 50); ?></td></tr>
112
+ </table>
113
+ </td>
114
+ </tr>
115
+ <tr>
116
+ <th>Sex/Gender</th>
117
+ <td>
118
+ <table class="newsletter-option-grid">
119
+ <tr><th>Field label</th><td><?php $controls->text('sex', 50); ?></td></tr>
120
+ <tr><th>When to show</th><td><?php $controls->select('sex_status', $status); ?></td></tr>
121
+ <tr><th>Value labels</th><td>
122
+ female: <?php $controls->text('sex_female'); ?>
123
+ male: <?php $controls->text('sex_male'); ?>
124
+ not specified: <?php $controls->text('sex_none'); ?>
125
+ </td></tr>
126
+
127
+ <tr><th>Salutation titles</th><td>
128
+
129
+ for males: <?php $controls->text('title_male'); ?> (ex. "Mr")<br>
130
+ for females: <?php $controls->text('title_female'); ?> (ex. "Mrs")<br>
131
+ for others: <?php $controls->text('title_none'); ?>
132
+ </td></tr>
133
+ </table>
134
+ <div class="hints">
135
+ Salutation titles are inserted in emails message when the tag {title} is used. For example
136
+ "Good morning {title} {surname} {name}".
137
+ </div>
138
  </td>
139
  </tr>
140
+
141
+ <tr>
142
+ <th>Button labels</th>
143
+ <td>
144
+ <table class="newsletter-option-grid">
145
+ <tr><th>Subscribe button</th><td><?php $controls->text('subscribe'); ?></td></tr>
146
+ <tr><th>Save button</th><td><?php $controls->text('save'); ?> (on profile page)</td></tr>
147
+ </table>
148
  <div class="hints">
149
+ For "subscribe" insert an URL to an image (http://...) to use it as a graphical button.
 
150
  </div>
151
  </td>
152
  </tr>
153
  <tr>
154
+ <th>Privacy check box</th>
155
+ <td>
156
+ <table class="newsletter-option-grid">
157
+ <tr><th>Label</th><td><?php $controls->text('privacy', 50); ?></td></tr>
158
+ <tr><th>Error message</th><td><?php $controls->text('privacy_error', 50); ?></td></tr>
159
+ <tr><th>Privacy URL</th><td><?php $controls->text('privacy_url', 50); ?></td></tr>
160
+ </table>
161
+ </td>
162
+ </tr>
163
+
164
 
165
  </table>
166
  </div>
subscription/subscription.php CHANGED
@@ -116,7 +116,7 @@ class NewsletterSubscription extends NewsletterModule {
116
  }
117
 
118
  function admin_menu() {
119
- $this->add_menu_page('options', 'Subscription');
120
  $this->add_admin_page('profile', 'Profile');
121
  $this->add_admin_page('forms', 'Forms');
122
  }
116
  }
117
 
118
  function admin_menu() {
119
+ $this->add_menu_page('options', 'Subscription Steps');
120
  $this->add_admin_page('profile', 'Profile');
121
  $this->add_admin_page('forms', 'Forms');
122
  }
users/massive.php CHANGED
@@ -17,6 +17,7 @@ if ($controls->is_action('remove_unconfirmed')) {
17
  }
18
 
19
  if ($controls->is_action('remove_unsubscribed')) {
 
20
  $controls->messages = $r . ' unsubscribed deleted (profiles associated to WordPress users are never deleted).';
21
  }
22
 
17
  }
18
 
19
  if ($controls->is_action('remove_unsubscribed')) {
20
+ $r = $wpdb->query("delete from " . NEWSLETTER_USERS_TABLE . " where status='U'");
21
  $controls->messages = $r . ' unsubscribed deleted (profiles associated to WordPress users are never deleted).';
22
  }
23