Version Description
- 2021-01-27
- Add notification email on moderation.
- Support WP Rocket for clearing cache.
- Add span around "from" text in frontend.
- Add "required" parameter to search widget.
- Better test for empty string of email subscribers.
- Change 'intval()' to '(int)'.
- Change 'strval()' to '(string)'.
Download this release
Release Info
Developer | mpol |
Plugin | Gwolle Guestbook |
Version | 4.1.0 |
Comparing to | |
See all releases |
Code changes from version 4.0.8 to 4.1.0
- admin/gb-ajax-management.php +5 -2
- admin/gb-page-editor.php +11 -2
- admin/gb-page-entries.php +4 -1
- admin/gb-page-import.php +4 -4
- admin/gb-page-settings.php +11 -0
- admin/gb-upgrade.php +3 -0
- admin/tabs/gb-emailtab.php +58 -0
- changelog/changelog-v0.txt +0 -1
- changelog/changelog-v1.txt +1 -0
- changelog/changelog-v2.txt +1 -0
- changelog/changelog-v3.txt +1 -0
- docs/filters/gwolle_gb_entry_the_admin_reply.txt +1 -1
- docs/filters/gwolle_gb_mail_author_on_moderation_body.txt +41 -0
- docs/filters/gwolle_gb_mail_author_on_moderation_subject.txt +25 -0
- frontend/gb-ajax-infinite-scroll.php +2 -2
- frontend/gb-read.php +1 -1
- frontend/gb-widget-search.php +1 -1
- frontend/gb-widget.php +1 -1
- frontend/gwolle_gb-entry.php +1 -1
- frontend/markitup/style.css +1 -0
- functions/gb-cache.php +5 -0
- functions/gb-class-entry.php +9 -10
- functions/gb-formatting.php +2 -2
- functions/gb-log.php +3 -3
- functions/gb-mail.php +77 -1
- functions/gb-settings.php +3 -1
- gwolle-gb.php +3 -4
- readme.txt +11 -87
admin/gb-ajax-management.php
CHANGED
@@ -351,10 +351,10 @@ function gwolle_gb_ajax_callback() {
|
|
351 |
}
|
352 |
|
353 |
if (isset($_POST['id'])) {
|
354 |
-
$id =
|
355 |
}
|
356 |
if (isset($_POST['setter'])) {
|
357 |
-
$setter =
|
358 |
}
|
359 |
|
360 |
|
@@ -391,6 +391,7 @@ function gwolle_gb_ajax_callback() {
|
|
391 |
if ($result ) {
|
392 |
$response = 'check';
|
393 |
gwolle_gb_add_log_entry( $entry->get_id(), 'entry-checked' );
|
|
|
394 |
} else {
|
395 |
$response = 'error';
|
396 |
}
|
@@ -405,6 +406,7 @@ function gwolle_gb_ajax_callback() {
|
|
405 |
if ($result ) {
|
406 |
$response = 'unspam';
|
407 |
gwolle_gb_add_log_entry( $entry->get_id(), 'marked-as-not-spam' );
|
|
|
408 |
gwolle_gb_akismet( $entry, 'submit-ham' );
|
409 |
} else {
|
410 |
$response = 'error';
|
@@ -435,6 +437,7 @@ function gwolle_gb_ajax_callback() {
|
|
435 |
if ($result ) {
|
436 |
$response = 'untrash';
|
437 |
gwolle_gb_add_log_entry( $entry->get_id(), 'entry-untrashed' );
|
|
|
438 |
} else {
|
439 |
$response = 'error';
|
440 |
}
|
351 |
}
|
352 |
|
353 |
if (isset($_POST['id'])) {
|
354 |
+
$id = (int) $_POST['id'];
|
355 |
}
|
356 |
if (isset($_POST['setter'])) {
|
357 |
+
$setter = (string) $_POST['setter'];
|
358 |
}
|
359 |
|
360 |
|
391 |
if ($result ) {
|
392 |
$response = 'check';
|
393 |
gwolle_gb_add_log_entry( $entry->get_id(), 'entry-checked' );
|
394 |
+
gwolle_gb_mail_author_on_moderation( $entry );
|
395 |
} else {
|
396 |
$response = 'error';
|
397 |
}
|
406 |
if ($result ) {
|
407 |
$response = 'unspam';
|
408 |
gwolle_gb_add_log_entry( $entry->get_id(), 'marked-as-not-spam' );
|
409 |
+
gwolle_gb_mail_author_on_moderation( $entry );
|
410 |
gwolle_gb_akismet( $entry, 'submit-ham' );
|
411 |
} else {
|
412 |
$response = 'error';
|
437 |
if ($result ) {
|
438 |
$response = 'untrash';
|
439 |
gwolle_gb_add_log_entry( $entry->get_id(), 'entry-untrashed' );
|
440 |
+
gwolle_gb_mail_author_on_moderation( $entry );
|
441 |
} else {
|
442 |
$response = 'error';
|
443 |
}
|
admin/gb-page-editor.php
CHANGED
@@ -28,9 +28,9 @@ function gwolle_gb_page_editor() {
|
|
28 |
$entry = new gwolle_gb_entry();
|
29 |
|
30 |
if ( isset($_POST['entry_id']) ) { // _POST has preference over _GET
|
31 |
-
$entry_id =
|
32 |
} else if ( isset($_GET['entry_id']) ) {
|
33 |
-
$entry_id =
|
34 |
}
|
35 |
if ( isset($entry_id) && $entry_id > 0 ) {
|
36 |
$result = $entry->load( $entry_id );
|
@@ -581,6 +581,12 @@ function gwolle_gb_page_editor_update( $entry ) {
|
|
581 |
}
|
582 |
}
|
583 |
|
|
|
|
|
|
|
|
|
|
|
|
|
584 |
/* Set as checked or unchecked, and by whom */
|
585 |
if ( isset($_POST['ischecked']) && $_POST['ischecked'] == 'on' ) {
|
586 |
if ( $_POST['ischecked'] == 'on' && $entry->get_ischecked() == 0 ) {
|
@@ -709,6 +715,9 @@ function gwolle_gb_page_editor_update( $entry ) {
|
|
709 |
if ($result ) {
|
710 |
gwolle_gb_add_log_entry( $entry->get_id(), 'entry-edited' );
|
711 |
gwolle_gb_add_message( '<p>' . esc_html__('Changes saved.', 'gwolle-gb') . '</p>', false, false);
|
|
|
|
|
|
|
712 |
do_action( 'gwolle_gb_save_entry_admin', $entry );
|
713 |
} else {
|
714 |
gwolle_gb_add_message( '<p>' . esc_html__('Error happened during saving.', 'gwolle-gb') . '</p>', true, false);
|
28 |
$entry = new gwolle_gb_entry();
|
29 |
|
30 |
if ( isset($_POST['entry_id']) ) { // _POST has preference over _GET
|
31 |
+
$entry_id = (int) $_POST['entry_id'];
|
32 |
} else if ( isset($_GET['entry_id']) ) {
|
33 |
+
$entry_id = (int) $_GET['entry_id'];
|
34 |
}
|
35 |
if ( isset($entry_id) && $entry_id > 0 ) {
|
36 |
$result = $entry->load( $entry_id );
|
581 |
}
|
582 |
}
|
583 |
|
584 |
+
/* Check if it was visible or not. We need to check this, because multiple changes are possible and we don't want multiple emails. */
|
585 |
+
$was_visible = false;
|
586 |
+
if ( $entry->get_ischecked() == 1 && $entry->get_isspam() == 0 && $entry->get_istrash() == 0 ) {
|
587 |
+
$was_visible = true;
|
588 |
+
}
|
589 |
+
|
590 |
/* Set as checked or unchecked, and by whom */
|
591 |
if ( isset($_POST['ischecked']) && $_POST['ischecked'] == 'on' ) {
|
592 |
if ( $_POST['ischecked'] == 'on' && $entry->get_ischecked() == 0 ) {
|
715 |
if ($result ) {
|
716 |
gwolle_gb_add_log_entry( $entry->get_id(), 'entry-edited' );
|
717 |
gwolle_gb_add_message( '<p>' . esc_html__('Changes saved.', 'gwolle-gb') . '</p>', false, false);
|
718 |
+
if ( $was_visible == false && $entry->get_ischecked() == 1 && $entry->get_isspam() == 0 && $entry->get_istrash() == 0 ) {
|
719 |
+
gwolle_gb_mail_author_on_moderation( $entry );
|
720 |
+
}
|
721 |
do_action( 'gwolle_gb_save_entry_admin', $entry );
|
722 |
} else {
|
723 |
gwolle_gb_add_message( '<p>' . esc_html__('Error happened during saving.', 'gwolle-gb') . '</p>', true, false);
|
admin/gb-page-entries.php
CHANGED
@@ -609,7 +609,7 @@ function gwolle_gb_page_entries_update() {
|
|
609 |
foreach( array_keys($_POST) as $postElementName ) {
|
610 |
if (strpos($postElementName, 'check') > -1 && ! strpos($postElementName, '-all-') && $_POST[$postElementName] == 'on') {
|
611 |
$entry_id = str_replace('check-','',$postElementName);
|
612 |
-
$entry_id =
|
613 |
if ( isset($entry_id) && $entry_id > 0 ) {
|
614 |
$entry = new gwolle_gb_entry();
|
615 |
$result = $entry->load( $entry_id );
|
@@ -624,6 +624,7 @@ function gwolle_gb_page_entries_update() {
|
|
624 |
$result = $entry->save();
|
625 |
if ( $result ) {
|
626 |
$entries_handled++;
|
|
|
627 |
do_action( 'gwolle_gb_save_entry_admin', $entry );
|
628 |
} else {
|
629 |
$entries_not_handled++;
|
@@ -675,6 +676,7 @@ function gwolle_gb_page_entries_update() {
|
|
675 |
$result = $entry->save();
|
676 |
if ( $result ) {
|
677 |
$entries_handled++;
|
|
|
678 |
do_action( 'gwolle_gb_save_entry_admin', $entry );
|
679 |
} else {
|
680 |
$entries_not_handled++;
|
@@ -738,6 +740,7 @@ function gwolle_gb_page_entries_update() {
|
|
738 |
$result = $entry->save();
|
739 |
if ( $result ) {
|
740 |
$entries_handled++;
|
|
|
741 |
do_action( 'gwolle_gb_save_entry_admin', $entry );
|
742 |
} else {
|
743 |
$entries_not_handled++;
|
609 |
foreach( array_keys($_POST) as $postElementName ) {
|
610 |
if (strpos($postElementName, 'check') > -1 && ! strpos($postElementName, '-all-') && $_POST[$postElementName] == 'on') {
|
611 |
$entry_id = str_replace('check-','',$postElementName);
|
612 |
+
$entry_id = (int) $entry_id;
|
613 |
if ( isset($entry_id) && $entry_id > 0 ) {
|
614 |
$entry = new gwolle_gb_entry();
|
615 |
$result = $entry->load( $entry_id );
|
624 |
$result = $entry->save();
|
625 |
if ( $result ) {
|
626 |
$entries_handled++;
|
627 |
+
gwolle_gb_mail_author_on_moderation( $entry );
|
628 |
do_action( 'gwolle_gb_save_entry_admin', $entry );
|
629 |
} else {
|
630 |
$entries_not_handled++;
|
676 |
$result = $entry->save();
|
677 |
if ( $result ) {
|
678 |
$entries_handled++;
|
679 |
+
gwolle_gb_mail_author_on_moderation( $entry );
|
680 |
do_action( 'gwolle_gb_save_entry_admin', $entry );
|
681 |
} else {
|
682 |
$entries_not_handled++;
|
740 |
$result = $entry->save();
|
741 |
if ( $result ) {
|
742 |
$entries_handled++;
|
743 |
+
gwolle_gb_mail_author_on_moderation( $entry );
|
744 |
do_action( 'gwolle_gb_save_entry_admin', $entry );
|
745 |
} else {
|
746 |
$entries_not_handled++;
|
admin/gb-page-import.php
CHANGED
@@ -404,14 +404,14 @@ function gwolle_gb_page_import_post() {
|
|
404 |
|
405 |
$args = array();
|
406 |
|
407 |
-
if ( isset($_POST['gwolle_gb_importfrom']) && $_POST['gwolle_gb_importfrom'] == 'page' && isset($_POST['gwolle_gb_pageid']) &&
|
408 |
-
$page_id =
|
409 |
$args = array(
|
410 |
'status' => 'all',
|
411 |
'post_id' => $page_id
|
412 |
);
|
413 |
-
} else if ( isset($_POST['gwolle_gb_importfrom']) && $_POST['gwolle_gb_importfrom'] == 'post' && isset($_POST['gwolle_gb_postid']) &&
|
414 |
-
$post_id =
|
415 |
$args = array(
|
416 |
'status' => 'all',
|
417 |
'post_id' => $post_id
|
404 |
|
405 |
$args = array();
|
406 |
|
407 |
+
if ( isset($_POST['gwolle_gb_importfrom']) && $_POST['gwolle_gb_importfrom'] == 'page' && isset($_POST['gwolle_gb_pageid']) && (int) $_POST['gwolle_gb_pageid'] > 0 ) {
|
408 |
+
$page_id = (int) $_POST['gwolle_gb_pageid'];
|
409 |
$args = array(
|
410 |
'status' => 'all',
|
411 |
'post_id' => $page_id
|
412 |
);
|
413 |
+
} else if ( isset($_POST['gwolle_gb_importfrom']) && $_POST['gwolle_gb_importfrom'] == 'post' && isset($_POST['gwolle_gb_postid']) && (int) $_POST['gwolle_gb_postid'] > 0 ) {
|
414 |
+
$post_id = (int) $_POST['gwolle_gb_postid'];
|
415 |
$args = array(
|
416 |
'status' => 'all',
|
417 |
'post_id' => $post_id
|
admin/gb-page-settings.php
CHANGED
@@ -462,6 +462,17 @@ function gwolle_gb_page_settings_update() {
|
|
462 |
update_option('gwolle_gb-authorMailContent', $mail_content);
|
463 |
}
|
464 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
465 |
if ( isset($_POST['gwolle_gb-mail_admin_replyContent']) ) {
|
466 |
$mail_content = gwolle_gb_sanitize_input( $_POST['gwolle_gb-mail_admin_replyContent'], 'setting_textarea' );
|
467 |
update_option('gwolle_gb-mail_admin_replyContent', $mail_content);
|
462 |
update_option('gwolle_gb-authorMailContent', $mail_content);
|
463 |
}
|
464 |
|
465 |
+
if (isset($_POST['mail_author_moderation']) && $_POST['mail_author_moderation'] == 'on') {
|
466 |
+
update_option('gwolle_gb-mail_author_moderation', 'true');
|
467 |
+
} else {
|
468 |
+
update_option('gwolle_gb-mail_author_moderation', 'false');
|
469 |
+
}
|
470 |
+
|
471 |
+
if ( isset($_POST['authormoderationcontent']) ) {
|
472 |
+
$mail_content = gwolle_gb_sanitize_input( $_POST['authormoderationcontent'], 'setting_textarea' );
|
473 |
+
update_option('gwolle_gb-authormoderationcontent', $mail_content);
|
474 |
+
}
|
475 |
+
|
476 |
if ( isset($_POST['gwolle_gb-mail_admin_replyContent']) ) {
|
477 |
$mail_content = gwolle_gb_sanitize_input( $_POST['gwolle_gb-mail_admin_replyContent'], 'setting_textarea' );
|
478 |
update_option('gwolle_gb-mail_admin_replyContent', $mail_content);
|
admin/gb-upgrade.php
CHANGED
@@ -601,6 +601,9 @@ function gwolle_gb_set_defaults() {
|
|
601 |
if ( get_option('gwolle_gb-mail_author', false) == false ) {
|
602 |
update_option( 'gwolle_gb-mail_author', 'false' );
|
603 |
}
|
|
|
|
|
|
|
604 |
if ( get_option('gwolle_gb-moderate-entries', false) == false ) {
|
605 |
update_option( 'gwolle_gb-moderate-entries', 'true' );
|
606 |
}
|
601 |
if ( get_option('gwolle_gb-mail_author', false) == false ) {
|
602 |
update_option( 'gwolle_gb-mail_author', 'false' );
|
603 |
}
|
604 |
+
if ( get_option('gwolle_gb-mail_author_moderation', false) == false ) {
|
605 |
+
update_option( 'gwolle_gb-mail_author_moderation', 'false' );
|
606 |
+
}
|
607 |
if ( get_option('gwolle_gb-moderate-entries', false) == false ) {
|
608 |
update_option( 'gwolle_gb-moderate-entries', 'true' );
|
609 |
}
|
admin/tabs/gb-emailtab.php
CHANGED
@@ -231,6 +231,64 @@ Entry content:
|
|
231 |
</td>
|
232 |
</tr>
|
233 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
<tr>
|
235 |
<th scope="row"><label for="gwolle_gb-mail_admin_replyContent"><?php esc_html_e('Admin Reply mail content', 'gwolle-gb'); ?></label></th>
|
236 |
<td>
|
231 |
</td>
|
232 |
</tr>
|
233 |
|
234 |
+
<tr>
|
235 |
+
<th scope="row"><label for="mail_author_moderation"><?php esc_html_e('Mail Author on moderation', 'gwolle-gb'); ?></label></th>
|
236 |
+
<td>
|
237 |
+
<input <?php
|
238 |
+
if (get_option( 'gwolle_gb-mail_author_moderation', 'false') == 'true') {
|
239 |
+
echo 'checked="checked"';
|
240 |
+
} ?>
|
241 |
+
type="checkbox" name="mail_author_moderation" id="mail_author_moderation">
|
242 |
+
<label for="mail_author_moderation">
|
243 |
+
<?php esc_html_e('Mail the author on moderation.', 'gwolle-gb'); ?>
|
244 |
+
</label>
|
245 |
+
<br />
|
246 |
+
<span class="setting-description">
|
247 |
+
<?php esc_html_e("The author of the guestbook entry will receive an email after his entry was moderated.", 'gwolle-gb'); ?>
|
248 |
+
</span>
|
249 |
+
</td>
|
250 |
+
</tr>
|
251 |
+
|
252 |
+
<tr>
|
253 |
+
<th scope="row"><label for="authormoderationcontent"><?php esc_html_e('Moderation mail content', 'gwolle-gb'); ?></label></th>
|
254 |
+
<td>
|
255 |
+
<?php
|
256 |
+
$mailText = gwolle_gb_sanitize_output( get_option('gwolle_gb-authormoderationcontent', false), 'setting_textarea' );
|
257 |
+
if ( ! $mailText) { // No text set by the user. Use the default text.
|
258 |
+
$mailText = esc_html__("
|
259 |
+
Hello,
|
260 |
+
|
261 |
+
An admin has just moderated your guestbook entry at '%blog_name%'.
|
262 |
+
|
263 |
+
Have a nice day.
|
264 |
+
The editors at %blog_name%.
|
265 |
+
|
266 |
+
|
267 |
+
Website address: %blog_url%
|
268 |
+
|
269 |
+
|
270 |
+
Original entry posted on %date%:
|
271 |
+
%entry_content%
|
272 |
+
"
|
273 |
+
, 'gwolle-gb');
|
274 |
+
} ?>
|
275 |
+
<textarea name="authormoderationcontent" id="authormoderationcontent" style="width:400px;height:300px;" class="regular-text"><?php echo $mailText; ?></textarea>
|
276 |
+
<br />
|
277 |
+
<span class="setting-description">
|
278 |
+
<?php esc_html_e('You can set the content of the moderation mail that the author of the entry will receive. The following tags are supported:', 'gwolle-gb');
|
279 |
+
echo '<br />';
|
280 |
+
$mailTags = array('user_email', 'user_name', 'blog_name', 'blog_url', 'entry_content', 'date');
|
281 |
+
for ($i = 0; $i < count($mailTags); $i++) {
|
282 |
+
if ($i != 0) {
|
283 |
+
echo ', ';
|
284 |
+
}
|
285 |
+
echo '%' . $mailTags[$i] . '%';
|
286 |
+
}
|
287 |
+
?>
|
288 |
+
</span>
|
289 |
+
</td>
|
290 |
+
</tr>
|
291 |
+
|
292 |
<tr>
|
293 |
<th scope="row"><label for="gwolle_gb-mail_admin_replyContent"><?php esc_html_e('Admin Reply mail content', 'gwolle-gb'); ?></label></th>
|
294 |
<td>
|
changelog/changelog-v0.txt
CHANGED
@@ -143,4 +143,3 @@
|
|
143 |
* [new] When uninstalling via the plugin's setting panel you'll be asked to confirm again.
|
144 |
* [new] Notification mails now can include a direct link to the editor, speeding things up for you.
|
145 |
|
146 |
-
|
143 |
* [new] When uninstalling via the plugin's setting panel you'll be asked to confirm again.
|
144 |
* [new] Notification mails now can include a direct link to the editor, speeding things up for you.
|
145 |
|
|
changelog/changelog-v1.txt
CHANGED
@@ -662,3 +662,4 @@
|
|
662 |
* 2014-11-28
|
663 |
* Release stable and updated version 1.0 to the public.
|
664 |
* Go on holiday, have a few beers, and watch the girls do the hoolahoop().
|
|
662 |
* 2014-11-28
|
663 |
* Release stable and updated version 1.0 to the public.
|
664 |
* Go on holiday, have a few beers, and watch the girls do the hoolahoop().
|
665 |
+
|
changelog/changelog-v2.txt
CHANGED
@@ -328,3 +328,4 @@
|
|
328 |
* Add some bootstrap classes to the form.
|
329 |
* Add comments for translators.
|
330 |
* Cleanup changelog. Add changelog.txt for v0 and v1.
|
|
328 |
* Add some bootstrap classes to the form.
|
329 |
* Add comments for translators.
|
330 |
* Cleanup changelog. Add changelog.txt for v0 and v1.
|
331 |
+
|
changelog/changelog-v3.txt
CHANGED
@@ -87,3 +87,4 @@
|
|
87 |
* Switch export to 2000 entries per part instead of 3000.
|
88 |
* Add strings for add-on 1.3.0.
|
89 |
* Cleanup changelog. Add changelog-v2.txt.
|
|
87 |
* Switch export to 2000 entries per part instead of 3000.
|
88 |
* Add strings for add-on 1.3.0.
|
89 |
* Cleanup changelog. Add changelog-v2.txt.
|
90 |
+
|
docs/filters/gwolle_gb_entry_the_admin_reply.txt
CHANGED
@@ -23,5 +23,5 @@ function my_gwolle_gb_entry_the_admin_reply($string, $entry) {
|
|
23 |
$string = str_replace( $old, $new, $string );
|
24 |
return $string;
|
25 |
}
|
26 |
-
add_filter( 'gwolle_gb_entry_the_admin_reply', my_gwolle_gb_entry_the_admin_reply', 10, 2 );
|
27 |
|
23 |
$string = str_replace( $old, $new, $string );
|
24 |
return $string;
|
25 |
}
|
26 |
+
add_filter( 'gwolle_gb_entry_the_admin_reply', 'my_gwolle_gb_entry_the_admin_reply', 10, 2 );
|
27 |
|
docs/filters/gwolle_gb_mail_author_on_moderation_body.txt
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
==Description==
|
4 |
+
|
5 |
+
The <b>"gwolle_gb_mail_author_on_moderation_body"</b> filter is used to set the body for the notification email the author gets when an entry has been moderated.
|
6 |
+
|
7 |
+
You can use this filter as:
|
8 |
+
|
9 |
+
<code><?php add_filter( 'gwolle_gb_mail_author_on_moderation_body', 'filter_function_name' ) ?></code>
|
10 |
+
|
11 |
+
Where 'filter_function_name' is the function WordPress should call when the filter is being used.
|
12 |
+
|
13 |
+
'''filter_function_name''' should be a unique function name. It cannot match any other function name already declared.
|
14 |
+
|
15 |
+
|
16 |
+
==Examples==
|
17 |
+
|
18 |
+
|
19 |
+
function my_gwolle_gb_mail_author_on_moderation_body( $body, $entry ) {
|
20 |
+
// this is the default;
|
21 |
+
$body = esc_html__("
|
22 |
+
Hello,
|
23 |
+
|
24 |
+
An admin has just moderated your guestbook entry at '%blog_name%'.
|
25 |
+
|
26 |
+
Have a nice day.
|
27 |
+
The editors at %blog_name%.
|
28 |
+
|
29 |
+
|
30 |
+
Website address: %blog_url%
|
31 |
+
|
32 |
+
|
33 |
+
Original entry posted on %date%:
|
34 |
+
%entry_content%
|
35 |
+
"
|
36 |
+
, 'gwolle-gb');
|
37 |
+
|
38 |
+
return $body;
|
39 |
+
}
|
40 |
+
add_filter( 'gwolle_gb_mail_author_on_moderation_body', 'my_gwolle_gb_mail_author_on_moderation_body', 10, 2 );
|
41 |
+
|
docs/filters/gwolle_gb_mail_author_on_moderation_subject.txt
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
==Description==
|
4 |
+
|
5 |
+
The <b>"gwolle_gb_mail_author_on_moderation_subject"</b> filter is used to set the subject for the notification email the author gets when an entry has been moderated.
|
6 |
+
|
7 |
+
You can use this filter as:
|
8 |
+
|
9 |
+
<code><?php add_filter( 'gwolle_gb_mail_author_on_moderation_subject', 'filter_function_name' ) ?></code>
|
10 |
+
|
11 |
+
Where 'filter_function_name' is the function WordPress should call when the filter is being used.
|
12 |
+
|
13 |
+
'''filter_function_name''' should be a unique function name. It cannot match any other function name already declared.
|
14 |
+
|
15 |
+
|
16 |
+
==Examples==
|
17 |
+
|
18 |
+
|
19 |
+
function my_gwolle_gb_mail_author_on_moderation_subject( $subject ) {
|
20 |
+
// this is the default;
|
21 |
+
$subject = '[' . gwolle_gb_format_values_for_mail(get_bloginfo('name')) . '] ' . esc_html__('Moderated', 'gwolle-gb');
|
22 |
+
return $subject;
|
23 |
+
}
|
24 |
+
add_filter( 'gwolle_gb_mail_author_on_moderation_subject', 'my_gwolle_gb_mail_author_on_moderation_subject', 10,1 );
|
25 |
+
|
frontend/gb-ajax-infinite-scroll.php
CHANGED
@@ -19,12 +19,12 @@ function gwolle_gb_infinite_scroll_callback() {
|
|
19 |
|
20 |
$pageNum = 1;
|
21 |
if ( isset($_POST['pageNum']) && is_numeric($_POST['pageNum']) ) {
|
22 |
-
$pageNum =
|
23 |
}
|
24 |
|
25 |
$book_id = 1;
|
26 |
if ( isset($_POST['book_id']) && is_numeric($_POST['book_id']) ) {
|
27 |
-
$book_id =
|
28 |
}
|
29 |
$shortcode_atts = array();
|
30 |
$shortcode_atts['book_id'] = $book_id;
|
19 |
|
20 |
$pageNum = 1;
|
21 |
if ( isset($_POST['pageNum']) && is_numeric($_POST['pageNum']) ) {
|
22 |
+
$pageNum = (int) $_POST['pageNum'];
|
23 |
}
|
24 |
|
25 |
$book_id = 1;
|
26 |
if ( isset($_POST['book_id']) && is_numeric($_POST['book_id']) ) {
|
27 |
+
$book_id = (int) $_POST['book_id'];
|
28 |
}
|
29 |
$shortcode_atts = array();
|
30 |
$shortcode_atts['book_id'] = $book_id;
|
frontend/gb-read.php
CHANGED
@@ -95,7 +95,7 @@ function gwolle_gb_frontend_read( $shortcode_atts, $shortcode ) {
|
|
95 |
|
96 |
$pageNum = 1;
|
97 |
if ( isset($_GET['pageNum']) && is_numeric($_GET['pageNum']) ) {
|
98 |
-
$pageNum =
|
99 |
}
|
100 |
|
101 |
if ( $pageNum > $pages_total ) {
|
95 |
|
96 |
$pageNum = 1;
|
97 |
if ( isset($_GET['pageNum']) && is_numeric($_GET['pageNum']) ) {
|
98 |
+
$pageNum = (int) $_GET['pageNum'];
|
99 |
}
|
100 |
|
101 |
if ( $pageNum > $pages_total ) {
|
frontend/gb-widget-search.php
CHANGED
@@ -61,7 +61,7 @@ if (function_exists('register_sidebar') && class_exists('WP_Widget')) {
|
|
61 |
<label for="gwolle-gb-search-input" class="text-info">' . esc_html__('Search:', 'gwolle-gb') . '</label>
|
62 |
</div>
|
63 |
<div class="input">
|
64 |
-
<input class="wp-exclude-emoji" value="' . $searchwords . '" type="text" name="gwolle-gb-search-input" id="gwolle-gb-search-input" placeholder="' . esc_attr__('Search...', 'gwolle-gb') . '" />
|
65 |
</div>
|
66 |
<div class="gwolle-gb-search-submit">
|
67 |
<div class="input">
|
61 |
<label for="gwolle-gb-search-input" class="text-info">' . esc_html__('Search:', 'gwolle-gb') . '</label>
|
62 |
</div>
|
63 |
<div class="input">
|
64 |
+
<input class="wp-exclude-emoji" value="' . $searchwords . '" type="text" name="gwolle-gb-search-input" id="gwolle-gb-search-input" placeholder="' . esc_attr__('Search...', 'gwolle-gb') . '" required="required" />
|
65 |
</div>
|
66 |
<div class="gwolle-gb-search-submit">
|
67 |
<div class="input">
|
frontend/gb-widget.php
CHANGED
@@ -95,7 +95,7 @@ if (function_exists('register_sidebar') && class_exists('WP_Widget')) {
|
|
95 |
foreach ($best as $entry_id) {
|
96 |
if ( $counter == $num_entries) { break; } // we have enough
|
97 |
$entry = new gwolle_gb_entry();
|
98 |
-
$entry_id =
|
99 |
if ( isset($entry_id) && $entry_id > 0 ) {
|
100 |
$result = $entry->load( $entry_id );
|
101 |
if ( !$result ) {
|
95 |
foreach ($best as $entry_id) {
|
96 |
if ( $counter == $num_entries) { break; } // we have enough
|
97 |
$entry = new gwolle_gb_entry();
|
98 |
+
$entry_id = (int) $entry_id;
|
99 |
if ( isset($entry_id) && $entry_id > 0 ) {
|
100 |
$result = $entry->load( $entry_id );
|
101 |
if ( !$result ) {
|
frontend/gwolle_gb-entry.php
CHANGED
@@ -89,7 +89,7 @@ if ( ! function_exists('gwolle_gb_entry_template') ) {
|
|
89 |
$origin = $entry->get_author_origin();
|
90 |
if ( strlen(str_replace(' ', '', $origin)) > 0 ) {
|
91 |
$entry_output .= '
|
92 |
-
<span class="gb-author-origin"> ' . /* translators: city or origin */ esc_html__('from', 'gwolle-gb') . ' ' . gwolle_gb_sanitize_output($origin) . '</span>';
|
93 |
}
|
94 |
}
|
95 |
|
89 |
$origin = $entry->get_author_origin();
|
90 |
if ( strlen(str_replace(' ', '', $origin)) > 0 ) {
|
91 |
$entry_output .= '
|
92 |
+
<span class="gb-author-origin"><span class="gb-author-origin-from-text"> ' . /* translators: city or origin */ esc_html__('from', 'gwolle-gb') . '</span> ' . gwolle_gb_sanitize_output($origin) . '</span>';
|
93 |
}
|
94 |
}
|
95 |
|
frontend/markitup/style.css
CHANGED
@@ -113,6 +113,7 @@
|
|
113 |
height: 20px;
|
114 |
text-indent: -10000px;
|
115 |
background-repeat: no-repeat;
|
|
|
116 |
padding: 3px 4px 1px 4px;
|
117 |
margin: 4px 0 0 0;
|
118 |
}
|
113 |
height: 20px;
|
114 |
text-indent: -10000px;
|
115 |
background-repeat: no-repeat;
|
116 |
+
background-size: 20px 20px;
|
117 |
padding: 3px 4px 1px 4px;
|
118 |
margin: 4px 0 0 0;
|
119 |
}
|
functions/gb-cache.php
CHANGED
@@ -68,6 +68,11 @@ function gwolle_gb_clear_cache( $entry = false ) {
|
|
68 |
wp_cache_clear_cache();
|
69 |
}
|
70 |
|
|
|
|
|
|
|
|
|
|
|
71 |
}
|
72 |
add_action( 'gwolle_gb_save_entry_admin', 'gwolle_gb_clear_cache' );
|
73 |
add_action( 'gwolle_gb_save_entry_frontend', 'gwolle_gb_clear_cache' );
|
68 |
wp_cache_clear_cache();
|
69 |
}
|
70 |
|
71 |
+
/* WP Rocket */
|
72 |
+
if ( function_exists('rocket_clean_domain') ) {
|
73 |
+
rocket_clean_domain();
|
74 |
+
}
|
75 |
+
|
76 |
}
|
77 |
add_action( 'gwolle_gb_save_entry_admin', 'gwolle_gb_clear_cache' );
|
78 |
add_action( 'gwolle_gb_save_entry_frontend', 'gwolle_gb_clear_cache' );
|
functions/gb-class-entry.php
CHANGED
@@ -425,7 +425,7 @@ class gwolle_gb_entry {
|
|
425 |
}
|
426 |
|
427 |
public function set_id($id) {
|
428 |
-
$id =
|
429 |
if ($id) {
|
430 |
$this->id = $id;
|
431 |
}
|
@@ -437,8 +437,7 @@ class gwolle_gb_entry {
|
|
437 |
}
|
438 |
}
|
439 |
public function set_author_id($author_id) {
|
440 |
-
$author_id =
|
441 |
-
$this->author_id = $author_id;
|
442 |
}
|
443 |
public function set_author_email($author_email) {
|
444 |
$author_email = gwolle_gb_sanitize_input($author_email);
|
@@ -476,7 +475,7 @@ class gwolle_gb_entry {
|
|
476 |
_deprecated_function( __FUNCTION__, ' 1.4.2', 'set_datetime()' );
|
477 |
}
|
478 |
public function set_datetime($datetime = 0) {
|
479 |
-
$datetime =
|
480 |
if ( ! $datetime ) {
|
481 |
$datetime = current_time( 'timestamp' );
|
482 |
}
|
@@ -486,22 +485,22 @@ class gwolle_gb_entry {
|
|
486 |
}
|
487 |
public function set_ischecked($ischecked) {
|
488 |
// $ischecked means the message has been moderated
|
489 |
-
$ischecked =
|
490 |
$this->ischecked = $ischecked;
|
491 |
}
|
492 |
public function set_checkedby($checkedby) {
|
493 |
// $checkedby is a userid of the moderator
|
494 |
-
$checkedby =
|
495 |
if ($checkedby) {
|
496 |
$this->checkedby = $checkedby;
|
497 |
}
|
498 |
}
|
499 |
public function set_istrash($istrash) {
|
500 |
-
$istrash =
|
501 |
$this->istrash = $istrash;
|
502 |
}
|
503 |
public function set_isspam($isspam) {
|
504 |
-
$isspam =
|
505 |
$this->isspam = $isspam;
|
506 |
}
|
507 |
public function set_admin_reply($admin_reply) {
|
@@ -509,10 +508,10 @@ class gwolle_gb_entry {
|
|
509 |
$this->admin_reply = $admin_reply;
|
510 |
}
|
511 |
public function set_admin_reply_uid($admin_reply_uid) {
|
512 |
-
$this->admin_reply_uid =
|
513 |
}
|
514 |
public function set_book_id($book_id) {
|
515 |
-
$this->book_id =
|
516 |
if ( ! $book_id) {
|
517 |
$this->book_id = 1;
|
518 |
}
|
425 |
}
|
426 |
|
427 |
public function set_id($id) {
|
428 |
+
$id = (int) $id;
|
429 |
if ($id) {
|
430 |
$this->id = $id;
|
431 |
}
|
437 |
}
|
438 |
}
|
439 |
public function set_author_id($author_id) {
|
440 |
+
$this->author_id = (int) $author_id;
|
|
|
441 |
}
|
442 |
public function set_author_email($author_email) {
|
443 |
$author_email = gwolle_gb_sanitize_input($author_email);
|
475 |
_deprecated_function( __FUNCTION__, ' 1.4.2', 'set_datetime()' );
|
476 |
}
|
477 |
public function set_datetime($datetime = 0) {
|
478 |
+
$datetime = (int) $datetime; // timestamp can be cast to int.
|
479 |
if ( ! $datetime ) {
|
480 |
$datetime = current_time( 'timestamp' );
|
481 |
}
|
485 |
}
|
486 |
public function set_ischecked($ischecked) {
|
487 |
// $ischecked means the message has been moderated
|
488 |
+
$ischecked = (int) $ischecked;
|
489 |
$this->ischecked = $ischecked;
|
490 |
}
|
491 |
public function set_checkedby($checkedby) {
|
492 |
// $checkedby is a userid of the moderator
|
493 |
+
$checkedby = (int) $checkedby;
|
494 |
if ($checkedby) {
|
495 |
$this->checkedby = $checkedby;
|
496 |
}
|
497 |
}
|
498 |
public function set_istrash($istrash) {
|
499 |
+
$istrash = (int) $istrash;
|
500 |
$this->istrash = $istrash;
|
501 |
}
|
502 |
public function set_isspam($isspam) {
|
503 |
+
$isspam = (int) $isspam;
|
504 |
$this->isspam = $isspam;
|
505 |
}
|
506 |
public function set_admin_reply($admin_reply) {
|
508 |
$this->admin_reply = $admin_reply;
|
509 |
}
|
510 |
public function set_admin_reply_uid($admin_reply_uid) {
|
511 |
+
$this->admin_reply_uid = (int) $admin_reply_uid;
|
512 |
}
|
513 |
public function set_book_id($book_id) {
|
514 |
+
$this->book_id = (int) $book_id;
|
515 |
if ( ! $book_id) {
|
516 |
$this->book_id = 1;
|
517 |
}
|
functions/gb-formatting.php
CHANGED
@@ -15,7 +15,7 @@ if ( strpos($_SERVER['PHP_SELF'], basename(__FILE__) )) {
|
|
15 |
* @return string $input sanitized string
|
16 |
*/
|
17 |
function gwolle_gb_sanitize_input( $input, $field = '' ) {
|
18 |
-
$input =
|
19 |
$input = htmlspecialchars_decode($input, ENT_COMPAT);
|
20 |
$input = stripslashes($input); // Make sure we're not just adding lots of slashes (or WordPress does).
|
21 |
$input = str_replace('\\', '\', $input); // Replace these to avoid nightmares with addslashes/stripslashes.
|
@@ -39,7 +39,7 @@ function gwolle_gb_sanitize_input( $input, $field = '' ) {
|
|
39 |
* @return string $input sanitized string
|
40 |
*/
|
41 |
function gwolle_gb_sanitize_output( $output, $field = '' ) {
|
42 |
-
$output =
|
43 |
$output = trim($output);
|
44 |
$output = htmlspecialchars_decode($output, ENT_COMPAT);
|
45 |
//$output = html_entity_decode($output, ENT_COMPAT, 'UTF-8'); // the opposite of htmlentities, for backwards compat. Breaks encoding...
|
15 |
* @return string $input sanitized string
|
16 |
*/
|
17 |
function gwolle_gb_sanitize_input( $input, $field = '' ) {
|
18 |
+
$input = (string) $input;
|
19 |
$input = htmlspecialchars_decode($input, ENT_COMPAT);
|
20 |
$input = stripslashes($input); // Make sure we're not just adding lots of slashes (or WordPress does).
|
21 |
$input = str_replace('\\', '\', $input); // Replace these to avoid nightmares with addslashes/stripslashes.
|
39 |
* @return string $input sanitized string
|
40 |
*/
|
41 |
function gwolle_gb_sanitize_output( $output, $field = '' ) {
|
42 |
+
$output = (string) $output;
|
43 |
$output = trim($output);
|
44 |
$output = htmlspecialchars_decode($output, ENT_COMPAT);
|
45 |
//$output = html_entity_decode($output, ENT_COMPAT, 'UTF-8'); // the opposite of htmlentities, for backwards compat. Breaks encoding...
|
functions/gb-log.php
CHANGED
@@ -67,8 +67,8 @@ function gwolle_gb_add_log_entry( $entry_id, $subject ) {
|
|
67 |
",
|
68 |
array(
|
69 |
addslashes( $subject ),
|
70 |
-
|
71 |
-
|
72 |
current_time( 'timestamp' )
|
73 |
)
|
74 |
) );
|
@@ -229,7 +229,7 @@ function gwolle_gb_get_log_entries( $entry_id ) {
|
|
229 |
function gwolle_gb_del_log_entries( $entry_id ) {
|
230 |
global $wpdb;
|
231 |
|
232 |
-
$entry_id =
|
233 |
|
234 |
if ( $entry_id == 0 || $entry_id < 0 ) {
|
235 |
return false;
|
67 |
",
|
68 |
array(
|
69 |
addslashes( $subject ),
|
70 |
+
(int) $entry_id,
|
71 |
+
(int) get_current_user_id(),
|
72 |
current_time( 'timestamp' )
|
73 |
)
|
74 |
) );
|
229 |
function gwolle_gb_del_log_entries( $entry_id ) {
|
230 |
global $wpdb;
|
231 |
|
232 |
+
$entry_id = (int) $entry_id ;
|
233 |
|
234 |
if ( $entry_id == 0 || $entry_id < 0 ) {
|
235 |
return false;
|
functions/gb-mail.php
CHANGED
@@ -22,7 +22,7 @@ function gwolle_gb_mail_moderators( $entry ) {
|
|
22 |
if ( ! $isspam ) {
|
23 |
$subscribers = Array();
|
24 |
$recipients = get_option('gwolle_gb-notifyByMail');
|
25 |
-
if ( strlen($recipients) > 0 ) {
|
26 |
$recipients = explode( ",", $recipients );
|
27 |
}
|
28 |
if ( is_array( $recipients ) && count( $recipients ) > 0 ) {
|
@@ -208,6 +208,82 @@ Entry content:
|
|
208 |
add_action( 'gwolle_gb_save_entry_frontend', 'gwolle_gb_mail_author' );
|
209 |
|
210 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
/*
|
212 |
* Send Notification Mail to the author that there is an admin_reply (only when it is not Spam).
|
213 |
*
|
22 |
if ( ! $isspam ) {
|
23 |
$subscribers = Array();
|
24 |
$recipients = get_option('gwolle_gb-notifyByMail');
|
25 |
+
if ( is_string( $recipients ) && strlen($recipients) > 0 ) {
|
26 |
$recipients = explode( ",", $recipients );
|
27 |
}
|
28 |
if ( is_array( $recipients ) && count( $recipients ) > 0 ) {
|
208 |
add_action( 'gwolle_gb_save_entry_frontend', 'gwolle_gb_mail_author' );
|
209 |
|
210 |
|
211 |
+
/*
|
212 |
+
* Send Notification Mail to the author that the entry is moderated and published.
|
213 |
+
*
|
214 |
+
* @param object $entry instance of gwolle_gb_entry
|
215 |
+
*
|
216 |
+
* @since 4.1.0
|
217 |
+
*/
|
218 |
+
function gwolle_gb_mail_author_on_moderation( $entry ) {
|
219 |
+
|
220 |
+
if (get_option( 'gwolle_gb-mail_author_moderation', 'false') != 'true') {
|
221 |
+
return;
|
222 |
+
}
|
223 |
+
|
224 |
+
if ( $entry->get_ischecked() == 1 && $entry->get_isspam() == 0 && $entry->get_istrash() == 0 ) {
|
225 |
+
|
226 |
+
// Set the Mail Content
|
227 |
+
$mailTags = array('user_email', 'user_name', 'blog_name', 'blog_url', 'entry_content', 'date');
|
228 |
+
$mail_body = gwolle_gb_sanitize_output( get_option( 'gwolle_gb-authormoderationcontent', false ), 'setting_textarea' );
|
229 |
+
if ( ! $mail_body) {
|
230 |
+
$mail_body = esc_html__("
|
231 |
+
Hello,
|
232 |
+
|
233 |
+
An admin has just moderated your guestbook entry at '%blog_name%'.
|
234 |
+
|
235 |
+
Have a nice day.
|
236 |
+
The editors at %blog_name%.
|
237 |
+
|
238 |
+
|
239 |
+
Website address: %blog_url%
|
240 |
+
|
241 |
+
|
242 |
+
Original entry posted on %date%:
|
243 |
+
%entry_content%
|
244 |
+
"
|
245 |
+
, 'gwolle-gb');
|
246 |
+
}
|
247 |
+
$mail_body = apply_filters( 'gwolle_gb_mail_author_on_moderation_body', $mail_body, $entry );
|
248 |
+
|
249 |
+
// Set the Mail Headers
|
250 |
+
$subject = '[' . gwolle_gb_format_values_for_mail(get_bloginfo('name')) . '] ' . esc_html__('Moderated', 'gwolle-gb');
|
251 |
+
$subject = apply_filters( 'gwolle_gb_mail_author_on_moderation_subject', $subject );
|
252 |
+
|
253 |
+
$header = "Content-Type: text/plain; charset=UTF-8\r\n"; // Encoding of the mail
|
254 |
+
if ( get_option('gwolle_gb-mail-from', false) ) {
|
255 |
+
$header .= "From: " . gwolle_gb_format_values_for_mail(get_bloginfo('name')) . " <" . gwolle_gb_sanitize_output( get_option('gwolle_gb-mail-from') ) . ">\r\n";
|
256 |
+
}
|
257 |
+
|
258 |
+
// Replace the tags from the mailtemplate with real data from the website and entry
|
259 |
+
$info = array();
|
260 |
+
$info['user_name'] = gwolle_gb_sanitize_output( $entry->get_author_name() );
|
261 |
+
$info['user_email'] = $entry->get_author_email();
|
262 |
+
$info['blog_name'] = get_bloginfo('name');
|
263 |
+
$postid = gwolle_gb_get_postid( (int) $entry->get_book_id() );
|
264 |
+
if ( $postid ) {
|
265 |
+
$permalink = gwolle_gb_get_permalink( $postid );
|
266 |
+
if ( is_wp_error( $permalink ) ) {
|
267 |
+
$info['blog_url'] = get_bloginfo('wpurl') . '?p=' . $postid;
|
268 |
+
} else {
|
269 |
+
$info['blog_url'] = $permalink;
|
270 |
+
}
|
271 |
+
} else {
|
272 |
+
$info['blog_url'] = get_bloginfo('wpurl');
|
273 |
+
}
|
274 |
+
$info['entry_content'] = gwolle_gb_format_values_for_mail(gwolle_gb_sanitize_output( $entry->get_content(), 'content' ));
|
275 |
+
$info['date'] = date_i18n( get_option('date_format'), $entry->get_datetime() );
|
276 |
+
for ($tagNum = 0; $tagNum < count($mailTags); $tagNum++) {
|
277 |
+
$mail_body = str_replace('%' . $mailTags[$tagNum] . '%', $info[$mailTags[$tagNum]], $mail_body);
|
278 |
+
$mail_body = gwolle_gb_format_values_for_mail( $mail_body );
|
279 |
+
}
|
280 |
+
|
281 |
+
wp_mail($entry->get_author_email(), $subject, $mail_body, $header);
|
282 |
+
|
283 |
+
}
|
284 |
+
}
|
285 |
+
|
286 |
+
|
287 |
/*
|
288 |
* Send Notification Mail to the author that there is an admin_reply (only when it is not Spam).
|
289 |
*
|
functions/gb-settings.php
CHANGED
@@ -19,6 +19,7 @@ function gwolle_gb_register_settings() {
|
|
19 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-antispam-question', 'strval' ); // empty string
|
20 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-antispam-answer', 'strval' ); // empty string
|
21 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-authorMailContent', 'strval' ); // empty by default
|
|
|
22 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-entries_per_page', 'intval' ); // 20
|
23 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-entriesPerPage', 'intval' ); // 20
|
24 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-excerpt_length', 'intval' ); // 0
|
@@ -32,8 +33,9 @@ function gwolle_gb_register_settings() {
|
|
32 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-linkchecker', 'strval' ); // 'true'
|
33 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-longtext', 'strval' ); // 'true'
|
34 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-mail-from', 'strval' ); // empty string
|
35 |
-
register_setting( 'gwolle_gb_options', 'gwolle_gb-mail_admin_replyContent', 'strval' ); //
|
36 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-mail_author', 'strval' ); // 'false'
|
|
|
37 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-moderate-entries', 'strval' ); // 'true'
|
38 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-navigation', 'intval' ); // 0 or 1, default is 0
|
39 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-nonce', 'strval' ); // 'true'
|
19 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-antispam-question', 'strval' ); // empty string
|
20 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-antispam-answer', 'strval' ); // empty string
|
21 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-authorMailContent', 'strval' ); // empty by default
|
22 |
+
register_setting( 'gwolle_gb_options', 'gwolle_gb-authormoderationcontent', 'strval' ); // empty by default
|
23 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-entries_per_page', 'intval' ); // 20
|
24 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-entriesPerPage', 'intval' ); // 20
|
25 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-excerpt_length', 'intval' ); // 0
|
33 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-linkchecker', 'strval' ); // 'true'
|
34 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-longtext', 'strval' ); // 'true'
|
35 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-mail-from', 'strval' ); // empty string
|
36 |
+
register_setting( 'gwolle_gb_options', 'gwolle_gb-mail_admin_replyContent', 'strval' ); // empty by default
|
37 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-mail_author', 'strval' ); // 'false'
|
38 |
+
register_setting( 'gwolle_gb_options', 'gwolle_gb-mail_author_moderation', 'strval' ); // 'false'
|
39 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-moderate-entries', 'strval' ); // 'true'
|
40 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-navigation', 'intval' ); // 0 or 1, default is 0
|
41 |
register_setting( 'gwolle_gb_options', 'gwolle_gb-nonce', 'strval' ); // 'true'
|
gwolle-gb.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Gwolle Guestbook
|
4 |
Plugin URI: https://wordpress.org/plugins/gwolle-gb/
|
5 |
Description: Gwolle Guestbook is not just another guestbook for WordPress. The goal is to provide an easy and slim way to integrate a guestbook into your WordPress powered site. Don't use your 'comment' section the wrong way - install Gwolle Guestbook and have a real guestbook.
|
6 |
-
Version: 4.0
|
7 |
Author: Marcel Pol
|
8 |
Author URI: https://zenoweb.nl
|
9 |
License: GPLv2 or later
|
@@ -12,7 +12,7 @@ Domain Path: /lang/
|
|
12 |
|
13 |
|
14 |
Copyright 2009 - 2010 Wolfgang Timme (email: gwolle@wolfgangtimme.de)
|
15 |
-
Copyright 2014 -
|
16 |
|
17 |
This program is free software; you can redistribute it and/or modify
|
18 |
it under the terms of the GNU General Public License as published by
|
@@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
31 |
|
32 |
|
33 |
// Plugin Version
|
34 |
-
define('GWOLLE_GB_VER', '4.0
|
35 |
|
36 |
|
37 |
/*
|
@@ -62,7 +62,6 @@ define('GWOLLE_GB_VER', '4.0.8');
|
|
62 |
* - Use select2 or similar for subscribe/unsubcribe dropdowns.
|
63 |
* - On one-page-design, paging doesn't work correctly in Chrome:
|
64 |
* https://wordpress.org/support/topic/problem-of-text-selection-in-gwolle-guestbook/
|
65 |
-
* - Clear page cache for Autoptimize.
|
66 |
*
|
67 |
*/
|
68 |
|
3 |
Plugin Name: Gwolle Guestbook
|
4 |
Plugin URI: https://wordpress.org/plugins/gwolle-gb/
|
5 |
Description: Gwolle Guestbook is not just another guestbook for WordPress. The goal is to provide an easy and slim way to integrate a guestbook into your WordPress powered site. Don't use your 'comment' section the wrong way - install Gwolle Guestbook and have a real guestbook.
|
6 |
+
Version: 4.1.0
|
7 |
Author: Marcel Pol
|
8 |
Author URI: https://zenoweb.nl
|
9 |
License: GPLv2 or later
|
12 |
|
13 |
|
14 |
Copyright 2009 - 2010 Wolfgang Timme (email: gwolle@wolfgangtimme.de)
|
15 |
+
Copyright 2014 - 2021 Marcel Pol (email: marcel@timelord.nl)
|
16 |
|
17 |
This program is free software; you can redistribute it and/or modify
|
18 |
it under the terms of the GNU General Public License as published by
|
31 |
|
32 |
|
33 |
// Plugin Version
|
34 |
+
define('GWOLLE_GB_VER', '4.1.0');
|
35 |
|
36 |
|
37 |
/*
|
62 |
* - Use select2 or similar for subscribe/unsubcribe dropdowns.
|
63 |
* - On one-page-design, paging doesn't work correctly in Chrome:
|
64 |
* https://wordpress.org/support/topic/problem-of-text-selection-in-gwolle-guestbook/
|
|
|
65 |
*
|
66 |
*/
|
67 |
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: Gwolle, mpol
|
|
3 |
Tags: guestbook, guest book, livre d'or, Gästebuch, review
|
4 |
Requires at least: 3.7
|
5 |
Tested up to: 5.6
|
6 |
-
Stable tag: 4.0
|
7 |
License: GPLv2 or later
|
8 |
Requires PHP: 5.3
|
9 |
|
@@ -424,6 +424,16 @@ But if you don't use standard comments, you can just as easily use the comment s
|
|
424 |
|
425 |
== Changelog ==
|
426 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
427 |
= 4.0.8 =
|
428 |
* 2020-10-21
|
429 |
* Security fix: always escape formdata in 'gwolle_gb_add_formdata()'.
|
@@ -497,89 +507,3 @@ But if you don't use standard comments, you can just as easily use the comment s
|
|
497 |
* Deprecate 'gwolle_gb_content_label' filter.
|
498 |
* Update strings for add-on.
|
499 |
|
500 |
-
= 3.1.9 =
|
501 |
-
* 2020-02-01
|
502 |
-
* Fix undefined variable notice (thanks ronr1999).
|
503 |
-
* Add 'float:none;' to frontend button.
|
504 |
-
|
505 |
-
= 3.1.8 =
|
506 |
-
* 2020-01-21
|
507 |
-
* Add highlight to search results (thanks @robinnatter).
|
508 |
-
* Add searchwords to search widget after searching.
|
509 |
-
* Do not set meta_key when shortcode is used in widget or one-page design.
|
510 |
-
* Show InnoDB engine on debug tab.
|
511 |
-
* Show existence of database tables on debug tab.
|
512 |
-
|
513 |
-
= 3.1.7 =
|
514 |
-
* 2019-10-25
|
515 |
-
* Show subscription status for email notifications on settings page.
|
516 |
-
* Comment out unused images in markitup CSS.
|
517 |
-
* Set rel='nofollow noopener noreferrer' for bbcode links and user website.
|
518 |
-
* Set referrerpolicy='no-referrer' for bbcode images and avatar.
|
519 |
-
* Add filter 'gwolle_gb_bbcode_img_referrer'.
|
520 |
-
* Update strings for add-on.
|
521 |
-
|
522 |
-
= 3.1.6 =
|
523 |
-
* 2019-08-21
|
524 |
-
* Use wp_kses for filtering html elements.
|
525 |
-
* Add support for quotes already in the bbcode link.
|
526 |
-
|
527 |
-
= 3.1.5 =
|
528 |
-
* 2019-06-08
|
529 |
-
* Add log entry for privacy policy accepted (gets added to notification mail).
|
530 |
-
* Add msg_txt key/value to log entries for plain text display.
|
531 |
-
* Small updates to install routine.
|
532 |
-
* Support new wp_initialize_site action for multisite.
|
533 |
-
|
534 |
-
= 3.1.4 =
|
535 |
-
* 2019-05-03
|
536 |
-
* Make it possible to set entry to moderated with the gwolle_gb_new_entry_frontend filter.
|
537 |
-
* Update strings for add-on.
|
538 |
-
|
539 |
-
= 3.1.3 =
|
540 |
-
* 2019-04-16
|
541 |
-
* Small fix for silly mistake.
|
542 |
-
|
543 |
-
= 3.1.2 =
|
544 |
-
* 2019-04-04
|
545 |
-
* Improve accessibility for the frontend metabox.
|
546 |
-
* Add filter gwolle_gb_new_entry_frontend.
|
547 |
-
* Add filter gwolle_gb_get_permalink.
|
548 |
-
* Change arrows in next/prev pagination.
|
549 |
-
* Auto-detect line endings in import from CSV.
|
550 |
-
|
551 |
-
= 3.1.1 =
|
552 |
-
* 2019-03-08
|
553 |
-
* Drop check for mime-type on import, too many problems.
|
554 |
-
* Small CSS fix for pagination.
|
555 |
-
|
556 |
-
= 3.1.0 =
|
557 |
-
* 2019-02-19
|
558 |
-
* Remove support for Really Simple Captcha plugin, since it is ineffective.
|
559 |
-
* Please take a look at the other options for spamfilters, there are more and better options.
|
560 |
-
* Update CSS for admin navigation for WP 5.1.
|
561 |
-
* Add screen-reader-text to navigation for frontend and admin.
|
562 |
-
* Small fixes found by the phan tool.
|
563 |
-
|
564 |
-
= 3.0.0 =
|
565 |
-
* 2019-01-22
|
566 |
-
* Add search widget (only visible on guestbook pages).
|
567 |
-
* Add '[noscript]' to frontend form for when JavaScript is disabled.
|
568 |
-
* Add function 'gwolle_gb_post_is_guestbook'.
|
569 |
-
* Add function 'gwolle_gb_get_entries_from_search'.
|
570 |
-
* Add function 'gwolle_gb_enqueue_markitup'.
|
571 |
-
* Fix BBcode: support images inside links.
|
572 |
-
* Fix BBcode: have sublists work.
|
573 |
-
* Show new username and book ID after editing in editor postbox.
|
574 |
-
* Add some accessibility fixes.
|
575 |
-
* Switch database engine to InnoDB.
|
576 |
-
* Don't use transients for hashed field names, is faster this way.
|
577 |
-
* Better test if admin user exists for admin_reply.
|
578 |
-
* Use 'field-name' for gwolle_gb_content too.
|
579 |
-
* On admin pages, have separate functions for $_POST update. (settings, editor, entries).
|
580 |
-
* Use GWOLLE_GB_URL where appropriate.
|
581 |
-
* Use static vars instead of global vars.
|
582 |
-
* Integrate 2 JavaScript files for Markitup/BBcode.
|
583 |
-
* Switch export to 2000 entries per part instead of 3000.
|
584 |
-
* Add strings for add-on 1.3.0.
|
585 |
-
* Cleanup changelog. Add changelog-v2.txt.
|
3 |
Tags: guestbook, guest book, livre d'or, Gästebuch, review
|
4 |
Requires at least: 3.7
|
5 |
Tested up to: 5.6
|
6 |
+
Stable tag: 4.1.0
|
7 |
License: GPLv2 or later
|
8 |
Requires PHP: 5.3
|
9 |
|
424 |
|
425 |
== Changelog ==
|
426 |
|
427 |
+
= 4.1.0 =
|
428 |
+
* 2021-01-27
|
429 |
+
* Add notification email on moderation.
|
430 |
+
* Support WP Rocket for clearing cache.
|
431 |
+
* Add span around "from" text in frontend.
|
432 |
+
* Add "required" parameter to search widget.
|
433 |
+
* Better test for empty string of email subscribers.
|
434 |
+
* Change 'intval()' to '(int)'.
|
435 |
+
* Change 'strval()' to '(string)'.
|
436 |
+
|
437 |
= 4.0.8 =
|
438 |
* 2020-10-21
|
439 |
* Security fix: always escape formdata in 'gwolle_gb_add_formdata()'.
|
507 |
* Deprecate 'gwolle_gb_content_label' filter.
|
508 |
* Update strings for add-on.
|
509 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|