Newsletter - Version 4.5.6

Version Description

  • New unified themes and composer selection screen
  • Fixed the WP integration panel (incompatibility with WP 4.5.3)
  • Removed few notices
  • More warning fix
  • Fix "isHTML" error
  • jQuery conflict fix
  • Escape fix
  • Warning fix
  • Fixed the mime header
Download this release

Release Info

Developer webagile
Plugin Icon 128x128 Newsletter
Version 4.5.6
Comparing to
See all releases

Code changes from version 4.5.4 to 4.5.6

emails/composer.php CHANGED
@@ -35,7 +35,7 @@ To change your subscription follow: {profile_url}.';
35
  $email['type'] = 'message';
36
  $email['send_on'] = time();
37
  $email = Newsletter::instance()->save_email($email, ARRAY_A);
38
- } elseif ($_GET['id']) {
39
 
40
  $email = Newsletter::instance()->get_email((int) $_GET['id'], ARRAY_A);
41
 
@@ -69,7 +69,10 @@ if ($controls->data == null) {
69
  }
70
 
71
  //$body = $controls->data['body'];
72
- $body = $email['message'];
 
 
 
73
 
74
  ?>
75
 
@@ -81,20 +84,16 @@ $body = $email['message'];
81
  <div id="tnp-heading" class="tnp-composer-heading">
82
 
83
  <img src="http://cdn.thenewsletterplugin.com/tests/tnp-composer-heading.png">
84
- <h2><?php _e('Compose a newsletter', 'newsletter') ?> <small style="color: #E67E22;">(Beta)</small>
85
- <?php if (empty($_GET['id'])): ?>
86
- <small><a href="<?php echo $module->get_admin_page_url('theme'); ?>">or switch to the old editor with themes.</a></small>
87
- <?php endif; ?>
88
- </h2>
89
  <form method="post" action="" id="tnpc-form">
90
  <?php $controls->init(); ?>
91
  <?php $controls->hidden('subject'); ?>
92
  <?php $controls->hidden('body'); ?>
93
  <?php $controls->button_reset(); ?>
94
- <?php $controls->button('save', 'Save', 'create();'); ?>
95
- <?php $controls->button('preview', 'Save & Preview &raquo;', 'create();'); ?>
96
  </form>
97
-
98
  </div>
99
 
100
  <div id="tnp-body" class="tnp-body-lite">
35
  $email['type'] = 'message';
36
  $email['send_on'] = time();
37
  $email = Newsletter::instance()->save_email($email, ARRAY_A);
38
+ } elseif (isset($_GET['id'])) {
39
 
40
  $email = Newsletter::instance()->get_email((int) $_GET['id'], ARRAY_A);
41
 
69
  }
70
 
71
  //$body = $controls->data['body'];
72
+ $body = "";
73
+ if (isset($email)) {
74
+ $body = $email['message'];
75
+ }
76
 
77
  ?>
78
 
84
  <div id="tnp-heading" class="tnp-composer-heading">
85
 
86
  <img src="http://cdn.thenewsletterplugin.com/tests/tnp-composer-heading.png">
87
+ <h2><?php _e('Compose a newsletter', 'newsletter') ?></h2>
88
+ <a href="http://www.thenewsletterplugin.com/plugins/newsletter/composer" target="_blank"><i class="fa fa-life-ring"></i> <?php _e('Read the guide', 'newsletter') ?></a>
 
 
 
89
  <form method="post" action="" id="tnpc-form">
90
  <?php $controls->init(); ?>
91
  <?php $controls->hidden('subject'); ?>
92
  <?php $controls->hidden('body'); ?>
93
  <?php $controls->button_reset(); ?>
94
+ <?php $controls->button('save', __('Save','newsletter'), 'create();'); ?>
95
+ <?php $controls->button('preview', __('Save & Preview','newsletter') . ' &raquo;', 'create();'); ?>
96
  </form>
 
97
  </div>
98
 
99
  <div id="tnp-body" class="tnp-body-lite">
emails/index.php CHANGED
@@ -78,7 +78,7 @@ $emails = Newsletter::instance()->get_emails('message');
78
  <?php } ?>
79
 
80
  <p>
81
- <a href="<?php echo $module->get_admin_page_url('composer'); ?>" class="button"><?php _e('New newsletter', 'newsletter') ?></a>
82
  <?php $controls->button_confirm('delete_selected', __('Delete selected newsletters', 'newsletter'), __('Proceed?', 'newsletter'));
83
  ?>
84
  <?php $controls->button('send', __('Trigger the delivery engine', 'newsletter')); ?>
78
  <?php } ?>
79
 
80
  <p>
81
+ <a href="<?php echo $module->get_admin_page_url('theme'); ?>" class="button"><?php _e('New newsletter', 'newsletter') ?></a>
82
  <?php $controls->button_confirm('delete_selected', __('Delete selected newsletters', 'newsletter'), __('Proceed?', 'newsletter'));
83
  ?>
84
  <?php $controls->button('send', __('Trigger the delivery engine', 'newsletter')); ?>
emails/theme.php CHANGED
@@ -61,6 +61,14 @@ $themes = $module->themes->get_all_with_data();
61
  <form method="post" id="newsletter-form" action="<?php echo $module->get_admin_page_url('new'); ?>">
62
  <?php $controls->init(); ?>
63
  <?php $controls->hidden('theme'); ?>
 
 
 
 
 
 
 
 
64
  <?php foreach ($themes as $key => &$data) { ?>
65
  <div class="tnp-theme-preview">
66
  <p><?php echo $data['name']; ?></p>
61
  <form method="post" id="newsletter-form" action="<?php echo $module->get_admin_page_url('new'); ?>">
62
  <?php $controls->init(); ?>
63
  <?php $controls->hidden('theme'); ?>
64
+
65
+ <div class="tnp-theme-preview">
66
+ <p><?php echo _e('Responsive Drag & Drop Composer', 'newsletter') ?></p>
67
+ <a href="<?php echo $module->get_admin_page_url('composer'); ?>" style="margin-right: 20px; margin-bottom: 20px">
68
+ <img src="<?php echo plugins_url('newsletter') . '/emails/themes/composer.gif' ?>" width="420" height="200">
69
+ </a>
70
+ </div>
71
+
72
  <?php foreach ($themes as $key => &$data) { ?>
73
  <div class="tnp-theme-preview">
74
  <p><?php echo $data['name']; ?></p>
emails/themes/composer.gif ADDED
Binary file
emails/tnp-composer/_css/newsletter-builder.css CHANGED
@@ -10,6 +10,11 @@
10
  font-weight: 400 !important;
11
  }
12
 
 
 
 
 
 
13
  .tnp-composer-heading form {
14
  display: inline-block;
15
  margin-left: 30px;
10
  font-weight: 400 !important;
11
  }
12
 
13
+ .tnp-composer-heading a {
14
+ display: inline-block;
15
+ margin-left: 30px;
16
+ }
17
+
18
  .tnp-composer-heading form {
19
  display: inline-block;
20
  margin-left: 30px;
emails/tnp-composer/blocks/footer-01-footer.block CHANGED
@@ -6,9 +6,9 @@
6
  <table width="500" border="0" cellspacing="0" cellpadding="0" align="center" class="responsive-table">
7
  <tr>
8
  <td align="center" style="font-size: 12px; line-height: 18px; font-family: Helvetica, Arial, sans-serif; color:#666666;">
9
- <div class="tnpc-row-edit" data-type="text" style="color:#666666;"><?php echo $block_options['footer_title'] ? $block_options['footer_title'] : 'Your Company' ?><br/>
10
- <?php echo $block_options['footer_contact'] ? $block_options['footer_contact'] : 'Company Address, Phone Number' ?><br/>
11
- <em><?php echo $block_options['footer_legal'] ? $block_options['footer_legal'] : 'Copyright or Legal text' ?></em>
12
  </div>
13
  </td>
14
  </tr>
6
  <table width="500" border="0" cellspacing="0" cellpadding="0" align="center" class="responsive-table">
7
  <tr>
8
  <td align="center" style="font-size: 12px; line-height: 18px; font-family: Helvetica, Arial, sans-serif; color:#666666;">
9
+ <div class="tnpc-row-edit" data-type="text" style="color:#666666;"><?php echo isset($block_options['footer_title']) ? $block_options['footer_title'] : 'Your Company' ?><br/>
10
+ <?php echo isset($block_options['footer_contact']) ? $block_options['footer_contact'] : 'Company Address, Phone Number' ?><br/>
11
+ <em><?php echo isset($block_options['footer_legal']) ? $block_options['footer_legal'] : 'Copyright or Legal text' ?></em>
12
  </div>
13
  </td>
14
  </tr>
emails/tnp-composer/blocks/header-01-header.block CHANGED
@@ -11,14 +11,14 @@
11
  <tr>
12
  <td width="100" align="left" class="tnpc-row-edit" data-type="image">
13
  <a href="#" target="_blank">
14
- <img alt="Logo" src="<?php echo $block_options['header_logo']['url'] ? $block_options['header_logo']['url'] : 'http://placehold.it/180x50?text=' . $block_options['header_title'] ?>" style="display: block; width: 180px; font-family: Helvetica, Arial, sans-serif; color: #ffffff; font-size: 16px;" border="0">
15
  </a>
16
  </td>
17
  <td width="400" align="right" class="mobile-hide">
18
  <table border="0" cellpadding="0" cellspacing="0">
19
  <tr>
20
  <td align="right" style="padding: 0 0 5px 0; font-size: 14px; font-family: Arial, sans-serif; color: #666666; text-decoration: none;" class="tnpc-row-edit" data-type="text">
21
- <span style="color: #666666; text-decoration: none;" ><?php echo $block_options['header_sub'] ? $block_options['header_sub'] : 'A little text up top can be nice.<br>Maybe a link to tweet?' ?></span>
22
  </td>
23
  </tr>
24
  </table>
11
  <tr>
12
  <td width="100" align="left" class="tnpc-row-edit" data-type="image">
13
  <a href="#" target="_blank">
14
+ <img alt="Logo" src="<?php echo isset($block_options['header_logo']) ? $block_options['header_logo']['url'] : 'http://placehold.it/180x50?text=' . isset($block_options['header_title']) ? $block_options['header_title'] : "" ?>" style="display: block; width: 180px; font-family: Helvetica, Arial, sans-serif; color: #ffffff; font-size: 16px;" border="0">
15
  </a>
16
  </td>
17
  <td width="400" align="right" class="mobile-hide">
18
  <table border="0" cellpadding="0" cellspacing="0">
19
  <tr>
20
  <td align="right" style="padding: 0 0 5px 0; font-size: 14px; font-family: Arial, sans-serif; color: #666666; text-decoration: none;" class="tnpc-row-edit" data-type="text">
21
+ <span style="color: #666666; text-decoration: none;" ><?php echo isset($block_options['header_sub']) ? $block_options['header_sub'] : 'A little text up top can be nice.<br>Maybe a link to tweet?' ?></span>
22
  </td>
23
  </tr>
24
  </table>
emails/tnp-composer/index.php CHANGED
@@ -54,7 +54,7 @@ $block_options = get_option('newsletter_main');
54
  <div id="newsletter-builder-area-center-frame-content">
55
 
56
  <?php
57
- if ($email) {
58
  $x = strpos($body, '<body');
59
  if ($x !== false) {
60
  $x = strpos($body, '>', $x);
54
  <div id="newsletter-builder-area-center-frame-content">
55
 
56
  <?php
57
+ if (isset($email)) {
58
  $x = strpos($body, '<body');
59
  if ($x !== false) {
60
  $x = strpos($body, '>', $x);
includes/controls.php CHANGED
@@ -533,7 +533,7 @@ class NewsletterControls {
533
  */
534
  function checkbox_group($name, $value, $label = '') {
535
  echo '<label><input type="checkbox" id="' . $name . '" name="options[' . $name . '][]" value="' . esc_attr($value) . '"';
536
- if (is_array($this->data[$name]) && array_search($value, $this->data[$name]) !== false) {
537
  echo ' checked';
538
  }
539
  echo '/>';
533
  */
534
  function checkbox_group($name, $value, $label = '') {
535
  echo '<label><input type="checkbox" id="' . $name . '" name="options[' . $name . '][]" value="' . esc_attr($value) . '"';
536
+ if (isset($this->data[$name]) && is_array($this->data[$name]) && array_search($value, $this->data[$name]) !== false) {
537
  echo ' checked';
538
  }
539
  echo '/>';
includes/module.php CHANGED
@@ -546,13 +546,17 @@ class NewsletterModule {
546
  $name = apply_filters('newsletter_admin_page', $name);
547
  add_submenu_page(null, $title, $title, ($newsletter->options['editor'] == 1) ? 'manage_categories' : 'manage_options', $name, array($this, 'menu_page'));
548
  }
 
 
 
 
549
 
550
  function menu_page() {
551
  global $plugin_page, $newsletter, $wpdb;
552
 
553
  $parts = explode('_', $plugin_page, 3);
554
- $module = sanitize_file_name($parts[1]);
555
- $page = sanitize_file_name($parts[2]);
556
  $page = str_replace('_', '-', $page);
557
 
558
  $file = WP_CONTENT_DIR . '/extensions/newsletter/' . $module . '/' . $page . '.php';
546
  $name = apply_filters('newsletter_admin_page', $name);
547
  add_submenu_page(null, $title, $title, ($newsletter->options['editor'] == 1) ? 'manage_categories' : 'manage_options', $name, array($this, 'menu_page'));
548
  }
549
+
550
+ function sanitize_file_name($name) {
551
+ return preg_replace('/[^a-z_\\-]/i', '', $name);
552
+ }
553
 
554
  function menu_page() {
555
  global $plugin_page, $newsletter, $wpdb;
556
 
557
  $parts = explode('_', $plugin_page, 3);
558
+ $module = $this->sanitize_file_name($parts[1]);
559
+ $page = $this->sanitize_file_name($parts[2]);
560
  $page = str_replace('_', '-', $page);
561
 
562
  $file = WP_CONTENT_DIR . '/extensions/newsletter/' . $module . '/' . $page . '.php';
main/index.php CHANGED
@@ -239,7 +239,7 @@ $labels = array_reverse($labels);
239
  <a href="<?php echo $emails_module->get_admin_page_url('index'); ?>">
240
  <i class="fa fa-list"></i> <?php _e('List', 'newsletter') ?>
241
  </a>
242
- <a href="<?php echo $emails_module->get_admin_page_url('composer'); ?>">
243
  <i class="fa fa-plus-square"></i> <?php _e('New', 'newsletter') ?>
244
  </a>
245
  </h3>
239
  <a href="<?php echo $emails_module->get_admin_page_url('index'); ?>">
240
  <i class="fa fa-list"></i> <?php _e('List', 'newsletter') ?>
241
  </a>
242
+ <a href="<?php echo $emails_module->get_admin_page_url('theme'); ?>">
243
  <i class="fa fa-plus-square"></i> <?php _e('New', 'newsletter') ?>
244
  </a>
245
  </h3>
plugin.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Newsletter
5
  Plugin URI: http://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="http://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
7
- Version: 4.5.4
8
  Author: Stefano Lissa & The Newsletter Team
9
  Author URI: http://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', '4.5.4');
18
 
19
  global $wpdb, $newsletter;
20
 
4
  Plugin Name: Newsletter
5
  Plugin URI: http://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="http://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
7
+ Version: 4.5.6
8
  Author: Stefano Lissa & The Newsletter Team
9
  Author URI: http://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', '4.5.6');
18
 
19
  global $wpdb, $newsletter;
20
 
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === Newsletter ===
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.5.2
5
- Stable tag: 4.5.4
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
@@ -77,8 +77,12 @@ Thank you, The Newsletter Team
77
 
78
  == Changelog ==
79
 
80
- = 4.5.4 =
81
 
 
 
 
 
82
  * Fix "isHTML" error
83
  * jQuery conflict fix
84
  * Escape fix
1
  === Newsletter ===
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.5.3
5
+ Stable tag: 4.5.6
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
77
 
78
  == Changelog ==
79
 
80
+ = 4.5.6 =
81
 
82
+ * New unified themes and composer selection screen
83
+ * Fixed the WP integration panel (incompatibility with WP 4.5.3)
84
+ * Removed few notices
85
+ * More warning fix
86
  * Fix "isHTML" error
87
  * jQuery conflict fix
88
  * Escape fix
widget.php CHANGED
@@ -92,6 +92,9 @@ class NewsletterWidget extends WP_Widget {
92
  function widget($args, $instance) {
93
  global $newsletter;
94
  extract($args);
 
 
 
95
 
96
  echo $before_widget;
97
 
92
  function widget($args, $instance) {
93
  global $newsletter;
94
  extract($args);
95
+
96
+ if (empty($instance)) $instance = array();
97
+ $instance = array_merge(array('text'=>'', 'title'=>''), $instance);
98
 
99
  echo $before_widget;
100