Gwolle Guestbook - Version 3.1.0

Version Description

  • 2019-02-19
  • Remove support for Really Simple Captcha plugin, since it is ineffective.
  • Please take a look at the other options for spamfilters, there are more and better options.
  • Update CSS for admin navigation for WP 5.1.
  • Add screen-reader-text to navigation for frontend and admin.
  • Small fixes found by the phan tool.
Download this release

Release Info

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

Code changes from version 3.0.0 to 3.1.0

Files changed (50) hide show
  1. admin/css/gwolle-gb-admin.css +51 -20
  2. admin/gb-page-entries.php +2 -2
  3. admin/gb-page-gwolle-gb.php +7 -8
  4. admin/gb-page-import.php +1 -1
  5. admin/gb-page-settings.php +4 -5
  6. admin/gb-pagination.php +12 -10
  7. admin/gwolle-gb-hooks.php +4 -4
  8. admin/{gfx → images}/entry-admin-reply.png +0 -0
  9. admin/{gfx → images}/entry-blue.png +0 -0
  10. admin/{gfx → images}/entry-checked.png +0 -0
  11. admin/{gfx → images}/entry-spam.png +0 -0
  12. admin/{gfx → images}/entry-trash.png +0 -0
  13. admin/{gfx → images}/entry-unchecked.png +0 -0
  14. admin/{gfx → images}/icon-45x45.png +0 -0
  15. admin/{gfx → images}/index.html +0 -0
  16. admin/{gfx → images}/loading.gif +0 -0
  17. admin/{gfx → images}/screenshot-entry-with-metabox-open.png +0 -0
  18. admin/tabs/gb-antispamtab.php +1 -24
  19. admin/tabs/gb-emailtab.php +3 -3
  20. admin/tabs/gb-formtab.php +0 -15
  21. admin/tabs/gb-readingtab.php +3 -3
  22. docs/filters/gwolle_gb_antispam_label.txt +1 -1
  23. docs/filters/gwolle_gb_author_name_html.txt +23 -7
  24. docs/filters/gwolle_gb_write_add_after_captcha.txt +0 -24
  25. frontend/css/gwolle-gb-frontend.css +4 -2
  26. frontend/gb-ajax-captcha.php +0 -44
  27. frontend/gb-ajax-infinite-scroll.php +2 -1
  28. frontend/gb-form-posthandling.php +3 -26
  29. frontend/gb-form.php +1 -78
  30. frontend/gb-pagination.php +3 -1
  31. frontend/gb-read.php +1 -1
  32. frontend/gb-rss.php +1 -4
  33. frontend/gb-widget-search.php +3 -3
  34. frontend/gb-widget.php +3 -3
  35. frontend/js/captcha.js +0 -32
  36. frontend/js/gwolle-gb-frontend.js +5 -1
  37. functions/gb-bbcode_emoji.php +19 -13
  38. functions/gb-book_id.php +1 -2
  39. functions/gb-debug.php +1 -1
  40. functions/gb-get_entries.php +5 -3
  41. functions/gb-mail.php +4 -1
  42. functions/gb-messages.php +2 -2
  43. functions/gb-post-meta.php +0 -2
  44. functions/gb-privacy.php +18 -18
  45. functions/gb-settings.php +0 -4
  46. functions/gb-stop-forum-spam.php +3 -2
  47. functions/gb-user.php +3 -3
  48. gwolle-gb-hooks.php +2 -2
  49. gwolle-gb.php +2 -3
  50. readme.txt +11 -12
admin/css/gwolle-gb-admin.css CHANGED
@@ -14,7 +14,7 @@
14
 
15
  /* Menu Icon */
16
  #icon-gwolle-gb {
17
- background-image: url('../gfx/icon-45x45.png');
18
  background-repeat: no-repeat;
19
  margin: 0 10px;
20
  float: left;
@@ -23,7 +23,9 @@
23
  }
24
 
25
 
26
- /* Welcome page */
 
 
27
 
28
  body #dashboard-widgets .postbox#gwolle_gb_notification form p.submit {
29
  margin: 1em 0;
@@ -58,7 +60,9 @@ body #dashboard-widgets .postbox#gwolle_gb_notification ul {
58
  }
59
 
60
 
61
- /* Editor.php */
 
 
62
 
63
  #gwolle_gb_editor #normal-sortables .postbox input[type="text"],
64
  #gwolle_gb_editor #normal-sortables .postbox input[type="url"],
@@ -104,7 +108,9 @@ body #dashboard-widgets .postbox#gwolle_gb_notification ul {
104
  }
105
 
106
 
107
- /* Entries.php */
 
 
108
 
109
  /* Page Navigation */
110
  .gwolle_gb .tablenav .tablenav-pages a {
@@ -123,6 +129,8 @@ body #dashboard-widgets .postbox#gwolle_gb_notification ul {
123
  .gwolle_gb .tablenav .tablenav-pages span.dots {
124
  margin-left: 4px;
125
  }
 
 
126
  /* Table */
127
  #gwolle_gb_entries th {
128
  white-space: nowrap;
@@ -131,6 +139,7 @@ body #dashboard-widgets .postbox#gwolle_gb_notification ul {
131
  #gwolle_gb_entries td {
132
  box-shadow: inset 0 -1px 0 #0000001a;
133
  }
 
134
  /* Dark Mode */
135
  .dark-mode #gwolle_gb_entries th,
136
  .dark-mode #gwolle_gb_entries td {
@@ -187,7 +196,10 @@ span.book-icon a {
187
  }
188
 
189
 
190
- /* Icons on entries.php and editor.php */
 
 
 
191
  .gwolle_gb td.entry-icons {
192
  min-width: 50px;
193
  }
@@ -203,31 +215,31 @@ span.book-icon a {
203
  }
204
  .gwolle_gb .visible .visible-icon {
205
  display: inline-block;
206
- background-image: url('../gfx/entry-checked.png');
207
  }
208
  .gwolle_gb .invisible .invisible-icon {
209
  display: inline-block;
210
- background-image: url('../gfx/entry-unchecked.png');
211
  }
212
  .gwolle_gb .spam .spam-icon {
213
  display: inline-block;
214
- background-image: url('../gfx/entry-spam.png');
215
  }
216
  .gwolle_gb .trash .trash-icon {
217
  display: inline-block;
218
- background-image: url('../gfx/entry-trash.png');
219
  }
220
  .gwolle_gb .admin_reply-icon {
221
  display: inline-block;
222
  width: 16px;
223
  height: 16px;
224
  margin-right: 5px;
225
- background-image: url('../gfx/entry-admin-reply.png');
226
  }
227
 
228
  /* AJAX */
229
  .gwolle_gb .entry-icons .gwolle_gb_ajax {
230
- background-image: url('../gfx/loading.gif'); /* Small icon for entries list */
231
  }
232
 
233
  .gwolle_gb tr.entry td span {
@@ -240,7 +252,9 @@ span.book-icon a {
240
  }
241
 
242
 
243
- /* Settings page */
 
 
244
 
245
  /* Tabs */
246
  form.gwolle_gb_options {
@@ -258,7 +272,9 @@ form.gwolle_gb_options.active {
258
  }
259
 
260
 
261
- /* Dashboard Widget */
 
 
262
 
263
  #gwolle_gb_dashboard .inside {
264
  margin-top: 4px;
@@ -293,7 +309,10 @@ form.gwolle_gb_options.active {
293
  }
294
 
295
 
296
- /* AJAX on Entries Page and on Dashboard Widget */
 
 
 
297
  span.gwolle_gb_check,
298
  span.gwolle_gb_uncheck,
299
  span.gwolle_gb_spam,
@@ -322,15 +341,21 @@ span.gwolle_gb_ajax {
322
  display: inline;
323
  }
324
 
325
- /* Admin Bar */
326
- /* Remember, the icon gets only loaded on our own admin pages... */
 
 
 
327
  #wpadminbar #wp-admin-bar-gwolle-gb .ab-icon::before {
328
  content: "";
329
  top: 3px;
330
  }
331
 
332
 
333
- /* Export page */
 
 
 
334
  #gwolle_gb_export .gwolle_gb_export_gif_container {
335
  position: relative;
336
  }
@@ -348,16 +373,22 @@ span.gwolle_gb_ajax {
348
  }
349
 
350
 
351
- /* Add-On admin page */
 
 
 
352
  #gwolle-gb-addon-screenshot {
353
- background-image: url("../gfx/screenshot-entry-with-metabox-open.png");
354
  width: 100%;
355
  height: 240px;
356
  background-size: cover;
357
  }
358
 
359
 
360
- /* Add-On */
 
 
 
361
  form.gwolle_gb_options.gwolle_gb_social img {
362
  margin-bottom: -8px;
363
  }
14
 
15
  /* Menu Icon */
16
  #icon-gwolle-gb {
17
+ background-image: url('../images/icon-45x45.png');
18
  background-repeat: no-repeat;
19
  margin: 0 10px;
20
  float: left;
23
  }
24
 
25
 
26
+ /*
27
+ * Welcome page
28
+ */
29
 
30
  body #dashboard-widgets .postbox#gwolle_gb_notification form p.submit {
31
  margin: 1em 0;
60
  }
61
 
62
 
63
+ /*
64
+ * Editor.php
65
+ */
66
 
67
  #gwolle_gb_editor #normal-sortables .postbox input[type="text"],
68
  #gwolle_gb_editor #normal-sortables .postbox input[type="url"],
108
  }
109
 
110
 
111
+ /*
112
+ * Entries.php
113
+ */
114
 
115
  /* Page Navigation */
116
  .gwolle_gb .tablenav .tablenav-pages a {
129
  .gwolle_gb .tablenav .tablenav-pages span.dots {
130
  margin-left: 4px;
131
  }
132
+
133
+
134
  /* Table */
135
  #gwolle_gb_entries th {
136
  white-space: nowrap;
139
  #gwolle_gb_entries td {
140
  box-shadow: inset 0 -1px 0 #0000001a;
141
  }
142
+
143
  /* Dark Mode */
144
  .dark-mode #gwolle_gb_entries th,
145
  .dark-mode #gwolle_gb_entries td {
196
  }
197
 
198
 
199
+ /*
200
+ * Icons on entries.php and editor.php
201
+ */
202
+
203
  .gwolle_gb td.entry-icons {
204
  min-width: 50px;
205
  }
215
  }
216
  .gwolle_gb .visible .visible-icon {
217
  display: inline-block;
218
+ background-image: url('../images/entry-checked.png');
219
  }
220
  .gwolle_gb .invisible .invisible-icon {
221
  display: inline-block;
222
+ background-image: url('../images/entry-unchecked.png');
223
  }
224
  .gwolle_gb .spam .spam-icon {
225
  display: inline-block;
226
+ background-image: url('../images/entry-spam.png');
227
  }
228
  .gwolle_gb .trash .trash-icon {
229
  display: inline-block;
230
+ background-image: url('../images/entry-trash.png');
231
  }
232
  .gwolle_gb .admin_reply-icon {
233
  display: inline-block;
234
  width: 16px;
235
  height: 16px;
236
  margin-right: 5px;
237
+ background-image: url('../images/entry-admin-reply.png');
238
  }
239
 
240
  /* AJAX */
241
  .gwolle_gb .entry-icons .gwolle_gb_ajax {
242
+ background-image: url('../images/loading.gif'); /* Small icon for entries list */
243
  }
244
 
245
  .gwolle_gb tr.entry td span {
252
  }
253
 
254
 
255
+ /*
256
+ * Settings page
257
+ */
258
 
259
  /* Tabs */
260
  form.gwolle_gb_options {
272
  }
273
 
274
 
275
+ /*
276
+ * Dashboard Widget
277
+ */
278
 
279
  #gwolle_gb_dashboard .inside {
280
  margin-top: 4px;
309
  }
310
 
311
 
312
+ /*
313
+ * AJAX on Entries Page and on Dashboard Widget
314
+ */
315
+
316
  span.gwolle_gb_check,
317
  span.gwolle_gb_uncheck,
318
  span.gwolle_gb_spam,
341
  display: inline;
342
  }
343
 
344
+ /*
345
+ * Admin Bar
346
+ * Remember, the icon gets only loaded on our own admin pages...
347
+ */
348
+
349
  #wpadminbar #wp-admin-bar-gwolle-gb .ab-icon::before {
350
  content: "";
351
  top: 3px;
352
  }
353
 
354
 
355
+ /*
356
+ * Export page
357
+ */
358
+
359
  #gwolle_gb_export .gwolle_gb_export_gif_container {
360
  position: relative;
361
  }
373
  }
374
 
375
 
376
+ /*
377
+ * Add-On admin page
378
+ */
379
+
380
  #gwolle-gb-addon-screenshot {
381
+ background-image: url("../images/screenshot-entry-with-metabox-open.png");
382
  width: 100%;
383
  height: 240px;
384
  background-size: cover;
385
  }
386
 
387
 
388
+ /*
389
+ * Add-On
390
+ */
391
+
392
  form.gwolle_gb_options.gwolle_gb_social img {
393
  margin-bottom: -8px;
394
  }
admin/gb-page-entries.php CHANGED
@@ -49,7 +49,7 @@ function gwolle_gb_page_entries() {
49
  $count['all'] = gwolle_gb_get_entry_count(array( 'all' => 'all' ));
50
  $count['user'] = 0; // dummy data, there is no pagination here.
51
 
52
- $num_entries = get_option('gwolle_gb-entries_per_page', 20);
53
 
54
  // Check if the requested page number is an integer > 0
55
  $pageNum = (isset($_REQUEST['pageNum']) && $_REQUEST['pageNum'] && (int) $_REQUEST['pageNum'] > 0) ? (int) $_REQUEST['pageNum'] : 1;
@@ -555,7 +555,7 @@ function gwolle_gb_page_entries_update() {
555
 
556
  /* Check if we are not sending in more entries than were even listed. */
557
  $entries_checked = 0;
558
- $num_entries = get_option('gwolle_gb-entries_per_page', 20);
559
  foreach( array_keys($_POST) as $postElementName ) {
560
  if (strpos($postElementName, 'check') > -1 && ! strpos($postElementName, '-all-') && $_POST[$postElementName] == 'on') {
561
  $entries_checked++;
49
  $count['all'] = gwolle_gb_get_entry_count(array( 'all' => 'all' ));
50
  $count['user'] = 0; // dummy data, there is no pagination here.
51
 
52
+ $num_entries = (int) get_option('gwolle_gb-entries_per_page', 20);
53
 
54
  // Check if the requested page number is an integer > 0
55
  $pageNum = (isset($_REQUEST['pageNum']) && $_REQUEST['pageNum'] && (int) $_REQUEST['pageNum'] > 0) ? (int) $_REQUEST['pageNum'] : 1;
555
 
556
  /* Check if we are not sending in more entries than were even listed. */
557
  $entries_checked = 0;
558
+ $num_entries = (int) get_option('gwolle_gb-entries_per_page', 20);
559
  foreach( array_keys($_POST) as $postElementName ) {
560
  if (strpos($postElementName, 'check') > -1 && ! strpos($postElementName, '-all-') && $_POST[$postElementName] == 'on') {
561
  $entries_checked++;
admin/gb-page-gwolle-gb.php CHANGED
@@ -227,8 +227,8 @@ function gwolle_gb_overview_notification() {
227
  if ( is_array($user_ids) && ! empty($user_ids) ) {
228
  echo '<ul>';
229
  foreach ( $user_ids as $user_id ) {
230
- $user_info = get_userdata($user_id);
231
- if ($user_info === FALSE) {
232
  // Invalid $user_id
233
  continue;
234
  }
@@ -261,7 +261,6 @@ function gwolle_gb_overview_thanks() {
261
  <li><a href="https://akismet.com/tos/" target="_blank">' . esc_html__( 'Akismet', 'gwolle-gb' ) . '</a></li>
262
  <li><a href="https://www.stopforumspam.com" target="_blank">' . esc_html__( 'Stop Forum Spam', 'gwolle-gb' ) . '</a></li>
263
  <li><a href="https://markitup.jaysalvat.com/" target="_blank">' . esc_html__( 'MarkItUp', 'gwolle-gb' ) . '</a></li>
264
- <li><a href="https://wordpress.org/plugins/really-simple-captcha/" target="_blank">' . esc_html__( 'Really Simple CAPTCHA plugin', 'gwolle-gb' ) . '</a></li>
265
  <li><a href="http://supersimpleslider.com/" target="_blank">' . esc_html__( 'Super Simple Slider', 'gwolle-gb' ) . '</a></li>
266
  </ul>';
267
  }
@@ -364,15 +363,15 @@ function gwolle_gb_welcome_post() {
364
  if ( strlen($user_ids_old) > 0 ) {
365
  $user_ids_old = explode( ",", $user_ids_old );
366
  foreach ( $user_ids_old as $user_id_old ) {
367
- if ( $user_id_old == $user_id ) {
368
  continue; // will be added again below the loop
369
  }
370
  if ( is_numeric($user_id_old) ) {
371
- $user_ids[] = $user_id_old;
372
  }
373
  }
374
  }
375
- $user_ids[] = $user_id; // Really add it.
376
 
377
  $user_ids = implode(",", $user_ids);
378
  update_option('gwolle_gb-notifyByMail', $user_ids);
@@ -387,11 +386,11 @@ function gwolle_gb_welcome_post() {
387
  if ( strlen($user_ids_old) > 0 ) {
388
  $user_ids_old = explode( ",", $user_ids_old );
389
  foreach ( $user_ids_old as $user_id_old ) {
390
- if ( $user_id_old == $user_id ) {
391
  continue;
392
  }
393
  if ( is_numeric($user_id_old) ) {
394
- $user_ids[] = $user_id_old;
395
  }
396
  }
397
  }
227
  if ( is_array($user_ids) && ! empty($user_ids) ) {
228
  echo '<ul>';
229
  foreach ( $user_ids as $user_id ) {
230
+ $user_info = get_userdata( (int) $user_id );
231
+ if ($user_info === false) {
232
  // Invalid $user_id
233
  continue;
234
  }
261
  <li><a href="https://akismet.com/tos/" target="_blank">' . esc_html__( 'Akismet', 'gwolle-gb' ) . '</a></li>
262
  <li><a href="https://www.stopforumspam.com" target="_blank">' . esc_html__( 'Stop Forum Spam', 'gwolle-gb' ) . '</a></li>
263
  <li><a href="https://markitup.jaysalvat.com/" target="_blank">' . esc_html__( 'MarkItUp', 'gwolle-gb' ) . '</a></li>
 
264
  <li><a href="http://supersimpleslider.com/" target="_blank">' . esc_html__( 'Super Simple Slider', 'gwolle-gb' ) . '</a></li>
265
  </ul>';
266
  }
363
  if ( strlen($user_ids_old) > 0 ) {
364
  $user_ids_old = explode( ",", $user_ids_old );
365
  foreach ( $user_ids_old as $user_id_old ) {
366
+ if ( (int) $user_id_old === (int) $user_id ) {
367
  continue; // will be added again below the loop
368
  }
369
  if ( is_numeric($user_id_old) ) {
370
+ $user_ids[] = (int) $user_id_old;
371
  }
372
  }
373
  }
374
+ $user_ids[] = (int) $user_id; // Really add it.
375
 
376
  $user_ids = implode(",", $user_ids);
377
  update_option('gwolle_gb-notifyByMail', $user_ids);
386
  if ( strlen($user_ids_old) > 0 ) {
387
  $user_ids_old = explode( ",", $user_ids_old );
388
  foreach ( $user_ids_old as $user_id_old ) {
389
+ if ( (int) $user_id_old === (int) $user_id ) {
390
  continue;
391
  }
392
  if ( is_numeric($user_id_old) ) {
393
+ $user_ids[] = (int) $user_id_old;
394
  }
395
  }
396
  }
admin/gb-page-import.php CHANGED
@@ -610,7 +610,7 @@ function gwolle_gb_page_import_post() {
610
  $entry = new gwolle_gb_entry();
611
 
612
  /* Check if the date is a timestamp, else convert */
613
- if ( !is_numeric($data[8]) ) {
614
  $data[8] = strtotime($data[8]);
615
  }
616
 
610
  $entry = new gwolle_gb_entry();
611
 
612
  /* Check if the date is a timestamp, else convert */
613
+ if ( ! is_numeric($data[8]) ) {
614
  $data[8] = strtotime($data[8]);
615
  }
616
 
admin/gb-page-settings.php CHANGED
@@ -183,7 +183,6 @@ function gwolle_gb_page_settings_update() {
183
  'form_message_mandatory',
184
  'form_bbcode_enabled',
185
  'form_antispam_enabled',
186
- 'form_recaptcha_enabled',
187
  'form_privacy_enabled'
188
  );
189
  $form_setting = Array();
@@ -403,11 +402,11 @@ function gwolle_gb_page_settings_update() {
403
  if ( strlen($user_ids_old) > 0 ) {
404
  $user_ids_old = explode( ",", $user_ids_old );
405
  foreach ( $user_ids_old as $user_id_old ) {
406
- if ( $user_id_old == $user_id ) {
407
  continue;
408
  }
409
  if ( is_numeric($user_id_old) ) {
410
- $user_ids[] = $user_id_old;
411
  }
412
  }
413
  }
@@ -424,11 +423,11 @@ function gwolle_gb_page_settings_update() {
424
  if ( strlen($user_ids_old) > 0 ) {
425
  $user_ids_old = explode( ",", $user_ids_old );
426
  foreach ( $user_ids_old as $user_id_old ) {
427
- if ( $user_id_old == $user_id ) {
428
  continue; // will be added again below the loop
429
  }
430
  if ( is_numeric($user_id_old) ) {
431
- $user_ids[] = $user_id_old;
432
  }
433
  }
434
  }
183
  'form_message_mandatory',
184
  'form_bbcode_enabled',
185
  'form_antispam_enabled',
 
186
  'form_privacy_enabled'
187
  );
188
  $form_setting = Array();
402
  if ( strlen($user_ids_old) > 0 ) {
403
  $user_ids_old = explode( ",", $user_ids_old );
404
  foreach ( $user_ids_old as $user_id_old ) {
405
+ if ( (int) $user_id_old === (int) $user_id ) {
406
  continue;
407
  }
408
  if ( is_numeric($user_id_old) ) {
409
+ $user_ids[] = (int) $user_id_old;
410
  }
411
  }
412
  }
423
  if ( strlen($user_ids_old) > 0 ) {
424
  $user_ids_old = explode( ",", $user_ids_old );
425
  foreach ( $user_ids_old as $user_id_old ) {
426
+ if ( (int) $user_id_old === (int) $user_id ) {
427
  continue; // will be added again below the loop
428
  }
429
  if ( is_numeric($user_id_old) ) {
430
+ $user_ids[] = (int) $user_id_old;
431
  }
432
  }
433
  }
admin/gb-pagination.php CHANGED
@@ -18,7 +18,7 @@ if ( strpos($_SERVER['PHP_SELF'], basename(__FILE__) )) {
18
  */
19
  function gwolle_gb_pagination_admin( $pageNum, $pages_total, $count, $show ) {
20
 
21
- $num_entries = get_option('gwolle_gb-entries_per_page', 20);
22
 
23
  $book_id = 0;
24
  if ( isset( $_GET['book_id'] ) ) {
@@ -38,7 +38,9 @@ function gwolle_gb_pagination_admin( $pageNum, $pages_total, $count, $show ) {
38
  $lastentry = $firstentry + $total_on_this_page -1;
39
  }
40
 
41
- $pagination = '<div class="tablenav-pages">';
 
 
42
 
43
  $highDotsMade = false;
44
  $pages_done = array();
@@ -50,7 +52,7 @@ function gwolle_gb_pagination_admin( $pageNum, $pages_total, $count, $show ) {
50
 
51
  if ($pageNum > 1) {
52
  $link = admin_url( 'admin.php?page=' . GWOLLE_GB_FOLDER . '/entries.php&show=' . $show . '&pageNum=' . round($pageNum - 1) . '&book_id=' . $book_id );
53
- $pagination .= '<a class="first page-numbers" href="' . $link . '" rel="prev">&laquo;</a>';
54
  }
55
 
56
  if ($pageNum < 5) {
@@ -67,7 +69,7 @@ function gwolle_gb_pagination_admin( $pageNum, $pages_total, $count, $show ) {
67
  } else {
68
  if ( in_array( $i, $pages_done ) ) { continue; }
69
  $link = admin_url( 'admin.php?page=' . GWOLLE_GB_FOLDER . '/entries.php&show=' . $show . '&pageNum=' . $i . '&book_id=' . $book_id );
70
- $pagination .= '<a class="page-numbers" href="' . $link . '">' . $i . '</a>';
71
  $pages_done[] = $i;
72
  if ( $i == $pages_total ) { break; }
73
  }
@@ -79,7 +81,7 @@ function gwolle_gb_pagination_admin( $pageNum, $pages_total, $count, $show ) {
79
  }
80
  } elseif ($pageNum > 4) {
81
  $link = admin_url( 'admin.php?page=' . GWOLLE_GB_FOLDER . '/entries.php&show=' . $show . '&pageNum=1&book_id=' . $book_id );
82
- $pagination .= '<a class="page-numbers" href="' . $link . '">1</a>';
83
  if ($pages_total > 4) {
84
  $pagination .= '<span class="page-numbers dots">...</span>';
85
  }
@@ -92,14 +94,14 @@ function gwolle_gb_pagination_admin( $pageNum, $pages_total, $count, $show ) {
92
  }
93
  for ($i = $minRange; $i <= $showRange; $i++) {
94
  if ($i == $pageNum) {
95
- $pagination .= '<span class="page-numbers current">' . $i . '</span>';
96
  } else {
97
  $link = admin_url( 'admin.php?page=' . GWOLLE_GB_FOLDER . '/entries.php&show=' . $show . '&pageNum=' . $i . '&book_id=' . $book_id );
98
- $pagination .= '<a class="page-numbers" href="' . $link . '">' . $i . '</a>';
99
  }
100
  }
101
  if ($pageNum == $pages_total) {
102
- $pagination .= '<span class="page-numbers current">' . $pageNum . '</span>';
103
  }
104
  }
105
 
@@ -110,10 +112,10 @@ function gwolle_gb_pagination_admin( $pageNum, $pages_total, $count, $show ) {
110
  }
111
  if ( ! in_array( $pages_total, $pages_done ) ) {
112
  $link = admin_url( 'admin.php?page=' . GWOLLE_GB_FOLDER . '/entries.php&show=' . $show . '&pageNum=' . $pages_total . '&book_id=' . $book_id );
113
- $pagination .= '<a class="page-numbers" href="' . $link . '">' . $pages_total . '</a>';
114
  }
115
  $link = admin_url( 'admin.php?page=' . GWOLLE_GB_FOLDER . '/entries.php&show=' . $show . '&pageNum=' . round($pageNum + 1) . '&book_id=' . $book_id );
116
- $pagination .= '<a class="last page-numbers" href="' . $link . '" rel="next">&raquo;</a>';
117
  }
118
 
119
  $pagination .= '</div>';
18
  */
19
  function gwolle_gb_pagination_admin( $pageNum, $pages_total, $count, $show ) {
20
 
21
+ $num_entries = (int) get_option('gwolle_gb-entries_per_page', 20);
22
 
23
  $book_id = 0;
24
  if ( isset( $_GET['book_id'] ) ) {
38
  $lastentry = $firstentry + $total_on_this_page -1;
39
  }
40
 
41
+ $pagination = '
42
+ <h2 class="screen-reader-text">' . esc_html__('Guestbook list navigation', 'gwolle-gb') . '</h2>
43
+ <div class="tablenav-pages">';
44
 
45
  $highDotsMade = false;
46
  $pages_done = array();
52
 
53
  if ($pageNum > 1) {
54
  $link = admin_url( 'admin.php?page=' . GWOLLE_GB_FOLDER . '/entries.php&show=' . $show . '&pageNum=' . round($pageNum - 1) . '&book_id=' . $book_id );
55
+ $pagination .= '<a class="first page-numbers button" href="' . $link . '" rel="prev">&laquo;</a>';
56
  }
57
 
58
  if ($pageNum < 5) {
69
  } else {
70
  if ( in_array( $i, $pages_done ) ) { continue; }
71
  $link = admin_url( 'admin.php?page=' . GWOLLE_GB_FOLDER . '/entries.php&show=' . $show . '&pageNum=' . $i . '&book_id=' . $book_id );
72
+ $pagination .= '<a class="page-numbers button" href="' . $link . '">' . $i . '</a>';
73
  $pages_done[] = $i;
74
  if ( $i == $pages_total ) { break; }
75
  }
81
  }
82
  } elseif ($pageNum > 4) {
83
  $link = admin_url( 'admin.php?page=' . GWOLLE_GB_FOLDER . '/entries.php&show=' . $show . '&pageNum=1&book_id=' . $book_id );
84
+ $pagination .= '<a class="page-numbers button" href="' . $link . '">1</a>';
85
  if ($pages_total > 4) {
86
  $pagination .= '<span class="page-numbers dots">...</span>';
87
  }
94
  }
95
  for ($i = $minRange; $i <= $showRange; $i++) {
96
  if ($i == $pageNum) {
97
+ $pagination .= '<span class="page-numbers button current">' . $i . '</span>';
98
  } else {
99
  $link = admin_url( 'admin.php?page=' . GWOLLE_GB_FOLDER . '/entries.php&show=' . $show . '&pageNum=' . $i . '&book_id=' . $book_id );
100
+ $pagination .= '<a class="page-numbers button" href="' . $link . '">' . $i . '</a>';
101
  }
102
  }
103
  if ($pageNum == $pages_total) {
104
+ $pagination .= '<span class="page-numbers button current">' . $pageNum . '</span>';
105
  }
106
  }
107
 
112
  }
113
  if ( ! in_array( $pages_total, $pages_done ) ) {
114
  $link = admin_url( 'admin.php?page=' . GWOLLE_GB_FOLDER . '/entries.php&show=' . $show . '&pageNum=' . $pages_total . '&book_id=' . $book_id );
115
+ $pagination .= '<a class="page-numbers button" href="' . $link . '">' . $pages_total . '</a>';
116
  }
117
  $link = admin_url( 'admin.php?page=' . GWOLLE_GB_FOLDER . '/entries.php&show=' . $show . '&pageNum=' . round($pageNum + 1) . '&book_id=' . $book_id );
118
+ $pagination .= '<a class="last page-numbers button" href="' . $link . '" rel="next">&raquo;</a>';
119
  }
120
 
121
  $pagination .= '</div>';
admin/gwolle-gb-hooks.php CHANGED
@@ -45,7 +45,7 @@ function gwolle_gb_adminmenu() {
45
  'moderate_comments',
46
  GWOLLE_GB_FOLDER . '/gwolle-gb.php',
47
  'gwolle_gb_welcome',
48
- 'dashicons-admin-comments'
49
  );
50
 
51
  // Admin page: admin/entries.php
@@ -126,9 +126,9 @@ function gwolle_gb_multisite_uninstall() {
126
  restore_current_blog();
127
  }
128
  // Avoid database errors and PHP notices, don't run these actions anymore.
129
- remove_action( 'admin_menu', 'gwolle_gb_adminmenu', 10, 1 );
130
- remove_action( 'wp_dashboard_setup', 'gwolle_gb_dashboard_setup', 10, 1 );
131
- remove_action( 'admin_bar_menu', 'gwolle_gb_admin_bar_menu', 61, 1 );
132
  }
133
  }
134
  }
45
  'moderate_comments',
46
  GWOLLE_GB_FOLDER . '/gwolle-gb.php',
47
  'gwolle_gb_welcome',
48
+ 'dashicons-testimonial'
49
  );
50
 
51
  // Admin page: admin/entries.php
126
  restore_current_blog();
127
  }
128
  // Avoid database errors and PHP notices, don't run these actions anymore.
129
+ remove_action( 'admin_menu', 'gwolle_gb_adminmenu', 10 );
130
+ remove_action( 'wp_dashboard_setup', 'gwolle_gb_dashboard_setup', 10 );
131
+ remove_action( 'admin_bar_menu', 'gwolle_gb_admin_bar_menu', 61 );
132
  }
133
  }
134
  }
admin/{gfx → images}/entry-admin-reply.png RENAMED
File without changes
admin/{gfx → images}/entry-blue.png RENAMED
File without changes
admin/{gfx → images}/entry-checked.png RENAMED
File without changes
admin/{gfx → images}/entry-spam.png RENAMED
File without changes
admin/{gfx → images}/entry-trash.png RENAMED
File without changes
admin/{gfx → images}/entry-unchecked.png RENAMED
File without changes
admin/{gfx → images}/icon-45x45.png RENAMED
File without changes
admin/{gfx → images}/index.html RENAMED
File without changes
admin/{gfx → images}/loading.gif RENAMED
File without changes
admin/{gfx → images}/screenshot-entry-with-metabox-open.png RENAMED
File without changes
admin/tabs/gb-antispamtab.php CHANGED
@@ -223,8 +223,7 @@ function gwolle_gb_page_settingstab_antispam() {
223
  </label><br />
224
  <span class="setting-description">
225
  <?php
226
- _e('Stop Forum Spam is an external service that acts as a spamfilter for guestbook entries.', 'gwolle-gb') . '<br />';
227
- echo '<br />';
228
  $link_wp = '<a href="https://www.stopforumspam.com" target="_blank">';
229
  /* translators: %s is a link */
230
  echo sprintf( esc_html__( 'If you want to know more about Stop Forum Spam and how it works, please read about it on their %swebsite%s.', 'gwolle-gb' ), $link_wp, '</a>' );
@@ -250,28 +249,6 @@ function gwolle_gb_page_settingstab_antispam() {
250
  </td>
251
  </tr>
252
 
253
- <tr valign="top">
254
- <th scope="row"><?php esc_html_e('CAPTCHA', 'gwolle-gb'); ?></th>
255
- <td>
256
- <div>
257
- <span class="setting-description">
258
- <?php esc_html_e('A CAPTCHA is a way to have visitors fill in a field with a few letters or numbers. It is a way to make sure that you have a human visitor and not a spambot. Not every visitor will appreciate it though, some will consider it unfriendly.', 'gwolle-gb'); ?>
259
- <br /><br />
260
- <?php
261
- $link_wp = '<a href="https://wordpress.org/plugins/really-simple-captcha/" title="' . esc_attr__('Really Simple CAPTCHA plugin at wordpress.org', 'gwolle-gb') . '" target="_blank">';
262
- /* translators: %s is a link */
263
- echo sprintf( esc_html__('For the CAPTCHA you need the plugin %sReally Simple CAPTCHA%s installed and activated.', 'gwolle-gb'), $link_wp, '</a>' );
264
- if ( class_exists('ReallySimpleCaptcha') ) {
265
- echo '<br />';
266
- esc_html_e('This plugin is installed and activated, so the CAPTCHA is ready to be used.', 'gwolle-gb');
267
- } ?>
268
- <br /><br />
269
- <?php esc_html_e('If you use any caching plugin together with this CAPTCHA, page caching will be disabled for the page that the CAPTCHA is shown on. This is to prevent errors and to have a fresh CAPCHA image each time.', 'gwolle-gb'); ?>
270
- </span>
271
- </div>
272
- </td>
273
- </tr>
274
-
275
  <tr>
276
  <th colspan="2">
277
  <p class="submit">
223
  </label><br />
224
  <span class="setting-description">
225
  <?php
226
+ esc_html_e('Stop Forum Spam is an external service that acts as a spamfilter for guestbook entries.', 'gwolle-gb'); echo '<br />';
 
227
  $link_wp = '<a href="https://www.stopforumspam.com" target="_blank">';
228
  /* translators: %s is a link */
229
  echo sprintf( esc_html__( 'If you want to know more about Stop Forum Spam and how it works, please read about it on their %swebsite%s.', 'gwolle-gb' ), $link_wp, '</a>' );
249
  </td>
250
  </tr>
251
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
252
  <tr>
253
  <th colspan="2">
254
  <p class="submit">
admin/tabs/gb-emailtab.php CHANGED
@@ -81,10 +81,10 @@ function gwolle_gb_page_settingstab_email() {
81
  <select name="unsubscribe" id="unsubscribe">
82
  <option value="0"><?php esc_html_e('Unsubscribe User', 'gwolle-gb'); ?></option>
83
  <?php
84
- if ( is_array($user_ids) && !empty($user_ids) ) {
85
  foreach ( $user_ids as $user_id ) {
86
 
87
- $user_info = get_userdata($user_id);
88
  if ($user_info === FALSE) {
89
  // Invalid $user_id
90
  continue;
@@ -93,7 +93,7 @@ function gwolle_gb_page_settingstab_email() {
93
  if ( $user_info->ID == get_current_user_id() ) {
94
  $username .= ' ' . esc_html__('You', 'gwolle-gb');
95
  }
96
- echo '<option value="' . $user_id . '">' . $username . '</option>';
97
  }
98
  } ?>
99
  </select><br />
81
  <select name="unsubscribe" id="unsubscribe">
82
  <option value="0"><?php esc_html_e('Unsubscribe User', 'gwolle-gb'); ?></option>
83
  <?php
84
+ if ( is_array($user_ids) && ! empty($user_ids) ) {
85
  foreach ( $user_ids as $user_id ) {
86
 
87
+ $user_info = get_userdata( (int) $user_id );
88
  if ($user_info === FALSE) {
89
  // Invalid $user_id
90
  continue;
93
  if ( $user_info->ID == get_current_user_id() ) {
94
  $username .= ' ' . esc_html__('You', 'gwolle-gb');
95
  }
96
+ echo '<option value="' . $user_info->ID . '">' . $username . '</option>';
97
  }
98
  } ?>
99
  </select><br />
admin/tabs/gb-formtab.php CHANGED
@@ -280,21 +280,6 @@ We reserve the right to edit, delete, or not publish entries.
280
  </td>
281
  </tr>
282
 
283
- <tr valign="top">
284
- <th scope="row"><label for="form_recaptcha_enabled"><?php esc_html_e('CAPTCHA', 'gwolle-gb'); ?>:</label></th>
285
- <td>
286
- <input type="checkbox" id="form_recaptcha_enabled" name="form_recaptcha_enabled"<?php
287
- if ( isset($form_setting['form_recaptcha_enabled']) && $form_setting['form_recaptcha_enabled'] === 'true' ) {
288
- echo ' checked="checked"';
289
- }
290
- ?> />
291
- <label for="form_recaptcha_enabled"><?php esc_html_e('Enabled', 'gwolle-gb'); ?></label>
292
- </td>
293
- <td>
294
- <?php esc_html_e('When enabled it is mandatory.', 'gwolle-gb'); ?>
295
- </td>
296
- </tr>
297
-
298
  <tr valign="top">
299
  <th scope="row"><label for="form_privacy_enabled"><?php esc_html_e('Privacy checkbox', 'gwolle-gb'); ?>:</label></th>
300
  <td>
280
  </td>
281
  </tr>
282
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
  <tr valign="top">
284
  <th scope="row"><label for="form_privacy_enabled"><?php esc_html_e('Privacy checkbox', 'gwolle-gb'); ?>:</label></th>
285
  <td>
admin/tabs/gb-readingtab.php CHANGED
@@ -35,7 +35,7 @@ function gwolle_gb_page_settingstab_reading() {
35
  <th scope="row"><label for="entriesPerPage"><?php esc_html_e('Entries per page on the frontend', 'gwolle-gb'); ?></label></th>
36
  <td>
37
  <select name="entriesPerPage" id="entriesPerPage">
38
- <?php $entriesPerPage = get_option( 'gwolle_gb-entriesPerPage', 20 );
39
  $presets = array(3, 5, 10, 15, 20, 25, 30, 40, 50, 60, 70, 80, 90, 100, 120, 150, 200, 250);
40
  for ($i = 0; $i < count($presets); $i++) {
41
  echo '<option value="' . $presets[$i] . '"';
@@ -56,7 +56,7 @@ function gwolle_gb_page_settingstab_reading() {
56
  <td>
57
  <select name="excerpt_length" id="excerpt_length">
58
  <?php
59
- $excerpt_length = get_option( 'gwolle_gb-excerpt_length', 0 );
60
  $presets = array( 20, 40, 60, 80, 100, 120, 150, 200, 300 );
61
  echo '<option value="0"';
62
  if ( 0 == $excerpt_length ) {
@@ -144,7 +144,7 @@ function gwolle_gb_page_settingstab_reading() {
144
  <tr valign="top">
145
  <th scope="row"><label for="navigation"><?php esc_html_e('Navigation', 'gwolle-gb'); ?></label></th>
146
  <td>
147
- <?php $navigation = get_option( 'gwolle_gb-navigation', 0 ); ?>
148
  <label><input type="radio" name="navigation" value="0" <?php checked('0', $navigation); ?> />
149
  <?php esc_html_e('Pagination', 'gwolle-gb'); ?>
150
  </label><br />
35
  <th scope="row"><label for="entriesPerPage"><?php esc_html_e('Entries per page on the frontend', 'gwolle-gb'); ?></label></th>
36
  <td>
37
  <select name="entriesPerPage" id="entriesPerPage">
38
+ <?php $entriesPerPage = (int) get_option( 'gwolle_gb-entriesPerPage', 20 );
39
  $presets = array(3, 5, 10, 15, 20, 25, 30, 40, 50, 60, 70, 80, 90, 100, 120, 150, 200, 250);
40
  for ($i = 0; $i < count($presets); $i++) {
41
  echo '<option value="' . $presets[$i] . '"';
56
  <td>
57
  <select name="excerpt_length" id="excerpt_length">
58
  <?php
59
+ $excerpt_length = (int) get_option( 'gwolle_gb-excerpt_length', 0 );
60
  $presets = array( 20, 40, 60, 80, 100, 120, 150, 200, 300 );
61
  echo '<option value="0"';
62
  if ( 0 == $excerpt_length ) {
144
  <tr valign="top">
145
  <th scope="row"><label for="navigation"><?php esc_html_e('Navigation', 'gwolle-gb'); ?></label></th>
146
  <td>
147
+ <?php $navigation = (int) get_option( 'gwolle_gb-navigation', 0 ); ?>
148
  <label><input type="radio" name="navigation" value="0" <?php checked('0', $navigation); ?> />
149
  <?php esc_html_e('Pagination', 'gwolle-gb'); ?>
150
  </label><br />
docs/filters/gwolle_gb_antispam_label.txt CHANGED
@@ -2,7 +2,7 @@
2
 
3
  ==Description==
4
 
5
- The <b>"gwolle_gb_antispam_label"</b> filter is used to change the text of the label for the input for antispam at the frontend. It is used for the Custom antispam question and the CAPTCHA.
6
 
7
  You can use this filter as:
8
 
2
 
3
  ==Description==
4
 
5
+ The <b>"gwolle_gb_antispam_label"</b> filter is used to change the text of the label for the input for antispam at the frontend. It is used for the Custom antispam question.
6
 
7
  You can use this filter as:
8
 
docs/filters/gwolle_gb_author_name_html.txt CHANGED
@@ -18,22 +18,38 @@ Where 'filter_function_name' is the function WordPress should call when the filt
18
 
19
  function my_gwolle_gb_author_name_html( $author_name_html ) {
20
  // $author_name_html is a string
 
21
  $author_name = gwolle_gb_sanitize_output( trim( $entry->get_author_name() ) );
22
 
23
  // Registered User gets italic font-style
24
  $author_id = $entry->get_author_id();
25
  $is_moderator = gwolle_gb_is_moderator( $author_id );
26
  if ( $is_moderator ) {
27
- $author_name_html = '<i>' . $author_name . '</i>';
28
  } else {
29
- $author_name_html = $author_name;
30
  }
31
 
32
- // Link to author email.
33
- $author_email = trim( $entry->get_author_email() );
34
- if ($author_email) {
35
- $author_name_html = '<a href="mailto:' . $author_email . '"
36
- title="Email ' . $author_name . '">' . $author_name_html . '</a>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  }
38
 
39
  return $author_name_html;
18
 
19
  function my_gwolle_gb_author_name_html( $author_name_html ) {
20
  // $author_name_html is a string
21
+
22
  $author_name = gwolle_gb_sanitize_output( trim( $entry->get_author_name() ) );
23
 
24
  // Registered User gets italic font-style
25
  $author_id = $entry->get_author_id();
26
  $is_moderator = gwolle_gb_is_moderator( $author_id );
27
  if ( $is_moderator ) {
28
+ $author_name_html = '<i class="gb-moderator">' . $author_name . '</i>';
29
  } else {
30
+ $author_name_html = $author_name;
31
  }
32
 
33
+ $author_link_to_buddypress = apply_filters( 'gwolle_gb_author_link_to_buddypress', true );
34
+ if ( function_exists('bp_core_get_user_domain') && $author_link_to_buddypress ) {
35
+ // Link to Buddypress profile.
36
+ $author_website = trim( bp_core_get_user_domain( $author_id ) );
37
+ if ($author_website) {
38
+ $author_name_html = '<a href="' . $author_website . '" target="_blank"
39
+ title="' . /* translators: BuddyPress profile */ esc_attr__( 'Visit the profile of', 'gwolle-gb' ) . ' ' . $author_name . ': ' . $author_website . '">' . $author_name_html . '</a>';
40
+ }
41
+ } else if ( get_option('gwolle_gb-linkAuthorWebsite', 'true') === 'true' ) {
42
+ // Link to author website if set in options.
43
+ $author_website = trim( $entry->get_author_website() );
44
+ if ($author_website) {
45
+ $pattern = '/^http/';
46
+ if ( ! preg_match($pattern, $author_website, $matches) ) {
47
+ $author_website = "http://" . $author_website;
48
+ }
49
+ $author_link_rel = apply_filters( 'gwolle_gb_author_link_rel', 'nofollow' );
50
+ $author_name_html = '<a href="' . $author_website . '" target="_blank" rel="' . $author_link_rel . '"
51
+ title="' . esc_attr__( 'Visit the website of', 'gwolle-gb' ) . ' ' . $author_name . ': ' . $author_website . '">' . $author_name_html . '</a>';
52
+ }
53
  }
54
 
55
  return $author_name_html;
docs/filters/gwolle_gb_write_add_after_captcha.txt DELETED
@@ -1,24 +0,0 @@
1
-
2
-
3
- ==Description==
4
-
5
- The <b>"gwolle_gb_write_add_after_captcha"</b> filter is used to add content after the captcha field of the form at the frontend.
6
-
7
- You can use this filter as:
8
-
9
- <code><?php add_filter( 'gwolle_gb_write_add_after_captcha', '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_write_add_after_captcha( $string ) {
20
- $string .= "Filter add after captcha: " . $entry->get_id();
21
- return $string;
22
- }
23
- add_filter( 'gwolle_gb_write_add_after_captcha', 'my_gwolle_gb_write_add_after_captcha', 10,1 );
24
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/css/gwolle-gb-frontend.css CHANGED
@@ -112,14 +112,16 @@ body .gwolle-gb-content a {
112
  padding: 2px;
113
  }
114
 
115
- #gwolle_gb form#gwolle_gb_new_entry .input.error, /* recaptcha */
116
- #gwolle_gb form#gwolle-gb-new-entry .input.error, /* recaptcha */
117
  #gwolle_gb form#gwolle_gb_new_entry input.error,
118
  #gwolle_gb form#gwolle-gb-new-entry input.error,
119
  #gwolle_gb form#gwolle_gb_new_entry textarea.error,
120
  #gwolle_gb form#gwolle-gb-new-entry textarea.error {
121
  border: 1px solid #dd3d36;
122
  }
 
 
 
 
123
 
124
  #gwolle_gb div.label,
125
  #gwolle_gb div.input {
112
  padding: 2px;
113
  }
114
 
 
 
115
  #gwolle_gb form#gwolle_gb_new_entry input.error,
116
  #gwolle_gb form#gwolle-gb-new-entry input.error,
117
  #gwolle_gb form#gwolle_gb_new_entry textarea.error,
118
  #gwolle_gb form#gwolle-gb-new-entry textarea.error {
119
  border: 1px solid #dd3d36;
120
  }
121
+ #gwolle_gb form#gwolle_gb_new_entry input[type="checkbox"].error,
122
+ #gwolle_gb form#gwolle-gb-new-entry input[type="checkbox"].error {
123
+ box-shadow: 1px 1px 0px 0px rgba(221,61,54,1);
124
+ }
125
 
126
  #gwolle_gb div.label,
127
  #gwolle_gb div.input {
frontend/gb-ajax-captcha.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
-
3
-
4
- // No direct calls to this script
5
- if ( strpos($_SERVER['PHP_SELF'], basename(__FILE__) )) {
6
- die('No direct calls allowed!');
7
- }
8
-
9
-
10
- /*
11
- * Handles AJAX request from Gwolle-GB Captcha AJAX check.
12
- * Expects that the plugin Really Simple Captcha is enabled.
13
- *
14
- * @return bool 'true' or 'false', if the CAPTCHA is filled in correctly.
15
- * This response is not required for validation and being able to submit the form.
16
- */
17
- function gwolle_gb_captcha_ajax_callback() {
18
-
19
- if ( class_exists('ReallySimpleCaptcha') ) {
20
-
21
- check_ajax_referer( 'gwolle_gb_captcha_ajax', 'security' );
22
-
23
- // Instantiate class
24
- $gwolle_gb_captcha = new ReallySimpleCaptcha();
25
-
26
- // This variable holds the CAPTCHA image prefix, which corresponds to the correct answer
27
- $gwolle_gb_captcha_prefix = ( isset( $_POST['gwolle_gb_captcha_prefix'] ) ? $_POST['gwolle_gb_captcha_prefix'] : false );
28
-
29
- // This variable holds the CAPTCHA response, entered by the user
30
- $gwolle_gb_captcha_code = ( isset( $_POST['gwolle_gb_captcha_code'] ) ? $_POST['gwolle_gb_captcha_code'] : false );
31
-
32
- // This variable will hold the result of the CAPTCHA validation. Set to 'false' until CAPTCHA validation passes
33
- $gwolle_gb_captcha_correct = ( $gwolle_gb_captcha->check( $gwolle_gb_captcha_prefix, $gwolle_gb_captcha_code ) ? 'true' : 'false' );
34
-
35
- // Return response
36
- echo $gwolle_gb_captcha_correct;
37
-
38
- }
39
-
40
- die(); // this is required to return a proper result
41
-
42
- }
43
- add_action( 'wp_ajax_gwolle_gb_captcha_ajax', 'gwolle_gb_captcha_ajax_callback' );
44
- add_action( 'wp_ajax_nopriv_gwolle_gb_captcha_ajax', 'gwolle_gb_captcha_ajax_callback' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/gb-ajax-infinite-scroll.php CHANGED
@@ -26,6 +26,7 @@ function gwolle_gb_infinite_scroll_callback() {
26
  if ( isset($_POST['book_id']) && is_numeric($_POST['book_id']) ) {
27
  $book_id = intval($_POST['book_id']);
28
  }
 
29
  $shortcode_atts['book_id'] = $book_id;
30
 
31
  $num_entries = (int) get_option('gwolle_gb-entriesPerPage', 20);
@@ -52,7 +53,7 @@ function gwolle_gb_infinite_scroll_callback() {
52
 
53
 
54
  /* Entries from the template */
55
- if ( !is_array($entries) || empty($entries) ) {
56
  $output .= 'false';
57
  } else {
58
 
26
  if ( isset($_POST['book_id']) && is_numeric($_POST['book_id']) ) {
27
  $book_id = intval($_POST['book_id']);
28
  }
29
+ $shortcode_atts = array();
30
  $shortcode_atts['book_id'] = $book_id;
31
 
32
  $num_entries = (int) get_option('gwolle_gb-entriesPerPage', 20);
53
 
54
 
55
  /* Entries from the template */
56
+ if ( ! is_array($entries) || empty($entries) ) {
57
  $output .= 'false';
58
  } else {
59
 
frontend/gb-form-posthandling.php CHANGED
@@ -177,29 +177,6 @@ function gwolle_gb_frontend_posthandling() {
177
  }
178
  }
179
 
180
- /* CAPTCHA */
181
- if ( isset($form_setting['form_recaptcha_enabled']) && $form_setting['form_recaptcha_enabled'] === 'true' ) {
182
- if ( class_exists('ReallySimpleCaptcha') ) {
183
- $gwolle_gb_captcha = new ReallySimpleCaptcha();
184
- // This variable holds the CAPTCHA image prefix, which corresponds to the correct answer
185
- $gwolle_gb_captcha_prefix = $_POST['gwolle_gb_captcha_prefix'];
186
- // This variable holds the CAPTCHA response, entered by the user
187
- $gwolle_gb_captcha_code = $_POST['gwolle_gb_captcha_code'];
188
- // Validate the CAPTCHA response
189
- $gwolle_gb_captcha_correct = $gwolle_gb_captcha->check( $gwolle_gb_captcha_prefix, $gwolle_gb_captcha_code );
190
- // If CAPTCHA validation fails (incorrect value entered in CAPTCHA field) mark comment as spam.
191
- if ( true != $gwolle_gb_captcha_correct ) {
192
- gwolle_gb_add_message( '<p class="error_fields gb-error-fields"><strong>' . esc_html__('The CAPTCHA was not filled in correctly, even though it is mandatory.', 'gwolle-gb') . '</strong></p>', true, 'gwolle_gb_captcha_code' );
193
- //gwolle_gb_add_message( '<p style="display_:none"><strong>' . $gwolle_gb_captcha_correct . '</strong></p>' );
194
- } else {
195
- // verified!
196
- //gwolle_gb_add_message( '<p class="error_fields"><strong>Verified.</strong></p>', false, false );
197
- }
198
- // Clean up the tmp directory.
199
- $gwolle_gb_captcha->cleanup();
200
- }
201
- }
202
-
203
  /* Privacy checkbox for GDPR compliance. */
204
  if ( isset($form_setting['form_privacy_enabled']) && $form_setting['form_privacy_enabled'] === 'true' ) {
205
  if (isset($_POST['gwolle_gb_privacy']) && $_POST['gwolle_gb_privacy'] == 'on') {
@@ -216,7 +193,7 @@ function gwolle_gb_frontend_posthandling() {
216
 
217
  /* If there are errors, stop here and return false */
218
  $gwolle_gb_error_fields = gwolle_gb_get_error_fields();
219
- if ( is_array( $gwolle_gb_error_fields ) && !empty( $gwolle_gb_error_fields ) ) {
220
  do_action( 'gwolle_gb_notsaved_entry_frontend', $entry );
221
  return false; // no need to check and save
222
  }
@@ -270,7 +247,7 @@ function gwolle_gb_frontend_posthandling() {
270
  if (get_option( 'gwolle_gb-honeypot', 'true') == 'true') {
271
  $field_name = gwolle_gb_get_field_name( 'honeypot' );
272
  $field_name2 = gwolle_gb_get_field_name( 'honeypot2' );
273
- $honeypot_value = get_option( 'gwolle_gb-honeypot_value', 15 );
274
  if ( isset($_POST["$field_name"]) && strlen($_POST["$field_name"]) > 0 ) {
275
  // Input field was filled in, so considered spam
276
  $entry->set_isspam(true);
@@ -427,7 +404,7 @@ function gwolle_gb_frontend_posthandling() {
427
  /*
428
  * Network Information
429
  */
430
- $set_author_ip = apply_filters( 'gwolle_gb_set_author_ip', true );
431
  $set_author_ip2 = get_option('gwolle_gb-store_ip', 'true');
432
  if ( $set_author_ip && ($set_author_ip2 == 'true') ) {
433
  $entry->set_author_ip( $_SERVER['REMOTE_ADDR'] );
177
  }
178
  }
179
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  /* Privacy checkbox for GDPR compliance. */
181
  if ( isset($form_setting['form_privacy_enabled']) && $form_setting['form_privacy_enabled'] === 'true' ) {
182
  if (isset($_POST['gwolle_gb_privacy']) && $_POST['gwolle_gb_privacy'] == 'on') {
193
 
194
  /* If there are errors, stop here and return false */
195
  $gwolle_gb_error_fields = gwolle_gb_get_error_fields();
196
+ if ( is_array( $gwolle_gb_error_fields ) && ! empty( $gwolle_gb_error_fields ) ) {
197
  do_action( 'gwolle_gb_notsaved_entry_frontend', $entry );
198
  return false; // no need to check and save
199
  }
247
  if (get_option( 'gwolle_gb-honeypot', 'true') == 'true') {
248
  $field_name = gwolle_gb_get_field_name( 'honeypot' );
249
  $field_name2 = gwolle_gb_get_field_name( 'honeypot2' );
250
+ $honeypot_value = (int) get_option( 'gwolle_gb-honeypot_value', 15 );
251
  if ( isset($_POST["$field_name"]) && strlen($_POST["$field_name"]) > 0 ) {
252
  // Input field was filled in, so considered spam
253
  $entry->set_isspam(true);
404
  /*
405
  * Network Information
406
  */
407
+ $set_author_ip = (bool) apply_filters( 'gwolle_gb_set_author_ip', true );
408
  $set_author_ip2 = get_option('gwolle_gb-store_ip', 'true');
409
  if ( $set_author_ip && ($set_author_ip2 == 'true') ) {
410
  $entry->set_author_ip( $_SERVER['REMOTE_ADDR'] );
frontend/gb-form.php CHANGED
@@ -280,7 +280,7 @@ function gwolle_gb_frontend_write( $shortcode_atts, $shortcode ) {
280
  if ( get_option( 'gwolle_gb-honeypot', 'true') == 'true' ) {
281
  $field_name = gwolle_gb_get_field_name( 'honeypot' );
282
  $field_name2 = gwolle_gb_get_field_name( 'honeypot2' );
283
- $honeypot_value = get_option( 'gwolle_gb-honeypot_value', 15 );
284
  $output .= '
285
  <div class="' . $field_name . '" style="display:none;">
286
  <div class="label">
@@ -386,83 +386,6 @@ function gwolle_gb_frontend_write( $shortcode_atts, $shortcode ) {
386
  }
387
  $output .= apply_filters( 'gwolle_gb_write_add_after_antispam', '' );
388
 
389
- /* CAPTCHA */
390
- if ( isset($form_setting['form_recaptcha_enabled']) && $form_setting['form_recaptcha_enabled'] === 'true' ) {
391
- if ( class_exists('ReallySimpleCaptcha') ) {
392
- // Disable page caching, we want a new CAPTCHA image each time.
393
- if ( ! defined( 'DONOTCACHEPAGE' ) )
394
- define( 'DONOTCACHEPAGE', 'true' );
395
-
396
- // Instantiate the ReallySimpleCaptcha class, which will handle all of the heavy lifting
397
- $gwolle_gb_captcha = new ReallySimpleCaptcha();
398
-
399
- // Set Really Simple CAPTCHA Options
400
- $gwolle_gb_captcha->chars = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789';
401
- $gwolle_gb_captcha->char_length = '4';
402
- $gwolle_gb_captcha->img_size = array( '72', '24' );
403
- $gwolle_gb_captcha->fg = array( '0', '0', '0' );
404
- $gwolle_gb_captcha->bg = array( '255', '255', '255' );
405
- $gwolle_gb_captcha->font_size = '16';
406
- $gwolle_gb_captcha->font_char_width = '15';
407
- $gwolle_gb_captcha->img_type = 'png';
408
- $gwolle_gb_captcha->base = array( '6', '18' );
409
-
410
- // Generate random word and image prefix
411
- $gwolle_gb_captcha_word = $gwolle_gb_captcha->generate_random_word();
412
- $gwolle_gb_captcha_prefix = mt_rand();
413
- // Generate CAPTCHA image
414
- $gwolle_gb_captcha_image_name = $gwolle_gb_captcha->generate_image($gwolle_gb_captcha_prefix, $gwolle_gb_captcha_word);
415
- // Define values for CAPTCHA fields
416
- $gwolle_gb_captcha_image_url = content_url('plugins/really-simple-captcha/tmp/');
417
- $gwolle_gb_captcha_image_src = $gwolle_gb_captcha_image_url . $gwolle_gb_captcha_image_name;
418
- $gwolle_gb_captcha_image_width = $gwolle_gb_captcha->img_size[0];
419
- $gwolle_gb_captcha_image_height = $gwolle_gb_captcha->img_size[1];
420
- $gwolle_gb_captcha_field_size = $gwolle_gb_captcha->char_length;
421
-
422
- // Enqueue and localize the frontend script for CAPTCHA.
423
- wp_enqueue_script('gwolle_gb_captcha_js', GWOLLE_GB_URL . 'frontend/js/captcha.js', 'jquery', GWOLLE_GB_VER, true );
424
- $dataToBePassed = array(
425
- // URL to wp-admin/admin-ajax.php to process the request
426
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
427
- // generate a nonce with a unique ID "gwolle_gb_captcha_ajax"
428
- // so that you can check it later when an AJAX request is sent
429
- 'security' => wp_create_nonce( 'gwolle_gb_captcha_ajax' ),
430
- 'correct' => esc_html__ ('Correct CAPTCHA value.', 'gwolle-gb' ),
431
- 'incorrect' => esc_html__( 'Incorrect CAPTCHA value.', 'gwolle-gb' ),
432
- 'gwolle_gb_captcha_prefix' => $gwolle_gb_captcha_prefix
433
- );
434
- wp_localize_script( 'gwolle_gb_captcha_js', 'gwolle_gb_captcha', $dataToBePassed );
435
-
436
- // Output the CAPTCHA fields
437
- $label = apply_filters( 'gwolle_gb_antispam_label', esc_html__('Anti-spam', 'gwolle-gb') );
438
- $output .= '
439
- <div class="gwolle_gb_captcha">
440
- <div class="label">
441
- <label for="gwolle_gb_captcha_code" class="text-info">' . $label . ': *<br />
442
- <img src="' . $gwolle_gb_captcha_image_src . '" alt="captcha" width="' . $gwolle_gb_captcha_image_width . '" height="' . $gwolle_gb_captcha_image_height . '" />
443
- </label>
444
- </div>
445
- <div class="input">
446
- <input class="';
447
- if (in_array('gwolle_gb_captcha_code', $gwolle_gb_error_fields)) {
448
- $output .= 'error';
449
- }
450
- $output .= '" value="" type="text" name="gwolle_gb_captcha_code" id="gwolle_gb_captcha_code" placeholder="' . esc_attr__('CAPTCHA', 'gwolle-gb') . '" ';
451
- if ( in_array('gwolle_gb_captcha_code', $gwolle_gb_error_fields) && isset($autofocus) ) {
452
- $output .= $autofocus;
453
- $autofocus = false; // disable it for the next error.
454
- }
455
- $output .= ' required'; // always required.
456
- $output .= ' />
457
- <input type="hidden" name="gwolle_gb_captcha_prefix" id="gwolle_gb_captcha_prefix" value="' . $gwolle_gb_captcha_prefix . '" />
458
- <span id="gwolle_gb_captcha_verify"></span>
459
- </div>
460
- </div>
461
- <div class="clearBoth">&nbsp;</div>';
462
- }
463
- }
464
- $output .= apply_filters( 'gwolle_gb_write_add_after_captcha', '' );
465
-
466
  /* Privacy checkbox for GDPR compliance. */
467
  if ( isset($form_setting['form_privacy_enabled']) && $form_setting['form_privacy_enabled'] === 'true' ) {
468
  $a_open = '';
280
  if ( get_option( 'gwolle_gb-honeypot', 'true') == 'true' ) {
281
  $field_name = gwolle_gb_get_field_name( 'honeypot' );
282
  $field_name2 = gwolle_gb_get_field_name( 'honeypot2' );
283
+ $honeypot_value = (int) get_option( 'gwolle_gb-honeypot_value', 15 );
284
  $output .= '
285
  <div class="' . $field_name . '" style="display:none;">
286
  <div class="label">
386
  }
387
  $output .= apply_filters( 'gwolle_gb_write_add_after_antispam', '' );
388
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
389
  /* Privacy checkbox for GDPR compliance. */
390
  if ( isset($form_setting['form_privacy_enabled']) && $form_setting['form_privacy_enabled'] === 'true' ) {
391
  $a_open = '';
frontend/gb-pagination.php CHANGED
@@ -26,7 +26,9 @@ function gwolle_gb_pagination_frontend( $pageNum, $pages_total ) {
26
  $permalink = add_query_arg( 'gwolle-gb-search-input', $search_query, $permalink );
27
  }
28
 
29
- $pagination = '<div class="page-navigation">';
 
 
30
 
31
  if ($pageNum > 1) {
32
  $pagination .= '<a href="' . add_query_arg( 'pageNum', round($pageNum - 1), $permalink ) . '" title="' . esc_attr__('Previous page', 'gwolle-gb') . '" rel="prev">&laquo;</a>';
26
  $permalink = add_query_arg( 'gwolle-gb-search-input', $search_query, $permalink );
27
  }
28
 
29
+ $pagination = '
30
+ <div class="page-navigation">
31
+ <span class="screen-reader-text">' . esc_html__('Guestbook list navigation', 'gwolle-gb') . '</span>';
32
 
33
  if ($pageNum > 1) {
34
  $pagination .= '<a href="' . add_query_arg( 'pageNum', round($pageNum - 1), $permalink ) . '" title="' . esc_attr__('Previous page', 'gwolle-gb') . '" rel="prev">&laquo;</a>';
frontend/gb-read.php CHANGED
@@ -163,7 +163,7 @@ function gwolle_gb_frontend_read( $shortcode_atts, $shortcode ) {
163
 
164
 
165
  /* Page navigation on top */
166
- $navigation = get_option( 'gwolle_gb-navigation', 0 );
167
  $entries_list_class = '';
168
  if ( $navigation == 0 ) {
169
  $pagination = gwolle_gb_pagination_frontend( $pageNum, $pages_total );
163
 
164
 
165
  /* Page navigation on top */
166
+ $navigation = (int) get_option( 'gwolle_gb-navigation', 0 );
167
  $entries_list_class = '';
168
  if ( $navigation == 0 ) {
169
  $pagination = gwolle_gb_pagination_frontend( $pageNum, $pages_total );
frontend/gb-rss.php CHANGED
@@ -94,10 +94,7 @@ function gwolle_gb_rss() {
94
  $permalink_biggest_book = $blog_url . '?p=' . $biggest_book;
95
  }
96
  /* Get the Language setting */
97
- $WPLANG = get_option('WPLANG', false);
98
- if ( ! $WPLANG ) {
99
- $WPLANG = WPLANG;
100
- }
101
  if ( ! $WPLANG ) {
102
  $WPLANG = 'en-us';
103
  }
94
  $permalink_biggest_book = $blog_url . '?p=' . $biggest_book;
95
  }
96
  /* Get the Language setting */
97
+ $WPLANG = get_locale();
 
 
 
98
  if ( ! $WPLANG ) {
99
  $WPLANG = 'en-us';
100
  }
frontend/gb-widget-search.php CHANGED
@@ -41,12 +41,12 @@ if (function_exists('register_sidebar') && class_exists('WP_Widget')) {
41
  // Init
42
  $widget_html = '';
43
 
44
- $widget_html .= $before_widget;
45
  $widget_html .= '
46
  <div class="' . $widget_class . '">';
47
 
48
  if ($widget_title !== FALSE) {
49
- $widget_html .= $before_title . apply_filters('widget_title', $widget_title) . $after_title;
50
  }
51
 
52
  $widget_html .= '
@@ -66,7 +66,7 @@ if (function_exists('register_sidebar') && class_exists('WP_Widget')) {
66
 
67
  $widget_html .= '
68
  </div>
69
- ' . $after_widget;
70
 
71
  // Add a filter for the widget, so devs can add or remove parts.
72
  $widget_html = apply_filters( 'gwolle_gb_widget_search', $widget_html);
41
  // Init
42
  $widget_html = '';
43
 
44
+ $widget_html .= $args['before_widget'];
45
  $widget_html .= '
46
  <div class="' . $widget_class . '">';
47
 
48
  if ($widget_title !== FALSE) {
49
+ $widget_html .= $args['before_title'] . apply_filters('widget_title', $widget_title) . $args['after_title'];
50
  }
51
 
52
  $widget_html .= '
66
 
67
  $widget_html .= '
68
  </div>
69
+ ' . $args['after_widget'];
70
 
71
  // Add a filter for the widget, so devs can add or remove parts.
72
  $widget_html = apply_filters( 'gwolle_gb_widget_search', $widget_html);
frontend/gb-widget.php CHANGED
@@ -70,12 +70,12 @@ if (function_exists('register_sidebar') && class_exists('WP_Widget')) {
70
  // Init
71
  $widget_html = '';
72
 
73
- $widget_html .= $before_widget;
74
  $widget_html .= '
75
  <div class="gwolle_gb_widget gwolle-gb-widget">';
76
 
77
  if ($widget_title !== FALSE) {
78
- $widget_html .= $before_title . apply_filters('widget_title', $widget_title) . $after_title;
79
  }
80
 
81
  $raquo = '';
@@ -240,7 +240,7 @@ if (function_exists('register_sidebar') && class_exists('WP_Widget')) {
240
  }
241
  $widget_html .= '
242
  </div>
243
- ' . $after_widget;
244
 
245
  // Add a filter for the entries, so devs can add or remove parts.
246
  $widget_html = apply_filters( 'gwolle_gb_widget', $widget_html);
70
  // Init
71
  $widget_html = '';
72
 
73
+ $widget_html .= $args['before_widget'];
74
  $widget_html .= '
75
  <div class="gwolle_gb_widget gwolle-gb-widget">';
76
 
77
  if ($widget_title !== FALSE) {
78
+ $widget_html .= $args['before_title'] . apply_filters('widget_title', $widget_title) . $args['after_title'];
79
  }
80
 
81
  $raquo = '';
240
  }
241
  $widget_html .= '
242
  </div>
243
+ ' . $args['after_widget'];
244
 
245
  // Add a filter for the entries, so devs can add or remove parts.
246
  $widget_html = apply_filters( 'gwolle_gb_widget', $widget_html);
frontend/js/captcha.js DELETED
@@ -1,32 +0,0 @@
1
-
2
- /*
3
- * JavaScript for CAPTCHA for Gwolle Guestbook Frontend.
4
- * AJAX event for the CAPTCHA check.
5
- */
6
- jQuery(document).ready(function($) {
7
- jQuery( "#gwolle_gb_captcha_code" ).focusout(function() {
8
-
9
- var gwolle_gb_captcha_code = jQuery( '#gwolle_gb_captcha_code' ).val();
10
-
11
- var data = {
12
- action: 'gwolle_gb_captcha_ajax',
13
- security: gwolle_gb_captcha.security,
14
- gwolle_gb_captcha_prefix: gwolle_gb_captcha.gwolle_gb_captcha_prefix,
15
- gwolle_gb_captcha_code: gwolle_gb_captcha_code
16
- };
17
-
18
- jQuery.post( gwolle_gb_captcha.ajaxurl, data, function(response) {
19
-
20
- // Update form verification feedback
21
- if ( 'true' == response ) {
22
- document.getElementById( 'gwolle_gb_captcha_verify' ).innerHTML = '<span style="color:green">' + gwolle_gb_captcha.correct + '</span>';
23
- jQuery( '#gwolle_gb_captcha_code' ).removeClass('error');
24
- } else if ( 'false' == response ) {
25
- document.getElementById( 'gwolle_gb_captcha_verify' ).innerHTML = '<span style="color:red">' + gwolle_gb_captcha.incorrect + '</span>';
26
- jQuery( '#gwolle_gb_captcha_code' ).addClass('error');
27
- }
28
-
29
- });
30
-
31
- });
32
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/js/gwolle-gb-frontend.js CHANGED
@@ -206,7 +206,7 @@ jQuery(document).ready(function($) {
206
  };
207
 
208
  jQuery('.gwolle_gb_form_ajax input').each(function( index, value ) {
209
- var val = jQuery( this ).val();
210
  var id = jQuery( this ).attr('id');
211
  if ( id == 'gwolle_gb_privacy' ) {
212
  var checked = jQuery('.gwolle_gb_form_ajax input#gwolle_gb_privacy').prop('checked');
@@ -215,6 +215,10 @@ jQuery(document).ready(function($) {
215
  }
216
  } else {
217
  gwolle_gb_ajax_data[id] = val;
 
 
 
 
218
  }
219
  });
220
  jQuery('.gwolle_gb_form_ajax textarea').each(function( index, value ) {
206
  };
207
 
208
  jQuery('.gwolle_gb_form_ajax input').each(function( index, value ) {
209
+ var val = jQuery( this ).prop('value'); // For some reason, some hosts do not see any value here, and data does not get sent.
210
  var id = jQuery( this ).attr('id');
211
  if ( id == 'gwolle_gb_privacy' ) {
212
  var checked = jQuery('.gwolle_gb_form_ajax input#gwolle_gb_privacy').prop('checked');
215
  }
216
  } else {
217
  gwolle_gb_ajax_data[id] = val;
218
+ /*if ( typeof console != 'undefined' ) {
219
+ console.log( id + ': ' + val );
220
+ console.table( val );
221
+ } */
222
  }
223
  });
224
  jQuery('.gwolle_gb_form_ajax textarea').each(function( index, value ) {
functions/gb-bbcode_emoji.php CHANGED
@@ -13,7 +13,10 @@ if ( strpos($_SERVER['PHP_SELF'], basename(__FILE__) )) {
13
  * @param string $str content that needs to be parsed
14
  * @return string parsed content
15
  */
16
- function gwolle_gb_bbcode_parse( $str ){
 
 
 
17
  $bb[] = "#\[b\](.*?)\[/b\]#si";
18
  $html[] = "<strong>\\1</strong>";
19
  $bb[] = "#\[i\](.*?)\[/i\]#si";
@@ -36,14 +39,14 @@ function gwolle_gb_bbcode_parse( $str ){
36
  $str = preg_replace($bb, $html, $str);
37
 
38
  // First images, then links, so we support images inside links.
39
- $pattern="#\[img\]([^\[]*)\[/img\]#i";
40
- $replace='<img src="\\1" alt=""/>';
41
- $str=preg_replace($pattern, $replace, $str);
42
 
43
- $pattern="#\[url href=([^\]]*)\]([^\[]*)\[/url\]#i";
44
  $bbcode_link_rel = apply_filters( 'gwolle_gb_bbcode_link_rel', 'nofollow' );
45
- $replace='<a href="\\1" target="_blank" rel="' . $bbcode_link_rel . '">\\2</a>';
46
- $str=preg_replace($pattern, $replace, $str);
47
 
48
  if ( get_option( 'gwolle_gb-showLineBreaks', 'false' ) === 'true' ) {
49
  // fix nl2br adding <br />'s
@@ -67,6 +70,9 @@ function gwolle_gb_bbcode_parse( $str ){
67
  * @return string stripped content
68
  */
69
  function gwolle_gb_bbcode_strip( $str ){
 
 
 
70
  $bb[] = "#\[b\](.*?)\[/b\]#si";
71
  $html[] = "\\1";
72
  $bb[] = "#\[i\](.*?)\[/i\]#si";
@@ -81,13 +87,13 @@ function gwolle_gb_bbcode_strip( $str ){
81
  $html[] = "\\1";
82
  $str = preg_replace($bb, $html, $str);
83
 
84
- $pattern="#\[url href=([^\]]*)\]([^\[]*)\[/url\]#i";
85
- $replace='\\1';
86
- $str=preg_replace($pattern, $replace, $str);
87
 
88
- $pattern="#\[img\]([^\[]*)\[/img\]#i";
89
- $replace='';
90
- $str=preg_replace($pattern, $replace, $str);
91
 
92
  return $str;
93
  }
13
  * @param string $str content that needs to be parsed
14
  * @return string parsed content
15
  */
16
+ function gwolle_gb_bbcode_parse( $str ) {
17
+ $bb = array();
18
+ $html = array();
19
+
20
  $bb[] = "#\[b\](.*?)\[/b\]#si";
21
  $html[] = "<strong>\\1</strong>";
22
  $bb[] = "#\[i\](.*?)\[/i\]#si";
39
  $str = preg_replace($bb, $html, $str);
40
 
41
  // First images, then links, so we support images inside links.
42
+ $pattern = "#\[img\]([^\[]*)\[/img\]#i";
43
+ $replace = '<img src="\\1" alt=""/>';
44
+ $str = preg_replace($pattern, $replace, $str);
45
 
46
+ $pattern = "#\[url href=([^\]]*)\]([^\[]*)\[/url\]#i";
47
  $bbcode_link_rel = apply_filters( 'gwolle_gb_bbcode_link_rel', 'nofollow' );
48
+ $replace = '<a href="\\1" target="_blank" rel="' . $bbcode_link_rel . '">\\2</a>';
49
+ $str = preg_replace($pattern, $replace, $str);
50
 
51
  if ( get_option( 'gwolle_gb-showLineBreaks', 'false' ) === 'true' ) {
52
  // fix nl2br adding <br />'s
70
  * @return string stripped content
71
  */
72
  function gwolle_gb_bbcode_strip( $str ){
73
+ $bb = array();
74
+ $html = array();
75
+
76
  $bb[] = "#\[b\](.*?)\[/b\]#si";
77
  $html[] = "\\1";
78
  $bb[] = "#\[i\](.*?)\[/i\]#si";
87
  $html[] = "\\1";
88
  $str = preg_replace($bb, $html, $str);
89
 
90
+ $pattern = "#\[url href=([^\]]*)\]([^\[]*)\[/url\]#i";
91
+ $replace = '\\1';
92
+ $str = preg_replace($pattern, $replace, $str);
93
 
94
+ $pattern = "#\[img\]([^\[]*)\[/img\]#i";
95
+ $replace = '';
96
+ $str = preg_replace($pattern, $replace, $str);
97
 
98
  return $str;
99
  }
functions/gb-book_id.php CHANGED
@@ -35,8 +35,7 @@ function gwolle_gb_get_postid( $book_id = 1 ) {
35
  if ( $the_query->have_posts() ) {
36
  while ( $the_query->have_posts() ) : $the_query->the_post();
37
  $postid = get_the_ID();
38
- return $postid;
39
- break; // only one postid is needed.
40
  endwhile;
41
  wp_reset_postdata();
42
  }
35
  if ( $the_query->have_posts() ) {
36
  while ( $the_query->have_posts() ) : $the_query->the_post();
37
  $postid = get_the_ID();
38
+ return $postid; // only one postid is needed.
 
39
  endwhile;
40
  wp_reset_postdata();
41
  }
functions/gb-debug.php CHANGED
@@ -29,7 +29,7 @@ function gwolle_gb_debug_info() {
29
  <td><?php
30
  if ( version_compare($wp_version,'3.4', '>=') ) {
31
  echo wp_get_theme()->get('Name');
32
- } else {
33
  echo get_current_theme();
34
  } ?>
35
  </td>
29
  <td><?php
30
  if ( version_compare($wp_version,'3.4', '>=') ) {
31
  echo wp_get_theme()->get('Name');
32
+ } else if ( function_exists('get_current_theme') ) {
33
  echo get_current_theme();
34
  } ?>
35
  </td>
functions/gb-get_entries.php CHANGED
@@ -406,12 +406,14 @@ function gwolle_gb_get_entry_ids($args = array()) {
406
  * - spam string: 'spam', delete the entries marked as spam
407
  * - trash string: 'trash', delete the entries that are in trash
408
  *
409
- * @return mixed int Number of deleted entries, bool false if no entries found.
410
  *
411
  * @since 1.0.0
412
  */
413
  function gwolle_gb_del_entries( $status ) {
414
  global $wpdb;
 
 
415
 
416
  // First get all the id's, so we can remove the logs later
417
 
@@ -424,7 +426,7 @@ function gwolle_gb_del_entries( $status ) {
424
  istrash = %d";
425
  $values[] = 1;
426
  } else {
427
- return false; // not the right $status
428
  }
429
 
430
  $sql = "
@@ -467,7 +469,7 @@ function gwolle_gb_del_entries( $status ) {
467
  return $result;
468
  }
469
  }
470
- return false;
471
  }
472
 
473
 
406
  * - spam string: 'spam', delete the entries marked as spam
407
  * - trash string: 'trash', delete the entries that are in trash
408
  *
409
+ * @return int Number of deleted entries, 0 if no entries found.
410
  *
411
  * @since 1.0.0
412
  */
413
  function gwolle_gb_del_entries( $status ) {
414
  global $wpdb;
415
+ $where = '';
416
+ $values = array();
417
 
418
  // First get all the id's, so we can remove the logs later
419
 
426
  istrash = %d";
427
  $values[] = 1;
428
  } else {
429
+ return 0; // not the right $status
430
  }
431
 
432
  $sql = "
469
  return $result;
470
  }
471
  }
472
+ return 0;
473
  }
474
 
475
 
functions/gb-mail.php CHANGED
@@ -28,7 +28,7 @@ function gwolle_gb_mail_moderators( $entry ) {
28
  if ( is_array( $recipients ) && count( $recipients ) > 0 ) {
29
  foreach ( $recipients as $recipient ) {
30
  if ( is_numeric($recipient) ) {
31
- $userdata = get_userdata( $recipient );
32
  $subscribers[] = $userdata->user_email;
33
  }
34
  }
@@ -80,6 +80,7 @@ Entry content:
80
  }
81
 
82
  // Replace the tags from the mailtemplate with real data from the website and entry
 
83
  $info['user_name'] = gwolle_gb_sanitize_output( $entry->get_author_name() );
84
  $info['user_email'] = $author_email;
85
  $info['blog_name'] = get_bloginfo('name');
@@ -186,6 +187,7 @@ Entry content:
186
  $header .= "Content-Type: text/plain; charset=UTF-8\r\n"; // Encoding of the mail
187
 
188
  // Replace the tags from the mailtemplate with real data from the website and entry
 
189
  $info['user_name'] = gwolle_gb_sanitize_output( $entry->get_author_name() );
190
  $info['user_email'] = $entry->get_author_email();
191
  $info['blog_name'] = get_bloginfo('name');
@@ -263,6 +265,7 @@ Original entry posted on %date%:
263
  $header .= "Content-Type: text/plain; charset=UTF-8\r\n"; // Encoding of the mail
264
 
265
  // Replace the tags from the mailtemplate with real data from the website and entry
 
266
  $info['user_name'] = gwolle_gb_sanitize_output( $entry->get_author_name() );
267
  $info['user_email'] = $entry->get_author_email();
268
  $info['blog_name'] = get_bloginfo('name');
28
  if ( is_array( $recipients ) && count( $recipients ) > 0 ) {
29
  foreach ( $recipients as $recipient ) {
30
  if ( is_numeric($recipient) ) {
31
+ $userdata = get_userdata( (int) $recipient );
32
  $subscribers[] = $userdata->user_email;
33
  }
34
  }
80
  }
81
 
82
  // Replace the tags from the mailtemplate with real data from the website and entry
83
+ $info = array();
84
  $info['user_name'] = gwolle_gb_sanitize_output( $entry->get_author_name() );
85
  $info['user_email'] = $author_email;
86
  $info['blog_name'] = get_bloginfo('name');
187
  $header .= "Content-Type: text/plain; charset=UTF-8\r\n"; // Encoding of the mail
188
 
189
  // Replace the tags from the mailtemplate with real data from the website and entry
190
+ $info = array();
191
  $info['user_name'] = gwolle_gb_sanitize_output( $entry->get_author_name() );
192
  $info['user_email'] = $entry->get_author_email();
193
  $info['blog_name'] = get_bloginfo('name');
265
  $header .= "Content-Type: text/plain; charset=UTF-8\r\n"; // Encoding of the mail
266
 
267
  // Replace the tags from the mailtemplate with real data from the website and entry
268
+ $info = array();
269
  $info['user_name'] = gwolle_gb_sanitize_output( $entry->get_author_name() );
270
  $info['user_email'] = $entry->get_author_email();
271
  $info['blog_name'] = get_bloginfo('name');
functions/gb-messages.php CHANGED
@@ -203,8 +203,8 @@ function gwolle_gb_get_formdata() {
203
 
204
  $gwolle_gb_formdata = gwolle_gb_add_formdata();
205
 
206
- $_gwolle_gb_formdata = apply_filters( 'gwolle_gb_formdata', $gwolle_gb_formdata );
207
 
208
- return $_gwolle_gb_formdata;
209
 
210
  }
203
 
204
  $gwolle_gb_formdata = gwolle_gb_add_formdata();
205
 
206
+ $gwolle_gb_formdata = apply_filters( 'gwolle_gb_formdata', $gwolle_gb_formdata );
207
 
208
+ return $gwolle_gb_formdata;
209
 
210
  }
functions/gb-post-meta.php CHANGED
@@ -55,10 +55,8 @@ function gwolle_gb_is_protected_meta( $protected, $meta_key, $meta_type ) {
55
  switch ($meta_key) {
56
  case 'gwolle_gb_read':
57
  return true;
58
- break;
59
  case 'gwolle_gb_book_id':
60
  return true;
61
- break;
62
  }
63
 
64
  return $protected;
55
  switch ($meta_key) {
56
  case 'gwolle_gb_read':
57
  return true;
 
58
  case 'gwolle_gb_book_id':
59
  return true;
 
60
  }
61
 
62
  return $protected;
functions/gb-privacy.php CHANGED
@@ -36,9 +36,9 @@ function gwolle_gb_add_privacy_policy_content() {
36
  }
37
 
38
  $content = sprintf(
39
- '<p>' . __( 'When visitors leave entries on the site we collect the data entered in the guestbook form and possibly the IP address and hostname of the visitor to help spam detection.', 'gwolle-gb' ) . '</p>' .
40
- '<p>' . __( 'An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your entry, your profile picture is visible to the public in the context of your guestbook entry.', 'gwolle-gb' ) . '</p>' .
41
- '<p>' . __( 'The entered entry and its metadata may be sent to third parties like Akismet and Stop Forum Spam to help spam detection. Their respective privacy policies are at https://automattic.com/privacy/ and https://www.stopforumspam.com/privacy.', 'gwolle-gb' ) . '</p>'
42
  );
43
 
44
  wp_add_privacy_policy_content(
@@ -59,7 +59,7 @@ add_action( 'admin_init', 'gwolle_gb_add_privacy_policy_content' );
59
  */
60
  function gwolle_gb_register_personal_data_exporter( $exporters ) {
61
  $exporters['gwolle-gb'] = array(
62
- 'exporter_friendly_name' => __( 'Gwolle Guestbook', 'gwolle-gb' ),
63
  'callback' => 'gwolle_gb_personal_data_exporter',
64
  );
65
 
@@ -84,15 +84,15 @@ function gwolle_gb_personal_data_exporter( $email_address, $page = 1 ) {
84
  $data_to_export = array();
85
 
86
  $entry_prop_to_export = array(
87
- 'author_name' => __( 'Author', 'gwolle-gb' ),
88
- 'author_email' => __( 'Email', 'gwolle-gb' ),
89
- 'author_origin' => __( 'Origin', 'gwolle-gb' ),
90
- 'author_website' => __( 'Website', 'gwolle-gb' ),
91
- 'author_ip' => __( 'IP address', 'gwolle-gb' ),
92
- 'author_host' => __( 'Host address', 'gwolle-gb' ),
93
- 'datetime' => __( 'Date of the entry', 'gwolle-gb' ),
94
- 'content' => __( 'Content', 'gwolle-gb' ),
95
- 'entry_link' => __( 'URL of entry', 'gwolle-gb' ),
96
  );
97
 
98
  /* Used for permalinks */
@@ -187,7 +187,7 @@ function gwolle_gb_personal_data_exporter( $email_address, $page = 1 ) {
187
 
188
  $data_to_export[] = array(
189
  'group_id' => 'gwolle-gb',
190
- 'group_label' => __( 'Guestbook entries', 'gwolle-gb' ),
191
  'item_id' => "gb-entry-{$entry_id}",
192
  'data' => $entry_data_to_export,
193
  );
@@ -215,7 +215,7 @@ function gwolle_gb_personal_data_exporter( $email_address, $page = 1 ) {
215
  */
216
  function gwolle_gb_register_personal_data_eraser( $erasers ) {
217
  $erasers['gwolle-gb'] = array(
218
- 'eraser_friendly_name' => __( 'Gwolle Guestbook', 'gwolle-gb' ),
219
  'callback' => 'gwolle_gb_personal_data_eraser',
220
  );
221
 
@@ -260,7 +260,7 @@ function gwolle_gb_personal_data_eraser( $email_address, $page = 1 ) {
260
  );
261
 
262
  if ( ! is_array($entries) || empty($entries) ) {
263
- $messages[] = __( 'No guestbook entries have been found for this email address.' );
264
  return array(
265
  'items_removed' => false,
266
  'items_retained' => false,
@@ -279,7 +279,7 @@ function gwolle_gb_personal_data_eraser( $email_address, $page = 1 ) {
279
  } else {
280
  $items_retained = true;
281
  /* translators: %d: Entry ID */
282
- $messages[] = sprintf( __( 'Guestbook entry %d contains personal data but could not be anonymized.' ), $entry->get_id() );
283
  }
284
  }
285
 
@@ -303,7 +303,7 @@ function gwolle_gb_personal_data_eraser( $email_address, $page = 1 ) {
303
  * @return object $entry anonymized instance of gwolle_gb_entry class.
304
  */
305
  function gwolle_gb_privacy_anonymize_entry( $entry ) {
306
- $entry->set_author_name( /* translators: Username */ __( 'Anonymous', 'gwolle-gb' ) );
307
  $entry->set_author_id( 0 );
308
  $entry->set_author_email( '' );
309
  $entry->set_author_origin( '' );
36
  }
37
 
38
  $content = sprintf(
39
+ '<p>' . esc_html__( 'When visitors leave entries on the site we collect the data entered in the guestbook form and possibly the IP address and hostname of the visitor to help spam detection.', 'gwolle-gb' ) . '</p>' .
40
+ '<p>' . esc_html__( 'An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your entry, your profile picture is visible to the public in the context of your guestbook entry.', 'gwolle-gb' ) . '</p>' .
41
+ '<p>' . esc_html__( 'The entered entry and its metadata may be sent to third parties like Akismet and Stop Forum Spam to help spam detection. Their respective privacy policies are at https://automattic.com/privacy/ and https://www.stopforumspam.com/privacy.', 'gwolle-gb' ) . '</p>'
42
  );
43
 
44
  wp_add_privacy_policy_content(
59
  */
60
  function gwolle_gb_register_personal_data_exporter( $exporters ) {
61
  $exporters['gwolle-gb'] = array(
62
+ 'exporter_friendly_name' => esc_html__( 'Gwolle Guestbook', 'gwolle-gb' ),
63
  'callback' => 'gwolle_gb_personal_data_exporter',
64
  );
65
 
84
  $data_to_export = array();
85
 
86
  $entry_prop_to_export = array(
87
+ 'author_name' => esc_html__( 'Author', 'gwolle-gb' ),
88
+ 'author_email' => esc_html__( 'Email', 'gwolle-gb' ),
89
+ 'author_origin' => esc_html__( 'Origin', 'gwolle-gb' ),
90
+ 'author_website' => esc_html__( 'Website', 'gwolle-gb' ),
91
+ 'author_ip' => esc_html__( 'IP address', 'gwolle-gb' ),
92
+ 'author_host' => esc_html__( 'Host address', 'gwolle-gb' ),
93
+ 'datetime' => esc_html__( 'Date of the entry', 'gwolle-gb' ),
94
+ 'content' => esc_html__( 'Content', 'gwolle-gb' ),
95
+ 'entry_link' => esc_html__( 'URL of entry', 'gwolle-gb' ),
96
  );
97
 
98
  /* Used for permalinks */
187
 
188
  $data_to_export[] = array(
189
  'group_id' => 'gwolle-gb',
190
+ 'group_label' => esc_html__( 'Guestbook entries', 'gwolle-gb' ),
191
  'item_id' => "gb-entry-{$entry_id}",
192
  'data' => $entry_data_to_export,
193
  );
215
  */
216
  function gwolle_gb_register_personal_data_eraser( $erasers ) {
217
  $erasers['gwolle-gb'] = array(
218
+ 'eraser_friendly_name' => esc_html__( 'Gwolle Guestbook', 'gwolle-gb' ),
219
  'callback' => 'gwolle_gb_personal_data_eraser',
220
  );
221
 
260
  );
261
 
262
  if ( ! is_array($entries) || empty($entries) ) {
263
+ $messages[] = esc_html__( 'No guestbook entries have been found for this email address.' );
264
  return array(
265
  'items_removed' => false,
266
  'items_retained' => false,
279
  } else {
280
  $items_retained = true;
281
  /* translators: %d: Entry ID */
282
+ $messages[] = sprintf( esc_html__( 'Guestbook entry %d contains personal data but could not be anonymized.' ), $entry->get_id() );
283
  }
284
  }
285
 
303
  * @return object $entry anonymized instance of gwolle_gb_entry class.
304
  */
305
  function gwolle_gb_privacy_anonymize_entry( $entry ) {
306
+ $entry->set_author_name( /* translators: Username */ esc_html__( 'Anonymous', 'gwolle-gb' ) );
307
  $entry->set_author_id( 0 );
308
  $entry->set_author_email( '' );
309
  $entry->set_author_origin( '' );
functions/gb-settings.php CHANGED
@@ -80,7 +80,6 @@ function gwolle_gb_get_setting($request) {
80
  'form_message_mandatory' => 'true',
81
  'form_bbcode_enabled' => 'false',
82
  'form_antispam_enabled' => 'false',
83
- 'form_recaptcha_enabled' => 'false',
84
  'form_privacy_enabled' => 'false'
85
  );
86
  $setting = get_option( 'gwolle_gb-form', Array() );
@@ -92,7 +91,6 @@ function gwolle_gb_get_setting($request) {
92
  return $setting;
93
  }
94
  return $defaults;
95
- break;
96
  case 'read':
97
  if ( get_option('show_avatars') ) {
98
  $avatar = 'true';
@@ -119,10 +117,8 @@ function gwolle_gb_get_setting($request) {
119
  return $setting;
120
  }
121
  return $defaults;
122
- break;
123
  default:
124
  return false;
125
- break;
126
  }
127
  }
128
  return false;
80
  'form_message_mandatory' => 'true',
81
  'form_bbcode_enabled' => 'false',
82
  'form_antispam_enabled' => 'false',
 
83
  'form_privacy_enabled' => 'false'
84
  );
85
  $setting = get_option( 'gwolle_gb-form', Array() );
91
  return $setting;
92
  }
93
  return $defaults;
 
94
  case 'read':
95
  if ( get_option('show_avatars') ) {
96
  $avatar = 'true';
117
  return $setting;
118
  }
119
  return $defaults;
 
120
  default:
121
  return false;
 
122
  }
123
  }
124
  return false;
functions/gb-stop-forum-spam.php CHANGED
@@ -21,6 +21,7 @@ if ( strpos($_SERVER['PHP_SELF'], basename(__FILE__) )) {
21
  * @since 2.3.0
22
  */
23
  function gwolle_gb_stop_forum_spam( $entry ) {
 
24
  $args['ip'] = $_SERVER['REMOTE_ADDR'];
25
  $args['email'] = urlencode(iconv( 'GBK', 'UTF-8', $entry->get_author_email() ));
26
  $args['username'] = urlencode(iconv( 'GBK', 'UTF-8', $entry->get_author_name() ));
@@ -28,9 +29,9 @@ function gwolle_gb_stop_forum_spam( $entry ) {
28
  $args['confidence'] = true;
29
  $args = array_filter( $args );
30
 
31
- $url = 'https://api.stopforumspam.com/api?';
32
  $query = $url . http_build_query( $args );
33
- $key = md5( $query );
34
 
35
  if ( false === ( $transient = get_transient( 'gwolle_gb_sfs_' . $key ) ) ) {
36
  $result = wp_remote_get( $query );
21
  * @since 2.3.0
22
  */
23
  function gwolle_gb_stop_forum_spam( $entry ) {
24
+ $args = array();
25
  $args['ip'] = $_SERVER['REMOTE_ADDR'];
26
  $args['email'] = urlencode(iconv( 'GBK', 'UTF-8', $entry->get_author_email() ));
27
  $args['username'] = urlencode(iconv( 'GBK', 'UTF-8', $entry->get_author_name() ));
29
  $args['confidence'] = true;
30
  $args = array_filter( $args );
31
 
32
+ $url = 'https://api.stopforumspam.com/api?';
33
  $query = $url . http_build_query( $args );
34
+ $key = md5( $query );
35
 
36
  if ( false === ( $transient = get_transient( 'gwolle_gb_sfs_' . $key ) ) ) {
37
  $result = wp_remote_get( $query );
functions/gb-user.php CHANGED
@@ -76,7 +76,7 @@ function gwolle_gb_get_moderators() {
76
 
77
  $moderators = array();
78
 
79
- if ( is_array($users) && !empty($users) ) {
80
  foreach ( $users as $user_info ) {
81
 
82
  if ($user_info === FALSE) {
@@ -137,7 +137,7 @@ function gwolle_gb_get_author_name_html($entry) {
137
  $author_name_html = $author_name;
138
  }
139
 
140
- $author_link_to_buddypress = apply_filters( 'gwolle_gb_author_link_to_buddypress', true );
141
  if ( function_exists('bp_core_get_user_domain') && $author_link_to_buddypress ) {
142
  // Link to Buddypress profile.
143
  $author_website = trim( bp_core_get_user_domain( $author_id ) );
@@ -156,7 +156,7 @@ function gwolle_gb_get_author_name_html($entry) {
156
  $author_link_rel = apply_filters( 'gwolle_gb_author_link_rel', 'nofollow' );
157
  $author_name_html = '<a href="' . $author_website . '" target="_blank" rel="' . $author_link_rel . '"
158
  title="' . esc_attr__( 'Visit the website of', 'gwolle-gb' ) . ' ' . $author_name . ': ' . $author_website . '">' . $author_name_html . '</a>';
159
- }
160
  }
161
 
162
  $author_name_html = apply_filters( 'gwolle_gb_author_name_html', $author_name_html, $entry );
76
 
77
  $moderators = array();
78
 
79
+ if ( is_array($users) && ! empty($users) ) {
80
  foreach ( $users as $user_info ) {
81
 
82
  if ($user_info === FALSE) {
137
  $author_name_html = $author_name;
138
  }
139
 
140
+ $author_link_to_buddypress = (bool) apply_filters( 'gwolle_gb_author_link_to_buddypress', true );
141
  if ( function_exists('bp_core_get_user_domain') && $author_link_to_buddypress ) {
142
  // Link to Buddypress profile.
143
  $author_website = trim( bp_core_get_user_domain( $author_id ) );
156
  $author_link_rel = apply_filters( 'gwolle_gb_author_link_rel', 'nofollow' );
157
  $author_name_html = '<a href="' . $author_website . '" target="_blank" rel="' . $author_link_rel . '"
158
  title="' . esc_attr__( 'Visit the website of', 'gwolle-gb' ) . ' ' . $author_name . ': ' . $author_website . '">' . $author_name_html . '</a>';
159
+ }
160
  }
161
 
162
  $author_name_html = apply_filters( 'gwolle_gb_author_name_html', $author_name_html, $entry );
gwolle-gb-hooks.php CHANGED
@@ -124,7 +124,7 @@ function gwolle_gb_admin_bar_menu( $wp_admin_bar ) {
124
  return;
125
 
126
  // Counter
127
- $count_unchecked = gwolle_gb_get_entry_count(
128
  array(
129
  'checked' => 'unchecked',
130
  'trash' => 'notrash',
@@ -136,7 +136,7 @@ function gwolle_gb_admin_bar_menu( $wp_admin_bar ) {
136
  $awaiting_text = esc_attr( sprintf( /* translators: Toolbar */ _n(
137
  '%s guestbook entry awaiting moderation',
138
  '%s guestbook entries awaiting moderation',
139
- $count_unchecked_i18n,
140
  'gwolle-gb' ),
141
  $count_unchecked_i18n ) );
142
 
124
  return;
125
 
126
  // Counter
127
+ $count_unchecked = (int) gwolle_gb_get_entry_count(
128
  array(
129
  'checked' => 'unchecked',
130
  'trash' => 'notrash',
136
  $awaiting_text = esc_attr( sprintf( /* translators: Toolbar */ _n(
137
  '%s guestbook entry awaiting moderation',
138
  '%s guestbook entries awaiting moderation',
139
+ $count_unchecked,
140
  'gwolle-gb' ),
141
  $count_unchecked_i18n ) );
142
 
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: 3.0.0
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', '3.0.0');
36
 
37
 
38
  /*
@@ -81,7 +81,6 @@ include_once( GWOLLE_GB_DIR . '/functions/gb-class-entry.php' );
81
 
82
  // Functions for the frontend
83
  include_once( GWOLLE_GB_DIR . '/frontend/gb-ajax-infinite-scroll.php' );
84
- include_once( GWOLLE_GB_DIR . '/frontend/gb-ajax-captcha.php' );
85
  include_once( GWOLLE_GB_DIR . '/frontend/gb-form.php' );
86
  include_once( GWOLLE_GB_DIR . '/frontend/gb-form-ajax.php' );
87
  include_once( GWOLLE_GB_DIR . '/frontend/gb-form-posthandling.php' );
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: 3.1.0
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', '3.1.0');
36
 
37
 
38
  /*
81
 
82
  // Functions for the frontend
83
  include_once( GWOLLE_GB_DIR . '/frontend/gb-ajax-infinite-scroll.php' );
 
84
  include_once( GWOLLE_GB_DIR . '/frontend/gb-form.php' );
85
  include_once( GWOLLE_GB_DIR . '/frontend/gb-form-ajax.php' );
86
  include_once( GWOLLE_GB_DIR . '/frontend/gb-form-posthandling.php' );
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.0
6
- Stable tag: 3.0.0
7
  License: GPLv2 or later
8
  Requires PHP: 5.3
9
 
@@ -26,7 +26,7 @@ Current features include:
26
  * Easy Import from other guestbooks into Gwolle Guestbook.
27
  * Notification by mail when a new entry has been posted.
28
  * Moderation, so that you can check an entry before it is visible in your guestbook (optional).
29
- * 7 anti-spam features, like Honeypot, Nonce, Form Timeout, Akismet, Stop Forum Spam, Custom Quiz Question and CAPTCHA.
30
  * Simple Form Builder to select which form-fields you want to use.
31
  * Simple Entry Builder with the parts of each entry that you want to show.
32
  * Multiple guestbooks are possible.
@@ -254,7 +254,6 @@ If you still have problems there are more options:
254
  * Akismet: Third party spamfilter by Automattic. Works really well, but not everybody likes to use a third party service.
255
  * Stop Forum Spam: Third party spamfilter. Again, works really well, but not everybody likes to use a third party service.
256
  * Custom Anti-Spam question: Use a simple quiz question to test if you are human.
257
- * CAPTCHA: Fill in numbers and letters from an image. This should be your last resort, since it has bad usability and will scare off some visitors.
258
 
259
  = I already use WP-SpamShield =
260
 
@@ -262,14 +261,6 @@ WP-SpamShield is a general plugin for anti-spam that supports the general WordPr
262
  Activating WP-SpamShield will disable the anti-spam features in Gwolle Guestbook and all anti-spam will be handled by WP-SpamShield.
263
  If you don’t want to use WP-SpamShield’s protection for Gwolle Guestbook, then all you need to do is disable Anti-Spam for Miscellaneous Forms in WP-SpamShield settings.
264
 
265
- = I enabled the CAPTCHA, but I don't see it in the form. =
266
-
267
- The CAPTCHA uses the one provided by the [Really Simple Captcha plugin](https://wordpress.org/plugins/really-simple-captcha/).
268
- Please install and activate that plugin.
269
-
270
- If it still doesn't show, it could be that the plugin has no write permission in the '/tmp' folder of the Really Simple Captcha plugin.
271
- Please fix this in your install.
272
-
273
  = How can I use Multiple Guestbooks? =
274
 
275
  You can add a parameter to the shortcode, like:
@@ -427,6 +418,14 @@ But if you don't use standard comments, you can just as easily use the comment s
427
 
428
  == Changelog ==
429
 
 
 
 
 
 
 
 
 
430
  = 3.0.0 =
431
  * 2019-01-22
432
  * Add search widget (only visible on guestbook pages).
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.1
6
+ Stable tag: 3.1.0
7
  License: GPLv2 or later
8
  Requires PHP: 5.3
9
 
26
  * Easy Import from other guestbooks into Gwolle Guestbook.
27
  * Notification by mail when a new entry has been posted.
28
  * Moderation, so that you can check an entry before it is visible in your guestbook (optional).
29
+ * 7 anti-spam features, like Honeypot, Nonce, Form Timeout, Akismet, Stop Forum Spam and Custom Quiz Question.
30
  * Simple Form Builder to select which form-fields you want to use.
31
  * Simple Entry Builder with the parts of each entry that you want to show.
32
  * Multiple guestbooks are possible.
254
  * Akismet: Third party spamfilter by Automattic. Works really well, but not everybody likes to use a third party service.
255
  * Stop Forum Spam: Third party spamfilter. Again, works really well, but not everybody likes to use a third party service.
256
  * Custom Anti-Spam question: Use a simple quiz question to test if you are human.
 
257
 
258
  = I already use WP-SpamShield =
259
 
261
  Activating WP-SpamShield will disable the anti-spam features in Gwolle Guestbook and all anti-spam will be handled by WP-SpamShield.
262
  If you don’t want to use WP-SpamShield’s protection for Gwolle Guestbook, then all you need to do is disable Anti-Spam for Miscellaneous Forms in WP-SpamShield settings.
263
 
 
 
 
 
 
 
 
 
264
  = How can I use Multiple Guestbooks? =
265
 
266
  You can add a parameter to the shortcode, like:
418
 
419
  == Changelog ==
420
 
421
+ = 3.1.0 =
422
+ * 2019-02-19
423
+ * Remove support for Really Simple Captcha plugin, since it is ineffective.
424
+ * Please take a look at the other options for spamfilters, there are more and better options.
425
+ * Update CSS for admin navigation for WP 5.1.
426
+ * Add screen-reader-text to navigation for frontend and admin.
427
+ * Small fixes found by the phan tool.
428
+
429
  = 3.0.0 =
430
  * 2019-01-22
431
  * Add search widget (only visible on guestbook pages).