Newsletter - Version 5.2.4

Version Description

  • readme.txt fix
  • Improved extension version checking
  • Changed the database timeout check on status panel
  • Added support for pixel perfect thumb nails of media library images
Download this release

Release Info

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

Code changes from version 5.2.3 to 5.2.4

Files changed (6) hide show
  1. admin.css +6 -0
  2. includes/helper.php +61 -4
  3. includes/module.php +1 -1
  4. main/status.php +4 -4
  5. plugin.php +3 -3
  6. readme.txt +43 -36
admin.css CHANGED
@@ -207,6 +207,7 @@
207
  color: #fff;
208
  background-color: #3498db;
209
  text-shadow: none;
 
210
  }
211
 
212
  /* Icon in button media selector */
@@ -227,6 +228,7 @@
227
  background-color: #fff!important;
228
  box-shadow: none !important;
229
  -webkit-box-shadow: none !important;
 
230
  }
231
 
232
  /* Form tables correction */
@@ -358,6 +360,7 @@
358
  #tnp-body #tabs .button-secondary:visited,
359
  #tnp-body #tabs .button-secondary:hover {
360
  color: #fff;
 
361
  }
362
 
363
  table.clicks td {
@@ -702,6 +705,7 @@ p.description {
702
  .wp-core-ui .button-primary {
703
  background-color: #2b2f3a;
704
  color: #fff;
 
705
  }
706
 
707
 
@@ -1017,11 +1021,13 @@ p.description {
1017
  color: #fff;
1018
  font-family: 'Montserrat',sans-serif;
1019
  margin: 0px 2px;
 
1020
  }
1021
 
1022
  .wp-core-ui .button-secondary:hover, .wp-core-ui .button:hover, .wp-core-ui .button-primary:hover {
1023
  background-color: #5DADE2;
1024
  color: #fff;
 
1025
  }
1026
 
1027
  span.wp-media-buttons-icon:before {
207
  color: #fff;
208
  background-color: #3498db;
209
  text-shadow: none;
210
+ width: auto;
211
  }
212
 
213
  /* Icon in button media selector */
228
  background-color: #fff!important;
229
  box-shadow: none !important;
230
  -webkit-box-shadow: none !important;
231
+ width: auto;
232
  }
233
 
234
  /* Form tables correction */
360
  #tnp-body #tabs .button-secondary:visited,
361
  #tnp-body #tabs .button-secondary:hover {
362
  color: #fff;
363
+ width: auto;
364
  }
365
 
366
  table.clicks td {
705
  .wp-core-ui .button-primary {
706
  background-color: #2b2f3a;
707
  color: #fff;
708
+ width: auto;
709
  }
710
 
711
 
1021
  color: #fff;
1022
  font-family: 'Montserrat',sans-serif;
1023
  margin: 0px 2px;
1024
+ width: auto;
1025
  }
1026
 
1027
  .wp-core-ui .button-secondary:hover, .wp-core-ui .button:hover, .wp-core-ui .button-primary:hover {
1028
  background-color: #5DADE2;
1029
  color: #fff;
1030
+ width: auto;
1031
  }
1032
 
1033
  span.wp-media-buttons-icon:before {
includes/helper.php CHANGED
@@ -1,10 +1,23 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit;
3
 
4
- function tnp_post_thumbnail_src($post, $size = 'thumbnail') {
5
- if (is_object($post)) $post = $post->ID;
 
 
 
 
 
 
 
 
 
 
 
 
6
  $media = wp_get_attachment_image_src(get_post_thumbnail_id($post), $size);
7
- if (strpos($media[0], 'http') !== 0) $media[0] = 'http:' . $media[0];
 
 
8
  return $media[0];
9
  }
10
 
@@ -36,3 +49,47 @@ function tnp_post_date($post, $format = null) {
36
  }
37
  return mysql2date($format, $post->post_date);
38
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
 
2
 
3
+ if (!defined('ABSPATH'))
4
+ exit;
5
+
6
+ function tnp_post_thumbnail_src($post, $size = 'thumbnail', $alternative = '') {
7
+ if (is_object($post)) {
8
+ $post = $post->ID;
9
+ }
10
+
11
+ if (is_array($size)) {
12
+ $media_id = get_post_thumbnail_id($post);
13
+ if (!$media_id) return $alternative;
14
+ return tnp_media_resize($media_id, $size);
15
+ }
16
+
17
  $media = wp_get_attachment_image_src(get_post_thumbnail_id($post), $size);
18
+ if (strpos($media[0], 'http') !== 0) {
19
+ $media[0] = 'http:' . $media[0];
20
+ }
21
  return $media[0];
22
  }
23
 
49
  }
50
  return mysql2date($format, $post->post_date);
51
  }
52
+
53
+ function tnp_media_resize($media_id, $size) {
54
+ $relative_file = get_post_meta($media_id, '_wp_attached_file', true);
55
+ $width = $size[0];
56
+ $height = $size[1];
57
+ $crop = false;
58
+ if (isset($size[2])) {
59
+ $crop = (boolean) $size[2];
60
+ }
61
+
62
+ $uploads = wp_upload_dir();
63
+ $absolute_file = $uploads['basedir'] . '/' . $relative_file;
64
+ // Relative and absolute name of the thumbnail.
65
+ $pathinfo = pathinfo($relative_file);
66
+ $relative_thumb = $pathinfo['dirname'] . '/' . $pathinfo['filename'] . '-' . $width . 'x' .
67
+ $height . ($crop ? '-c' : '') . '.' . $pathinfo['extension'];
68
+ $absolute_thumb = WP_CONTENT_DIR . '/newsletter/thumbnails/' . $relative_thumb;
69
+
70
+ // Thumbnail generation if needed.
71
+ if (!file_exists($absolute_thumb) || filemtime($absolute_thumb) < filemtime($absolute_file)) {
72
+ wp_mkdir_p(WP_CONTENT_DIR . '/newsletter/thumbnails/' . $pathinfo['dirname']);
73
+
74
+ $editor = wp_get_image_editor($absolute_file);
75
+ if (is_wp_error($editor)) {
76
+ //echo 'error 1';
77
+ return $uploads['baseurl'] . '/' . $relative_file;
78
+ }
79
+
80
+ $editor->set_quality(80);
81
+ $resized = $editor->resize($width, $height, $crop);
82
+
83
+ if (is_wp_error($resized)) {
84
+ //echo 'error 2';
85
+ return $uploads['baseurl'] . '/' . $relative_file;
86
+ }
87
+
88
+ $saved = $editor->save($absolute_thumb);
89
+ if (is_wp_error($saved)) {
90
+ return $uploads['baseurl'] . '/' . $relative_file;
91
+ }
92
+ }
93
+
94
+ return WP_CONTENT_URL . '/newsletter/thumbnails/' . $relative_thumb;
95
+ }
includes/module.php CHANGED
@@ -444,7 +444,7 @@ class NewsletterModule {
444
  * @param int $time
445
  */
446
  static function split_posts(&$posts, $time = 0) {
447
- if ($last_run < 0) {
448
  return array_chunk($posts, ceil(count($posts) / 2));
449
  }
450
 
444
  * @param int $time
445
  */
446
  static function split_posts(&$posts, $time = 0) {
447
+ if ($time < 0) {
448
  return array_chunk($posts, ceil(count($posts) / 2));
449
  }
450
 
main/status.php CHANGED
@@ -390,7 +390,7 @@ $options = $module->get_options('status');
390
  <tr>
391
  <td>Database wait timeout</td>
392
  <td>
393
- <?php if ($wait_timeout < 300) { ?>
394
  <span class="tnp-ko">KO</span>
395
  <?php } else { ?>
396
  <span class="tnp-ok">OK</span>
@@ -399,9 +399,9 @@ $options = $module->get_options('status');
399
  </td>
400
  <td>
401
  Your database wait timeout is <?php echo $wait_timeout; ?> seconds<br>
402
- <?php if ($wait_timeout < 300) { ?>
403
- That value is low and could produce database connection errors while sending emails. Ask the provider to raise it
404
- at least to 300 seconds.
405
  <?php } ?>
406
  </td>
407
  </tr>
390
  <tr>
391
  <td>Database wait timeout</td>
392
  <td>
393
+ <?php if ($wait_timeout < 30) { ?>
394
  <span class="tnp-ko">KO</span>
395
  <?php } else { ?>
396
  <span class="tnp-ok">OK</span>
399
  </td>
400
  <td>
401
  Your database wait timeout is <?php echo $wait_timeout; ?> seconds<br>
402
+ <?php if ($wait_timeout < 30) { ?>
403
+ That value is low and could produce database connection errors while sending emails or during long import
404
+ sessions. Ask the provider to raise it at least to 60 seconds.
405
  <?php } ?>
406
  </td>
407
  </tr>
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.2.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.
@@ -14,7 +14,7 @@
14
  */
15
 
16
  // Used as dummy parameter on css and js links
17
- define('NEWSLETTER_VERSION', '5.2.3');
18
 
19
  global $wpdb, $newsletter;
20
 
@@ -1063,7 +1063,7 @@ class Newsletter extends NewsletterModule {
1063
  if (!$force && !defined('NEWSLETTER_EXTENSION')) {
1064
  return;
1065
  }
1066
- $response = wp_remote_get('http://www.thenewsletterplugin.com/wp-content/versions/all.txt');
1067
  if (is_wp_error($response)) {
1068
  $this->logger->error($response);
1069
  return;
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.2.4
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.2.4');
18
 
19
  global $wpdb, $newsletter;
20
 
1063
  if (!$force && !defined('NEWSLETTER_EXTENSION')) {
1064
  return;
1065
  }
1066
+ $response = wp_remote_get('http://www.thenewsletterplugin.com/wp-content/versions/all.txt?ts=' . time());
1067
  if (is_wp_error($response)) {
1068
  $this->logger->error($response);
1069
  return;
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.4
5
- Stable tag: 5.2.3
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
@@ -73,7 +73,7 @@ We provide support for our plugin on [Wordpress.org forums](https://wordpress.or
73
  See the [Newsletter FAQ](https://www.thenewsletterplugin.com/plugins/newsletter/newsletter-faq) or the
74
  [Newsletter Forum](https://www.thenewsletterplugin.com/forums) to ask for help.
75
 
76
- For documentation start from [Newsletter documentation](https://www.thenewsletterplugin.com/plugins/newsletter/newsletter-documentation).
77
 
78
  Thank you, The Newsletter Team
79
 
@@ -85,47 +85,54 @@ Thank you, The Newsletter Team
85
 
86
  == Changelog ==
87
 
88
- == 5.2.3 ==
 
 
 
 
 
 
 
89
 
90
  * Newsletter subject ideas popup
91
 
92
- == 5.2.2 ==
93
 
94
  * Removed create_function from widgets (compatibility PHP 7.2)
95
  * Fixed the list exclusion condition
96
  * Added [options to Newsletter shortcodes](https://www.thenewsletterplugin.com/documentation/subscription-form-shortcodes) to show the lists as dropdown
97
 
98
- == 5.2.1 ==
99
 
100
  * Commit fix
101
 
102
- == 5.2.0 ==
103
 
104
  * Fixed email_url tag (broken to fix Automated in previous version)
105
 
106
- == 5.1.9 ==
107
 
108
  * Fixed debug notice on test email from Automated Extension
109
 
110
- == 5.1.8 ==
111
 
112
  * Newsletter page creation fix
113
 
114
- == 5.1.7 ==
115
 
116
  * NEW! Welcome wizard
117
 
118
- == 5.1.6 ==
119
 
120
  * Fix list selection on first save
121
 
122
- == 5.1.5 ==
123
 
124
  * Re-confirmation is now allows for unsubscribed and bounced
125
  * Fixed to minimal widget and minimal css
126
  * Fixed the approx. subscriber count on newsletter creation (was showing encoded data)
127
 
128
- == 5.1.4 ==
129
 
130
  * Fixed notices on email edit panel
131
  * Added microdata to the call to action block
@@ -135,12 +142,12 @@ Thank you, The Newsletter Team
135
  * Fixed the min size of thumbnails on default theme
136
  * Removed references to font awesome where not used
137
 
138
- == 5.1.3 ==
139
 
140
  * Fixed newsletter duplication which was loosing the editor type
141
  * Fixed gender saving on targeting
142
 
143
- == 5.1.2 ==
144
 
145
  * Improved the speed report on status panel
146
  * Removed the obsolete diagnostic panel
@@ -152,65 +159,65 @@ Thank you, The Newsletter Team
152
  * Confirmation is now activation
153
  * CSS clean up
154
 
155
- == 5.1.1 ==
156
 
157
  * Fix on email check
158
 
159
- == 5.1.0 ==
160
 
161
  * "ncu" parameter can be used for alternative welcome page as well, not only confirmation, when single opt in is selected
162
  * Removed the old "email alternative" to create custom subscription messages templates (has no effects)
163
  * Added the antiflood system
164
 
165
- == 5.0.9 ==
166
 
167
  * Removed wp users integration and locked content now available as FREE optional extensions (to make the plugin smaller)
168
  * Removed obsolete code loading old-style extensions
169
 
170
- == 5.0.8 ==
171
 
172
  * Improved select 2 layout
173
  * Support for conditional comments in the editor
174
 
175
- == 5.0.7 ==
176
 
177
  * Fix a database table field size
178
 
179
- == 5.0.6 ==
180
 
181
  * Improved performance with new db indexes
182
  * Fixed a bug in social URLs
183
  * Home URL check on status panel
184
  * Fixed a not removable notice
185
 
186
- == 5.0.5 ==
187
 
188
  * Fixed an administration notice removal
189
 
190
- == 5.0.4 ==
191
 
192
  * Fix media selector for blog without absolute URLs
193
  * Notice to install the wp users integration
194
  * Added workaround for XSS protection in chrome on custom form when they contains JS code
195
 
196
- == 5.0.3 ==
197
 
198
  * Added {email_url_encoded} tag
199
  * Changed https to http for compatibility with old servers
200
 
201
- == 5.0.2 ==
202
 
203
  * Fixed a notice on theme selection panel
204
  * Fixed a block initialization error notice for woocommerce
205
  * Improved the emoji support on newsletter subject
206
 
207
- == 5.0.1 ==
208
 
209
  * Fixed and improved the heading block
210
  * Fixed the can spam block (not showing default texts is not configured)
211
  * Fixed the footer block changed the unsubscribe url to the profile url
212
 
213
- == 5.0.0 ==
214
 
215
  * Added wp user identifier on subscriber details panel
216
  * Fixed a notice on subscriber list panel
@@ -221,50 +228,50 @@ Thank you, The Newsletter Team
221
  * Fix for sites with forced relative content url
222
  * Fix debug notices on vimeo theme
223
 
224
- == 4.9.9 ==
225
 
226
  * Fixed action URL for hand written forms in the subscription text
227
  * Fixed rewrite not working with specific html formatting
228
  * Change the composer text editor height
229
 
230
- == 4.9.8 ==
231
 
232
  * Fixed the antibot option
233
 
234
- == 4.9.7 ==
235
 
236
  * Fixed setup script throwing a debug notice
237
  * Changed chart library
238
 
239
- == 4.9.6 ==
240
 
241
  * Extension version check improved
242
  * HTML5 form source code on profile panel
243
 
244
- == 4.9.5 ==
245
 
246
  * Fixed table creation with dbDelta
247
 
248
- == 4.9.4 ==
249
 
250
  * Admin css fix
251
  * Log fix
252
 
253
- == 4.9.3 ==
254
 
255
  * Replacing fix
256
 
257
- == 4.9.2 ==
258
 
259
  * Style fix
260
 
261
- == 4.9.1 ==
262
 
263
  * Small code fixes
264
  * Chart js conflict fix
265
  * Curl SSL version on status panel
266
 
267
- == 4.9.0 ==
268
 
269
  * Fixed logo editing when not set in the Company Info
270
  * Fix few layout problem on the user statistics panel
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.4
5
+ Stable tag: 5.2.4
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
73
  See the [Newsletter FAQ](https://www.thenewsletterplugin.com/plugins/newsletter/newsletter-faq) or the
74
  [Newsletter Forum](https://www.thenewsletterplugin.com/forums) to ask for help.
75
 
76
+ For documentation start from [Newsletter documentation](https://www.thenewsletterplugin.com/documentation).
77
 
78
  Thank you, The Newsletter Team
79
 
85
 
86
  == Changelog ==
87
 
88
+ = 5.2.4 =
89
+
90
+ * readme.txt fix
91
+ * Improved extension version checking
92
+ * Changed the database timeout check on status panel
93
+ * Added support for pixel perfect thumb nails of media library images
94
+
95
+ = 5.2.3 =
96
 
97
  * Newsletter subject ideas popup
98
 
99
+ = 5.2.2 =
100
 
101
  * Removed create_function from widgets (compatibility PHP 7.2)
102
  * Fixed the list exclusion condition
103
  * Added [options to Newsletter shortcodes](https://www.thenewsletterplugin.com/documentation/subscription-form-shortcodes) to show the lists as dropdown
104
 
105
+ = 5.2.1 =
106
 
107
  * Commit fix
108
 
109
+ = 5.2.0 =
110
 
111
  * Fixed email_url tag (broken to fix Automated in previous version)
112
 
113
+ = 5.1.9 =
114
 
115
  * Fixed debug notice on test email from Automated Extension
116
 
117
+ = 5.1.8 =
118
 
119
  * Newsletter page creation fix
120
 
121
+ = 5.1.7 =
122
 
123
  * NEW! Welcome wizard
124
 
125
+ = 5.1.6 =
126
 
127
  * Fix list selection on first save
128
 
129
+ = 5.1.5 =
130
 
131
  * Re-confirmation is now allows for unsubscribed and bounced
132
  * Fixed to minimal widget and minimal css
133
  * Fixed the approx. subscriber count on newsletter creation (was showing encoded data)
134
 
135
+ = 5.1.4 =
136
 
137
  * Fixed notices on email edit panel
138
  * Added microdata to the call to action block
142
  * Fixed the min size of thumbnails on default theme
143
  * Removed references to font awesome where not used
144
 
145
+ = 5.1.3 =
146
 
147
  * Fixed newsletter duplication which was loosing the editor type
148
  * Fixed gender saving on targeting
149
 
150
+ = 5.1.2 =
151
 
152
  * Improved the speed report on status panel
153
  * Removed the obsolete diagnostic panel
159
  * Confirmation is now activation
160
  * CSS clean up
161
 
162
+ = 5.1.1 =
163
 
164
  * Fix on email check
165
 
166
+ = 5.1.0 =
167
 
168
  * "ncu" parameter can be used for alternative welcome page as well, not only confirmation, when single opt in is selected
169
  * Removed the old "email alternative" to create custom subscription messages templates (has no effects)
170
  * Added the antiflood system
171
 
172
+ = 5.0.9 =
173
 
174
  * Removed wp users integration and locked content now available as FREE optional extensions (to make the plugin smaller)
175
  * Removed obsolete code loading old-style extensions
176
 
177
+ = 5.0.8 =
178
 
179
  * Improved select 2 layout
180
  * Support for conditional comments in the editor
181
 
182
+ = 5.0.7 =
183
 
184
  * Fix a database table field size
185
 
186
+ = 5.0.6 =
187
 
188
  * Improved performance with new db indexes
189
  * Fixed a bug in social URLs
190
  * Home URL check on status panel
191
  * Fixed a not removable notice
192
 
193
+ = 5.0.5 =
194
 
195
  * Fixed an administration notice removal
196
 
197
+ = 5.0.4 =
198
 
199
  * Fix media selector for blog without absolute URLs
200
  * Notice to install the wp users integration
201
  * Added workaround for XSS protection in chrome on custom form when they contains JS code
202
 
203
+ = 5.0.3 =
204
 
205
  * Added {email_url_encoded} tag
206
  * Changed https to http for compatibility with old servers
207
 
208
+ = 5.0.2 =
209
 
210
  * Fixed a notice on theme selection panel
211
  * Fixed a block initialization error notice for woocommerce
212
  * Improved the emoji support on newsletter subject
213
 
214
+ = 5.0.1 =
215
 
216
  * Fixed and improved the heading block
217
  * Fixed the can spam block (not showing default texts is not configured)
218
  * Fixed the footer block changed the unsubscribe url to the profile url
219
 
220
+ = 5.0.0 =
221
 
222
  * Added wp user identifier on subscriber details panel
223
  * Fixed a notice on subscriber list panel
228
  * Fix for sites with forced relative content url
229
  * Fix debug notices on vimeo theme
230
 
231
+ = 4.9.9 =
232
 
233
  * Fixed action URL for hand written forms in the subscription text
234
  * Fixed rewrite not working with specific html formatting
235
  * Change the composer text editor height
236
 
237
+ = 4.9.8 =
238
 
239
  * Fixed the antibot option
240
 
241
+ = 4.9.7 =
242
 
243
  * Fixed setup script throwing a debug notice
244
  * Changed chart library
245
 
246
+ = 4.9.6 =
247
 
248
  * Extension version check improved
249
  * HTML5 form source code on profile panel
250
 
251
+ = 4.9.5 =
252
 
253
  * Fixed table creation with dbDelta
254
 
255
+ = 4.9.4 =
256
 
257
  * Admin css fix
258
  * Log fix
259
 
260
+ = 4.9.3 =
261
 
262
  * Replacing fix
263
 
264
+ = 4.9.2 =
265
 
266
  * Style fix
267
 
268
+ = 4.9.1 =
269
 
270
  * Small code fixes
271
  * Chart js conflict fix
272
  * Curl SSL version on status panel
273
 
274
+ = 4.9.0 =
275
 
276
  * Fixed logo editing when not set in the Company Info
277
  * Fix few layout problem on the user statistics panel