Newsletter - Version 5.8.0

Version Description

  • Add-ons manager compatibility
Download this release

Release Info

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

Code changes from version 5.7.9 to 5.8.0

Files changed (4) hide show
  1. admin.css +26 -0
  2. plugin.php +46 -4
  3. readme.txt +5 -1
  4. tnp-header.php +6 -1
admin.css CHANGED
@@ -2084,3 +2084,29 @@ iframe.tnp-editor-preview-desktop {
2084
  height: 500px;
2085
  float: left;
2086
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2084
  height: 500px;
2085
  float: left;
2086
  }
2087
+
2088
+
2089
+ /* Form inserimento licenza in Addons Manager */
2090
+
2091
+ #tnp-license-control {
2092
+ border: 2px solid #27313C;
2093
+ display: inline-block;
2094
+ padding: 15px 25px;
2095
+ margin-left: -10px;
2096
+ margin-top: 15px;
2097
+ border-radius: 2px;
2098
+ }
2099
+
2100
+ #tnp-license-control form {
2101
+ margin-bottom: 10px;
2102
+ margin-top: 10px;
2103
+ }
2104
+
2105
+ #tnp-license-control form input {
2106
+ padding-left: 10px;
2107
+ }
2108
+
2109
+ #tnp-license-control a {
2110
+ border-bottom: none;
2111
+
2112
+ }
plugin.php CHANGED
@@ -4,17 +4,32 @@
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.
11
  Text Domain: newsletter
 
12
 
13
  Copyright 2009-2018 The Newsletter Team (email: info@thenewsletterplugin.com, web: https://www.thenewsletterplugin.com)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
 
@@ -336,7 +351,7 @@ class Newsletter extends NewsletterModule {
336
 
337
  function add_extensions_menu() {
338
  if (!class_exists('NewsletterExtensions')) {
339
- $this->add_menu_page('extensions', '<span style="color:#27AE60; font-weight: bold;">Add-ons</span>');
340
  }
341
  }
342
 
@@ -1148,7 +1163,7 @@ class Newsletter extends NewsletterModule {
1148
  */
1149
  function getTnpExtensions() {
1150
 
1151
- $extensions_json = false; //get_transient('tnp_extensions_json');
1152
 
1153
  if (false === $extensions_json) {
1154
  $url = "http://www.thenewsletterplugin.com/wp-content/extensions.json";
@@ -1227,6 +1242,33 @@ class Newsletter extends NewsletterModule {
1227
  return $this->newsletter_page_url;
1228
  }
1229
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1230
  }
1231
 
1232
  $newsletter = Newsletter::instance();
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.8.0
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.
11
  Text Domain: newsletter
12
+ License: GPLv2 or later
13
 
14
  Copyright 2009-2018 The Newsletter Team (email: info@thenewsletterplugin.com, web: https://www.thenewsletterplugin.com)
15
+
16
+ Newsletter is free software: you can redistribute it and/or modify
17
+ it under the terms of the GNU General Public License as published by
18
+ the Free Software Foundation, either version 2 of the License, or
19
+ any later version.
20
+
21
+ Newsletter is distributed in the hope that it will be useful,
22
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ GNU General Public License for more details.
25
+
26
+ You should have received a copy of the GNU General Public License
27
+ along with Newsletter. If not, see https://www.gnu.org/licenses/gpl-2.0.html.
28
+
29
  */
30
 
31
  // Used as dummy parameter on css and js links
32
+ define('NEWSLETTER_VERSION', '5.8.0');
33
 
34
  global $newsletter, $wpdb;
35
 
351
 
352
  function add_extensions_menu() {
353
  if (!class_exists('NewsletterExtensions')) {
354
+ $this->add_menu_page('extensions', '<span style="color:#27AE60; font-weight: bold;">Addons</span>');
355
  }
356
  }
357
 
1163
  */
1164
  function getTnpExtensions() {
1165
 
1166
+ $extensions_json = get_transient('tnp_extensions_json');
1167
 
1168
  if (false === $extensions_json) {
1169
  $url = "http://www.thenewsletterplugin.com/wp-content/extensions.json";
1242
  return $this->newsletter_page_url;
1243
  }
1244
 
1245
+ function get_license_key() {
1246
+ if (defined('NEWSLETTER_LICENSE_KEY')) {
1247
+ return NEWSLETTER_LICENSE_KEY;
1248
+ } else {
1249
+ if (!empty($this->options['contract_key'])) {
1250
+ return $this->options['contract_key'];
1251
+ }
1252
+ }
1253
+ return false;
1254
+ }
1255
+
1256
+ public static function check_license($license_key) {
1257
+ $response = wp_remote_get('http://www.thenewsletterplugin.com/wp-content/plugins/file-commerce-pro/check.php?k=' . urlencode($license_key), array('sslverify' => false));
1258
+ if (is_wp_error($response)) {
1259
+ /* @var $response WP_Error */
1260
+ return new WP_Error(-1,'It seems that your blog cannot contact the license validator. Ask your provider to unlock the HTTP/HTTPS connections to www.thenewsletterplugin.com<br>'
1261
+ .esc_html($response->get_error_code()) . ' - ' . esc_html($response->get_error_message()));
1262
+ } else if ($response['response']['code'] != 200) {
1263
+ return new WP_Error(-1,'[' . $response['response']['code'] . '] The license seems expired or not valid, please check your <a href="https://www.thenewsletterplugin.com/account">license code and status</a>, thank you.'
1264
+ .'<br>You can anyway download the professional extension from https://www.thenewsletterplugin.com.');
1265
+ } elseif ($expires = json_decode(wp_remote_retrieve_body($response))) {
1266
+ return array('expires' => $expires->expire, 'message' => 'Your license is valid and expires on ' . esc_html(date('Y-m-d', $expires->expire)));
1267
+ } else {
1268
+ return new WP_Error(-1,'Unable to detect the license expiration. Debug data to report to the support: <code>' . esc_html(wp_remote_retrieve_body($response)) . '</code>');
1269
+ }
1270
+ }
1271
+
1272
  }
1273
 
1274
  $newsletter = Newsletter::instance();
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.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,6 +117,10 @@ Thank you, The Newsletter Team
117
 
118
  == Changelog ==
119
 
 
 
 
 
120
  = 5.7.9 =
121
 
122
  * Fixes on add-ons panel
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.8.0
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.8.0 =
121
+
122
+ * Add-ons manager compatibility
123
+
124
  = 5.7.9 =
125
 
126
  * Fixes on add-ons panel
tnp-header.php CHANGED
@@ -143,7 +143,12 @@ $warning |= empty($status_options['mail']);
143
  <?php } else { ?>
144
  <?php if (Newsletter::instance()->options['licence_expires'] > time()) { ?>
145
  <li class="tnp-professional-extensions-button">
146
- <a href="?page=newsletter_main_extensions"><i class="fa fa-check-square-o"></i> <?php _e('Licence active', 'newsletter') ?></a>
 
 
 
 
 
147
  <?php } elseif (Newsletter::instance()->options['licence_expires'] < time()) { ?>
148
  <li class="tnp-professional-extensions-button-red">
149
  <a href="?page=newsletter_main_main"><i class="fa fa-hand-paper-o" style="color: white"></i> <?php _e('Licence expired', 'newsletter') ?></a>
143
  <?php } else { ?>
144
  <?php if (Newsletter::instance()->options['licence_expires'] > time()) { ?>
145
  <li class="tnp-professional-extensions-button">
146
+ <?php if (!class_exists('NewsletterExtensions')) {
147
+ echo '<a href="?page=newsletter_main_extensions">';
148
+ } else {
149
+ echo '<a href="?page=newsletter_extensions_index">';
150
+ } ?>
151
+ <i class="fa fa-check-square-o"></i> <?php _e('Licence active', 'newsletter') ?></a>
152
  <?php } elseif (Newsletter::instance()->options['licence_expires'] < time()) { ?>
153
  <li class="tnp-professional-extensions-button-red">
154
  <a href="?page=newsletter_main_main"><i class="fa fa-hand-paper-o" style="color: white"></i> <?php _e('Licence expired', 'newsletter') ?></a>