Newsletter - Version 6.7.3

Version Description

  • Added the company_legal tag
  • Change a column type on statitics table to improve performances on site with big subscription lists (100k+)
  • Fix attempt on posts block for RTL languages
Download this release

Release Info

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

Code changes from version 6.7.2 to 6.7.3

emails/blocks/giphy/options.php CHANGED
@@ -9,11 +9,11 @@
9
  <div style="clear: both; max-height: 300px; overflow: scroll; margin-bottom: 15px" id="tnp-giphy-results"></div>
10
 
11
  <?php $controls->hidden('giphy_url') ?>
12
- <div id="giphy-preview">
13
- <?php if (!empty($controls->data['giphy_url'])) { ?>
14
- <img src="<?php echo esc_attr($controls->data['giphy_url'])?>" style="max-width: 300px">
15
- <?php } ?>
16
- </div>
17
 
18
 
19
  <?php $fields->block_commons() ?>
@@ -29,22 +29,26 @@
29
 
30
  jQuery("#options-q").keyup(
31
  function () {
32
- if (typeof(tid) != "undefined") {
33
  window.clearTimeout(tid);
34
  }
35
  tid = window.setTimeout(function () {
36
  var rating = "r";
37
- var limit = 20;
38
  var offset = 0;
39
-
40
- jQuery.get("https://api.giphy.com/v1/gifs/search", {limit: limit, rating: rating, api_key: "57FLbVJJd7oQBZ0fEiRnzhM2VtZp5OP1", q: jQuery("#options-q").val()}, function (data) {
41
- jQuery("#tnp-giphy-results").html("");
42
- jQuery.each(data.data, function (index, value) {
43
- jQuery("#tnp-giphy-results").append('<div style="overflow: hidden; width: 120px; height: 120px; float: left; margin: 5px"><img src="' + value.images.fixed_width_small.url + '" onclick="choose_gif(\'' + value.images.fixed_height.url + '\')" style="float:left; max-width: 100%"></div>');
44
- });
45
- }, "json");
46
- }, 500);
 
 
 
47
  });
48
- jQuery("#options-q").trigger('keyup');
 
49
 
50
  </script>
9
  <div style="clear: both; max-height: 300px; overflow: scroll; margin-bottom: 15px" id="tnp-giphy-results"></div>
10
 
11
  <?php $controls->hidden('giphy_url') ?>
12
+ <div id="giphy-preview">
13
+ <?php if (!empty($controls->data['giphy_url'])) { ?>
14
+ <img src="<?php echo esc_attr($controls->data['giphy_url']) ?>" style="max-width: 300px">
15
+ <?php } ?>
16
+ </div>
17
 
18
 
19
  <?php $fields->block_commons() ?>
29
 
30
  jQuery("#options-q").keyup(
31
  function () {
32
+ if (typeof (tid) != "undefined") {
33
  window.clearTimeout(tid);
34
  }
35
  tid = window.setTimeout(function () {
36
  var rating = "r";
37
+ var limit = 40;
38
  var offset = 0;
39
+
40
+ jQuery.get("https://api.giphy.com/v1/gifs/search", {limit: limit, rating: rating, api_key: "57FLbVJJd7oQBZ0fEiRnzhM2VtZp5OP1", q: jQuery("#options-q").val()}, function (data) {
41
+ jQuery("#tnp-giphy-results").html("");
42
+ jQuery.each(data.data, function (index, value) {
43
+ jQuery("#tnp-giphy-results").append('<div style="overflow: hidden; width: 120px; height: 120px; float: left; margin: 5px"><img src="' + value.images.fixed_width_small.url + '" onclick="choose_gif(\'' + value.images.fixed_height.url + '\')" style="float:left; max-width: 100%"></div>');
44
+ });
45
+ }, "json").fail(function (x) {
46
+ alert('There was an error');
47
+ //console.log(x);
48
+ });
49
+ }, 500);
50
  });
51
+ if (jQuery("#options-q").val() !== '')
52
+ jQuery("#options-q").trigger('keyup');
53
 
54
  </script>
emails/blocks/posts/block.php CHANGED
@@ -229,16 +229,16 @@ remove_all_filters('excerpt_more');
229
  <table border="0" cellspacing="0" cellpadding="0" width="100%">
230
  <?php if (!empty($options['show_date'])) { ?>
231
  <tr>
232
- <td align="left" inline-class="posts-post-date">
233
  <?php echo tnp_post_date($post) ?>
234
  </td>
235
  </tr>
236
  <?php } ?>
237
  <tr>
238
- <td align="left"
239
  inline-class="posts-post-title"
240
  class="tnpc-row-edit tnpc-inline-editable"
241
- data-type="title" data-id="<?php echo $post->ID ?>">
242
  <?php
243
  echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'title', $post->ID) ?
244
  TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'title', $post->ID) :
@@ -247,10 +247,10 @@ remove_all_filters('excerpt_more');
247
  </td>
248
  </tr>
249
  <tr>
250
- <td align="left"
251
  inline-class="posts-post-excerpt"
252
  class="padding-copy tnpc-row-edit tnpc-inline-editable"
253
- data-type="text" data-id="<?php echo $post->ID ?>">
254
  <?php
255
  echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'text', $post->ID) ?
256
  TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'text', $post->ID) :
@@ -259,11 +259,11 @@ remove_all_filters('excerpt_more');
259
  </td>
260
  </tr>
261
  <tr>
262
- <td align="left" class="padding">
263
- <table border="0" cellpadding="0" cellspacing="0" inline-class="posts-button-table" align="right">
264
  <tr>
265
- <td align="center" valign="middle" inline-class="posts-button-td">
266
- <a href="<?php echo esc_attr($url) ?>" target="_blank" inline-class="posts-button-a"><?php echo $button_label ?></a>
267
  </td>
268
  </tr>
269
  </table>
229
  <table border="0" cellspacing="0" cellpadding="0" width="100%">
230
  <?php if (!empty($options['show_date'])) { ?>
231
  <tr>
232
+ <td align="<?php echo $align_left?>" inline-class="posts-post-date">
233
  <?php echo tnp_post_date($post) ?>
234
  </td>
235
  </tr>
236
  <?php } ?>
237
  <tr>
238
+ <td align="<?php echo $align_left?>"
239
  inline-class="posts-post-title"
240
  class="tnpc-row-edit tnpc-inline-editable"
241
+ data-type="title" data-id="<?php echo $post->ID ?>" dir="<?php echo $dir?>">
242
  <?php
243
  echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'title', $post->ID) ?
244
  TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'title', $post->ID) :
247
  </td>
248
  </tr>
249
  <tr>
250
+ <td align="<?php echo $align_left?>"
251
  inline-class="posts-post-excerpt"
252
  class="padding-copy tnpc-row-edit tnpc-inline-editable"
253
+ data-type="text" data-id="<?php echo $post->ID ?>" dir="<?php echo $dir?>">
254
  <?php
255
  echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'text', $post->ID) ?
256
  TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'text', $post->ID) :
259
  </td>
260
  </tr>
261
  <tr>
262
+ <td align="<?php echo $align_left?>" class="padding">
263
+ <table border="0" cellpadding="0" cellspacing="0" inline-class="posts-button-table" align="<?php echo $align_right?>">
264
  <tr>
265
+ <td align="center" valign="middle" inline-class="posts-button-td" dir="<?php echo $dir?>">
266
+ <a href="<?php echo esc_attr($url) ?>" target="_blank" inline-class="posts-button-a" dir="<?php echo $dir?>"><?php echo $button_label ?></a>
267
  </td>
268
  </tr>
269
  </table>
emails/emails.php CHANGED
@@ -325,7 +325,11 @@ class NewsletterEmails extends NewsletterModule {
325
  }
326
 
327
  $out = array('subject' => '', 'return_empty_message' => false, 'stop' => false, 'skip' => false);
328
-
 
 
 
 
329
 
330
  ob_start();
331
  $logger = $this->logger;
325
  }
326
 
327
  $out = array('subject' => '', 'return_empty_message' => false, 'stop' => false, 'skip' => false);
328
+
329
+ $dir = is_rtl()?'rtl':'ltr';
330
+ $align_left = is_rtl()?'right':'left';
331
+ $align_right = is_rtl()?'left':'right';
332
+
333
 
334
  ob_start();
335
  $logger = $this->logger;
includes/composer.php CHANGED
@@ -89,7 +89,9 @@ class TNP_Composer {
89
  $open .= "<style type=\"text/css\">\n";
90
  $open .= NewsletterEmails::instance()->get_composer_css();
91
  $open .= "\n</style>\n";
92
- $open .= "</head>\n<body style=\"margin: 0; padding: 0;\">\n";
 
 
93
  return $open;
94
  }
95
 
89
  $open .= "<style type=\"text/css\">\n";
90
  $open .= NewsletterEmails::instance()->get_composer_css();
91
  $open .= "\n</style>\n";
92
+ $open .= "</head>\n";
93
+ $open .= '<body style="margin: 0; padding: 0;" dir="' . (is_rtl()?'rtl':'ltr') . '">';
94
+ $open .= "\n";
95
  return $open;
96
  }
97
 
includes/module.php CHANGED
@@ -1769,6 +1769,7 @@ class NewsletterModule {
1769
  $options = Newsletter::instance()->get_options('info');
1770
  $text = str_replace('{company_address}', $options['footer_contact'], $text);
1771
  $text = str_replace('{company_name}', $options['footer_title'], $text);
 
1772
 
1773
 
1774
  //$this->logger->debug('Replace end');
1769
  $options = Newsletter::instance()->get_options('info');
1770
  $text = str_replace('{company_address}', $options['footer_contact'], $text);
1771
  $text = str_replace('{company_name}', $options['footer_title'], $text);
1772
+ $text = str_replace('{company_legal}', $options['footer_legal'], $text);
1773
 
1774
 
1775
  //$this->logger->debug('Replace end');
main/status.php CHANGED
@@ -125,6 +125,16 @@ if ($controls->is_action('test')) {
125
  }
126
  }
127
 
 
 
 
 
 
 
 
 
 
 
128
  $options = $this->get_options('status');
129
 
130
  // Compute the number of newsletters ongoing and other stats
@@ -208,7 +218,7 @@ function tnp_status_print_flag($condition) {
208
  </ol>
209
  <?php } ?>
210
  <br>
211
- <a href="https://www.thenewsletterplugin.com/documentation/email-sending-issues" target="_blank">Read more to solve your issues, if any</a>.
212
  <br>
213
  Email: <?php $controls->text_email('test_email') ?> <?php $controls->button('test', __('Send a test message')) ?>
214
  </td>
@@ -414,7 +424,7 @@ function tnp_status_print_flag($condition) {
414
  </td>
415
  <td>
416
  <?php if ($condition == 0) { ?>
417
- Newsletter Addons update is disabled (probably in your <code>wp-config.php</code> file the constant
418
  <code>NEWSLETTER_EXTENSION_UPDATE</code> is set to <code>true</code>)
419
  <?php } else { ?>
420
  Newsletter Addons can be updated
@@ -572,7 +582,7 @@ function tnp_status_print_flag($condition) {
572
 
573
  <?php } ?>
574
  </td>
575
- </tr>
576
 
577
 
578
  <?php
@@ -628,10 +638,10 @@ function tnp_status_print_flag($condition) {
628
  Max mean time measured: <?php echo sprintf("%.2f", $send_max) ?> seconds<br>
629
  Min mean time measured: <?php echo sprintf("%.2f", $send_min) ?> seconds<br>
630
  Total email in the sample: <?php echo $send_total_emails ?><br>
631
- Runs in the sample: <?php echo count($send_calls); ?><br>
632
  Runs prematurely interrupted: <?php echo sprintf("%.2f", (count($send_calls) - $send_completed) * 100.0 / count($send_calls)) ?>%<br>
633
  </td>
634
- </tr>
635
  <?php
636
  }
637
  ?>
@@ -724,7 +734,7 @@ function tnp_status_print_flag($condition) {
724
  <span class="tnp-maybe">MAYBE</span>
725
  <?php } else { ?>
726
  <span class="tnp-ok">OK</span>
727
- <?php } ?>
728
 
729
 
730
  </td>
@@ -763,7 +773,7 @@ function tnp_status_print_flag($condition) {
763
  Cannot create the folder or it is not writable.
764
  <?php } ?>
765
  </td>
766
- </tr>
767
  </tbody>
768
  </table>
769
 
@@ -1073,7 +1083,7 @@ function tnp_status_print_flag($condition) {
1073
  ?>
1074
  </td>
1075
 
1076
- </tr>
1077
  <?php if (ini_get('opcache.validate_timestamps') === '0') { ?>
1078
  <tr>
1079
  <td>
@@ -1116,8 +1126,8 @@ function tnp_status_print_flag($condition) {
1116
  Charset: <?php echo $wpdb->charset; ?>
1117
  <br>
1118
  <?php if ($wpdb->charset != 'utf8mb4') { ?>
1119
- The recommended charset for your database is <code>utf8mb4</code> to avoid possible saving errors when you use emoji.
1120
- Read the WordPress Codex <a href="https://codex.wordpress.org/Converting_Database_Character_Sets" target="_blank">conversion
1121
  instructions</a> (skilled technicia required).
1122
  <?php } else { ?>
1123
  If you experience newsletter saving database error
@@ -1181,13 +1191,29 @@ function tnp_status_print_flag($condition) {
1181
  <?php } else { ?>
1182
  <?php } ?>
1183
  </td>
1184
- </tr>
1185
 
1186
  <?php
1187
  // Clean up
1188
  $res = $wpdb->query("drop table if exists {$wpdb->prefix}newsletter_test");
1189
  ?>
1190
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1191
  </tbody>
1192
  </table>
1193
  <h3>General parameters</h3>
125
  }
126
  }
127
 
128
+ if ($controls->is_action( 'stats_email_column_upgrade') ) {
129
+ $this->query( "alter table " . NEWSLETTER_STATS_TABLE . " drop index email_id" );
130
+ $this->query( "alter table " . NEWSLETTER_STATS_TABLE . " drop index user_id" );
131
+ $this->query( "alter table `" . NEWSLETTER_STATS_TABLE . "` modify column `email_id` int(11) not null default 0" );
132
+ $this->query( "create index email_id on " . NEWSLETTER_STATS_TABLE . " (email_id)" );
133
+ $this->query( "create index user_id on " . NEWSLETTER_STATS_TABLE . " (user_id)" );
134
+ $controls->add_message_done();
135
+ update_option('newsletter_stats_email_column_upgraded', true);
136
+ }
137
+
138
  $options = $this->get_options('status');
139
 
140
  // Compute the number of newsletters ongoing and other stats
218
  </ol>
219
  <?php } ?>
220
  <br>
221
+ <a href="https://www.thenewsletterplugin.com/documentation/email-sending-issues" target="_blank">Read more to solve your issues, if any</a>.
222
  <br>
223
  Email: <?php $controls->text_email('test_email') ?> <?php $controls->button('test', __('Send a test message')) ?>
224
  </td>
424
  </td>
425
  <td>
426
  <?php if ($condition == 0) { ?>
427
+ Newsletter Addons update is disabled (probably in your <code>wp-config.php</code> file the constant
428
  <code>NEWSLETTER_EXTENSION_UPDATE</code> is set to <code>true</code>)
429
  <?php } else { ?>
430
  Newsletter Addons can be updated
582
 
583
  <?php } ?>
584
  </td>
585
+ </tr>
586
 
587
 
588
  <?php
638
  Max mean time measured: <?php echo sprintf("%.2f", $send_max) ?> seconds<br>
639
  Min mean time measured: <?php echo sprintf("%.2f", $send_min) ?> seconds<br>
640
  Total email in the sample: <?php echo $send_total_emails ?><br>
641
+ Runs in the sample: <?php echo count($send_calls); ?><br>
642
  Runs prematurely interrupted: <?php echo sprintf("%.2f", (count($send_calls) - $send_completed) * 100.0 / count($send_calls)) ?>%<br>
643
  </td>
644
+ </tr>
645
  <?php
646
  }
647
  ?>
734
  <span class="tnp-maybe">MAYBE</span>
735
  <?php } else { ?>
736
  <span class="tnp-ok">OK</span>
737
+ <?php } ?>
738
 
739
 
740
  </td>
773
  Cannot create the folder or it is not writable.
774
  <?php } ?>
775
  </td>
776
+ </tr>
777
  </tbody>
778
  </table>
779
 
1083
  ?>
1084
  </td>
1085
 
1086
+ </tr>
1087
  <?php if (ini_get('opcache.validate_timestamps') === '0') { ?>
1088
  <tr>
1089
  <td>
1126
  Charset: <?php echo $wpdb->charset; ?>
1127
  <br>
1128
  <?php if ($wpdb->charset != 'utf8mb4') { ?>
1129
+ The recommended charset for your database is <code>utf8mb4</code> to avoid possible saving errors when you use emoji.
1130
+ Read the WordPress Codex <a href="https://codex.wordpress.org/Converting_Database_Character_Sets" target="_blank">conversion
1131
  instructions</a> (skilled technicia required).
1132
  <?php } else { ?>
1133
  If you experience newsletter saving database error
1191
  <?php } else { ?>
1192
  <?php } ?>
1193
  </td>
1194
+ </tr>
1195
 
1196
  <?php
1197
  // Clean up
1198
  $res = $wpdb->query("drop table if exists {$wpdb->prefix}newsletter_test");
1199
  ?>
1200
 
1201
+ <?php if ( ! get_option( 'newsletter_stats_email_column_upgraded', false ) ) { ?>
1202
+ <?php
1203
+ $data_type = $wpdb->get_var(
1204
+ $wpdb->prepare( 'SELECT DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = %s AND TABLE_NAME = %s AND COLUMN_NAME = %s',
1205
+ DB_NAME, NEWSLETTER_STATS_TABLE, 'email_id' ) );
1206
+ $to_upgrade = strtoupper( $data_type ) == 'INT' ? false : true;
1207
+ ?>
1208
+ <?php if ( $to_upgrade ) { ?>
1209
+ <tr>
1210
+ <td>Database stats table upgrade</td>
1211
+ <td><?php tnp_status_print_flag( 0 ) ?></td>
1212
+ <td><?php $controls->button( 'stats_email_column_upgrade', 'Stats table upgrade' ) ?></td>
1213
+ </tr>
1214
+ <?php } ?>
1215
+ <?php } ?>
1216
+
1217
  </tbody>
1218
  </table>
1219
  <h3>General parameters</h3>
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: 6.7.2
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.
@@ -35,7 +35,7 @@ if (version_compare(phpversion(), '5.6', '<')) {
35
  return;
36
  }
37
 
38
- define('NEWSLETTER_VERSION', '6.7.2');
39
 
40
  global $newsletter, $wpdb;
41
 
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: 6.7.3
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.
35
  return;
36
  }
37
 
38
+ define('NEWSLETTER_VERSION', '6.7.3');
39
 
40
  global $newsletter, $wpdb;
41
 
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === Newsletter ===
2
  Tags: email, email marketing, newsletter, newsletter subscribers, welcome email, signup forms, contact, lead generation, popup, marketing automation
3
  Requires at least: 3.4.0
4
- Tested up to: 5.4.1
5
- Stable tag: 6.7.2
6
  Requires PHP: 5.6
7
  Contributors: satollo,webagile,michael-travan
8
 
@@ -113,6 +113,12 @@ Thank you, The Newsletter Team
113
 
114
  == Changelog ==
115
 
 
 
 
 
 
 
116
  = 6.7.2 =
117
 
118
  * Fix post permalink with WPML on language specific setting for Newsletter themes and blocks
1
  === Newsletter ===
2
  Tags: email, email marketing, newsletter, newsletter subscribers, welcome email, signup forms, contact, lead generation, popup, marketing automation
3
  Requires at least: 3.4.0
4
+ Tested up to: 5.4.2
5
+ Stable tag: 6.7.3
6
  Requires PHP: 5.6
7
  Contributors: satollo,webagile,michael-travan
8
 
113
 
114
  == Changelog ==
115
 
116
+ = 6.7.3 =
117
+
118
+ * Added the company_legal tag
119
+ * Change a column type on statitics table to improve performances on site with big subscription lists (100k+)
120
+ * Fix attempt on posts block for RTL languages
121
+
122
  = 6.7.2 =
123
 
124
  * Fix post permalink with WPML on language specific setting for Newsletter themes and blocks