Newsletter - Version 3.3.7

Version Description

  • Fixed the feed by mail field on widget
  • Fixed tab names to avoid mod_security interference
  • Fixed the "name" form field rules
  • Added (undocumented/untested) way to change the table names
Download this release

Release Info

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

Code changes from version 3.3.6 to 3.3.7

emails/edit.php CHANGED
@@ -241,15 +241,15 @@ if ($email['editor'] == 0) {
241
 
242
  <div id="tabs">
243
  <ul>
244
- <li><a href="#tabs-1">Message</a></li>
245
- <li><a href="#tabs-2">Message (textual)</a></li>
246
- <li><a href="#tabs-3">Who will receive it</a></li>
247
- <li><a href="#tabs-4">Status</a></li>
248
  <!--<li><a href="#tabs-5">Documentation</a></li>-->
249
  </ul>
250
 
251
 
252
- <div id="tabs-1">
253
  <table class="form-table">
254
  <tr valign="top">
255
  <th>Subject</th>
@@ -275,7 +275,7 @@ if ($email['editor'] == 0) {
275
  </div>
276
 
277
 
278
- <div id="tabs-2">
279
  <p>
280
  This is the textual version of your newsletter. If you empty it, only an HTML version will be sent but
281
  is an anti-spam best practice to include a text only version.
@@ -291,7 +291,7 @@ if ($email['editor'] == 0) {
291
  </div>
292
 
293
 
294
- <div id="tabs-3">
295
  <table class="form-table">
296
  <tr valign="top">
297
  <th>Approximative number of receivers</th>
@@ -365,7 +365,7 @@ if ($email['editor'] == 0) {
365
  </div>
366
 
367
 
368
- <div id="tabs-4">
369
  <table class="form-table">
370
  <tr valign="top">
371
  <th>Send on</th>
241
 
242
  <div id="tabs">
243
  <ul>
244
+ <li><a href="#tabs-a">Message</a></li>
245
+ <li><a href="#tabs-b">Message (textual)</a></li>
246
+ <li><a href="#tabs-c">Who will receive it</a></li>
247
+ <li><a href="#tabs-d">Status</a></li>
248
  <!--<li><a href="#tabs-5">Documentation</a></li>-->
249
  </ul>
250
 
251
 
252
+ <div id="tabs-a">
253
  <table class="form-table">
254
  <tr valign="top">
255
  <th>Subject</th>
275
  </div>
276
 
277
 
278
+ <div id="tabs-b">
279
  <p>
280
  This is the textual version of your newsletter. If you empty it, only an HTML version will be sent but
281
  is an anti-spam best practice to include a text only version.
291
  </div>
292
 
293
 
294
+ <div id="tabs-c">
295
  <table class="form-table">
296
  <tr valign="top">
297
  <th>Approximative number of receivers</th>
365
  </div>
366
 
367
 
368
+ <div id="tabs-d">
369
  <table class="form-table">
370
  <tr valign="top">
371
  <th>Send on</th>
emails/themes/linear/theme.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
  $posts = get_posts();
3
  $theme_options['theme_background'] = 'purple.png';
 
4
  ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
5
  <html>
6
  <head>
1
  <?php
2
  $posts = get_posts();
3
  $theme_options['theme_background'] = 'purple.png';
4
+ global $post;
5
  ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
6
  <html>
7
  <head>
feed/feed.php CHANGED
@@ -49,7 +49,7 @@ class NewsletterFeed extends NewsletterModule {
49
 
50
  if ($this->options['subscription'] == 1) {
51
  $field = array();
52
- $field['label'] = '&nbsp;';
53
  $field['field'] = '<input type="checkbox" name="feed" value="1"/>&nbsp;' . $this->options['name'];
54
  $extra[] = $field;
55
  }
49
 
50
  if ($this->options['subscription'] == 1) {
51
  $field = array();
52
+ $field['label'] = '';
53
  $field['field'] = '<input type="checkbox" name="feed" value="1"/>&nbsp;' . $this->options['name'];
54
  $extra[] = $field;
55
  }
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.3.6
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,15 +13,20 @@
13
  */
14
 
15
  // Useed as dummy parameter on css and js links
16
- define('NEWSLETTER_VERSION', '3.3.6');
17
 
18
  global $wpdb, $newsletter;
19
 
20
  //@include_once WP_CONTENT_DIR . '/extensions/newsletter/config.php';
21
 
22
- define('NEWSLETTER_EMAILS_TABLE', $wpdb->prefix . 'newsletter_emails');
23
- define('NEWSLETTER_USERS_TABLE', $wpdb->prefix . 'newsletter');
24
- define('NEWSLETTER_STATS_TABLE', $wpdb->prefix . 'newsletter_stats');
 
 
 
 
 
25
 
26
  // Do not use basename(dirname()) since on activation the plugin is sandboxed inside a function
27
  define('NEWSLETTER_SLUG', 'newsletter');
@@ -170,37 +175,37 @@ class Newsletter extends NewsletterModule {
170
 
171
  parent::upgrade();
172
 
173
- $this->upgrade_query("create table if not exists " . $wpdb->prefix . "newsletter_emails (id int auto_increment, primary key (id)) $charset_collate");
174
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter_emails add column message longtext");
175
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter_emails add column message_text longtext");
176
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter_emails add column subject varchar(255) not null default ''");
177
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter_emails add column type varchar(50) not null default ''");
178
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter_emails add column created timestamp not null default current_timestamp");
179
 
180
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter_emails add column status enum('new','sending','sent','paused') not null default 'new'");
181
 
182
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter_emails add column total int not null default 0");
183
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter_emails add column last_id int not null default 0");
184
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter_emails add column sent int not null default 0");
185
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter_emails add column send_on int not null default 0");
186
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter_emails add column track tinyint not null default 0");
187
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter_emails add column editor tinyint not null default 0");
188
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter_emails add column sex char(1) not null default ''");
189
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter_emails change column sex sex char(1) not null default ''");
190
 
191
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter_emails add column query text");
192
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter_emails add column preferences text");
193
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter_emails add column options longtext");
194
 
195
  // Cleans up old installations
196
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter_emails drop column name");
197
  $this->upgrade_query("drop table if exists " . $wpdb->prefix . "newsletter_work");
198
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter_emails convert to character set utf8");
199
 
200
  // TODO: To be moved on users module.
201
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter convert to character set utf8");
202
 
203
- $this->upgrade_query("update " . $wpdb->prefix . "newsletter set sex='n' where sex='' or sex=' '");
204
 
205
  // Some setting check to avoid the common support request for mis-configurations
206
  $options = $this->get_options();
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.3.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
  */
14
 
15
  // Useed as dummy parameter on css and js links
16
+ define('NEWSLETTER_VERSION', '3.3.7');
17
 
18
  global $wpdb, $newsletter;
19
 
20
  //@include_once WP_CONTENT_DIR . '/extensions/newsletter/config.php';
21
 
22
+ if (!defined('NEWSLETTER_EMAILS_TABLE'))
23
+ define('NEWSLETTER_EMAILS_TABLE', $wpdb->prefix . 'newsletter_emails');
24
+
25
+ if (!defined('NEWSLETTER_USERS_TABLE'))
26
+ define('NEWSLETTER_USERS_TABLE', $wpdb->prefix . 'newsletter');
27
+
28
+ if (!defined('NEWSLETTER_STATS_TABLE'))
29
+ define('NEWSLETTER_STATS_TABLE', $wpdb->prefix . 'newsletter_stats');
30
 
31
  // Do not use basename(dirname()) since on activation the plugin is sandboxed inside a function
32
  define('NEWSLETTER_SLUG', 'newsletter');
175
 
176
  parent::upgrade();
177
 
178
+ $this->upgrade_query("create table if not exists " . NEWSLETTER_EMAILS_TABLE . " (id int auto_increment, primary key (id)) $charset_collate");
179
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column message longtext");
180
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column message_text longtext");
181
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column subject varchar(255) not null default ''");
182
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column type varchar(50) not null default ''");
183
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column created timestamp not null default current_timestamp");
184
 
185
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column status enum('new','sending','sent','paused') not null default 'new'");
186
 
187
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column total int not null default 0");
188
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column last_id int not null default 0");
189
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column sent int not null default 0");
190
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column send_on int not null default 0");
191
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column track tinyint not null default 0");
192
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column editor tinyint not null default 0");
193
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column sex char(1) not null default ''");
194
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " change column sex sex char(1) not null default ''");
195
 
196
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column query text");
197
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column preferences text");
198
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column options longtext");
199
 
200
  // Cleans up old installations
201
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " drop column name");
202
  $this->upgrade_query("drop table if exists " . $wpdb->prefix . "newsletter_work");
203
+ $this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " convert to character set utf8");
204
 
205
  // TODO: To be moved on users module.
206
+ $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " convert to character set utf8");
207
 
208
+ $this->upgrade_query("update " . NEWSLETTER_USERS_TABLE . " set sex='n' where sex='' or sex=' '");
209
 
210
  // Some setting check to avoid the common support request for mis-configurations
211
  $options = $this->get_options();
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.2
5
- Stable tag: 3.3.6
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.3.6 =
59
 
60
  * Fixed a caching blocking on short code
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.2
5
+ Stable tag: 3.3.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
 
56
  == Changelog ==
57
 
58
+ = 3.3.7 =
59
+
60
+ * Fixed the feed by mail field on widget
61
+ * Fixed tab names to avoid mod_security interference
62
+ * Fixed the "name" form field rules
63
+ * Added (undocumented/untested) way to change the table names
64
+
65
  = 3.3.6 =
66
 
67
  * Fixed a caching blocking on short code
subscription/profile.php CHANGED
@@ -92,7 +92,7 @@ $rules = array(0=>'Optional', 1=>'Required');
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">
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('name_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">
subscription/subscription.php CHANGED
@@ -4,7 +4,6 @@ require_once NEWSLETTER_INCLUDES_DIR . '/module.php';
4
 
5
  class NewsletterSubscription extends NewsletterModule {
6
 
7
- const VERSION = '1.0.3';
8
  const MESSAGE_CONFIRMED = 'confirmed';
9
 
10
  static $instance;
@@ -20,7 +19,7 @@ class NewsletterSubscription extends NewsletterModule {
20
  }
21
 
22
  function __construct() {
23
- parent::__construct('subscription', self::VERSION);
24
 
25
  add_action('wp_login', array($this, 'hook_wp_login'));
26
 
4
 
5
  class NewsletterSubscription extends NewsletterModule {
6
 
 
7
  const MESSAGE_CONFIRMED = 'confirmed';
8
 
9
  static $instance;
19
  }
20
 
21
  function __construct() {
22
+ parent::__construct('subscription', '1.0.4');
23
 
24
  add_action('wp_login', array($this, 'hook_wp_login'));
25
 
users/users.php CHANGED
@@ -25,42 +25,42 @@ class NewsletterUsers extends NewsletterModule {
25
 
26
  parent::upgrade();
27
 
28
- $this->upgrade_query("create table if not exists " . $wpdb->prefix . "newsletter (id int auto_increment, `email` varchar(100) not null default '', primary key (id), unique key email (email)) $charset_collate");
29
 
30
  // User personal data
31
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter add column name varchar(100) not null default ''");
32
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter add column surname varchar(100) not null default ''");
33
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter add column sex char(1) not null default 'n'");
34
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter change column sex sex char(1) not null default 'n'");
35
 
36
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter add column status char(1) not null default 'S'");
37
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter add column created timestamp not null default current_timestamp");
38
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter add column token varchar(50) not null default ''");
39
 
40
  // Feed by mail
41
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter add column feed tinyint(4) not null default 0");
42
- $this->upgrade_query("alter table " . $wpdb->prefix . "newsletter add column feed_time bigint(20) not null default 0");
43
- $this->upgrade_query("alter table {$wpdb->prefix}newsletter add column country varchar(4) not null default ''");
44
 
45
  // List/Preferences
46
  for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
47
- $this->upgrade_query("alter table {$wpdb->prefix}newsletter add column list_$i tinyint(4) not null default 0");
48
  }
49
 
50
  // Profiles
51
  for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) {
52
- $this->upgrade_query("alter table {$wpdb->prefix}newsletter add column profile_$i varchar(255) not null default ''");
53
  }
54
 
55
  // TODO: Still makes sense the referrer?
56
- $this->upgrade_query("alter table {$wpdb->prefix}newsletter add column referrer varchar(50) not null default ''");
57
- $this->upgrade_query("alter table {$wpdb->prefix}newsletter add column http_referer varchar(255) not null default ''");
58
- $this->upgrade_query("alter table {$wpdb->prefix}newsletter add column wp_user_id int not null default 0");
59
- $this->upgrade_query("alter table {$wpdb->prefix}newsletter add column ip varchar(50) not null default ''");
60
- $this->upgrade_query("alter table {$wpdb->prefix}newsletter add column test tinyint(4) not null default 0");
61
 
62
  // TODO: Flow module should add that it self (?)
63
- $this->upgrade_query("alter table {$wpdb->prefix}newsletter add column flow tinyint(4) not null default 0");
64
  }
65
 
66
  function admin_menu() {
@@ -100,7 +100,7 @@ class NewsletterUsers extends NewsletterModule {
100
 
101
  $page = 0;
102
  while (true) {
103
- $query = "select * from " . $wpdb->prefix . "newsletter";
104
  if (!empty($_POST['options']['list'])) {
105
  $query .= " where list_" . $_POST['options']['list'] . "=1";
106
  }
25
 
26
  parent::upgrade();
27
 
28
+ $this->upgrade_query("create table if not exists " . NEWSLETTER_USERS_TABLE . " (id int auto_increment, `email` varchar(100) not null default '', primary key (id), unique key email (email)) $charset_collate");
29
 
30
  // User personal data
31
+ $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column name varchar(100) not null default ''");
32
+ $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column surname varchar(100) not null default ''");
33
+ $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column sex char(1) not null default 'n'");
34
+ $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " change column sex sex char(1) not null default 'n'");
35
 
36
+ $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column status char(1) not null default 'S'");
37
+ $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column created timestamp not null default current_timestamp");
38
+ $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column token varchar(50) not null default ''");
39
 
40
  // Feed by mail
41
+ $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column feed tinyint(4) not null default 0");
42
+ $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column feed_time bigint(20) not null default 0");
43
+ $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column country varchar(4) not null default ''");
44
 
45
  // List/Preferences
46
  for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
47
+ $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column list_$i tinyint(4) not null default 0");
48
  }
49
 
50
  // Profiles
51
  for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) {
52
+ $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column profile_$i varchar(255) not null default ''");
53
  }
54
 
55
  // TODO: Still makes sense the referrer?
56
+ $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column referrer varchar(50) not null default ''");
57
+ $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column http_referer varchar(255) not null default ''");
58
+ $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column wp_user_id int not null default 0");
59
+ $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column ip varchar(50) not null default ''");
60
+ $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column test tinyint(4) not null default 0");
61
 
62
  // TODO: Flow module should add that it self (?)
63
+ $this->upgrade_query("alter table " . NEWSLETTER_USERS_TABLE . " add column flow tinyint(4) not null default 0");
64
  }
65
 
66
  function admin_menu() {
100
 
101
  $page = 0;
102
  while (true) {
103
+ $query = "select * from " . NEWSLETTER_USERS_TABLE . "";
104
  if (!empty($_POST['options']['list'])) {
105
  $query .= " where list_" . $_POST['options']['list'] . "=1";
106
  }
widget.php CHANGED
@@ -72,7 +72,8 @@ class NewsletterWidget extends WP_Widget {
72
 
73
  $extra = apply_filters('newsletter_subscription_extra', array());
74
  foreach ($extra as &$x) {
75
- $form .= "<p>" . $x['label'] . "<br/>";
 
76
  $form .= $x['field'] . "</p>";
77
  }
78
 
72
 
73
  $extra = apply_filters('newsletter_subscription_extra', array());
74
  foreach ($extra as &$x) {
75
+ $form .= "<p>";
76
+ if (!empty($x['label'])) $form .= $x['label'] . "<br/>";
77
  $form .= $x['field'] . "</p>";
78
  }
79