Gwolle Guestbook - Version 3.1.7

Version Description

  • 2019-10-25
  • Show subscription status for email notifications on settings page.
  • Comment out unused images in markitup CSS.
  • Set rel='nofollow noopener noreferrer' for bbcode links and user website.
  • Set referrerpolicy='no-referrer' for bbcode images and avatar.
  • Add filter 'gwolle_gb_bbcode_img_referrer'.
  • Update strings for add-on.
Download this release

Release Info

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

Code changes from version 3.1.6 to 3.1.7

add-on/gb-add-on.php CHANGED
@@ -96,6 +96,10 @@ Entry content:
96
  /* translators: Commercial Add-On */
97
  esc_html__('Rating', 'gwolle-gb');
98
 
 
 
 
 
99
  // class GwolleGB_Widget_Av_Rating extends WP_Widget {
100
  /* translators: Commercial Add-On Widget */
101
  esc_html__('Displays the average star rating of a guestbook.','gwolle-gb');
96
  /* translators: Commercial Add-On */
97
  esc_html__('Rating', 'gwolle-gb');
98
 
99
+ // function gwolle_gb_entry_edit_javascript() {
100
+ /* translators: Commercial Add-On metabox line for edit inline */
101
+ esc_attr__('Edit entry:', 'gwolle-gb');
102
+
103
  // class GwolleGB_Widget_Av_Rating extends WP_Widget {
104
  /* translators: Commercial Add-On Widget */
105
  esc_html__('Displays the average star rating of a guestbook.','gwolle-gb');
admin/gb-page-add-on.php CHANGED
@@ -84,6 +84,7 @@ function gwolle_gb_addon_features() {
84
  <li>' . esc_html__('Preview for the frontend form.','gwolle-gb').'</li>
85
  <li>' . esc_html__('Preview for the admin editor form.','gwolle-gb').'</li>
86
  <li>' . esc_html__('Admin reply on the frontend with AJAX.','gwolle-gb').'</li>
 
87
  <li>' . esc_html__('Report Abuse.','gwolle-gb').'</li>
88
  <li>' . esc_html__('Blacklist for words and IP address.','gwolle-gb').'</li>
89
  <li>' . esc_html__('Easy String Replacement in the default text so you can make this guestbook into a review section or anything you want.','gwolle-gb').'</li>
84
  <li>' . esc_html__('Preview for the frontend form.','gwolle-gb').'</li>
85
  <li>' . esc_html__('Preview for the admin editor form.','gwolle-gb').'</li>
86
  <li>' . esc_html__('Admin reply on the frontend with AJAX.','gwolle-gb').'</li>
87
+ <li>' . esc_html__('Edit content of entry on the frontend with AJAX.','gwolle-gb').'</li>
88
  <li>' . esc_html__('Report Abuse.','gwolle-gb').'</li>
89
  <li>' . esc_html__('Blacklist for words and IP address.','gwolle-gb').'</li>
90
  <li>' . esc_html__('Easy String Replacement in the default text so you can make this guestbook into a review section or anything you want.','gwolle-gb').'</li>
admin/gb-page-editor.php CHANGED
@@ -471,7 +471,7 @@ function gwolle_gb_editor_meta_inputs( $entry ) {
471
 
472
  $date = $entry->get_datetime();
473
  if ( ! $date ) {
474
- $date = current_time('timestamp');
475
  }
476
 
477
  $dd = date( 'd', $date );
471
 
472
  $date = $entry->get_datetime();
473
  if ( ! $date ) {
474
+ $date = current_time( 'timestamp' );
475
  }
476
 
477
  $dd = date( 'd', $date );
admin/tabs/gb-emailtab.php CHANGED
@@ -35,6 +35,20 @@ function gwolle_gb_page_settingstab_email() {
35
  if ( strlen($user_ids) > 0 ) {
36
  $user_ids = explode( ",", $user_ids );
37
  } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  <tr valign="top">
39
  <th scope="row"><label for="subscribe"><?php esc_html_e('Subscribe moderators', 'gwolle-gb'); ?></label></th>
40
  <td>
35
  if ( strlen($user_ids) > 0 ) {
36
  $user_ids = explode( ",", $user_ids );
37
  } ?>
38
+
39
+ <tr valign="top">
40
+ <th scope="row"><label><?php esc_html_e('Subscription status', 'gwolle-gb'); ?></label></th>
41
+ <td>
42
+ <?php
43
+ $my_user_id = get_current_user_id();
44
+ if ( is_array($user_ids) && in_array($my_user_id, $user_ids) ) {
45
+ esc_html_e('You are subscribed to email notifications.', 'gwolle-gb');
46
+ } else {
47
+ esc_html_e('You are not subscribed to email notifications.', 'gwolle-gb');
48
+ } ?>
49
+ </td>
50
+ </tr>
51
+
52
  <tr valign="top">
53
  <th scope="row"><label for="subscribe"><?php esc_html_e('Subscribe moderators', 'gwolle-gb'); ?></label></th>
54
  <td>
docs/filters/gwolle_gb_bbode_image_referrer.txt ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ ==Description==
4
+
5
+ The <b>"gwolle_gb_bbcode_img_referrer"</b> filter is used to change the referrerpolicy attribute of BBcode images that were entered by the user.
6
+
7
+ You can use this filter as:
8
+
9
+ <code><?php add_filter( 'gwolle_gb_bbcode_img_referrer', '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_bbcode_img_referrer( $referrerpolicy ) {
20
+ // default "no-referrer"
21
+ return 'origin'; // Help out tracking bastards.
22
+ }
23
+ add_filter( 'gwolle_gb_bbcode_img_referrer', 'my_gwolle_gb_bbcode_img_referrer' );
24
+
docs/filters/gwolle_gb_bbode_link_rel.txt CHANGED
@@ -17,7 +17,7 @@ Where 'filter_function_name' is the function WordPress should call when the filt
17
 
18
 
19
  function my_gwolle_gb_bbcode_link_rel( $rel ) {
20
- // default "nofollow"
21
  return 'follow'; // Help out mr. spamalot
22
  }
23
  add_filter( 'gwolle_gb_bbcode_link_rel', 'my_gwolle_gb_bbcode_link_rel' );
17
 
18
 
19
  function my_gwolle_gb_bbcode_link_rel( $rel ) {
20
+ // default "nofollow noopener noreferrer"
21
  return 'follow'; // Help out mr. spamalot
22
  }
23
  add_filter( 'gwolle_gb_bbcode_link_rel', 'my_gwolle_gb_bbcode_link_rel' );
frontend/gwolle_gb-entry.php CHANGED
@@ -70,6 +70,7 @@ if ( ! function_exists('gwolle_gb_entry_template') ) {
70
  if ( isset($read_setting['read_avatar']) && $read_setting['read_avatar'] === 'true' ) {
71
  $avatar = get_avatar( $entry->get_author_email(), 32, '', $entry->get_author_name() );
72
  if ($avatar) {
 
73
  $entry_output .= '
74
  <span class="gb-author-avatar">' . $avatar . '</span>';
75
  }
70
  if ( isset($read_setting['read_avatar']) && $read_setting['read_avatar'] === 'true' ) {
71
  $avatar = get_avatar( $entry->get_author_email(), 32, '', $entry->get_author_name() );
72
  if ($avatar) {
73
+ $avatar = str_replace('<img', '<img referrerpolicy="no-referrer"', $avatar);
74
  $entry_output .= '
75
  <span class="gb-author-avatar">' . $avatar . '</span>';
76
  }
frontend/markitup/style.css CHANGED
@@ -57,7 +57,7 @@
57
  display:block;
58
  }
59
  .markItUpHeader ul .markItUpDropMenu {
60
- background:transparent url(images/menu.png) no-repeat 115% 50%;
61
  margin-right:5px;
62
  }
63
  .markItUpHeader ul .markItUpDropMenu li {
@@ -88,7 +88,7 @@
88
  border-bottom:1px solid #3C769D;
89
  }
90
  .markItUpHeader ul ul .markItUpDropMenu {
91
- background:#F5F5F5 url(images/submenu.png) no-repeat 100% 50%;
92
  }
93
  /* next rows of buttons */
94
  .markItUpHeader ul ul ul {
@@ -130,20 +130,20 @@
130
  }
131
  /***************************************************************************************/
132
  .html .markItUpEditor {
133
- background-image:url(images/bg-editor-html.png);
134
  }
135
  .markdown .markItUpEditor {
136
- background-image:url(images/bg-editor-markdown.png);
137
  }
138
  .textile .markItUpEditor {
139
- background-image:url(images/bg-editor-textile.png);
140
  }
141
  .bbcode .markItUpEditor {
142
- background-image:url(images/bg-editor-bbcode.png);
143
  }
144
  .wiki .markItUpEditor,
145
  .dotclear .markItUpEditor {
146
- background-image:url(images/bg-editor-wiki.png);
147
  }
148
 
149
  /* -------------------------------------------------------------------
57
  display:block;
58
  }
59
  .markItUpHeader ul .markItUpDropMenu {
60
+ /*background:transparent url(images/menu.png) no-repeat 115% 50%;*/
61
  margin-right:5px;
62
  }
63
  .markItUpHeader ul .markItUpDropMenu li {
88
  border-bottom:1px solid #3C769D;
89
  }
90
  .markItUpHeader ul ul .markItUpDropMenu {
91
+ /*background:#F5F5F5 url(images/submenu.png) no-repeat 100% 50%;*/
92
  }
93
  /* next rows of buttons */
94
  .markItUpHeader ul ul ul {
130
  }
131
  /***************************************************************************************/
132
  .html .markItUpEditor {
133
+ /*background-image:url(images/bg-editor-html.png);*/
134
  }
135
  .markdown .markItUpEditor {
136
+ /*background-image:url(images/bg-editor-markdown.png);*/
137
  }
138
  .textile .markItUpEditor {
139
+ /*background-image:url(images/bg-editor-textile.png);*/
140
  }
141
  .bbcode .markItUpEditor {
142
+ /*background-image:url(images/bg-editor-bbcode.png);*/
143
  }
144
  .wiki .markItUpEditor,
145
  .dotclear .markItUpEditor {
146
+ /*background-image:url(images/bg-editor-wiki.png);*/
147
  }
148
 
149
  /* -------------------------------------------------------------------
functions/gb-bbcode_emoji.php CHANGED
@@ -39,12 +39,13 @@ function gwolle_gb_bbcode_parse( $str ) {
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
  // Links with quotes.
47
- $bbcode_link_rel = apply_filters( 'gwolle_gb_bbcode_link_rel', 'nofollow' );
48
  $pattern = "#\[url href=\&\#034\;([^\]]*)\&\#034\;\]([^\[]*)\[/url\]#i";
49
  $replace = '<a href="\\1" target="_blank" rel="' . $bbcode_link_rel . '">\\2</a>';
50
  $str = preg_replace($pattern, $replace, $str);
39
  $str = preg_replace($bb, $html, $str);
40
 
41
  // First images, then links, so we support images inside links.
42
+ $bbcode_img_referrer = apply_filters( 'gwolle_gb_bbcode_img_referrer', 'no-referrer' );
43
  $pattern = "#\[img\]([^\[]*)\[/img\]#i";
44
+ $replace = '<img src="\\1" alt="" referrerpolicy="' . $bbcode_img_referrer . '" />';
45
  $str = preg_replace($pattern, $replace, $str);
46
 
47
  // Links with quotes.
48
+ $bbcode_link_rel = apply_filters( 'gwolle_gb_bbcode_link_rel', 'nofollow noopener noreferrer' );
49
  $pattern = "#\[url href=\&\#034\;([^\]]*)\&\#034\;\]([^\[]*)\[/url\]#i";
50
  $replace = '<a href="\\1" target="_blank" rel="' . $bbcode_link_rel . '">\\2</a>';
51
  $str = preg_replace($pattern, $replace, $str);
functions/gb-metabox.php CHANGED
@@ -20,7 +20,7 @@ function gwolle_gb_entry_metabox_lines_edit_link( $gb_metabox, $entry ) {
20
  if ( function_exists('current_user_can') && current_user_can('moderate_comments') ) {
21
  $gb_metabox .= '
22
  <div class="gb-metabox-line">
23
- <a class="gwolle_gb_edit_link gwolle-gb-edit-link" href="' . admin_url('admin.php?page=' . GWOLLE_GB_FOLDER . '/editor.php&amp;entry_id=' . $entry->get_id() ) . '" title="' . esc_attr__('Edit entry', 'gwolle-gb') . '">' . esc_html__('Edit', 'gwolle-gb') . '</a>
24
  </div>';
25
  }
26
  return $gb_metabox;
20
  if ( function_exists('current_user_can') && current_user_can('moderate_comments') ) {
21
  $gb_metabox .= '
22
  <div class="gb-metabox-line">
23
+ <a class="gwolle_gb_edit_link gwolle-gb-edit-link" href="' . admin_url('admin.php?page=' . GWOLLE_GB_FOLDER . '/editor.php&amp;entry_id=' . $entry->get_id() ) . '" title="' . esc_attr__('Edit entry', 'gwolle-gb') . '">' . esc_html__('Edit in Editor', 'gwolle-gb') . '</a>
24
  </div>';
25
  }
26
  return $gb_metabox;
functions/gb-user.php CHANGED
@@ -142,7 +142,8 @@ function gwolle_gb_get_author_name_html($entry) {
142
  // Link to Buddypress profile.
143
  $author_website = trim( bp_core_get_user_domain( $author_id ) );
144
  if ($author_website) {
145
- $author_name_html = '<a href="' . $author_website . '" target="_blank"
 
146
  title="' . /* translators: BuddyPress profile */ esc_attr__( 'Visit the profile of', 'gwolle-gb' ) . ' ' . $author_name . ': ' . $author_website . '">' . $author_name_html . '</a>';
147
  }
148
  } else if ( get_option('gwolle_gb-linkAuthorWebsite', 'true') === 'true' ) {
@@ -153,7 +154,7 @@ function gwolle_gb_get_author_name_html($entry) {
153
  if ( ! preg_match($pattern, $author_website, $matches) ) {
154
  $author_website = "http://" . $author_website;
155
  }
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
  }
142
  // Link to Buddypress profile.
143
  $author_website = trim( bp_core_get_user_domain( $author_id ) );
144
  if ($author_website) {
145
+ $author_link_rel = apply_filters( 'gwolle_gb_author_link_rel', 'nofollow noopener noreferrer' );
146
+ $author_name_html = '<a href="' . $author_website . '" target="_blank" rel="' . $author_link_rel . '"
147
  title="' . /* translators: BuddyPress profile */ esc_attr__( 'Visit the profile of', 'gwolle-gb' ) . ' ' . $author_name . ': ' . $author_website . '">' . $author_name_html . '</a>';
148
  }
149
  } else if ( get_option('gwolle_gb-linkAuthorWebsite', 'true') === 'true' ) {
154
  if ( ! preg_match($pattern, $author_website, $matches) ) {
155
  $author_website = "http://" . $author_website;
156
  }
157
+ $author_link_rel = apply_filters( 'gwolle_gb_author_link_rel', 'nofollow noopener noreferrer' );
158
  $author_name_html = '<a href="' . $author_website . '" target="_blank" rel="' . $author_link_rel . '"
159
  title="' . esc_attr__( 'Visit the website of', 'gwolle-gb' ) . ' ' . $author_name . ': ' . $author_website . '">' . $author_name_html . '</a>';
160
  }
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.1.6
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.1.6');
36
 
37
 
38
  /*
@@ -63,7 +63,9 @@ define('GWOLLE_GB_VER', '3.1.6');
63
  * - Use button for metabox control.
64
  * - Show InnoDB on debug tab (Azure is teh suxorz).
65
  * - Do not set meta_key when shortcode is used in widget.
66
- *
 
 
67
  */
68
 
69
 
3
  Plugin Name: Gwolle Guestbook
4
  Plugin URI: http://zenoweb.nl
5
  Description: Gwolle Guestbook is not just another guestbook for WordPress. The goal is to provide an easy and slim way to integrate a guestbook into your WordPress powered site. Don't use your 'comment' section the wrong way - install Gwolle Guestbook and have a real guestbook.
6
+ Version: 3.1.7
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.7');
36
 
37
 
38
  /*
63
  * - Use button for metabox control.
64
  * - Show InnoDB on debug tab (Azure is teh suxorz).
65
  * - Do not set meta_key when shortcode is used in widget.
66
+ * - fase out current_time:
67
+ * https://make.wordpress.org/core/2019/09/23/date-time-improvements-wp-5-3/
68
+ * - Support rewrite API for single entry.
69
  */
70
 
71
 
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.2
6
- Stable tag: 3.1.6
7
  License: GPLv2 or later
8
  Requires PHP: 5.3
9
 
@@ -82,6 +82,7 @@ Current features include:
82
  * Preview for the frontend form.
83
  * Preview for the admin editor form.
84
  * Admin reply on the frontend with AJAX.
 
85
  * Report Abuse.
86
  * Blacklist for words and IP address.
87
  * Easy String Replacement in the default text so you can make this guestbook into a review section or anything you want.
@@ -427,6 +428,15 @@ But if you don't use standard comments, you can just as easily use the comment s
427
 
428
  == Changelog ==
429
 
 
 
 
 
 
 
 
 
 
430
  = 3.1.6 =
431
  * 2019-08-21
432
  * Use wp_kses for filtering html elements.
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.3
6
+ Stable tag: 3.1.7
7
  License: GPLv2 or later
8
  Requires PHP: 5.3
9
 
82
  * Preview for the frontend form.
83
  * Preview for the admin editor form.
84
  * Admin reply on the frontend with AJAX.
85
+ * Edit content of entry on the frontend with AJAX.
86
  * Report Abuse.
87
  * Blacklist for words and IP address.
88
  * Easy String Replacement in the default text so you can make this guestbook into a review section or anything you want.
428
 
429
  == Changelog ==
430
 
431
+ = 3.1.7 =
432
+ * 2019-10-25
433
+ * Show subscription status for email notifications on settings page.
434
+ * Comment out unused images in markitup CSS.
435
+ * Set rel='nofollow noopener noreferrer' for bbcode links and user website.
436
+ * Set referrerpolicy='no-referrer' for bbcode images and avatar.
437
+ * Add filter 'gwolle_gb_bbcode_img_referrer'.
438
+ * Update strings for add-on.
439
+
440
  = 3.1.6 =
441
  * 2019-08-21
442
  * Use wp_kses for filtering html elements.