Version Description
- Fixed debug notices on composer post blocks
- Improved image styles on composer hero block
- Added support for WP_Error in the logger
- Improved the license checking
Download this release
Release Info
Developer | satollo |
Plugin | Newsletter |
Version | 4.6.0 |
Comparing to | |
See all releases |
Code changes from version 4.5.9 to 4.6.0
- emails/tnp-composer/blocks/content-01-hero.block +1 -1
- emails/tnp-composer/blocks/content-02-heading.block +1 -1
- emails/tnp-composer/blocks/content-03-text.block +1 -1
- emails/tnp-composer/blocks/content-05-image.block +1 -1
- emails/tnp-composer/blocks/content-06-posts.block +2 -2
- emails/tnp-composer/blocks/content-07-twocols.block +1 -1
- emails/tnp-composer/edit.php +2 -0
- includes/helper.php +1 -0
- includes/logger.php +6 -2
- main/diagnostic.php +49 -48
- main/main.php +7 -3
- plugin.php +29 -7
- readme.txt +9 -2
- tnp-header.php +0 -22
emails/tnp-composer/blocks/content-01-hero.block
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
<tr>
|
11 |
<td class="padding-copy tnpc-row-edit" data-type="image">
|
12 |
<a href="#" target="_blank">
|
13 |
-
<img src="https://unsplash.it/500/300?image=885" width="500"
|
14 |
</a>
|
15 |
</td>
|
16 |
</tr>
|
10 |
<tr>
|
11 |
<td class="padding-copy tnpc-row-edit" data-type="image">
|
12 |
<a href="#" target="_blank">
|
13 |
+
<img src="https://unsplash.it/500/300?image=885" width="500" border="0" alt="Insert alt text here" style="max-width: 100%!important; width: 500px!important; height: auto!important; display: block; color: #666666; font-family: Helvetica, arial, sans-serif; font-size: 16px;" class="img-max">
|
14 |
</a>
|
15 |
</td>
|
16 |
</tr>
|
emails/tnp-composer/blocks/content-02-heading.block
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="tnpc-row" data-id="content-02">
|
3 |
<tr>
|
4 |
<td bgcolor="#ffffff" align="center" style="padding: 15px; font-family: Helvetica, Arial, sans-serif;" class="section-padding edit-block">
|
5 |
-
<table border="0" cellpadding="0" cellspacing="0" width="500" class="responsive-table">
|
6 |
<tr>
|
7 |
<td align="center" style="font-size: 25px; color: #333333; padding-top: 30px;" class="padding-copy tnpc-row-edit" data-type="title">An Awesome Title</td>
|
8 |
</tr>
|
2 |
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="tnpc-row" data-id="content-02">
|
3 |
<tr>
|
4 |
<td bgcolor="#ffffff" align="center" style="padding: 15px; font-family: Helvetica, Arial, sans-serif;" class="section-padding edit-block">
|
5 |
+
<table border="0" cellpadding="0" cellspacing="0" width="500" class="responsive-table" style="width: 500px!important; max-width: 100%!important">
|
6 |
<tr>
|
7 |
<td align="center" style="font-size: 25px; color: #333333; padding-top: 30px;" class="padding-copy tnpc-row-edit" data-type="title">An Awesome Title</td>
|
8 |
</tr>
|
emails/tnp-composer/blocks/content-03-text.block
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="tnpc-row" data-id="content-03">
|
3 |
<tr>
|
4 |
<td bgcolor="#ffffff" align="center" style="padding: 20px 15px 20px 15px; font-family: Helvetica, Arial, sans-serif;" class="section-padding edit-block">
|
5 |
-
<table border="0" cellpadding="0" cellspacing="0"
|
6 |
<tr>
|
7 |
<td align="center" style="padding: 0 0 0 0; font-size: 16px; line-height: 25px; color: #666666;" class="padding-copy tnpc-row-edit" data-type="text">The judge, by the way, was the King; and as he wore his crown over the wig, (look at the frontispiece if you want to see how he did it,) he did not look at all comfortable, and it was certainly not becoming.</td>
|
8 |
</tr>
|
2 |
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="tnpc-row" data-id="content-03">
|
3 |
<tr>
|
4 |
<td bgcolor="#ffffff" align="center" style="padding: 20px 15px 20px 15px; font-family: Helvetica, Arial, sans-serif;" class="section-padding edit-block">
|
5 |
+
<table border="0" cellpadding="0" cellspacing="0" class="responsive-table" style="width: 100%!important">
|
6 |
<tr>
|
7 |
<td align="center" style="padding: 0 0 0 0; font-size: 16px; line-height: 25px; color: #666666;" class="padding-copy tnpc-row-edit" data-type="text">The judge, by the way, was the King; and as he wore his crown over the wig, (look at the frontispiece if you want to see how he did it,) he did not look at all comfortable, and it was certainly not becoming.</td>
|
8 |
</tr>
|
emails/tnp-composer/blocks/content-05-image.block
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
<td bgcolor="#ffffff" align="center" style="padding: 0; font-family: Helvetica, Arial, sans-serif;" class="section-padding edit-block">
|
5 |
<div class="tnpc-row-edit" data-type="image">
|
6 |
<a href="#" target="_blank">
|
7 |
-
<img src="https://unsplash.it/800/300?image=998" width="800"
|
8 |
</a>
|
9 |
</div>
|
10 |
</td>
|
4 |
<td bgcolor="#ffffff" align="center" style="padding: 0; font-family: Helvetica, Arial, sans-serif;" class="section-padding edit-block">
|
5 |
<div class="tnpc-row-edit" data-type="image">
|
6 |
<a href="#" target="_blank">
|
7 |
+
<img src="https://unsplash.it/800/300?image=998" width="800" border="0" alt="Insert alt text here" style="max-width: 100%!important; width: 800px!important; height: auto!important;display: block; color: #666666; font-family: Helvetica, arial, sans-serif; font-size: 16px;" class="img-max">
|
8 |
</a>
|
9 |
</div>
|
10 |
</td>
|
emails/tnp-composer/blocks/content-06-posts.block
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
include NEWSLETTER_INCLUDES_DIR . '/helper.php';
|
3 |
|
4 |
$filters = array();
|
5 |
-
$filters['showposts'] = $_POST['num'] ? intval($_POST['num']) : 3;
|
6 |
if (!empty($_POST['categories'])) {
|
7 |
$filters['category__in'] = $_POST['categories'];
|
8 |
}
|
@@ -27,7 +27,7 @@ $posts = get_posts($filters);
|
|
27 |
<tr>
|
28 |
<td valign="top" style="padding: 40px 0 0 0;" class="mobile-hide tnpc-row-edit" data-type="image">
|
29 |
<a href="<?php echo tnp_post_permalink($post) ?>" target="_blank">
|
30 |
-
<img src="<?php echo tnp_post_thumbnail_src($post) ?>" width="105" height="105" border="0" style="display: block; font-family: Arial; color: #666666; font-size: 14px; width: 105px; height: 105px;">
|
31 |
</a>
|
32 |
</td>
|
33 |
<td style="padding: 40px 0 0 0;" class="no-padding">
|
2 |
include NEWSLETTER_INCLUDES_DIR . '/helper.php';
|
3 |
|
4 |
$filters = array();
|
5 |
+
$filters['showposts'] = isset($_POST['num']) ? intval($_POST['num']) : 3;
|
6 |
if (!empty($_POST['categories'])) {
|
7 |
$filters['category__in'] = $_POST['categories'];
|
8 |
}
|
27 |
<tr>
|
28 |
<td valign="top" style="padding: 40px 0 0 0;" class="mobile-hide tnpc-row-edit" data-type="image">
|
29 |
<a href="<?php echo tnp_post_permalink($post) ?>" target="_blank">
|
30 |
+
<img src="<?php echo tnp_post_thumbnail_src($post) ?>" width="105" height="105" border="0" style="display: block; font-family: Arial; color: #666666; font-size: 14px; width: 105px!important; height: 105px!important;">
|
31 |
</a>
|
32 |
</td>
|
33 |
<td style="padding: 40px 0 0 0;" class="no-padding">
|
emails/tnp-composer/blocks/content-07-twocols.block
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
include NEWSLETTER_INCLUDES_DIR . '/helper.php';
|
3 |
|
4 |
$filters = array();
|
5 |
-
$filters['showposts'] = $_POST['num'] ? intval($_POST['num']) : 3;
|
6 |
if (!empty($_POST['categories'])) {
|
7 |
$filters['category__in'] = $_POST['categories'];
|
8 |
}
|
2 |
include NEWSLETTER_INCLUDES_DIR . '/helper.php';
|
3 |
|
4 |
$filters = array();
|
5 |
+
$filters['showposts'] = isset($_POST['num']) ? intval($_POST['num']) : 3;
|
6 |
if (!empty($_POST['categories'])) {
|
7 |
$filters['category__in'] = $_POST['categories'];
|
8 |
}
|
emails/tnp-composer/edit.php
CHANGED
@@ -40,6 +40,8 @@
|
|
40 |
// We set multiple to false so only get one image from the uploader
|
41 |
attachment = file_frame.state().get('selection').first().toJSON();
|
42 |
// Do something with attachment.id and/or attachment.url here
|
|
|
|
|
43 |
jQuery('#tnpc-edit-image .image').val(attachment.url);
|
44 |
});
|
45 |
// Finally, open the modal
|
40 |
// We set multiple to false so only get one image from the uploader
|
41 |
attachment = file_frame.state().get('selection').first().toJSON();
|
42 |
// Do something with attachment.id and/or attachment.url here
|
43 |
+
// Patch for plugins which remove the protocol (not good for a newsletter...)
|
44 |
+
if (attachment.url.indexOf("http") !== 0) attachment.url = "http:" + attachment.url;
|
45 |
jQuery('#tnpc-edit-image .image').val(attachment.url);
|
46 |
});
|
47 |
// Finally, open the modal
|
includes/helper.php
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
|
3 |
function tnp_post_thumbnail_src($post, $size = 'thumbnail') {
|
4 |
$media = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), $size);
|
|
|
5 |
return $media[0];
|
6 |
}
|
7 |
|
2 |
|
3 |
function tnp_post_thumbnail_src($post, $size = 'thumbnail') {
|
4 |
$media = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), $size);
|
5 |
+
if (strpos($media[0], 'http') !== 0) $media[0] = 'http:' . $media[0];
|
6 |
return $media[0];
|
7 |
}
|
8 |
|
includes/logger.php
CHANGED
@@ -49,8 +49,12 @@ class NewsletterLogger {
|
|
49 |
case self::DEBUG: $time .= '- DEBUG';
|
50 |
break;
|
51 |
}
|
52 |
-
if (
|
53 |
-
|
|
|
|
|
|
|
|
|
54 |
// The "logs" dir is created on Newsletter constructor.
|
55 |
$current_user_id = 0;
|
56 |
if (function_exists('get_current_user_id')) $current_user_id = get_current_user_id();
|
49 |
case self::DEBUG: $time .= '- DEBUG';
|
50 |
break;
|
51 |
}
|
52 |
+
if (is_wp_error($text)) {
|
53 |
+
/* @var $text WP_Error */
|
54 |
+
$text = $text->get_error_message() . ' (' . $text->get_error_code() . ')';
|
55 |
+
} else {
|
56 |
+
if (is_array($text) || is_object($text)) $text = print_r($text, true);
|
57 |
+
}
|
58 |
// The "logs" dir is created on Newsletter constructor.
|
59 |
$current_user_id = 0;
|
60 |
if (function_exists('get_current_user_id')) $current_user_id = get_current_user_id();
|
main/diagnostic.php
CHANGED
@@ -194,11 +194,11 @@ if (count($calls) > 1) {
|
|
194 |
<div id="tabs">
|
195 |
|
196 |
<ul>
|
197 |
-
<li><a href="#tabs-tests"
|
198 |
-
<li><a href="#tabs-
|
199 |
-
<li><a href="#tabs-
|
200 |
-
<li><a href="#tabs-4"
|
201 |
-
<li><a href="#tabs-upgrade"
|
202 |
<?php if (isset($_GET['debug'])) { ?>
|
203 |
<li><a href="#tabs-debug">Debug Data</a></li>
|
204 |
<?php } ?>
|
@@ -277,44 +277,40 @@ if (count($calls) > 1) {
|
|
277 |
|
278 |
<!-- SEMAPHORES -->
|
279 |
<div id="tabs-2">
|
280 |
-
|
|
|
281 |
<table class="widefat">
|
282 |
<thead>
|
283 |
<tr>
|
284 |
-
<th>
|
285 |
-
<th>
|
286 |
</tr>
|
287 |
</thead>
|
288 |
|
289 |
<tbody>
|
290 |
<tr>
|
291 |
-
<td>
|
292 |
-
Newsletter delivery
|
293 |
-
</td>
|
294 |
<td>
|
295 |
<?php
|
296 |
-
$
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
|
|
|
|
|
|
|
|
|
|
301 |
?>
|
302 |
-
<?php $controls->button('delete_transient', 'Delete', null, 'newsletter_main_engine'); ?>
|
303 |
-
</td>
|
304 |
-
</tr>
|
305 |
-
</tbody>
|
306 |
-
</table>
|
307 |
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
<th>Function</th>
|
313 |
-
<th>Status</th>
|
314 |
-
</tr>
|
315 |
-
</thead>
|
316 |
|
317 |
-
|
|
|
318 |
<tr>
|
319 |
<td>
|
320 |
WordPress Cron System
|
@@ -374,30 +370,35 @@ if (count($calls) > 1) {
|
|
374 |
<p class="description">Samples are collected in a maximum number of <?php echo Newsletter::MAX_CRON_SAMPLES; ?></p>
|
375 |
</td>
|
376 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
377 |
<tr>
|
378 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
379 |
<td>
|
380 |
<?php
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
echo ' (<span style="color: red; font-weight: bold">KO</span>)';
|
387 |
-
}
|
388 |
-
} else {
|
389 |
-
echo 'Still not enough data. It requires few hours to collect a relevant data set.';
|
390 |
-
}
|
391 |
?>
|
392 |
-
|
393 |
-
<p class="description">
|
394 |
-
Should be less than <?php echo NEWSLETTER_CRON_INTERVAL; ?> seconds.
|
395 |
-
<a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-delivery-engine" target="_blank">Read more</a>.
|
396 |
-
</p>
|
397 |
-
|
398 |
</td>
|
399 |
</tr>
|
400 |
-
|
401 |
</tbody>
|
402 |
</table>
|
403 |
</div>
|
194 |
<div id="tabs">
|
195 |
|
196 |
<ul>
|
197 |
+
<li><a href="#tabs-tests"><?php _e('Tests', 'newsletter')?></a></li>
|
198 |
+
<li><a href="#tabs-2"><?php _e('Scheduler', 'newsletter')?></a></li>
|
199 |
+
<li><a href="#tabs-logging"><?php _e('Logging', 'newsletter')?></a></li>
|
200 |
+
<li><a href="#tabs-4"><?php _e('System', 'newsletter')?></a></li>
|
201 |
+
<li><a href="#tabs-upgrade"><?php _e('Maintenance', 'newsletter')?></a></li>
|
202 |
<?php if (isset($_GET['debug'])) { ?>
|
203 |
<li><a href="#tabs-debug">Debug Data</a></li>
|
204 |
<?php } ?>
|
277 |
|
278 |
<!-- SEMAPHORES -->
|
279 |
<div id="tabs-2">
|
280 |
+
|
281 |
+
<h3>Crons</h3>
|
282 |
<table class="widefat">
|
283 |
<thead>
|
284 |
<tr>
|
285 |
+
<th>Function</th>
|
286 |
+
<th>Status</th>
|
287 |
</tr>
|
288 |
</thead>
|
289 |
|
290 |
<tbody>
|
291 |
<tr>
|
292 |
+
<td>Scheduler execution interval mean</td>
|
|
|
|
|
293 |
<td>
|
294 |
<?php
|
295 |
+
if (count($calls) > 10) {
|
296 |
+
echo (int) $mean . ' seconds';
|
297 |
+
if ($mean < NEWSLETTER_CRON_INTERVAL * 1.2) {
|
298 |
+
echo ' (<span style="color: green; font-weight: bold">OK</span>)';
|
299 |
+
} else {
|
300 |
+
echo ' (<span style="color: red; font-weight: bold">KO</span>)';
|
301 |
+
}
|
302 |
+
} else {
|
303 |
+
echo 'Still not enough data. It requires few hours to collect a relevant data set.';
|
304 |
+
}
|
305 |
?>
|
|
|
|
|
|
|
|
|
|
|
306 |
|
307 |
+
<p class="description">
|
308 |
+
Should be less than <?php echo NEWSLETTER_CRON_INTERVAL; ?> seconds.
|
309 |
+
<a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-delivery-engine" target="_blank">Read more</a>.
|
310 |
+
</p>
|
|
|
|
|
|
|
|
|
311 |
|
312 |
+
</td>
|
313 |
+
</tr>
|
314 |
<tr>
|
315 |
<td>
|
316 |
WordPress Cron System
|
370 |
<p class="description">Samples are collected in a maximum number of <?php echo Newsletter::MAX_CRON_SAMPLES; ?></p>
|
371 |
</td>
|
372 |
</tr>
|
373 |
+
|
374 |
+
</tbody>
|
375 |
+
</table>
|
376 |
+
|
377 |
+
<h3>Semaphores</h3>
|
378 |
+
<table class="widefat">
|
379 |
+
<thead>
|
380 |
<tr>
|
381 |
+
<th>Name</th>
|
382 |
+
<th>Active since</th>
|
383 |
+
</tr>
|
384 |
+
</thead>
|
385 |
+
|
386 |
+
<tbody>
|
387 |
+
<tr>
|
388 |
+
<td>
|
389 |
+
Newsletter delivery
|
390 |
+
</td>
|
391 |
<td>
|
392 |
<?php
|
393 |
+
$value = get_transient('newsletter_main_engine');
|
394 |
+
if ($value)
|
395 |
+
echo (time() - $value) . ' seconds';
|
396 |
+
else
|
397 |
+
echo 'Not set';
|
|
|
|
|
|
|
|
|
|
|
398 |
?>
|
399 |
+
<?php $controls->button('delete_transient', 'Delete', null, 'newsletter_main_engine'); ?>
|
|
|
|
|
|
|
|
|
|
|
400 |
</td>
|
401 |
</tr>
|
|
|
402 |
</tbody>
|
403 |
</table>
|
404 |
</div>
|
main/main.php
CHANGED
@@ -45,6 +45,9 @@ if (!$controls->is_action()) {
|
|
45 |
if (!$newsletter->is_email($controls->data['reply_to'], true)) {
|
46 |
$controls->errors .= __('Reply to email is not correct.', 'newsletter') . '<br>';
|
47 |
}
|
|
|
|
|
|
|
48 |
if (empty($controls->errors)) {
|
49 |
$module->merge_options($controls->data);
|
50 |
$controls->messages .= __('Saved.', 'newsletter');
|
@@ -57,21 +60,22 @@ if (!empty($controls->data['contract_key'])) {
|
|
57 |
$response = wp_remote_get('http://www.thenewsletterplugin.com/wp-content/plugins/file-commerce-pro/check.php?k=' . $controls->data['contract_key']);
|
58 |
if (is_wp_error($response)) {
|
59 |
/* @var $response WP_Error */
|
60 |
-
$controls->errors .= 'It seems that your blog cannot contact the license validator
|
61 |
$controls->errors .= $response->get_error_code() . ' - ' . $response->get_error_message();
|
62 |
$controls->data['licence_expires'] = "";
|
63 |
} else if ($response['response']['code'] != 200) {
|
64 |
-
$controls->errors .= 'The license seems expired or not valid, please check your
|
65 |
$controls->data['licence_expires'] = "";
|
66 |
} elseif ($expires = json_decode(wp_remote_retrieve_body($response))) {
|
67 |
$controls->data['licence_expires'] = $expires->expire;
|
|
|
68 |
} else {
|
|
|
69 |
$controls->data['licence_expires'] = "";
|
70 |
}
|
71 |
$module->merge_options($controls->data);
|
72 |
}
|
73 |
|
74 |
-
//echo $module->get_extension_version(64);
|
75 |
?>
|
76 |
|
77 |
<div class="wrap" id="tnp-wrap">
|
45 |
if (!$newsletter->is_email($controls->data['reply_to'], true)) {
|
46 |
$controls->errors .= __('Reply to email is not correct.', 'newsletter') . '<br>';
|
47 |
}
|
48 |
+
|
49 |
+
$controls->data['contract_key'] = trim($controls->data['contract_key']);
|
50 |
+
|
51 |
if (empty($controls->errors)) {
|
52 |
$module->merge_options($controls->data);
|
53 |
$controls->messages .= __('Saved.', 'newsletter');
|
60 |
$response = wp_remote_get('http://www.thenewsletterplugin.com/wp-content/plugins/file-commerce-pro/check.php?k=' . $controls->data['contract_key']);
|
61 |
if (is_wp_error($response)) {
|
62 |
/* @var $response WP_Error */
|
63 |
+
$controls->errors .= 'It seems that your blog cannot contact the license validator. Ask your provider to unlock the HTTP/HTTPS connections to www.thenewsletterplugin.com<br>';
|
64 |
$controls->errors .= $response->get_error_code() . ' - ' . $response->get_error_message();
|
65 |
$controls->data['licence_expires'] = "";
|
66 |
} else if ($response['response']['code'] != 200) {
|
67 |
+
$controls->errors .= 'The license seems expired or not valid, please check your <a href="http://www.thenewsletterplugin.com/account">license code and status</a>, thank you.';
|
68 |
$controls->data['licence_expires'] = "";
|
69 |
} elseif ($expires = json_decode(wp_remote_retrieve_body($response))) {
|
70 |
$controls->data['licence_expires'] = $expires->expire;
|
71 |
+
$controls->messages = 'Your license is valid and expires on ' . date('Y-m-d', $expires->expire);
|
72 |
} else {
|
73 |
+
$controls->errors = 'Unable to detect the license expiration. Debug data to report to the support: <code>' . wp_remote_retrieve_body($response) . '</code>';
|
74 |
$controls->data['licence_expires'] = "";
|
75 |
}
|
76 |
$module->merge_options($controls->data);
|
77 |
}
|
78 |
|
|
|
79 |
?>
|
80 |
|
81 |
<div class="wrap" id="tnp-wrap">
|
plugin.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: Newsletter
|
5 |
Plugin URI: http://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="http://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
|
7 |
-
Version: 4.
|
8 |
Author: Stefano Lissa & The Newsletter Team
|
9 |
Author URI: http://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', '4.
|
18 |
|
19 |
global $wpdb, $newsletter;
|
20 |
|
@@ -150,14 +150,29 @@ class Newsletter extends NewsletterModule {
|
|
150 |
|
151 |
if (defined('DOING_CRON') && DOING_CRON) {
|
152 |
$calls = get_option('newsletter_diagnostic_cron_calls', array());
|
153 |
-
if (empty($calls)) {
|
154 |
-
add_option('newsletter_diagnostic_cron_calls', $calls, null, 'no');
|
155 |
-
}
|
156 |
$calls[] = time();
|
157 |
if (count($calls) > self::MAX_CRON_SAMPLES) {
|
158 |
array_shift($calls);
|
159 |
}
|
160 |
-
update_option('newsletter_diagnostic_cron_calls', $calls);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
return;
|
162 |
}
|
163 |
|
@@ -365,6 +380,11 @@ class Newsletter extends NewsletterModule {
|
|
365 |
$warnings .= 'The delivery engine is off (it should never be off). Deactivate and reactivate the plugin. Thank you.<br>';
|
366 |
} else if (time() - $x > 900) {
|
367 |
$warnings .= 'The cron system seems not running correctly. See <a href="http://www.thenewsletterplugin.com/how-to-make-the-wordpress-cron-work" target="_blank">this page</a> for more information.<br>';
|
|
|
|
|
|
|
|
|
|
|
368 |
}
|
369 |
|
370 |
if (!empty($warnings)) {
|
@@ -608,6 +628,8 @@ class Newsletter extends NewsletterModule {
|
|
608 |
@set_time_limit((int) $this->options['php_time_limit']);
|
609 |
} else if (defined('NEWSLETTER_MAX_EXECUTION_TIME')) {
|
610 |
@set_time_limit(NEWSLETTER_MAX_EXECUTION_TIME);
|
|
|
|
|
611 |
}
|
612 |
|
613 |
$max_time = (int) (@ini_get('max_execution_time') * 0.95);
|
@@ -1076,7 +1098,7 @@ class Newsletter extends NewsletterModule {
|
|
1076 |
$nk = $user->id . '-' . $user->token;
|
1077 |
|
1078 |
$options_subscription = NewsletterSubscription::instance()->options;
|
1079 |
-
|
1080 |
if ($email) {
|
1081 |
$text = str_replace('{email_id}', $email->id, $text);
|
1082 |
$text = str_replace('{email_subject}', $email->subject, $text);
|
4 |
Plugin Name: Newsletter
|
5 |
Plugin URI: http://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="http://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
|
7 |
+
Version: 4.6.0
|
8 |
Author: Stefano Lissa & The Newsletter Team
|
9 |
Author URI: http://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', '4.6.0');
|
18 |
|
19 |
global $wpdb, $newsletter;
|
20 |
|
150 |
|
151 |
if (defined('DOING_CRON') && DOING_CRON) {
|
152 |
$calls = get_option('newsletter_diagnostic_cron_calls', array());
|
|
|
|
|
|
|
153 |
$calls[] = time();
|
154 |
if (count($calls) > self::MAX_CRON_SAMPLES) {
|
155 |
array_shift($calls);
|
156 |
}
|
157 |
+
update_option('newsletter_diagnostic_cron_calls', $calls, false);
|
158 |
+
|
159 |
+
if (count($calls) > 50) {
|
160 |
+
$mean = 0;
|
161 |
+
$max = 0;
|
162 |
+
$min = 0;
|
163 |
+
for ($i = 1; $i < count($calls); $i++) {
|
164 |
+
$diff = $calls[$i] - $calls[$i - 1];
|
165 |
+
$mean += $diff;
|
166 |
+
if ($min == 0 || $min > $diff) {
|
167 |
+
$min = $diff;
|
168 |
+
}
|
169 |
+
if ($max < $diff) {
|
170 |
+
$max = $diff;
|
171 |
+
}
|
172 |
+
}
|
173 |
+
$mean = $mean / count($calls) - 1;
|
174 |
+
update_option('newsletter_diagnostic_cron_data', array('mean'=>$mean, 'max'=>$max, 'min'=>$min), false);
|
175 |
+
}
|
176 |
return;
|
177 |
}
|
178 |
|
380 |
$warnings .= 'The delivery engine is off (it should never be off). Deactivate and reactivate the plugin. Thank you.<br>';
|
381 |
} else if (time() - $x > 900) {
|
382 |
$warnings .= 'The cron system seems not running correctly. See <a href="http://www.thenewsletterplugin.com/how-to-make-the-wordpress-cron-work" target="_blank">this page</a> for more information.<br>';
|
383 |
+
} else {
|
384 |
+
$cron_data = get_option('newsletter_diagnostic_cron_data');
|
385 |
+
if ($cron_data && $cron_data['mean'] > 400) {
|
386 |
+
$warnings .= 'The WordPress internal schedule is not triggered enough often. See <a href="http://www.thenewsletterplugin.com/how-to-make-the-wordpress-cron-work" target="_blank">this page</a> for more information.<br>';
|
387 |
+
}
|
388 |
}
|
389 |
|
390 |
if (!empty($warnings)) {
|
628 |
@set_time_limit((int) $this->options['php_time_limit']);
|
629 |
} else if (defined('NEWSLETTER_MAX_EXECUTION_TIME')) {
|
630 |
@set_time_limit(NEWSLETTER_MAX_EXECUTION_TIME);
|
631 |
+
} else {
|
632 |
+
@set_time_limit(NEWSLETTER_CRON_INTERVAL);
|
633 |
}
|
634 |
|
635 |
$max_time = (int) (@ini_get('max_execution_time') * 0.95);
|
1098 |
$nk = $user->id . '-' . $user->token;
|
1099 |
|
1100 |
$options_subscription = NewsletterSubscription::instance()->options;
|
1101 |
+
|
1102 |
if ($email) {
|
1103 |
$text = str_replace('{email_id}', $email->id, $text);
|
1104 |
$text = str_replace('{email_subject}', $email->subject, $text);
|
readme.txt
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
=== Newsletter ===
|
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.
|
5 |
-
Stable tag: 4.
|
6 |
Contributors: satollo,webagile,michael-travan
|
7 |
|
8 |
Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
|
@@ -77,6 +77,13 @@ Thank you, The Newsletter Team
|
|
77 |
|
78 |
== Changelog ==
|
79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
= 4.5.9 =
|
81 |
|
82 |
* Fixed a PHP syntax error on composer panel
|
1 |
=== Newsletter ===
|
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.6.0
|
5 |
+
Stable tag: 4.6.0
|
6 |
Contributors: satollo,webagile,michael-travan
|
7 |
|
8 |
Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
|
77 |
|
78 |
== Changelog ==
|
79 |
|
80 |
+
= 4.6.0 =
|
81 |
+
|
82 |
+
* Fixed debug notices on composer post blocks
|
83 |
+
* Improved image styles on composer hero block
|
84 |
+
* Added support for WP_Error in the logger
|
85 |
+
* Improved the license checking
|
86 |
+
|
87 |
= 4.5.9 =
|
88 |
|
89 |
* Fixed a PHP syntax error on composer panel
|
tnp-header.php
CHANGED
@@ -187,28 +187,6 @@ function newsletter_print_entries($group) {
|
|
187 |
</div>
|
188 |
<?php } ?>
|
189 |
|
190 |
-
<?php if (!isset($dismissed['wpmail'])) { ?>
|
191 |
-
<div class="tnp-notice">
|
192 |
-
<a href="<?php echo $_SERVER['REQUEST_URI'] . '&noheader=1&dismiss=wpmail' ?>" class="tnp-dismiss">×</a>
|
193 |
-
|
194 |
-
Important change: now Newsletter sends emails using WordPress! <a href="http://www.thenewsletterplugin.com/configuration-tnin-send-email" target="_blank">Read more</a>.
|
195 |
-
|
196 |
-
</div>
|
197 |
-
<?php } ?>
|
198 |
-
|
199 |
-
<?php /*
|
200 |
-
if (isset($_GET['page']) && !Newsletter::instance()->has_license()) {
|
201 |
-
$p = $_GET['page'];
|
202 |
-
if (strpos($p, 'newsletter_reports') === 0 || strpos($p, 'newsletter_automated') === 0 || strpos($p, 'newsletter_feed') === 0 ||
|
203 |
-
strpos($p, 'newsletter_followup') === 0 || strpos($p, 'newsletter_autoresponder') === 0 || strpos($p, 'newsletter_sendgrid') === 0) {
|
204 |
-
?>
|
205 |
-
<div class="tnp-notice">
|
206 |
-
You have not set your licence
|
207 |
-
</div>
|
208 |
-
<?php
|
209 |
-
}
|
210 |
-
} */
|
211 |
-
?>
|
212 |
<div id="tnp-notification">
|
213 |
<?php Newsletter::instance()->warnings(); ?>
|
214 |
<?php
|
187 |
</div>
|
188 |
<?php } ?>
|
189 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
<div id="tnp-notification">
|
191 |
<?php Newsletter::instance()->warnings(); ?>
|
192 |
<?php
|