Gwolle Guestbook - Version 2.5.2

Version Description

  • 2018-05-12
  • Support link to privacy policy (requires WordPress 4.9.6).
Download this release

Release Info

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

Code changes from version 2.5.1 to 2.5.2

Files changed (4) hide show
  1. frontend/gb-form.php +13 -4
  2. functions/gb-misc.php +29 -0
  3. gwolle-gb.php +3 -3
  4. readme.txt +5 -1
frontend/gb-form.php CHANGED
@@ -457,7 +457,7 @@ function gwolle_gb_frontend_write( $shortcode_atts, $shortcode ) {
457
  </label>
458
  </div>
459
  <div class="input">
460
- <input class="';
461
  if (in_array('gwolle_gb_captcha_code', $gwolle_gb_error_fields)) {
462
  $output .= 'error';
463
  }
@@ -468,8 +468,8 @@ function gwolle_gb_frontend_write( $shortcode_atts, $shortcode ) {
468
  }
469
  $output .= ' required'; // always required.
470
  $output .= ' />
471
- <input type="hidden" name="gwolle_gb_captcha_prefix" id="gwolle_gb_captcha_prefix" value="' . $gwolle_gb_captcha_prefix . '" />
472
- <span id="gwolle_gb_captcha_verify"></span>
473
  </div>
474
  </div>
475
  <div class="clearBoth">&nbsp;</div>';
@@ -479,7 +479,16 @@ function gwolle_gb_frontend_write( $shortcode_atts, $shortcode ) {
479
 
480
  /* Privacy checkbox for GDPR compliance. */
481
  if ( isset($form_setting['form_privacy_enabled']) && $form_setting['form_privacy_enabled'] === 'true' ) {
482
- $label = apply_filters( 'gwolle_gb_privacy_label', esc_html__('Accept Privacy Policy', 'gwolle-gb') );
 
 
 
 
 
 
 
 
 
483
  $output .= '
484
  <div class="gwolle_gb_privacy">
485
  <div class="label"><label for="gwolle_gb_privacy" class="text-info">' . $label . ': *</label></div>
457
  </label>
458
  </div>
459
  <div class="input">
460
+ <input class="';
461
  if (in_array('gwolle_gb_captcha_code', $gwolle_gb_error_fields)) {
462
  $output .= 'error';
463
  }
468
  }
469
  $output .= ' required'; // always required.
470
  $output .= ' />
471
+ <input type="hidden" name="gwolle_gb_captcha_prefix" id="gwolle_gb_captcha_prefix" value="' . $gwolle_gb_captcha_prefix . '" />
472
+ <span id="gwolle_gb_captcha_verify"></span>
473
  </div>
474
  </div>
475
  <div class="clearBoth">&nbsp;</div>';
479
 
480
  /* Privacy checkbox for GDPR compliance. */
481
  if ( isset($form_setting['form_privacy_enabled']) && $form_setting['form_privacy_enabled'] === 'true' ) {
482
+ $a_open = '';
483
+ $a_close = '';
484
+ $privacy_policy_page_id = gwolle_gb_get_privacy_policy_id();
485
+ if ( ! empty( $privacy_policy_page_id ) ) {
486
+ $privacy_policy_page_permalink = get_permalink( $privacy_policy_page_id );
487
+ $a_open = '<a href="' . $privacy_policy_page_permalink . '" title="' . esc_attr__('Read the Privacy Policy', 'gwolle-gb') . '" target="_blank">';
488
+ $a_close = '</a>';
489
+ }
490
+ /* translators: %s is a link to the privacy policy page. */
491
+ $label = apply_filters( 'gwolle_gb_privacy_label', sprintf( esc_html__( 'Accept %sPrivacy Policy%s', 'gwolle-gb' ), $a_open, $a_close ) );
492
  $output .= '
493
  <div class="gwolle_gb_privacy">
494
  <div class="label"><label for="gwolle_gb_privacy" class="text-info">' . $label . ': *</label></div>
functions/gb-misc.php CHANGED
@@ -91,3 +91,32 @@ function gwolle_gb_get_field_name( $field ) {
91
 
92
  return $field_name;
93
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
  return $field_name;
93
  }
94
+
95
+
96
+ /*
97
+ * If a privacy policy page ID is available, make sure the page actually exists. If not, display an error.
98
+ *
99
+ * @return int page ID of the privacy policy page. Returns false if no page found.
100
+ *
101
+ * @since 2.5.2
102
+ */
103
+ function gwolle_gb_get_privacy_policy_id() {
104
+
105
+ $privacy_policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' ); // Available since WordPress 4.9.6
106
+
107
+ if ( ! empty( $privacy_policy_page_id ) ) {
108
+ $privacy_policy_page = get_post( $privacy_policy_page_id );
109
+
110
+ if ( ! $privacy_policy_page instanceof WP_Post ) {
111
+ return false;
112
+ } else {
113
+ if ( 'trash' === $privacy_policy_page->post_status ) {
114
+ return false;
115
+ } else {
116
+ return $privacy_policy_page_id;
117
+ }
118
+ }
119
+ }
120
+ return false;
121
+
122
+ }
gwolle-gb.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Gwolle Guestbook
4
  Plugin URI: http://zenoweb.nl
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: 2.5.1
7
  Author: Marcel Pol
8
  Author URI: http://zenoweb.nl
9
  License: GPLv2 or later
@@ -32,7 +32,7 @@ Domain Path: /lang/
32
 
33
 
34
  // Plugin Version
35
- define('GWOLLE_GB_VER', '2.5.1');
36
 
37
 
38
  /*
@@ -63,7 +63,7 @@ define('GWOLLE_GB_VER', '2.5.1');
63
  * - Support mark-as-spam and mark-as-ham for Stop Forum Spam.
64
  * - Consider adding a checkbox to honeypot.
65
  * - Emoji: Sinterklaas and Zwarte Piet.
66
- * - Add %privacy_policy% to form notice. Use a WP Core function to get it. Remove %ip% from default text.
67
  * - Someday, do something with the REST API. Someday.
68
  *
69
  */
3
  Plugin Name: Gwolle Guestbook
4
  Plugin URI: http://zenoweb.nl
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: 2.5.2
7
  Author: Marcel Pol
8
  Author URI: http://zenoweb.nl
9
  License: GPLv2 or later
32
 
33
 
34
  // Plugin Version
35
+ define('GWOLLE_GB_VER', '2.5.2');
36
 
37
 
38
  /*
63
  * - Support mark-as-spam and mark-as-ham for Stop Forum Spam.
64
  * - Consider adding a checkbox to honeypot.
65
  * - Emoji: Sinterklaas and Zwarte Piet.
66
+ * - Remove %ip% from default notice text.
67
  * - Someday, do something with the REST API. Someday.
68
  *
69
  */
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: 4.9
6
- Stable tag: 2.5.1
7
  License: GPLv2 or later
8
 
9
  Gwolle Guestbook is the WordPress guestbook you've just been looking for. Beautiful and easy.
@@ -405,6 +405,10 @@ But if you don't use standard comments, you can just as easily use the comment s
405
 
406
  == Changelog ==
407
 
 
 
 
 
408
  = 2.5.1 =
409
  * 2018-05-01
410
  * Fix link checker.
3
  Tags: guestbook, guest book, livre d'or, Gästebuch, review
4
  Requires at least: 3.7
5
  Tested up to: 4.9
6
+ Stable tag: 2.5.2
7
  License: GPLv2 or later
8
 
9
  Gwolle Guestbook is the WordPress guestbook you've just been looking for. Beautiful and easy.
405
 
406
  == Changelog ==
407
 
408
+ = 2.5.2 =
409
+ * 2018-05-12
410
+ * Support link to privacy policy (requires WordPress 4.9.6).
411
+
412
  = 2.5.1 =
413
  * 2018-05-01
414
  * Fix link checker.