Newsletter - Version 5.7.9

Version Description

  • Fixes on add-ons panel
Download this release

Release Info

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

Code changes from version 5.7.8 to 5.7.9

Files changed (3) hide show
  1. main/extensions.php +83 -64
  2. plugin.php +6 -2
  3. readme.txt +5 -1
main/extensions.php CHANGED
@@ -7,27 +7,34 @@ $extensions = $module->getTnpExtensions();
7
  $controls->data = get_option('newsletter_main');
8
 
9
  if (isset($_POST['email']) && check_admin_referer('subscribe')) {
10
- $body = array();
11
- $body['ne'] = $_POST['email'];
12
- $body['nr'] = 'extensions';
13
- $body['nl'] = array('3', '4', '1');
14
- $body['optin'] = 'single';
15
 
16
- wp_remote_post('http://www.thenewsletterplugin.com/?na=ajaxsub', array('body'=>$body));
17
 
18
- update_option('newsletter_subscribed', time(), false);
19
 
20
- $id = (int)$_POST['id'];
21
- wp_redirect(wp_nonce_url(admin_url('admin.php'), 'save') . '&page=newsletter_main_extensions&act=install&id=' . $id);
22
- die();
23
  }
24
 
25
  $subscribed = get_option('newsletter_subscribed', false);
 
 
 
 
 
 
 
26
  ?>
27
 
28
  <div class="wrap" id="tnp-wrap">
29
 
30
- <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
31
 
32
  <div id="tnp-heading">
33
 
@@ -39,117 +46,129 @@ $subscribed = get_option('newsletter_subscribed', false);
39
 
40
  <div id="tnp-body">
41
 
42
- <?php if (is_array($extensions)) { ?>
43
 
44
  <!--PREMIUM EXTENSIONS-->
45
- <?php foreach ($extensions AS $e) { ?>
46
 
47
- <?php
48
- $e->activate_url = wp_nonce_url(admin_url('admin.php') . '?page=newsletter_main_extensions&act=activate&id=' . $e->id, 'save');
49
- $e->install_url = wp_nonce_url(admin_url('admin.php') . '?page=newsletter_main_extensions&act=install&id=' . $e->id, 'save');
50
- ?>
51
 
52
  <!--PREMIUM EXTENSIONS-->
53
- <?php if ($e->type == "premium") { ?>
54
  <div class="tnp-extension-premium-box <?php echo $e->slug ?>">
55
  <div class="tnp-extensions-image"><img src="<?php echo $e->image ?>" alt="" /></div>
56
  <h3><?php echo $e->title ?></h3>
57
  <p><?php echo $e->description ?></p>
58
  <div class="tnp-extension-premium-action">
59
- <?php if (is_plugin_active($e->wp_slug)) { ?>
60
  <span><i class="fa fa-check" aria-hidden="true"></i> <?php _e('Plugin active', 'newsletter') ?></span>
61
- <?php } elseif (file_exists(WP_PLUGIN_DIR . "/" . $e->wp_slug)) { ?>
62
  <a href="<?php echo $e->activate_url ?>" class="tnp-extension-activate">
63
  <i class="fa fa-power-off" aria-hidden="true"></i> <?php _e('Activate', 'newsletter') ?>
64
  </a>
65
- <?php } else { ?>
66
- <a href="<?php echo $e->url ?>" class="tnp-extension-install" target="_blank">
67
- BUY NOW
68
- </a>
69
- <?php } ?>
 
 
 
 
 
 
70
  </div>
71
  </div>
72
- <?php } ?>
73
- <?php } ?>
74
 
75
  <!--FREE EXTENSIONS-->
76
- <?php foreach ($extensions AS $e) { ?>
77
-
78
- <?php
79
- $e->activate_url = wp_nonce_url(admin_url('admin.php') . '?page=newsletter_main_extensions&act=activate&id=' . $e->id, 'save');
80
- if ($subscribed) {
81
- $e->install_url = wp_nonce_url(admin_url('admin.php') . '?page=newsletter_main_extensions&act=install&id=' . $e->id, 'save');
82
- } else {
83
- $e->install_url = 'javascript:newsletter_subscribe(' . $e->id . ')';
84
- }
85
- ?>
86
- <?php if ($e->type == "free") { ?>
87
  <div class="tnp-extension-free-box <?php echo $e->slug ?>">
88
- <img class="tnp-extensions-free-badge" src="<?php echo plugins_url('newsletter')?>/images/extension-free.png">
89
  <div class="tnp-extensions-image"><img src="<?php echo $e->image ?>"></div>
90
  <h3><?php echo $e->title ?></h3>
91
  <p><?php echo $e->description ?></p>
92
  <div class="tnp-extension-free-action">
93
- <?php if (is_plugin_active($e->wp_slug)) { ?>
94
  <span><i class="fa fa-check" aria-hidden="true"></i> <?php _e('Plugin active', 'newsletter') ?></span>
95
- <?php } elseif (file_exists(WP_PLUGIN_DIR . "/" . $e->wp_slug)) { ?>
96
  <a href="<?php echo $e->activate_url ?>" class="tnp-extension-activate">
97
  <i class="fa fa-power-off" aria-hidden="true"></i> <?php _e('Activate', 'newsletter') ?>
98
  </a>
99
- <?php } else { ?>
100
  <a href="<?php echo $e->url ?>" class="tnp-extension-install" target="_blank">
101
  <i class="fa fa-download" aria-hidden="true"></i> Download now
102
  </a>
103
- <?php } ?>
104
  </div>
105
  </div>
106
- <?php } ?>
107
 
108
- <?php } ?>
109
 
110
  <!-- INTEGRATIONS -->
111
- <?php foreach ($extensions AS $e) { ?>
112
 
113
- <?php
114
- $e->activate_url = wp_nonce_url(admin_url('admin.php') . '?page=newsletter_main_extensions&act=activate&id=' . $e->id, 'save');
115
- $e->install_url = wp_nonce_url(admin_url('admin.php') . '?page=newsletter_main_extensions&act=install&id=' . $e->id, 'save');
116
- ?>
117
- <?php if ($e->type == "integration") { ?>
118
  <div class="tnp-integration-box <?php echo $e->slug ?>">
119
  <div class="tnp-extensions-image"><img src="<?php echo $e->image ?>" alt="" /></div>
120
  <h3><?php echo $e->title ?></h3>
121
  <p><?php echo $e->description ?></p>
122
  <div class="tnp-integration-action">
123
- <?php if (is_plugin_active($e->wp_slug)) { ?>
124
  <span><i class="fa fa-check" aria-hidden="true"></i> <?php _e('Plugin active', 'newsletter') ?></span>
125
- <?php } elseif (file_exists(WP_PLUGIN_DIR . "/" . $e->wp_slug)) { ?>
126
  <a href="<?php echo $e->activate_url ?>" class="tnp-extension-activate">
127
  <i class="fa fa-power-off" aria-hidden="true"></i> <?php _e('Activate', 'newsletter') ?>
128
  </a>
129
- <?php } else { ?>
130
- <a href="<?php echo $e->url ?>" class="tnp-extension-install" target="_blank">
131
- BUY NOW
132
- </a>
133
- <?php } ?>
 
 
 
 
 
 
134
  </div>
135
  </div>
136
- <?php } ?>
137
 
138
- <?php } ?>
139
 
140
 
141
- <?php } else { ?>
142
 
143
  <p style="color: white;">No extensions available.</p>
144
 
145
- <?php } ?>
146
 
147
 
148
  <p class="clear"></p>
149
 
150
  </div>
151
 
152
- <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
153
 
154
  </div>
155
 
@@ -169,7 +188,7 @@ $subscribed = get_option('newsletter_subscribed', false);
169
  Subscribe our newsletter to get this extension<br>
170
  and be informed about updates and best practices.</div>
171
  <form method="post" action="?page=newsletter_main_extensions&noheader=true">
172
- <?php wp_nonce_field('subscribe'); ?>
173
  <input type="hidden" value="id" name="id" id="tnp-extension-id">
174
  <div id="tnp-subscribe-email-wrapper"><input type="email" id="tnp-subscribe-email" name="email" value="<?php echo esc_attr(get_option('admin_email')) ?>"></div>
175
  <div id="tnp-subscribe-submit-wrapper"><input type="submit" id="tnp-subscribe-submit" value="<?php esc_attr_e('Subscribe', 'newsletter') ?>"></div>
7
  $controls->data = get_option('newsletter_main');
8
 
9
  if (isset($_POST['email']) && check_admin_referer('subscribe')) {
10
+ $body = array();
11
+ $body['ne'] = $_POST['email'];
12
+ $body['nr'] = 'extensions';
13
+ $body['nl'] = array('3', '4', '1');
14
+ $body['optin'] = 'single';
15
 
16
+ wp_remote_post('http://www.thenewsletterplugin.com/?na=ajaxsub', array('body' => $body));
17
 
18
+ update_option('newsletter_subscribed', time(), false);
19
 
20
+ $id = (int) $_POST['id'];
21
+ wp_redirect(wp_nonce_url(admin_url('admin.php'), 'save') . '&page=newsletter_main_extensions&act=install&id=' . $id);
22
+ die();
23
  }
24
 
25
  $subscribed = get_option('newsletter_subscribed', false);
26
+ $has_license = !empty(Newsletter::instance()->options['contract_key']);
27
+ if ($has_license) {
28
+ if (!class_exists('NewsletterExtensions')) {
29
+ $controls->warnings = 'Please, install our add-ons manager to manage all extensions from this panel.
30
+ <a href="https://www.thenewsletterplugin.com/documentation/how-to-install-the-addons-manager" target="_blank">Get it here</a>.';
31
+ }
32
+ }
33
  ?>
34
 
35
  <div class="wrap" id="tnp-wrap">
36
 
37
+ <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
38
 
39
  <div id="tnp-heading">
40
 
46
 
47
  <div id="tnp-body">
48
 
49
+ <?php if (is_array($extensions)) { ?>
50
 
51
  <!--PREMIUM EXTENSIONS-->
52
+ <?php foreach ($extensions AS $e) { ?>
53
 
54
+ <?php
55
+ $e->activate_url = wp_nonce_url(admin_url('admin.php') . '?page=newsletter_main_extensions&act=activate&id=' . $e->id, 'save');
56
+ $e->install_url = wp_nonce_url(admin_url('admin.php') . '?page=newsletter_main_extensions&act=install&id=' . $e->id, 'save');
57
+ ?>
58
 
59
  <!--PREMIUM EXTENSIONS-->
60
+ <?php if ($e->type == "premium") { ?>
61
  <div class="tnp-extension-premium-box <?php echo $e->slug ?>">
62
  <div class="tnp-extensions-image"><img src="<?php echo $e->image ?>" alt="" /></div>
63
  <h3><?php echo $e->title ?></h3>
64
  <p><?php echo $e->description ?></p>
65
  <div class="tnp-extension-premium-action">
66
+ <?php if (is_plugin_active($e->wp_slug)) { ?>
67
  <span><i class="fa fa-check" aria-hidden="true"></i> <?php _e('Plugin active', 'newsletter') ?></span>
68
+ <?php } elseif (file_exists(WP_PLUGIN_DIR . "/" . $e->wp_slug)) { ?>
69
  <a href="<?php echo $e->activate_url ?>" class="tnp-extension-activate">
70
  <i class="fa fa-power-off" aria-hidden="true"></i> <?php _e('Activate', 'newsletter') ?>
71
  </a>
72
+ <?php } else { ?>
73
+ <?php if ($has_license) { ?>
74
+ <a href="https://www.thenewsletterplugin.com/account" class="tnp-extension-install" target="_blank">
75
+ DOWNLOAD NOW
76
+ </a>
77
+ <?php } else { ?>
78
+ <a href="<?php echo $e->url ?>" class="tnp-extension-install" target="_blank">
79
+ BUY NOW
80
+ </a>
81
+ <?php } ?>
82
+ <?php } ?>
83
  </div>
84
  </div>
85
+ <?php } ?>
86
+ <?php } ?>
87
 
88
  <!--FREE EXTENSIONS-->
89
+ <?php foreach ($extensions AS $e) { ?>
90
+
91
+ <?php
92
+ $e->activate_url = wp_nonce_url(admin_url('admin.php') . '?page=newsletter_main_extensions&act=activate&id=' . $e->id, 'save');
93
+ if ($subscribed) {
94
+ $e->install_url = wp_nonce_url(admin_url('admin.php') . '?page=newsletter_main_extensions&act=install&id=' . $e->id, 'save');
95
+ } else {
96
+ $e->install_url = 'javascript:newsletter_subscribe(' . $e->id . ')';
97
+ }
98
+ ?>
99
+ <?php if ($e->type == "free") { ?>
100
  <div class="tnp-extension-free-box <?php echo $e->slug ?>">
101
+ <img class="tnp-extensions-free-badge" src="<?php echo plugins_url('newsletter') ?>/images/extension-free.png">
102
  <div class="tnp-extensions-image"><img src="<?php echo $e->image ?>"></div>
103
  <h3><?php echo $e->title ?></h3>
104
  <p><?php echo $e->description ?></p>
105
  <div class="tnp-extension-free-action">
106
+ <?php if (is_plugin_active($e->wp_slug)) { ?>
107
  <span><i class="fa fa-check" aria-hidden="true"></i> <?php _e('Plugin active', 'newsletter') ?></span>
108
+ <?php } elseif (file_exists(WP_PLUGIN_DIR . "/" . $e->wp_slug)) { ?>
109
  <a href="<?php echo $e->activate_url ?>" class="tnp-extension-activate">
110
  <i class="fa fa-power-off" aria-hidden="true"></i> <?php _e('Activate', 'newsletter') ?>
111
  </a>
112
+ <?php } else { ?>
113
  <a href="<?php echo $e->url ?>" class="tnp-extension-install" target="_blank">
114
  <i class="fa fa-download" aria-hidden="true"></i> Download now
115
  </a>
116
+ <?php } ?>
117
  </div>
118
  </div>
119
+ <?php } ?>
120
 
121
+ <?php } ?>
122
 
123
  <!-- INTEGRATIONS -->
124
+ <?php foreach ($extensions AS $e) { ?>
125
 
126
+ <?php
127
+ $e->activate_url = wp_nonce_url(admin_url('admin.php') . '?page=newsletter_main_extensions&act=activate&id=' . $e->id, 'save');
128
+ $e->install_url = wp_nonce_url(admin_url('admin.php') . '?page=newsletter_main_extensions&act=install&id=' . $e->id, 'save');
129
+ ?>
130
+ <?php if ($e->type == "integration") { ?>
131
  <div class="tnp-integration-box <?php echo $e->slug ?>">
132
  <div class="tnp-extensions-image"><img src="<?php echo $e->image ?>" alt="" /></div>
133
  <h3><?php echo $e->title ?></h3>
134
  <p><?php echo $e->description ?></p>
135
  <div class="tnp-integration-action">
136
+ <?php if (is_plugin_active($e->wp_slug)) { ?>
137
  <span><i class="fa fa-check" aria-hidden="true"></i> <?php _e('Plugin active', 'newsletter') ?></span>
138
+ <?php } elseif (file_exists(WP_PLUGIN_DIR . "/" . $e->wp_slug)) { ?>
139
  <a href="<?php echo $e->activate_url ?>" class="tnp-extension-activate">
140
  <i class="fa fa-power-off" aria-hidden="true"></i> <?php _e('Activate', 'newsletter') ?>
141
  </a>
142
+ <?php } else { ?>
143
+ <?php if ($has_license) { ?>
144
+ <a href="https://www.thenewsletterplugin.com/account" class="tnp-extension-install" target="_blank">
145
+ DOWNLOAD NOW
146
+ </a>
147
+ <?php } else { ?>
148
+ <a href="<?php echo $e->url ?>" class="tnp-extension-install" target="_blank">
149
+ BUY NOW
150
+ </a>
151
+ <?php } ?>
152
+ <?php } ?>
153
  </div>
154
  </div>
155
+ <?php } ?>
156
 
157
+ <?php } ?>
158
 
159
 
160
+ <?php } else { ?>
161
 
162
  <p style="color: white;">No extensions available.</p>
163
 
164
+ <?php } ?>
165
 
166
 
167
  <p class="clear"></p>
168
 
169
  </div>
170
 
171
+ <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
172
 
173
  </div>
174
 
188
  Subscribe our newsletter to get this extension<br>
189
  and be informed about updates and best practices.</div>
190
  <form method="post" action="?page=newsletter_main_extensions&noheader=true">
191
+ <?php wp_nonce_field('subscribe'); ?>
192
  <input type="hidden" value="id" name="id" id="tnp-extension-id">
193
  <div id="tnp-subscribe-email-wrapper"><input type="email" id="tnp-subscribe-email" name="email" value="<?php echo esc_attr(get_option('admin_email')) ?>"></div>
194
  <div id="tnp-subscribe-submit-wrapper"><input type="submit" id="tnp-subscribe-submit" value="<?php esc_attr_e('Subscribe', 'newsletter') ?>"></div>
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.7.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,7 +14,7 @@
14
  */
15
 
16
  // Used as dummy parameter on css and js links
17
- define('NEWSLETTER_VERSION', '5.7.8');
18
 
19
  global $newsletter, $wpdb;
20
 
@@ -1177,6 +1177,10 @@ class Newsletter extends NewsletterModule {
1177
  if (function_exists('load_plugin_textdomain')) {
1178
  load_plugin_textdomain('newsletter', false, plugin_basename(dirname(__FILE__)) . '/languages');
1179
  }
 
 
 
 
1180
  }
1181
 
1182
  var $panels = array();
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.7.9
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.7.9');
18
 
19
  global $newsletter, $wpdb;
20
 
1177
  if (function_exists('load_plugin_textdomain')) {
1178
  load_plugin_textdomain('newsletter', false, plugin_basename(dirname(__FILE__)) . '/languages');
1179
  }
1180
+
1181
+ if (!empty($this->action)) {
1182
+ do_action('newsletter_action', $this->action);
1183
+ }
1184
  }
1185
 
1186
  var $panels = array();
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing,automation,automated,mailing list
3
  Requires at least: 3.4.0
4
  Tested up to: 4.9.8
5
- Stable tag: 5.7.8
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
@@ -117,6 +117,10 @@ Thank you, The Newsletter Team
117
 
118
  == Changelog ==
119
 
 
 
 
 
120
  = 5.7.8 =
121
 
122
  * Support for the [Add on Manager](https://www.thenewsletterplugin.com/documentation/how-to-install-the-addons-manager)
2
  Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing,automation,automated,mailing list
3
  Requires at least: 3.4.0
4
  Tested up to: 4.9.8
5
+ Stable tag: 5.7.9
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
117
 
118
  == Changelog ==
119
 
120
+ = 5.7.9 =
121
+
122
+ * Fixes on add-ons panel
123
+
124
  = 5.7.8 =
125
 
126
  * Support for the [Add on Manager](https://www.thenewsletterplugin.com/documentation/how-to-install-the-addons-manager)