Gwolle Guestbook - Version 4.2.1

Version Description

  • 2021-12-09
  • Fix pagination, always use 'int', not the 'float' from 'ceil()'.
  • Fix editor checkboxes, use int, not string.
Download this release

Release Info

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

Code changes from version 4.2.0 to 4.2.1

add-on/gb-add-on.php CHANGED
@@ -59,7 +59,7 @@ function gwolle_gb_addon_translation_strings() {
59
  esc_html__("
60
  Hello,
61
 
62
- There was a report for abuse for a guestbook entry at '%blog_name%'.
63
  You can check it at %entry_management_url%.
64
 
65
  Have a nice day.
@@ -89,6 +89,8 @@ Entry content:
89
  // function gwolle_gb_entry_metabox_lines_email( $gb_metabox, $entry ) {
90
  /* translators: Commercial Add-On metabox line */
91
  esc_html__('Email author', 'gwolle-gb');
 
 
92
 
93
  //function gwolle_gb_entry_metabox_lines_like_ajax( $gb_metabox, $entry ) {
94
  /* translators: Commercial Add-On metabox line */
59
  esc_html__("
60
  Hello,
61
 
62
+ There was a report for abuse for a guestbook entry at %blog_name%.
63
  You can check it at %entry_management_url%.
64
 
65
  Have a nice day.
89
  // function gwolle_gb_entry_metabox_lines_email( $gb_metabox, $entry ) {
90
  /* translators: Commercial Add-On metabox line */
91
  esc_html__('Email author', 'gwolle-gb');
92
+ /* translators: Commercial Add-On metabox line, email author */
93
+ esc_html__('Email %s', 'gwolle-gb');
94
 
95
  //function gwolle_gb_entry_metabox_lines_like_ajax( $gb_metabox, $entry ) {
96
  /* translators: Commercial Add-On metabox line */
admin/gb-page-editor.php CHANGED
@@ -276,7 +276,7 @@ function gwolle_gb_editor_postbox_icons( $entry ) {
276
 
277
  <label for="ischecked" class="selectit">
278
  <input id="ischecked" name="ischecked" type="checkbox" <?php
279
- if ($entry->get_ischecked() === '1' || $entry->get_id() === 0) {
280
  echo 'checked="checked"';
281
  }
282
  ?> />
@@ -286,7 +286,7 @@ function gwolle_gb_editor_postbox_icons( $entry ) {
286
  <br />
287
  <label for="isspam" class="selectit">
288
  <input id="isspam" name="isspam" type="checkbox" <?php
289
- if ($entry->get_isspam() === '1') {
290
  echo 'checked="checked"';
291
  }
292
  ?> />
@@ -296,7 +296,7 @@ function gwolle_gb_editor_postbox_icons( $entry ) {
296
  <br />
297
  <label for="istrash" class="selectit">
298
  <input id="istrash" name="istrash" type="checkbox" <?php
299
- if ($entry->get_istrash() === '1') {
300
  echo 'checked="checked"';
301
  }
302
  ?> />
@@ -305,7 +305,7 @@ function gwolle_gb_editor_postbox_icons( $entry ) {
305
 
306
  <?php
307
  $trashclass = '';
308
- if ( $entry->get_istrash() === '0' ) {
309
  $trashclass = 'gwolle-gb-hide';
310
  } ?>
311
  <br />
276
 
277
  <label for="ischecked" class="selectit">
278
  <input id="ischecked" name="ischecked" type="checkbox" <?php
279
+ if ($entry->get_ischecked() === 1 || $entry->get_id() === 0) {
280
  echo 'checked="checked"';
281
  }
282
  ?> />
286
  <br />
287
  <label for="isspam" class="selectit">
288
  <input id="isspam" name="isspam" type="checkbox" <?php
289
+ if ($entry->get_isspam() === 1) {
290
  echo 'checked="checked"';
291
  }
292
  ?> />
296
  <br />
297
  <label for="istrash" class="selectit">
298
  <input id="istrash" name="istrash" type="checkbox" <?php
299
+ if ($entry->get_istrash() === 1) {
300
  echo 'checked="checked"';
301
  }
302
  ?> />
305
 
306
  <?php
307
  $trashclass = '';
308
+ if ( $entry->get_istrash() === 0 ) {
309
  $trashclass = 'gwolle-gb-hide';
310
  } ?>
311
  <br />
admin/gb-page-entries.php CHANGED
@@ -59,7 +59,7 @@ function gwolle_gb_page_entries() {
59
  $page_num = (int) $_GET['pageNum'];
60
  }
61
 
62
- $pages_total = ceil( $count["$show"] / $num_entries );
63
  if ($page_num > $pages_total) {
64
  $page_num = 1; // page does not exist, return to first page.
65
  }
@@ -165,7 +165,7 @@ function gwolle_gb_page_entries() {
165
  'book_id' => $book_id,
166
  ));
167
  }
168
- $count_entrypages = ceil( $count_entries / $num_entries );
169
 
170
 
171
  if ( empty( $entries ) ) {
59
  $page_num = (int) $_GET['pageNum'];
60
  }
61
 
62
+ $pages_total = (int) ceil( $count["$show"] / $num_entries );
63
  if ($page_num > $pages_total) {
64
  $page_num = 1; // page does not exist, return to first page.
65
  }
165
  'book_id' => $book_id,
166
  ));
167
  }
168
+ $count_entrypages = (int) ceil( $count_entries / $num_entries );
169
 
170
 
171
  if ( empty( $entries ) ) {
admin/gb-page-export.php CHANGED
@@ -49,7 +49,7 @@ function gwolle_gb_export_postbox() {
49
 
50
  $count = gwolle_gb_get_entry_count(array( 'all' => 'all' ));
51
  $num_entries = 2000;
52
- $parts = ceil( $count / $num_entries );
53
  ?>
54
 
55
  <form name="gwolle_gb_export" id="gwolle_gb_export" method="POST" action="#" accept-charset="UTF-8">
@@ -141,7 +141,7 @@ function gwolle_gb_export_callback() {
141
 
142
  $count = gwolle_gb_get_entry_count(array( 'all' => 'all' ));
143
  $num_entries = 2000;
144
- $parts = ceil( $count / $num_entries );
145
  if ( isset( $_POST['gwolle_gb_export_part'] ) && ( (int) $_POST['gwolle_gb_export_part'] < ( $parts + 1 ) ) ) {
146
  $part = (int) $_POST['gwolle_gb_export_part'];
147
  } else {
49
 
50
  $count = gwolle_gb_get_entry_count(array( 'all' => 'all' ));
51
  $num_entries = 2000;
52
+ $parts = (int) ceil( $count / $num_entries );
53
  ?>
54
 
55
  <form name="gwolle_gb_export" id="gwolle_gb_export" method="POST" action="#" accept-charset="UTF-8">
141
 
142
  $count = gwolle_gb_get_entry_count(array( 'all' => 'all' ));
143
  $num_entries = 2000;
144
+ $parts = (int) ceil( $count / $num_entries );
145
  if ( isset( $_POST['gwolle_gb_export_part'] ) && ( (int) $_POST['gwolle_gb_export_part'] < ( $parts + 1 ) ) ) {
146
  $part = (int) $_POST['gwolle_gb_export_part'];
147
  } else {
admin/tabs/gb-readingtab.php CHANGED
@@ -146,10 +146,10 @@ function gwolle_gb_page_settingstab_reading() {
146
  <th scope="row"><label for="navigation"><?php esc_html_e('Navigation', 'gwolle-gb'); ?></label></th>
147
  <td>
148
  <?php $navigation = (int) get_option( 'gwolle_gb-navigation', 0 ); ?>
149
- <label><input type="radio" name="navigation" value="0" <?php checked('0', $navigation); ?> />
150
  <?php esc_html_e('Pagination', 'gwolle-gb'); ?>
151
  </label><br />
152
- <label><input type="radio" name="navigation" value="1" <?php checked('1', $navigation); ?> />
153
  <?php esc_html_e('Infinite Scroll', 'gwolle-gb'); ?>
154
  </label><br />
155
  <span class="setting-description"><?php esc_html_e('Use standard navigation with links to all pages, or use infinite scroll where entries will be added to the bottom as you are reading.', 'gwolle-gb'); ?></span>
146
  <th scope="row"><label for="navigation"><?php esc_html_e('Navigation', 'gwolle-gb'); ?></label></th>
147
  <td>
148
  <?php $navigation = (int) get_option( 'gwolle_gb-navigation', 0 ); ?>
149
+ <label><input type="radio" name="navigation" value="0" <?php checked( 0, $navigation ); ?> />
150
  <?php esc_html_e('Pagination', 'gwolle-gb'); ?>
151
  </label><br />
152
+ <label><input type="radio" name="navigation" value="1" <?php checked( 1, $navigation ); ?> />
153
  <?php esc_html_e('Infinite Scroll', 'gwolle-gb'); ?>
154
  </label><br />
155
  <span class="setting-description"><?php esc_html_e('Use standard navigation with links to all pages, or use infinite scroll where entries will be added to the bottom as you are reading.', 'gwolle-gb'); ?></span>
frontend/gb-read.php CHANGED
@@ -91,7 +91,7 @@ function gwolle_gb_frontend_read( $shortcode_atts, $shortcode ) {
91
  set_transient( $key, $entries_total, DAY_IN_SECONDS );
92
  }
93
  }
94
- $pages_total = ceil( $entries_total / $num_entries );
95
 
96
  $page_num = 1;
97
  if ( isset($_GET['pageNum']) && is_numeric($_GET['pageNum']) ) {
91
  set_transient( $key, $entries_total, DAY_IN_SECONDS );
92
  }
93
  }
94
+ $pages_total = (int) ceil( $entries_total / $num_entries );
95
 
96
  $page_num = 1;
97
  if ( isset($_GET['pageNum']) && is_numeric($_GET['pageNum']) ) {
functions/gb-user-ip.php CHANGED
@@ -42,14 +42,14 @@ function gwolle_gb_get_user_ip() {
42
  );
43
  foreach ( $proxy_headers as $header ) {
44
  if ( isset( $_SERVER["$header"] ) ) {
45
- $user_ip = $_SERVER["$header"];
46
  break;
47
  }
48
  }
49
  return $user_ip;
50
  }
51
 
52
- $user_ip = $_SERVER['REMOTE_ADDR'];
53
  return $user_ip;
54
 
55
  }
42
  );
43
  foreach ( $proxy_headers as $header ) {
44
  if ( isset( $_SERVER["$header"] ) ) {
45
+ $user_ip = sanitize_text_field( $_SERVER["$header"] );
46
  break;
47
  }
48
  }
49
  return $user_ip;
50
  }
51
 
52
+ $user_ip = sanitize_text_field( $_SERVER['REMOTE_ADDR'] );
53
  return $user_ip;
54
 
55
  }
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.2.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 (https://github.com/wtimme)
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,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.2.0');
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.2.1
7
  Author: Marcel Pol
8
  Author URI: https://zenoweb.nl
9
  License: GPLv2 or later
12
 
13
 
14
  Copyright 2009 - 2010 Wolfgang Timme (https://github.com/wtimme)
15
+ Copyright 2014 - 2021 Marcel Pol (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.2.1');
35
 
36
 
37
  /*
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  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.8
6
- Stable tag: 4.2.0
7
  License: GPLv2 or later
8
  Requires PHP: 5.3
9
 
@@ -432,6 +432,11 @@ But if you don't use standard comments, you can just as easily use the comment s
432
 
433
  == Changelog ==
434
 
 
 
 
 
 
435
  = 4.2.0 =
436
  * 2021-11-18
437
  * Security fix for CSRF, use 'sanitize_text_field' for user_email on author search.
2
  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.9
6
+ Stable tag: 4.2.1
7
  License: GPLv2 or later
8
  Requires PHP: 5.3
9
 
432
 
433
  == Changelog ==
434
 
435
+ = 4.2.1 =
436
+ * 2021-12-09
437
+ * Fix pagination, always use 'int', not the 'float' from 'ceil()'.
438
+ * Fix editor checkboxes, use int, not string.
439
+
440
  = 4.2.0 =
441
  * 2021-11-18
442
  * Security fix for CSRF, use 'sanitize_text_field' for user_email on author search.