Newsletter - Version 5.1.8

Version Description

=

Newsletter page creation fix

=

Download this release

Release Info

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

Code changes from version 5.1.7 to 5.1.8

Files changed (3) hide show
  1. main/welcome.php +2 -39
  2. plugin.php +2 -2
  3. readme.txt +5 -1
main/welcome.php CHANGED
@@ -22,32 +22,6 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_GET['action']) && $_GET['act
22
  die();
23
  }
24
 
25
- if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_GET['action']) && $_GET['action'] == 'page') {
26
- // Dedicated page
27
- $module = NewsletterSubscription::instance();
28
- $options = $module->get_options();
29
- $page_exists = !empty($options['page']) && get_permalink($options['page']);
30
- if (!$page_exists) {
31
- // Page creation
32
- $page = array();
33
- $page['post_title'] = 'Newsletter';
34
- $page['post_content'] = '[newsletter]';
35
- $page['post_status'] = 'publish';
36
- $page['post_type'] = 'page';
37
- $page['comment_status'] = 'closed';
38
- $page['ping_status'] = 'closed';
39
- $page['post_category'] = array(1);
40
-
41
- // Insert the post into the database
42
- $page_id = wp_insert_post($page);
43
-
44
- $options['page'] = $page_id;
45
- $module->save_options($options);
46
- }
47
- echo 'The page has been setup, thank you!';
48
- die();
49
- }
50
-
51
  if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_GET['action']) && $_GET['action'] == 'test') {
52
  $module = Newsletter::instance();
53
  $email = $_POST['test_email'];
@@ -83,6 +57,7 @@ $main_options = Newsletter::instance()->get_options();
83
  $subscription_options = NewsletterSubscription::instance()->get_options();
84
 
85
  $page_exists = !empty($subscription_options['page']) && get_permalink($subscription_options['page']);
 
86
  if (!$page_exists) {
87
  // Page creation
88
  $page = array();
@@ -98,7 +73,7 @@ if (!$page_exists) {
98
  $page_id = wp_insert_post($page);
99
 
100
  $subscription_options['page'] = $page_id;
101
- NewsletterSubscription::instance()->save_options($options);
102
  $subscription_options = NewsletterSubscription::instance()->get_options();
103
  $page_exists = true;
104
  }
@@ -107,13 +82,6 @@ if (!$page_exists) {
107
  <script src="<?php echo plugins_url('newsletter') ?>/main/js/snap.svg-min.js"></script>
108
  <script src="<?php echo plugins_url('newsletter') ?>/main/js/main.js"></script>
109
  <script>
110
- // Dedicated page creation call
111
- function tnp_welcome_page() {
112
- jQuery.post("?page=newsletter_main_welcome&noheader=1&action=page", function (response) {
113
- alert(response);
114
- });
115
- }
116
-
117
  // Email test
118
  function tnp_welcome_test() {
119
  jQuery.post("?page=newsletter_main_welcome&noheader=1&action=test",
@@ -182,11 +150,6 @@ if (!$page_exists) {
182
  <div>
183
  <h2><?php _e ('Subscription and Edit<br>page creation', 'newsletter'); ?></h2>
184
  <p><?php _e ('We\'ve just created the page where your visitors will subscribe and where they will edit their preferences.', 'newsletter'); ?></p>
185
- <!--
186
- <div class="tnp-margin-top">
187
- <a href="#" class="tnp-welcome-confirm-button" onclick="tnp_welcome_page(); return false;">Generate page</a>
188
- </div>
189
- -->
190
  </div>
191
  </li>
192
  <li>
22
  die();
23
  }
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_GET['action']) && $_GET['action'] == 'test') {
26
  $module = Newsletter::instance();
27
  $email = $_POST['test_email'];
57
  $subscription_options = NewsletterSubscription::instance()->get_options();
58
 
59
  $page_exists = !empty($subscription_options['page']) && get_permalink($subscription_options['page']);
60
+
61
  if (!$page_exists) {
62
  // Page creation
63
  $page = array();
73
  $page_id = wp_insert_post($page);
74
 
75
  $subscription_options['page'] = $page_id;
76
+ NewsletterSubscription::instance()->save_options($subscription_options);
77
  $subscription_options = NewsletterSubscription::instance()->get_options();
78
  $page_exists = true;
79
  }
82
  <script src="<?php echo plugins_url('newsletter') ?>/main/js/snap.svg-min.js"></script>
83
  <script src="<?php echo plugins_url('newsletter') ?>/main/js/main.js"></script>
84
  <script>
 
 
 
 
 
 
 
85
  // Email test
86
  function tnp_welcome_test() {
87
  jQuery.post("?page=newsletter_main_welcome&noheader=1&action=test",
150
  <div>
151
  <h2><?php _e ('Subscription and Edit<br>page creation', 'newsletter'); ?></h2>
152
  <p><?php _e ('We\'ve just created the page where your visitors will subscribe and where they will edit their preferences.', 'newsletter'); ?></p>
 
 
 
 
 
153
  </div>
154
  </li>
155
  <li>
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.1.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.1.7');
18
 
19
  global $wpdb, $newsletter;
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.1.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.1.8');
18
 
19
  global $wpdb, $newsletter;
20
 
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.1
5
- Stable tag: 5.1.7
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
@@ -85,6 +85,10 @@ Thank you, The Newsletter Team
85
 
86
  == Changelog ==
87
 
 
 
 
 
88
  == 5.1.7 ==
89
 
90
  * NEW! Welcome wizard
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.1
5
+ Stable tag: 5.1.8
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
85
 
86
  == Changelog ==
87
 
88
+ == 5.1.8 ==
89
+
90
+ Newsletter page creation fix
91
+
92
  == 5.1.7 ==
93
 
94
  * NEW! Welcome wizard