Version Description
- [COMPOSER] Posts block excerpt removed when set to 0-length
- Added special characters on test message
- Added more specific error for action calls on System/Status panel
- Check for the _wp_amp_action_xhr_converted parameter by AMP plugin
Download this release
Release Info
Developer | satollo |
Plugin | Newsletter |
Version | 7.2.2 |
Comparing to | |
See all releases |
Code changes from version 7.2.1 to 7.2.2
- admin.css +1 -1
- emails/blocks/posts/layout-big-image.php +9 -8
- emails/blocks/posts/layout-one-2.php +13 -11
- emails/blocks/posts/layout-one.php +12 -10
- emails/blocks/posts/layout-two.php +11 -9
- emails/composer.php +3 -18
- includes/module.php +1 -1
- includes/test-message.html +45 -0
- main/main.php +4 -2
- main/status.php +60 -17
- plugin.php +8 -4
- readme.txt +14 -7
- subscription/subscription.php +1 -2
admin.css
CHANGED
@@ -186,7 +186,7 @@
|
|
186 |
|
187 |
#tnp-body {
|
188 |
padding: 10px;
|
189 |
-
background-color: #28313C
|
190 |
}
|
191 |
|
192 |
#tnp-body h1,
|
186 |
|
187 |
#tnp-body {
|
188 |
padding: 10px;
|
189 |
+
/*background-color: #28313C;*/
|
190 |
}
|
191 |
|
192 |
#tnp-body h1,
|
emails/blocks/posts/layout-big-image.php
CHANGED
@@ -86,7 +86,7 @@ $size = ['width' => 600, 'height' => 0];
|
|
86 |
</td>
|
87 |
</tr>
|
88 |
<?php } ?>
|
89 |
-
|
90 |
<tr>
|
91 |
<td align="<?php echo $align_left ?>" inline-class="title" class="tnpc-row-edit tnpc-inline-editable"
|
92 |
data-type="title" data-id="<?php echo $post->ID ?>" dir="<?php echo $dir ?>">
|
@@ -97,18 +97,19 @@ $size = ['width' => 600, 'height' => 0];
|
|
97 |
?>
|
98 |
</td>
|
99 |
</tr>
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
class="tnpc-row-edit tnpc-inline-editable"
|
104 |
-
data-type="text" data-id="<?php echo $post->ID ?>" dir="<?php echo $dir ?>">
|
105 |
<?php
|
106 |
echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'text', $post->ID) ?
|
107 |
TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'text', $post->ID) :
|
108 |
tnp_post_excerpt($post, $excerpt_length)
|
109 |
?>
|
110 |
-
|
111 |
-
|
|
|
|
|
112 |
<?php if ($show_read_more_button) { ?>
|
113 |
<tr>
|
114 |
<td align="<?php echo $align_left ?>" inline-class="button">
|
86 |
</td>
|
87 |
</tr>
|
88 |
<?php } ?>
|
89 |
+
|
90 |
<tr>
|
91 |
<td align="<?php echo $align_left ?>" inline-class="title" class="tnpc-row-edit tnpc-inline-editable"
|
92 |
data-type="title" data-id="<?php echo $post->ID ?>" dir="<?php echo $dir ?>">
|
97 |
?>
|
98 |
</td>
|
99 |
</tr>
|
100 |
+
|
101 |
+
<?php if ($excerpt_length) { ?>
|
102 |
+
<tr>
|
103 |
+
<td align="<?php echo $align_left ?>" inline-class="excerpt" class="tnpc-row-edit tnpc-inline-editable" data-type="text" data-id="<?php echo $post->ID ?>" dir="<?php echo $dir ?>">
|
|
|
104 |
<?php
|
105 |
echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'text', $post->ID) ?
|
106 |
TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'text', $post->ID) :
|
107 |
tnp_post_excerpt($post, $excerpt_length)
|
108 |
?>
|
109 |
+
</td>
|
110 |
+
</tr>
|
111 |
+
<?php } ?>
|
112 |
+
|
113 |
<?php if ($show_read_more_button) { ?>
|
114 |
<tr>
|
115 |
<td align="<?php echo $align_left ?>" inline-class="button">
|
emails/blocks/posts/layout-one-2.php
CHANGED
@@ -104,17 +104,19 @@ $column_width = $total_width / 2 - 10;
|
|
104 |
</tr>
|
105 |
<?php } ?>
|
106 |
|
107 |
-
|
108 |
-
<
|
109 |
-
<
|
110 |
-
<?php
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
|
|
|
|
118 |
|
119 |
<?php if ($show_read_more_button) { ?>
|
120 |
<tr>
|
104 |
</tr>
|
105 |
<?php } ?>
|
106 |
|
107 |
+
<?php if ($excerpt_length) { ?>
|
108 |
+
<tr>
|
109 |
+
<td align="<?php echo $align_left ?>" dir="<?php echo $dir ?>">
|
110 |
+
<a href="<?php $url ?>" data-id="<?php echo $post->ID ?>" inline-class="excerpt" class="tnpc-row-edit tnpc-inline-editable" data-type="text">
|
111 |
+
<?php
|
112 |
+
echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'text', $post->ID) ?
|
113 |
+
TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'text', $post->ID) :
|
114 |
+
tnp_post_excerpt($post, $excerpt_length)
|
115 |
+
?>
|
116 |
+
</a>
|
117 |
+
</td>
|
118 |
+
</tr>
|
119 |
+
<?php } ?>
|
120 |
|
121 |
<?php if ($show_read_more_button) { ?>
|
122 |
<tr>
|
emails/blocks/posts/layout-one.php
CHANGED
@@ -102,16 +102,18 @@ $column_width = $total_width / 2 - 10;
|
|
102 |
</td>
|
103 |
</tr>
|
104 |
|
105 |
-
|
106 |
-
<
|
107 |
-
|
108 |
-
<?php
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
|
|
|
|
115 |
|
116 |
<?php if ($show_read_more_button) { ?>
|
117 |
<tr>
|
102 |
</td>
|
103 |
</tr>
|
104 |
|
105 |
+
<?php if ($excerpt_length) { ?>
|
106 |
+
<tr>
|
107 |
+
<td align="<?php echo $align_left ?>" inline-class="excerpt" class="tnpc-row-edit tnpc-inline-editable"
|
108 |
+
data-type="text" data-id="<?php echo $post->ID ?>" dir="<?php echo $dir ?>">
|
109 |
+
<?php
|
110 |
+
echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'text', $post->ID) ?
|
111 |
+
TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'text', $post->ID) :
|
112 |
+
tnp_post_excerpt($post, $excerpt_length)
|
113 |
+
?>
|
114 |
+
</td>
|
115 |
+
</tr>
|
116 |
+
<?php } ?>
|
117 |
|
118 |
<?php if ($show_read_more_button) { ?>
|
119 |
<tr>
|
emails/blocks/posts/layout-two.php
CHANGED
@@ -100,16 +100,18 @@ $column_width = $total_width / 2 - 20;
|
|
100 |
<?php } ?>
|
101 |
|
102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
-
<tr>
|
105 |
-
<td align="center" inline-class="excerpt" class="tnpc-row-edit tnpc-inline-editable" data-type="text" data-id="<?php echo $row[0]->ID ?>">
|
106 |
-
<?php
|
107 |
-
echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'text', $row[0]->ID) ?
|
108 |
-
TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'text', $row[0]->ID) :
|
109 |
-
tnp_post_excerpt($row[0], $excerpt_length)
|
110 |
-
?>
|
111 |
-
</td>
|
112 |
-
</tr>
|
113 |
<?php if ($show_read_more_button) { ?>
|
114 |
<tr>
|
115 |
<td align="center" inline-class="button">
|
100 |
<?php } ?>
|
101 |
|
102 |
|
103 |
+
<?php if ($excerpt_length) { ?>
|
104 |
+
<tr>
|
105 |
+
<td align="center" inline-class="excerpt" class="tnpc-row-edit tnpc-inline-editable" data-type="text" data-id="<?php echo $row[0]->ID ?>">
|
106 |
+
<?php
|
107 |
+
echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'text', $row[0]->ID) ?
|
108 |
+
TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'text', $row[0]->ID) :
|
109 |
+
tnp_post_excerpt($row[0], $excerpt_length)
|
110 |
+
?>
|
111 |
+
</td>
|
112 |
+
</tr>
|
113 |
+
<?php } ?>
|
114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
<?php if ($show_read_more_button) { ?>
|
116 |
<tr>
|
117 |
<td align="center" inline-class="button">
|
emails/composer.php
CHANGED
@@ -16,6 +16,7 @@ $email = null;
|
|
16 |
if ($controls->is_action()) {
|
17 |
|
18 |
if ($controls->is_action('save_preset')) {
|
|
|
19 |
// Create new preset email
|
20 |
$email = new stdClass();
|
21 |
TNP_Composer::update_email($email, $controls);
|
@@ -24,13 +25,6 @@ if ($controls->is_action()) {
|
|
24 |
$email->subject = $module->sanitize_preset_name($controls->data['subject']);
|
25 |
$email->message = $controls->data['message'];
|
26 |
|
27 |
-
//Save Global Style options
|
28 |
-
foreach ($controls->data as $name => $value) {
|
29 |
-
if (strpos($name, 'options_composer_') === 0) {
|
30 |
-
$email->options[substr($name, 8)] = $value;
|
31 |
-
}
|
32 |
-
}
|
33 |
-
|
34 |
$email = Newsletter::instance()->save_email($email);
|
35 |
|
36 |
$redirect = $module->get_admin_page_url('composer');
|
@@ -40,7 +34,7 @@ if ($controls->is_action()) {
|
|
40 |
}
|
41 |
|
42 |
if ($controls->is_action('update_preset') && !empty($_POST['preset_id'])) {
|
43 |
-
|
44 |
$email = Newsletter::instance()->get_email((int) $_POST['preset_id']);
|
45 |
TNP_Composer::update_email($email, $controls);
|
46 |
|
@@ -48,21 +42,13 @@ if ($controls->is_action()) {
|
|
48 |
$email->subject = $module->sanitize_preset_name($controls->data['subject']);
|
49 |
}
|
50 |
|
|
|
51 |
$email->message = $controls->data['message'];
|
52 |
|
53 |
$email = Newsletter::instance()->save_email($email);
|
54 |
|
55 |
-
//Save Global Style options
|
56 |
-
foreach ($controls->data as $name => $value) {
|
57 |
-
if (strpos($name, 'options_composer_') === 0) {
|
58 |
-
$email->options[substr($name, 8)] = $value;
|
59 |
-
}
|
60 |
-
}
|
61 |
-
|
62 |
$redirect = $module->get_admin_page_url('composer');
|
63 |
$controls->js_redirect($redirect);
|
64 |
-
|
65 |
-
return;
|
66 |
}
|
67 |
|
68 |
|
@@ -106,7 +92,6 @@ if ($controls->is_action()) {
|
|
106 |
|
107 |
$controls->js_redirect($redirect . '&id=' . $email->id);
|
108 |
|
109 |
-
return;
|
110 |
} else {
|
111 |
|
112 |
if (!empty($_GET['id'])) {
|
16 |
if ($controls->is_action()) {
|
17 |
|
18 |
if ($controls->is_action('save_preset')) {
|
19 |
+
$this->admin_logger->info('Saving new preset: ' . $controls->data['subject']);
|
20 |
// Create new preset email
|
21 |
$email = new stdClass();
|
22 |
TNP_Composer::update_email($email, $controls);
|
25 |
$email->subject = $module->sanitize_preset_name($controls->data['subject']);
|
26 |
$email->message = $controls->data['message'];
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
$email = Newsletter::instance()->save_email($email);
|
29 |
|
30 |
$redirect = $module->get_admin_page_url('composer');
|
34 |
}
|
35 |
|
36 |
if ($controls->is_action('update_preset') && !empty($_POST['preset_id'])) {
|
37 |
+
$this->admin_logger->info('Updating preset ' . $_POST['preset_id']);
|
38 |
$email = Newsletter::instance()->get_email((int) $_POST['preset_id']);
|
39 |
TNP_Composer::update_email($email, $controls);
|
40 |
|
42 |
$email->subject = $module->sanitize_preset_name($controls->data['subject']);
|
43 |
}
|
44 |
|
45 |
+
// We store only the blocks, after the TNP_Composer::update_email(...) call we have the full HTML
|
46 |
$email->message = $controls->data['message'];
|
47 |
|
48 |
$email = Newsletter::instance()->save_email($email);
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
$redirect = $module->get_admin_page_url('composer');
|
51 |
$controls->js_redirect($redirect);
|
|
|
|
|
52 |
}
|
53 |
|
54 |
|
92 |
|
93 |
$controls->js_redirect($redirect . '&id=' . $email->id);
|
94 |
|
|
|
95 |
} else {
|
96 |
|
97 |
if (!empty($_GET['id'])) {
|
includes/module.php
CHANGED
@@ -1684,7 +1684,7 @@ class NewsletterModule {
|
|
1684 |
* @return TNP_User[]
|
1685 |
*/
|
1686 |
function get_test_users() {
|
1687 |
-
return $this->store->get_all(NEWSLETTER_USERS_TABLE, "where test=1");
|
1688 |
}
|
1689 |
|
1690 |
/**
|
1684 |
* @return TNP_User[]
|
1685 |
*/
|
1686 |
function get_test_users() {
|
1687 |
+
return $this->store->get_all(NEWSLETTER_USERS_TABLE, "where test=1 and status in ('C', 'S')");
|
1688 |
}
|
1689 |
|
1690 |
/**
|
includes/test-message.html
CHANGED
@@ -35,6 +35,51 @@
|
|
35 |
|
36 |
</td>
|
37 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
</tbody>
|
39 |
</table>
|
40 |
|
35 |
|
36 |
</td>
|
37 |
</tr>
|
38 |
+
|
39 |
+
<tr>
|
40 |
+
<td style="direction: ltr; font-size: 16px; padding: 20px 10px; text-align: center;">
|
41 |
+
<p><strong>Emoji</strong></p>
|
42 |
+
<p>
|
43 |
+
😋 💡 👍 👩 😲 😍
|
44 |
+
</p>
|
45 |
+
<p>Emoji are actually special characters, every device renders them in a different way (or not render at all!).</p>
|
46 |
+
</td>
|
47 |
+
</tr>
|
48 |
+
|
49 |
+
<tr>
|
50 |
+
<td style="direction: ltr; font-size: 16px; padding: 20px 10px; text-align: center;">
|
51 |
+
<p><strong>Cyrillic</strong></p>
|
52 |
+
<p>
|
53 |
+
Лорем ипсум долор сит амет, нонумы инвидунт детерруиссет сит еа. Меис лаудем цонцлудатуряуе яуи ин.
|
54 |
+
Ат цум веро иусто инвенире. Те вим лудус граецис. Диссентиас реформиданс ин меи. Сеа ад хабео
|
55 |
+
алияуип, популо тинцидунт цонсецтетуер цу еум, еа хас дицта рецусабо.
|
56 |
+
</p>
|
57 |
+
</td>
|
58 |
+
</tr>
|
59 |
+
|
60 |
+
<tr>
|
61 |
+
<td style="direction: ltr; font-size: 16px; padding: 20px 10px; text-align: center;">
|
62 |
+
<p><strong>Greek</strong></p>
|
63 |
+
<p>
|
64 |
+
Λορεμ ιπσθμ δολορ σιτ αμετ, vιξ ωισι προμπτα αccθσαμθσ νο, εοσ σιντ λεγερε ινστρθcτιορ τε,
|
65 |
+
προ cθ ταμqθαμ cομπλεcτιτθρ. Ρεφορμιδανσ ρεφερρεντθρ ηισ ιν, vιξ διαμ ιμπεδιτ αν. Εστ
|
66 |
+
ηαβεο μεδιοcρεμ νο. Εθ ιθδιcο qθαεστιο vολθπτατθμ νεc, ιθσ θτ αλια ιθδιcαβιτ εξπλιcαρι,
|
67 |
+
προ αππετερε cονσετετθρ ιδ. Ηισ νεμορε εξπετενδισ ρεφερρεντθρ ατ.
|
68 |
+
</p>
|
69 |
+
</td>
|
70 |
+
</tr>
|
71 |
+
|
72 |
+
<tr>
|
73 |
+
<td style="direction: ltr; font-size: 16px; padding: 20px 10px; text-align: center;">
|
74 |
+
<p><strong>Hindi</strong></p>
|
75 |
+
<p>
|
76 |
+
विवरन साधन दर्शाता सम्पर्क स्वतंत्रता अन्तरराष्ट्रीयकरन देखने सुना नयेलिए स्थापित
|
77 |
+
कम्प्युटर रचना बनाना गटको कराना लक्ष्य स्थापित विभाजनक्षमता वास्तविक यन्त्रालय खण्ड
|
78 |
+
मुख्य ७हल लचकनहि अमितकुमार लक्षण सारांश प्राथमिक देकर प्राण आंतरजाल मार्गदर्शन
|
79 |
+
दिये मजबुत करता। भारतीय वैश्विक वहहर
|
80 |
+
</p>
|
81 |
+
</td>
|
82 |
+
</tr>
|
83 |
</tbody>
|
84 |
</table>
|
85 |
|
main/main.php
CHANGED
@@ -236,15 +236,17 @@ if (!empty($return_path)) {
|
|
236 |
</div>
|
237 |
|
238 |
<div id="tabs-speed">
|
239 |
-
|
240 |
<table class="form-table">
|
241 |
<tr>
|
242 |
<th>
|
243 |
<?php _e('Max emails per hour', 'newsletter') ?>
|
244 |
-
<?php $controls->field_help('https://www.thenewsletterplugin.com/documentation/
|
245 |
</th>
|
246 |
<td>
|
247 |
<?php $controls->text('scheduler_max', 5); ?> (min. 10)
|
|
|
|
|
248 |
</td>
|
249 |
</tr>
|
250 |
</table>
|
236 |
</div>
|
237 |
|
238 |
<div id="tabs-speed">
|
239 |
+
|
240 |
<table class="form-table">
|
241 |
<tr>
|
242 |
<th>
|
243 |
<?php _e('Max emails per hour', 'newsletter') ?>
|
244 |
+
<?php $controls->field_help('https://www.thenewsletterplugin.com/documentation/installation/newsletter-configuration/#speed') ?>
|
245 |
</th>
|
246 |
<td>
|
247 |
<?php $controls->text('scheduler_max', 5); ?> (min. 10)
|
248 |
+
<p class="description">
|
249 |
+
<a href="?page=newsletter_main_status#tnp-speed">See the collected statistics</a>
|
250 |
</td>
|
251 |
</tr>
|
252 |
</table>
|
main/status.php
CHANGED
@@ -4,6 +4,8 @@
|
|
4 |
|
5 |
defined('ABSPATH') || exit;
|
6 |
|
|
|
|
|
7 |
include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
|
8 |
$controls = new NewsletterControls();
|
9 |
|
@@ -158,9 +160,11 @@ function tnp_status_print_flag($condition) {
|
|
158 |
}
|
159 |
|
160 |
class TNP_WPDB extends wpdb {
|
|
|
161 |
public function get_table_charset($table) {
|
162 |
return parent::get_table_charset($table);
|
163 |
}
|
|
|
164 |
}
|
165 |
|
166 |
$tnp_wpdb = new TNP_WPDB(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
@@ -240,14 +244,22 @@ $tnp_wpdb = new TNP_WPDB(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
|
240 |
</tr>
|
241 |
<?php
|
242 |
// Send calls stats
|
243 |
-
$send_calls = get_option('newsletter_diagnostic_send_calls',
|
244 |
-
|
|
|
|
|
|
|
|
|
245 |
$send_max = 0;
|
246 |
$send_min = PHP_INT_MAX;
|
247 |
$send_total_time = 0;
|
248 |
$send_total_emails = 0;
|
249 |
$send_completed = 0;
|
250 |
for ($i = 0; $i < count($send_calls); $i++) {
|
|
|
|
|
|
|
|
|
251 |
if (empty($send_calls[$i][2]))
|
252 |
continue;
|
253 |
|
@@ -255,6 +267,10 @@ $tnp_wpdb = new TNP_WPDB(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
|
255 |
$send_total_time += $delta;
|
256 |
$send_total_emails += $send_calls[$i][2];
|
257 |
$send_mean = $delta / $send_calls[$i][2];
|
|
|
|
|
|
|
|
|
258 |
if ($send_min > $send_mean) {
|
259 |
$send_min = $send_mean;
|
260 |
}
|
@@ -268,7 +284,7 @@ $tnp_wpdb = new TNP_WPDB(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
|
268 |
$send_mean = $send_total_time / $send_total_emails;
|
269 |
?>
|
270 |
<tr>
|
271 |
-
<td>
|
272 |
Send details
|
273 |
</td>
|
274 |
<td>
|
@@ -295,6 +311,31 @@ $tnp_wpdb = new TNP_WPDB(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
|
295 |
Runs prematurely interrupted: <?php echo sprintf("%.2f", (count($send_calls) - $send_completed) * 100.0 / count($send_calls)) ?>%<br>
|
296 |
<br>
|
297 |
<?php $controls->button_reset('reset_send_stats') ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
</td>
|
299 |
</tr>
|
300 |
<?php } else { ?>
|
@@ -567,17 +608,18 @@ $tnp_wpdb = new TNP_WPDB(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
|
567 |
|
568 |
|
569 |
<?php
|
570 |
-
$res =
|
571 |
$response = wp_remote_post(home_url('/') . '?na=test');
|
572 |
if (is_wp_error($response)) {
|
573 |
-
$res =
|
574 |
$message = $response->get_error_message();
|
575 |
-
} else {
|
576 |
-
|
577 |
-
$res = false;
|
578 |
$message = wp_remote_retrieve_response_message($response);
|
579 |
-
|
|
|
580 |
}
|
|
|
581 |
?>
|
582 |
<tr>
|
583 |
<td>
|
@@ -591,11 +633,12 @@ $tnp_wpdb = new TNP_WPDB(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
|
591 |
<?php } ?>
|
592 |
</td>
|
593 |
<td>
|
594 |
-
<?php if (
|
595 |
The blog is not responding to Newsletter URLs: ask the provider or your IT consultant to check this problem. Report the URL and error below<br>
|
596 |
Error: <?php echo esc_html($message) ?><br>
|
597 |
-
<?php } else { ?>
|
598 |
-
|
|
|
599 |
<?php } ?>
|
600 |
Url: <?php echo esc_html(home_url('/') . '?na=test') ?><br>
|
601 |
</td>
|
@@ -1129,18 +1172,18 @@ $tnp_wpdb = new TNP_WPDB(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
|
1129 |
<?php } ?>
|
1130 |
</td>
|
1131 |
</tr>
|
1132 |
-
|
1133 |
<tr>
|
1134 |
<td>get_table_charset()</td>
|
1135 |
<td>
|
1136 |
-
|
1137 |
</td>
|
1138 |
<td>
|
1139 |
-
<?php echo esc_html(NEWSLETTER_USERS_TABLE), ': ', esc_html($tnp_wpdb->get_table_charset(NEWSLETTER_USERS_TABLE))?>
|
1140 |
</td>
|
1141 |
</tr>
|
1142 |
-
|
1143 |
-
|
1144 |
|
1145 |
|
1146 |
<?php
|
4 |
|
5 |
defined('ABSPATH') || exit;
|
6 |
|
7 |
+
wp_enqueue_script('tnp-chart');
|
8 |
+
|
9 |
include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
|
10 |
$controls = new NewsletterControls();
|
11 |
|
160 |
}
|
161 |
|
162 |
class TNP_WPDB extends wpdb {
|
163 |
+
|
164 |
public function get_table_charset($table) {
|
165 |
return parent::get_table_charset($table);
|
166 |
}
|
167 |
+
|
168 |
}
|
169 |
|
170 |
$tnp_wpdb = new TNP_WPDB(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
244 |
</tr>
|
245 |
<?php
|
246 |
// Send calls stats
|
247 |
+
$send_calls = get_option('newsletter_diagnostic_send_calls', []);
|
248 |
+
$chart_data = [];
|
249 |
+
$chart_labels = [];
|
250 |
+
$chart_labels_idx = 1;
|
251 |
+
$chart_point_labels = [];
|
252 |
+
if ($send_calls) {
|
253 |
$send_max = 0;
|
254 |
$send_min = PHP_INT_MAX;
|
255 |
$send_total_time = 0;
|
256 |
$send_total_emails = 0;
|
257 |
$send_completed = 0;
|
258 |
for ($i = 0; $i < count($send_calls); $i++) {
|
259 |
+
// 0 - batch start time
|
260 |
+
// 1 - batch end time
|
261 |
+
// 2 - number of sent email in this batch
|
262 |
+
// 3 - 0: prematurely stopped, 1: completed
|
263 |
if (empty($send_calls[$i][2]))
|
264 |
continue;
|
265 |
|
267 |
$send_total_time += $delta;
|
268 |
$send_total_emails += $send_calls[$i][2];
|
269 |
$send_mean = $delta / $send_calls[$i][2];
|
270 |
+
$chart_data[] = $send_mean;
|
271 |
+
$chart_labels[] = $chart_labels_idx;
|
272 |
+
$chart_labels_idx++;
|
273 |
+
$chart_point_labels[] = 'Emails: ' . $send_calls[$i][2];
|
274 |
if ($send_min > $send_mean) {
|
275 |
$send_min = $send_mean;
|
276 |
}
|
284 |
$send_mean = $send_total_time / $send_total_emails;
|
285 |
?>
|
286 |
<tr>
|
287 |
+
<td id="tnp-speed">
|
288 |
Send details
|
289 |
</td>
|
290 |
<td>
|
311 |
Runs prematurely interrupted: <?php echo sprintf("%.2f", (count($send_calls) - $send_completed) * 100.0 / count($send_calls)) ?>%<br>
|
312 |
<br>
|
313 |
<?php $controls->button_reset('reset_send_stats') ?>
|
314 |
+
|
315 |
+
<canvas id="tnp-send-chart" style="width: 550px; height: 150px"></canvas>
|
316 |
+
<script>
|
317 |
+
jQuery(function () {
|
318 |
+
var sendChartData = {
|
319 |
+
labels: <?php echo json_encode($chart_labels) ?>,
|
320 |
+
datasets: [
|
321 |
+
{
|
322 |
+
label: "Batch Average Time",
|
323 |
+
data: <?php echo json_encode($chart_data) ?>,
|
324 |
+
borderColor: '#2980b9',
|
325 |
+
fill: false
|
326 |
+
}]
|
327 |
+
};
|
328 |
+
var sendChartConfig = {
|
329 |
+
type: "line",
|
330 |
+
data: sendChartData,
|
331 |
+
options: {
|
332 |
+
responsive: false,
|
333 |
+
maintainAspectRatio: false
|
334 |
+
}
|
335 |
+
};
|
336 |
+
new Chart('tnp-send-chart', sendChartConfig);
|
337 |
+
});
|
338 |
+
</script>
|
339 |
</td>
|
340 |
</tr>
|
341 |
<?php } else { ?>
|
608 |
|
609 |
|
610 |
<?php
|
611 |
+
$res = 0;
|
612 |
$response = wp_remote_post(home_url('/') . '?na=test');
|
613 |
if (is_wp_error($response)) {
|
614 |
+
$res = 1;
|
615 |
$message = $response->get_error_message();
|
616 |
+
} else if (wp_remote_retrieve_response_code($response) != 200) {
|
617 |
+
$res = 1;
|
|
|
618 |
$message = wp_remote_retrieve_response_message($response);
|
619 |
+
} else if (wp_remote_retrieve_body($response) !== 'ok') {
|
620 |
+
$res = 2;
|
621 |
}
|
622 |
+
|
623 |
?>
|
624 |
<tr>
|
625 |
<td>
|
633 |
<?php } ?>
|
634 |
</td>
|
635 |
<td>
|
636 |
+
<?php if ($res === 1) { ?>
|
637 |
The blog is not responding to Newsletter URLs: ask the provider or your IT consultant to check this problem. Report the URL and error below<br>
|
638 |
Error: <?php echo esc_html($message) ?><br>
|
639 |
+
<?php } else if ($res === 2) { ?>
|
640 |
+
The response does not contain the "ok" text: probably a caching/optimization plugin or a server configuration is forcing the blog to ignore
|
641 |
+
the URL's query string. Reported that to your system administrator.
|
642 |
<?php } ?>
|
643 |
Url: <?php echo esc_html(home_url('/') . '?na=test') ?><br>
|
644 |
</td>
|
1172 |
<?php } ?>
|
1173 |
</td>
|
1174 |
</tr>
|
1175 |
+
|
1176 |
<tr>
|
1177 |
<td>get_table_charset()</td>
|
1178 |
<td>
|
1179 |
+
|
1180 |
</td>
|
1181 |
<td>
|
1182 |
+
<?php echo esc_html(NEWSLETTER_USERS_TABLE), ': ', esc_html($tnp_wpdb->get_table_charset(NEWSLETTER_USERS_TABLE)) ?>
|
1183 |
</td>
|
1184 |
</tr>
|
1185 |
+
|
1186 |
+
|
1187 |
|
1188 |
|
1189 |
<?php
|
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: 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', '7.2.
|
39 |
|
40 |
global $newsletter, $wpdb;
|
41 |
|
@@ -260,6 +260,7 @@ class Newsletter extends NewsletterModule {
|
|
260 |
}
|
261 |
|
262 |
if ($this->action == 'test') {
|
|
|
263 |
echo 'ok';
|
264 |
die();
|
265 |
}
|
@@ -461,8 +462,9 @@ class Newsletter extends NewsletterModule {
|
|
461 |
}
|
462 |
|
463 |
function admin_menu() {
|
464 |
-
if (!$this->is_allowed())
|
465 |
return;
|
|
|
466 |
|
467 |
add_menu_page('Newsletter', 'Newsletter', 'exist', 'newsletter_main_index', '', plugins_url('newsletter') . '/images/menu-icon.png', '30.333');
|
468 |
|
@@ -471,7 +473,9 @@ class Newsletter extends NewsletterModule {
|
|
471 |
|
472 |
if (current_user_can('administrator')) {
|
473 |
$this->add_menu_page('welcome', __('Welcome', 'newsletter'));
|
474 |
-
$this->add_menu_page('main', __('Settings
|
|
|
|
|
475 |
$this->add_admin_page('smtp', 'SMTP');
|
476 |
$this->add_admin_page('status', __('Status', 'newsletter'));
|
477 |
$this->add_admin_page('delivery', __('Delivery Diagnostic', 'newsletter'));
|
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: 7.2.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 |
return;
|
36 |
}
|
37 |
|
38 |
+
define('NEWSLETTER_VERSION', '7.2.2');
|
39 |
|
40 |
global $newsletter, $wpdb;
|
41 |
|
260 |
}
|
261 |
|
262 |
if ($this->action == 'test') {
|
263 |
+
// This response is tested, do not change it!
|
264 |
echo 'ok';
|
265 |
die();
|
266 |
}
|
462 |
}
|
463 |
|
464 |
function admin_menu() {
|
465 |
+
if (!$this->is_allowed()) {
|
466 |
return;
|
467 |
+
}
|
468 |
|
469 |
add_menu_page('Newsletter', 'Newsletter', 'exist', 'newsletter_main_index', '', plugins_url('newsletter') . '/images/menu-icon.png', '30.333');
|
470 |
|
473 |
|
474 |
if (current_user_can('administrator')) {
|
475 |
$this->add_menu_page('welcome', __('Welcome', 'newsletter'));
|
476 |
+
$this->add_menu_page('main', __('Settings', 'newsletter'));
|
477 |
+
|
478 |
+
// Pages not on menu
|
479 |
$this->add_admin_page('smtp', 'SMTP');
|
480 |
$this->add_admin_page('status', __('Status', 'newsletter'));
|
481 |
$this->add_admin_page('delivery', __('Delivery Diagnostic', 'newsletter'));
|
readme.txt
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
=== Newsletter ===
|
2 |
Tags: newsletter, email marketing, welcome email, signup forms, contact, lead generation, marketing automation
|
3 |
Requires at least: 3.4.0
|
4 |
-
Tested up to: 5.
|
5 |
-
Stable tag: 7.2.
|
6 |
Requires PHP: 5.6
|
7 |
Contributors: satollo,webagile,michael-travan
|
8 |
License: GPLv2 or later
|
@@ -120,6 +120,13 @@ Thank you, The Newsletter Team
|
|
120 |
|
121 |
== Changelog ==
|
122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
= 7.2.1 =
|
124 |
|
125 |
* Added more detailed admin logging
|
@@ -130,9 +137,9 @@ Thank you, The Newsletter Team
|
|
130 |
* Fixed activation email on profile change
|
131 |
* Extended year selection on newsletter scheduling
|
132 |
* [DELIVERY] Breaking change: old enqueue() and flush() methods have been removed
|
133 |
-
* Fixed alert message on some buttons
|
134 |
-
* Fixed error message on multiple subscriptions (when not allowed)
|
135 |
-
* Fixed erratic error log line on main log
|
136 |
|
137 |
= 7.1.9 =
|
138 |
|
@@ -145,11 +152,11 @@ Thank you, The Newsletter Team
|
|
145 |
|
146 |
= 7.1.8 =
|
147 |
|
148 |
-
* Fixed alignment of single big image on Outlook Android
|
149 |
|
150 |
= 7.1.7 =
|
151 |
|
152 |
-
* Fix of permalink onm email with multilanguage plugins
|
153 |
|
154 |
= 7.1.6 =
|
155 |
|
1 |
=== Newsletter ===
|
2 |
Tags: newsletter, email marketing, welcome email, signup forms, contact, lead generation, marketing automation
|
3 |
Requires at least: 3.4.0
|
4 |
+
Tested up to: 5.8
|
5 |
+
Stable tag: 7.2.2
|
6 |
Requires PHP: 5.6
|
7 |
Contributors: satollo,webagile,michael-travan
|
8 |
License: GPLv2 or later
|
120 |
|
121 |
== Changelog ==
|
122 |
|
123 |
+
= 7.2.2 =
|
124 |
+
|
125 |
+
* [COMPOSER] Posts block excerpt removed when set to 0-length
|
126 |
+
* Added special characters on test message
|
127 |
+
* Added more specific error for action calls on System/Status panel
|
128 |
+
* Check for the _wp_amp_action_xhr_converted parameter by AMP plugin
|
129 |
+
|
130 |
= 7.2.1 =
|
131 |
|
132 |
* Added more detailed admin logging
|
137 |
* Fixed activation email on profile change
|
138 |
* Extended year selection on newsletter scheduling
|
139 |
* [DELIVERY] Breaking change: old enqueue() and flush() methods have been removed
|
140 |
+
* [GENERAL] Fixed alert message on some buttons
|
141 |
+
* [SUBSCRIPTION] Fixed error message on multiple subscriptions (when not allowed)
|
142 |
+
* [GENERAL] Fixed erratic error log line on main log
|
143 |
|
144 |
= 7.1.9 =
|
145 |
|
152 |
|
153 |
= 7.1.8 =
|
154 |
|
155 |
+
* [COMPOSER] Fixed alignment of single big image on Outlook Android
|
156 |
|
157 |
= 7.1.7 =
|
158 |
|
159 |
+
* [GENERAL] Fix of permalink onm email with multilanguage plugins
|
160 |
|
161 |
= 7.1.6 =
|
162 |
|
subscription/subscription.php
CHANGED
@@ -144,8 +144,7 @@ class NewsletterSubscription extends NewsletterModule {
|
|
144 |
|
145 |
$captcha = !empty($options_antibot['captcha']);
|
146 |
|
147 |
-
|
148 |
-
if (!empty($options_antibot['disabled']) || $this->antibot_form_check($captcha)) {
|
149 |
|
150 |
$subscription = $this->build_subscription();
|
151 |
|
144 |
|
145 |
$captcha = !empty($options_antibot['captcha']);
|
146 |
|
147 |
+
if (!empty($_GET['_wp_amp_action_xhr_converted']) || !empty($options_antibot['disabled']) || $this->antibot_form_check($captcha)) {
|
|
|
148 |
|
149 |
$subscription = $this->build_subscription();
|
150 |
|