Gwolle Guestbook - Version 4.0.7

Version Description

  • 2020-10-06
  • Remove placeholders in form, labels should be enough.
  • Fix closing/opening of postboxes.
  • Check for double entries is now a filter, so that it can be disabled.
Download this release

Release Info

Developer mpol
Plugin Icon 128x128 Gwolle Guestbook
Version 4.0.7
Comparing to
See all releases

Code changes from version 4.0.6 to 4.0.7

add-on/gb-add-on.php CHANGED
@@ -124,7 +124,7 @@ Entry content:
124
  /* translators: Commercial Add-On */
125
  esc_html_e('The slug of the field is where your data is attached to. Only change the slug if you know what you are doing.', 'gwolle-gb');
126
  /* translators: Commercial Add-On */
127
- esc_html_e('The name of the field is what you will see in the label and placeholder in the form.', 'gwolle-gb');
128
  /* translators: Commercial Add-On. */
129
  esc_html_e('Required:', 'gwolle-gb');
130
  /* translators: Commercial Add-On. */
124
  /* translators: Commercial Add-On */
125
  esc_html_e('The slug of the field is where your data is attached to. Only change the slug if you know what you are doing.', 'gwolle-gb');
126
  /* translators: Commercial Add-On */
127
+ esc_html_e('The name of the field is what you will see in the label in the form.', 'gwolle-gb');
128
  /* translators: Commercial Add-On. */
129
  esc_html_e('Required:', 'gwolle-gb');
130
  /* translators: Commercial Add-On. */
admin/gb-page-add-on.php CHANGED
@@ -107,7 +107,7 @@ function gwolle_gb_addon_buy() {
107
  <p><?php
108
  $link = '<a href="https://zenoweb.nl/downloads/gwolle-guestbook-add-on/" target="_blank">';
109
  /* translators: %s is a link */
110
- echo sprintf( esc_html__( 'You can buy this add-on at the %sZenoWeb Webshop%s for only $ 9.', 'gwolle-gb' ), $link, '</a>' ); ?><br />
111
  <?php
112
  $link = '<a href="https://zenoweb.nl/forums/forum/guestbook-add-on/" target="_blank">';
113
  /* translators: %s is a link */
107
  <p><?php
108
  $link = '<a href="https://zenoweb.nl/downloads/gwolle-guestbook-add-on/" target="_blank">';
109
  /* translators: %s is a link */
110
+ echo sprintf( esc_html__( 'You can buy this add-on at the %sZenoWeb Webshop%s for only %s Euro.', 'gwolle-gb' ), $link, '</a>', '15' ); ?><br />
111
  <?php
112
  $link = '<a href="https://zenoweb.nl/forums/forum/guestbook-add-on/" target="_blank">';
113
  /* translators: %s is a link */
admin/gb-page-editor.php CHANGED
@@ -127,7 +127,7 @@ function gwolle_gb_page_editor() {
127
  */
128
  function gwolle_gb_editor_postbox_content( $entry ) {
129
  ?>
130
- <textarea rows="10" name="gwolle_gb_content" id="gwolle_gb_content" class="wp-exclude-emoji" placeholder="<?php esc_html_e('Message', 'gwolle-gb'); ?>"><?php echo gwolle_gb_sanitize_output( $entry->get_content(), 'content' ); ?></textarea>
131
  <?php
132
  if (get_option('gwolle_gb-showLineBreaks', 'false') == 'false') {
133
  $settingslink = '<a href="' . admin_url( 'admin.php?page=' . GWOLLE_GB_FOLDER . '/settings.php' ) . '">';
@@ -157,7 +157,7 @@ function gwolle_gb_editor_postbox_content( $entry ) {
157
  */
158
  function gwolle_gb_editor_postbox_website( $entry ) {
159
  ?>
160
- <input type="url" name="gwolle_gb_author_website" value="<?php echo gwolle_gb_sanitize_output( $entry->get_author_website() ); ?>" id="author_website" placeholder="<?php esc_attr_e('Website', 'gwolle-gb'); ?>" />
161
  <p><?php
162
  /* translators: %s is a code element */
163
  echo sprintf( esc_html__('Example: %shttps://www.example.com/%s', 'gwolle-gb'), '<code>', '</code>' ); ?>
@@ -171,7 +171,7 @@ function gwolle_gb_editor_postbox_website( $entry ) {
171
  */
172
  function gwolle_gb_editor_postbox_author_origin( $entry ) {
173
  ?>
174
- <input type="text" name="gwolle_gb_author_origin" class="wp-exclude-emoji" placeholder="<?php esc_attr_e('City', 'gwolle-gb'); ?>" value="<?php echo gwolle_gb_sanitize_output( $entry->get_author_origin() ); ?>" id="author_origin" />
175
  <?php
176
  }
177
 
@@ -183,7 +183,7 @@ function gwolle_gb_editor_postbox_admin_reply( $entry ) {
183
  $form_setting = gwolle_gb_get_setting( 'form' );
184
  ?>
185
 
186
- <textarea rows="10" name="gwolle_gb_admin_reply" id="gwolle_gb_admin_reply" class="wp-exclude-emoji" placeholder="<?php esc_attr_e('Admin Reply', 'gwolle-gb'); ?>"><?php echo gwolle_gb_sanitize_output( $entry->get_admin_reply(), 'admin_reply' ); ?></textarea>
187
 
188
  <?php
189
  if ( isset($form_setting['form_bbcode_enabled']) && $form_setting['form_bbcode_enabled'] === 'true' ) {
127
  */
128
  function gwolle_gb_editor_postbox_content( $entry ) {
129
  ?>
130
+ <textarea rows="10" name="gwolle_gb_content" id="gwolle_gb_content" class="wp-exclude-emoji"><?php echo gwolle_gb_sanitize_output( $entry->get_content(), 'content' ); ?></textarea>
131
  <?php
132
  if (get_option('gwolle_gb-showLineBreaks', 'false') == 'false') {
133
  $settingslink = '<a href="' . admin_url( 'admin.php?page=' . GWOLLE_GB_FOLDER . '/settings.php' ) . '">';
157
  */
158
  function gwolle_gb_editor_postbox_website( $entry ) {
159
  ?>
160
+ <input type="url" name="gwolle_gb_author_website" value="<?php echo gwolle_gb_sanitize_output( $entry->get_author_website() ); ?>" id="author_website" />
161
  <p><?php
162
  /* translators: %s is a code element */
163
  echo sprintf( esc_html__('Example: %shttps://www.example.com/%s', 'gwolle-gb'), '<code>', '</code>' ); ?>
171
  */
172
  function gwolle_gb_editor_postbox_author_origin( $entry ) {
173
  ?>
174
+ <input type="text" name="gwolle_gb_author_origin" class="wp-exclude-emoji" value="<?php echo gwolle_gb_sanitize_output( $entry->get_author_origin() ); ?>" id="author_origin" />
175
  <?php
176
  }
177
 
183
  $form_setting = gwolle_gb_get_setting( 'form' );
184
  ?>
185
 
186
+ <textarea rows="10" name="gwolle_gb_admin_reply" id="gwolle_gb_admin_reply" class="wp-exclude-emoji"><?php echo gwolle_gb_sanitize_output( $entry->get_admin_reply(), 'admin_reply' ); ?></textarea>
187
 
188
  <?php
189
  if ( isset($form_setting['form_bbcode_enabled']) && $form_setting['form_bbcode_enabled'] === 'true' ) {
admin/js/gwolle-gb-admin.js CHANGED
@@ -10,12 +10,12 @@ jQuery(document).ready(function($) {
10
  jQuery('#gwolle_gb_editor_postbox_preview').addClass('closed');
11
 
12
  jQuery('.gwolle_gb .postbox button.handlediv').click( function() {
13
- jQuery(jQuery(this).parent().get(0)).toggleClass('closed');
14
  });
15
  });
16
  jQuery(document).ready(function($) {
17
  jQuery('.gwolle_gb .postbox h2').click( function() {
18
- jQuery(jQuery(this).parent().get(0)).toggleClass('closed');
19
  });
20
  });
21
 
10
  jQuery('#gwolle_gb_editor_postbox_preview').addClass('closed');
11
 
12
  jQuery('.gwolle_gb .postbox button.handlediv').click( function() {
13
+ jQuery(this).closest('.postbox').toggleClass('closed');
14
  });
15
  });
16
  jQuery(document).ready(function($) {
17
  jQuery('.gwolle_gb .postbox h2').click( function() {
18
+ jQuery(this).closest('.postbox').toggleClass('closed');
19
  });
20
  });
21
 
frontend/gb-form-posthandling.php CHANGED
@@ -437,29 +437,6 @@ function gwolle_gb_frontend_posthandling() {
437
  $entry->set_book_id( $book_id );
438
 
439
 
440
- /*
441
- * Check for double post using email field and content.
442
- * Only if content is mandatory.
443
- */
444
- if ( isset($form_setting['form_message_mandatory']) && $form_setting['form_message_mandatory'] === 'true' ) {
445
- $entries = gwolle_gb_get_entries(array(
446
- 'email' => $entry->get_author_email(),
447
- 'book_id' => $entry->get_book_id()
448
- ));
449
- if ( is_array( $entries ) && !empty( $entries ) ) {
450
- $field_name = gwolle_gb_get_field_name( 'content' );
451
- foreach ( $entries as $entry_email ) {
452
- if ( $entry_email->get_content() == $entry->get_content() ) {
453
- // Match is double entry
454
- gwolle_gb_add_message( '<p class="double_post gb-double-post"><strong>' . esc_html__('Double post: An entry with the data you entered has already been saved.', 'gwolle-gb') . '</strong></p>', true, $field_name );
455
- do_action( 'gwolle_gb_notsaved_entry_frontend', $entry );
456
- return false;
457
- }
458
- }
459
- }
460
- }
461
-
462
-
463
  /*
464
  * Save the Entry
465
  */
@@ -529,3 +506,40 @@ function gwolle_gb_frontend_posthandling() {
529
  }
530
  }
531
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
437
  $entry->set_book_id( $book_id );
438
 
439
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
  /*
441
  * Save the Entry
442
  */
506
  }
507
  }
508
  }
509
+
510
+
511
+ /*
512
+ * Check for double entry using email field and content.
513
+ * If there is a double entry, do not save the message and return the form with an error.
514
+ *
515
+ * @since 4.0.7
516
+ *
517
+ * @param object $entry the guestbook entry that was submitted by the user.
518
+ *
519
+ * @return object $entry the guestbook entry that was submitted by the user.
520
+ */
521
+ function gwolle_gb_check_double_entry( $entry ) {
522
+
523
+ $form_setting = gwolle_gb_get_setting( 'form' );
524
+
525
+ if ( isset($form_setting['form_message_mandatory']) && $form_setting['form_message_mandatory'] === 'true' ) {
526
+ $entries = gwolle_gb_get_entries(array(
527
+ 'email' => $entry->get_author_email(),
528
+ 'book_id' => $entry->get_book_id()
529
+ ));
530
+ if ( is_array( $entries ) && ! empty( $entries ) ) {
531
+ $field_name = gwolle_gb_get_field_name( 'content' );
532
+ foreach ( $entries as $entry_email ) {
533
+ if ( $entry_email->get_content() == $entry->get_content() ) {
534
+ // Match is double entry
535
+ gwolle_gb_add_message( '<p class="double_post gb-double-post"><strong>' . esc_html__('Double post: An entry with the data you entered has already been saved.', 'gwolle-gb') . '</strong></p>', true, $field_name );
536
+ return $entry;
537
+ }
538
+ }
539
+ }
540
+ }
541
+ return $entry;
542
+
543
+ }
544
+ add_filter( 'gwolle_gb_new_entry_frontend', 'gwolle_gb_check_double_entry' );
545
+
frontend/gb-form.php CHANGED
@@ -180,7 +180,7 @@ function gwolle_gb_frontend_write( $shortcode_atts, $shortcode ) {
180
  if (in_array($field_name, $gwolle_gb_error_fields)) {
181
  $output .= ' error';
182
  }
183
- $output .= '" value="' . $name . '" type="text" name="' . $field_name . '" placeholder="' . $label . '"';
184
  if ( in_array($field_name, $gwolle_gb_error_fields) && isset($autofocus) ) {
185
  $output .= $autofocus;
186
  $autofocus = false; // disable it for the next error.
@@ -207,7 +207,7 @@ function gwolle_gb_frontend_write( $shortcode_atts, $shortcode ) {
207
  if (in_array($field_name, $gwolle_gb_error_fields)) {
208
  $output .= ' error';
209
  }
210
- $output .= '" value="' . $origin . '" type="text" name="' . $field_name . '" placeholder="' . $label . '"';
211
  if ( in_array($field_name, $gwolle_gb_error_fields) && isset($autofocus) ) {
212
  $output .= $autofocus;
213
  $autofocus = false; // disable it for the next error.
@@ -233,7 +233,7 @@ function gwolle_gb_frontend_write( $shortcode_atts, $shortcode ) {
233
  if (in_array($field_name, $gwolle_gb_error_fields)) {
234
  $output .= ' error';
235
  }
236
- $output .= '" value="' . $email . '" ' . ($html5 ? 'type="email"' : 'type="text"') . ' name="' . $field_name . '" placeholder="' . $label . '" ';
237
  if ( in_array($field_name, $gwolle_gb_error_fields) && isset($autofocus) ) {
238
  $output .= $autofocus;
239
  $autofocus = false; // disable it for the next error.
@@ -264,7 +264,7 @@ function gwolle_gb_frontend_write( $shortcode_atts, $shortcode ) {
264
  if (in_array($field_name, $gwolle_gb_error_fields)) {
265
  $output .= ' error';
266
  }
267
- $output .= '" value="' . $website . '" ' . ($html5 ? 'type="url"' : 'type="text"') . ' name="' . $field_name . '" placeholder="' . $label . '" ';
268
  if ( in_array($field_name, $gwolle_gb_error_fields) && isset($autofocus) ) {
269
  $output .= $autofocus;
270
  $autofocus = false; // disable it for the next error.
@@ -291,8 +291,8 @@ function gwolle_gb_frontend_write( $shortcode_atts, $shortcode ) {
291
  <label for="' . $field_name2 . '" class="text-primary">' . esc_html__('Do not touch this', 'gwolle-gb') . '</label>
292
  </div>
293
  <div class="input">
294
- <input value="' . $honeypot_value . '" type="text" name="' . $field_name . '" class="' . $field_name . '" placeholder="" />
295
- <input value="" type="text" name="' . $field_name2 . '" class="' . $field_name2 . '" placeholder="" />
296
  </div>
297
  </div>
298
  <div class="clearBoth"></div>';
@@ -310,8 +310,8 @@ function gwolle_gb_frontend_write( $shortcode_atts, $shortcode ) {
310
  <label for="' . $field_name2 . '" class="text-primary">' . esc_html__('Do not touch this', 'gwolle-gb') . '</label>
311
  </div>
312
  <div class="input">
313
- <input value="' . $random . '" type="text" name="' . $field_name . '" class="' . $field_name . '" placeholder="" />
314
- <input value="' . $random . '" type="text" name="' . $field_name2 . '" class="' . $field_name2 . '" placeholder="" />
315
  </div>
316
  </div>
317
  <div class="clearBoth"></div>';
@@ -330,7 +330,7 @@ function gwolle_gb_frontend_write( $shortcode_atts, $shortcode ) {
330
  if (in_array($field_name, $gwolle_gb_error_fields)) {
331
  $output .= ' error';
332
  }
333
- $output .= '" placeholder="' . $label . '" ';
334
  if ( in_array('content', $gwolle_gb_error_fields) && isset($autofocus) ) {
335
  $output .= $autofocus;
336
  $autofocus = false; // disable it for the next error.
@@ -375,7 +375,7 @@ function gwolle_gb_frontend_write( $shortcode_atts, $shortcode ) {
375
  if (in_array( $field_name, $gwolle_gb_error_fields)) {
376
  $output .= ' error ';
377
  }
378
- $output .= '" value="' . $antispam . '" type="text" name="' . $field_name . '" placeholder="' . esc_attr__('Answer', 'gwolle-gb') . '" ';
379
  if ( in_array( $field_name, $gwolle_gb_error_fields) && isset($autofocus) ) {
380
  $output .= $autofocus;
381
  $autofocus = false; // disable it for the next error.
180
  if (in_array($field_name, $gwolle_gb_error_fields)) {
181
  $output .= ' error';
182
  }
183
+ $output .= '" value="' . $name . '" type="text" name="' . $field_name . '"';
184
  if ( in_array($field_name, $gwolle_gb_error_fields) && isset($autofocus) ) {
185
  $output .= $autofocus;
186
  $autofocus = false; // disable it for the next error.
207
  if (in_array($field_name, $gwolle_gb_error_fields)) {
208
  $output .= ' error';
209
  }
210
+ $output .= '" value="' . $origin . '" type="text" name="' . $field_name . '"';
211
  if ( in_array($field_name, $gwolle_gb_error_fields) && isset($autofocus) ) {
212
  $output .= $autofocus;
213
  $autofocus = false; // disable it for the next error.
233
  if (in_array($field_name, $gwolle_gb_error_fields)) {
234
  $output .= ' error';
235
  }
236
+ $output .= '" value="' . $email . '" ' . ($html5 ? 'type="email"' : 'type="text"') . ' name="' . $field_name . '"';
237
  if ( in_array($field_name, $gwolle_gb_error_fields) && isset($autofocus) ) {
238
  $output .= $autofocus;
239
  $autofocus = false; // disable it for the next error.
264
  if (in_array($field_name, $gwolle_gb_error_fields)) {
265
  $output .= ' error';
266
  }
267
+ $output .= '" value="' . $website . '" ' . ($html5 ? 'type="url"' : 'type="text"') . ' name="' . $field_name . '"';
268
  if ( in_array($field_name, $gwolle_gb_error_fields) && isset($autofocus) ) {
269
  $output .= $autofocus;
270
  $autofocus = false; // disable it for the next error.
291
  <label for="' . $field_name2 . '" class="text-primary">' . esc_html__('Do not touch this', 'gwolle-gb') . '</label>
292
  </div>
293
  <div class="input">
294
+ <input value="' . $honeypot_value . '" type="text" name="' . $field_name . '" class="' . $field_name . '" />
295
+ <input value="" type="text" name="' . $field_name2 . '" class="' . $field_name2 . '" />
296
  </div>
297
  </div>
298
  <div class="clearBoth"></div>';
310
  <label for="' . $field_name2 . '" class="text-primary">' . esc_html__('Do not touch this', 'gwolle-gb') . '</label>
311
  </div>
312
  <div class="input">
313
+ <input value="' . $random . '" type="text" name="' . $field_name . '" class="' . $field_name . '" />
314
+ <input value="' . $random . '" type="text" name="' . $field_name2 . '" class="' . $field_name2 . '" />
315
  </div>
316
  </div>
317
  <div class="clearBoth"></div>';
330
  if (in_array($field_name, $gwolle_gb_error_fields)) {
331
  $output .= ' error';
332
  }
333
+ $output .= '"';
334
  if ( in_array('content', $gwolle_gb_error_fields) && isset($autofocus) ) {
335
  $output .= $autofocus;
336
  $autofocus = false; // disable it for the next error.
375
  if (in_array( $field_name, $gwolle_gb_error_fields)) {
376
  $output .= ' error ';
377
  }
378
+ $output .= '" value="' . $antispam . '" type="text" name="' . $field_name . '"';
379
  if ( in_array( $field_name, $gwolle_gb_error_fields) && isset($autofocus) ) {
380
  $output .= $autofocus;
381
  $autofocus = false; // disable it for the next error.
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.6
7
  Author: Marcel Pol
8
  Author URI: https://zenoweb.nl
9
  License: GPLv2 or later
@@ -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.6');
35
 
36
 
37
  /*
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
7
  Author: Marcel Pol
8
  Author URI: https://zenoweb.nl
9
  License: GPLv2 or later
31
 
32
 
33
  // Plugin Version
34
+ define('GWOLLE_GB_VER', '4.0.7');
35
 
36
 
37
  /*
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.5
6
- Stable tag: 4.0.6
7
  License: GPLv2 or later
8
  Requires PHP: 5.3
9
 
@@ -93,7 +93,7 @@ Current features include:
93
  * Auto Anonymize timer (optional).
94
  * Auto Delete timer (optional).
95
 
96
- You can buy the Add-On at [ZenoWeb Webshop](https://zenoweb.nl/downloads/gwolle-guestbook-add-on/) for only $ 9.
97
 
98
  = Demo with Add-On =
99
 
@@ -421,6 +421,12 @@ But if you don't use standard comments, you can just as easily use the comment s
421
 
422
  == Changelog ==
423
 
 
 
 
 
 
 
424
  = 4.0.6 =
425
  * 2020-08-10
426
  * Fix blocklist.
3
  Tags: guestbook, guest book, livre d'or, Gästebuch, review
4
  Requires at least: 3.7
5
  Tested up to: 5.5
6
+ Stable tag: 4.0.7
7
  License: GPLv2 or later
8
  Requires PHP: 5.3
9
 
93
  * Auto Anonymize timer (optional).
94
  * Auto Delete timer (optional).
95
 
96
+ You can buy the Add-On at [ZenoWeb Webshop](https://zenoweb.nl/downloads/gwolle-guestbook-add-on/) for only 15 Euro.
97
 
98
  = Demo with Add-On =
99
 
421
 
422
  == Changelog ==
423
 
424
+ = 4.0.7 =
425
+ * 2020-10-06
426
+ * Remove placeholders in form, labels should be enough.
427
+ * Fix closing/opening of postboxes.
428
+ * Check for double entries is now a filter, so that it can be disabled.
429
+
430
  = 4.0.6 =
431
  * 2020-08-10
432
  * Fix blocklist.