Gwolle Guestbook - Version 4.1.1

Version Description

  • 2021-03-01
  • Fix deprecated jQuery calls with WP 5.6 and jQuery 3.5.
  • Fix form submission when using http on a https website or viceversa.
Download this release

Release Info

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

Code changes from version 4.1.0 to 4.1.1

admin/gb-ajax-management.php CHANGED
@@ -27,7 +27,7 @@ function gwolle_gb_ajax_javascript() {
27
  jQuery( document ).ready( function( $ ) {
28
 
29
  // Page-entries.php Admin page Click events
30
- jQuery( '#gwolle_gb_entries .gwolle_gb_actions a' ).click(function(event) {
31
 
32
  // Do not do anything here...
33
  var parent_class = jQuery(this).parent().hasClass('gwolle_gb_edit');
@@ -66,8 +66,8 @@ function gwolle_gb_ajax_javascript() {
66
 
67
 
68
  // Do the actual request
69
- $.post( ajaxurl, data, function( response ) {
70
- response = jQuery.trim( response );
71
 
72
  // Set classes accordingly
73
  if ( response == setter ) { // We got what we wanted
@@ -141,7 +141,7 @@ function gwolle_gb_ajax_javascript() {
141
 
142
 
143
  // Page-editor.php Admin page Click events
144
- jQuery( '#gwolle_gb_editor .gwolle_gb_actions a' ).click(function(event) {
145
 
146
  // Do not do anything here...
147
  var parent_class = jQuery(this).parent().hasClass('gwolle_gb_ajax');
@@ -175,8 +175,8 @@ function gwolle_gb_ajax_javascript() {
175
 
176
 
177
  // Do the actual request
178
- $.post( ajaxurl, data, function( response ) {
179
- response = jQuery.trim( response );
180
 
181
  // Set classes accordingly
182
  if ( response == setter ) { // We got what we wanted
@@ -269,7 +269,7 @@ function gwolle_gb_ajax_javascript() {
269
 
270
 
271
  // Dashboard Widget Click events
272
- jQuery( '#gwolle_gb_dashboard .row-actions a' ).click(function(event) {
273
 
274
  // Do not do anything here...
275
  var parent_class = jQuery(this).parent().hasClass('gwolle_gb_edit');
@@ -305,8 +305,8 @@ function gwolle_gb_ajax_javascript() {
305
 
306
 
307
  // Do the actual request
308
- $.post( ajaxurl, data, function( response ) {
309
- response = jQuery.trim( response );
310
 
311
  if ( response == setter ) { // We got what we wanted
312
  // Remove entry from widget
27
  jQuery( document ).ready( function( $ ) {
28
 
29
  // Page-entries.php Admin page Click events
30
+ jQuery( '#gwolle_gb_entries .gwolle_gb_actions a' ).on( 'click', function(event) {
31
 
32
  // Do not do anything here...
33
  var parent_class = jQuery(this).parent().hasClass('gwolle_gb_edit');
66
 
67
 
68
  // Do the actual request
69
+ jQuery.post( ajaxurl, data, function( response ) {
70
+ response = response.trim();
71
 
72
  // Set classes accordingly
73
  if ( response == setter ) { // We got what we wanted
141
 
142
 
143
  // Page-editor.php Admin page Click events
144
+ jQuery( '#gwolle_gb_editor .gwolle_gb_actions a' ).on( 'click', function(event) {
145
 
146
  // Do not do anything here...
147
  var parent_class = jQuery(this).parent().hasClass('gwolle_gb_ajax');
175
 
176
 
177
  // Do the actual request
178
+ jQuery.post( ajaxurl, data, function( response ) {
179
+ response = response.trim();
180
 
181
  // Set classes accordingly
182
  if ( response == setter ) { // We got what we wanted
269
 
270
 
271
  // Dashboard Widget Click events
272
+ jQuery( '#gwolle_gb_dashboard .row-actions a' ).on( 'click', function(event) {
273
 
274
  // Do not do anything here...
275
  var parent_class = jQuery(this).parent().hasClass('gwolle_gb_edit');
305
 
306
 
307
  // Do the actual request
308
+ jQuery.post( ajaxurl, data, function( response ) {
309
+ response = response.trim();
310
 
311
  if ( response == setter ) { // We got what we wanted
312
  // Remove entry from widget
admin/js/gwolle-gb-admin.js CHANGED
@@ -9,12 +9,11 @@
9
  jQuery(document).ready(function($) {
10
  jQuery('#gwolle_gb_editor_postbox_preview').addClass('closed');
11
 
12
- jQuery('.gwolle_gb .postbox button.handlediv').click( function() {
13
  jQuery(this).closest('.postbox').toggleClass('closed');
14
  });
15
- });
16
- jQuery(document).ready(function($) {
17
- jQuery('.gwolle_gb .postbox h2').click( function() {
18
  jQuery(this).closest('.postbox').toggleClass('closed');
19
  });
20
  });
@@ -25,11 +24,11 @@ jQuery(document).ready(function($) {
25
  */
26
  jQuery(document).ready(function($) {
27
 
28
- jQuery("#gwolle_gb_entries input[name='check-all-top']").change(function() {
29
  gwolle_gb_toggleCheckboxes(jQuery("input[name='check-all-top']").is(":checked"));
30
  });
31
 
32
- jQuery("#gwolle_gb_entries input[name='check-all-bottom']").change(function() {
33
  gwolle_gb_toggleCheckboxes(jQuery("input[name='check-all-bottom']").is(":checked"));
34
  });
35
 
@@ -47,17 +46,17 @@ jQuery(document).ready(function($) {
47
 
48
  /* Edit metadata */
49
  jQuery(document).ready(function($) {
50
- jQuery('.gwolle_gb_edit_meta').click( function() {
51
  jQuery('.gwolle_gb_editor_meta_inputs').toggle();
52
  return false;
53
  });
54
 
55
- jQuery('.gwolle_gb_cancel_timestamp').click( function() {
56
  jQuery('.gwolle_gb_editor_meta_inputs').toggle();
57
  return false;
58
  });
59
 
60
- jQuery('.gwolle_gb_save_timestamp').click( function() {
61
 
62
  var dd = jQuery("#dd").val();
63
  var mm = jQuery("#mm").find(":selected").val();
@@ -106,14 +105,14 @@ jQuery(document).ready(function($) {
106
  /* Checking checkbox will enable the uninstall button */
107
  jQuery("input#gwolle_gb_uninstall_confirmed").prop("checked", false); // init
108
 
109
- jQuery("input#gwolle_gb_uninstall_confirmed").change(function() {
110
  var checked = jQuery( "input#gwolle_gb_uninstall_confirmed" ).prop('checked');
111
  if ( checked == true ) {
112
  jQuery("#gwolle_gb_uninstall").addClass( 'button-primary' );
113
- jQuery("#gwolle_gb_uninstall").removeAttr('disabled');
114
  } else {
115
  jQuery("#gwolle_gb_uninstall").removeClass( 'button-primary' );
116
- jQuery("#gwolle_gb_uninstall").attr('disabled', true);
117
  }
118
  });
119
 
@@ -128,14 +127,14 @@ jQuery(document).ready(function($) {
128
  /* Checking checkbox will enable the submit button for DMS import */
129
  jQuery("input#gwolle_gb_dmsguestbook").prop("checked", false); // init
130
 
131
- jQuery("input#gwolle_gb_dmsguestbook").change(function() {
132
  var checked = jQuery( "input#gwolle_gb_dmsguestbook" ).prop('checked');
133
  if ( checked == true ) {
134
  jQuery("#start_import_dms").addClass( 'button-primary' );
135
- jQuery("#start_import_dms").removeAttr('disabled');
136
  } else {
137
  jQuery("#start_import_dms").removeClass( 'button-primary' );
138
- jQuery("#start_import_dms").attr('disabled', true);
139
  }
140
  });
141
 
@@ -143,25 +142,25 @@ jQuery(document).ready(function($) {
143
  /* Checking radio-buttons will enable the submit button for Gwolle import */
144
  jQuery("input#gwolle_gb_importfrom").prop("checked", false); // init
145
 
146
- jQuery("input#gwolle_gb_importfrom").change(function() {
147
  if ( jQuery(this).val() ) {
148
  jQuery("#start_import_wp").addClass( 'button-primary' );
149
- jQuery("#start_import_wp").removeAttr('disabled');
150
  } else {
151
  jQuery("#start_import_wp").removeClass( 'button-primary' );
152
- jQuery("#start_import_wp").attr('disabled', true);
153
  }
154
  });
155
 
156
 
157
  /* Checking checkbox will enable the submit button for CSV-file */
158
- jQuery("input#start_import_gwolle_file").change(function() {
159
  if ( jQuery(this).val() ) {
160
  jQuery("#start_import_gwolle").addClass( 'button-primary' );
161
- jQuery("#start_import_gwolle").removeAttr('disabled');
162
  } else {
163
  jQuery("#start_import_gwolle").removeClass( 'button-primary' );
164
- jQuery("#start_import_gwolle").attr('disabled', true);
165
  }
166
  });
167
 
@@ -177,14 +176,14 @@ jQuery(document).ready(function($) {
177
  jQuery("input#start_export_enable").prop("checked", false); // init
178
  jQuery("#gwolle_gb_export_part").val( 1 ); // init
179
 
180
- jQuery("input#start_export_enable").change(function() {
181
  var checked = jQuery( "input#start_export_enable" ).prop('checked');
182
  if ( checked == true ) {
183
  jQuery("#gwolle_gb_start_export").addClass( 'button-primary' );
184
- jQuery("#gwolle_gb_start_export").removeAttr('disabled');
185
  } else {
186
  jQuery("#gwolle_gb_start_export").removeClass( 'button-primary' );
187
- jQuery("#gwolle_gb_start_export").attr('disabled', true);
188
  }
189
  });
190
 
@@ -192,16 +191,16 @@ jQuery(document).ready(function($) {
192
  /* Click Event, submit the form through AJAX and receive a CSV-file.
193
  * Will request multi part files, every 5 seconds to be easy on the webserver.
194
  */
195
- jQuery( 'input#gwolle_gb_start_export' ).click(function(event) {
196
 
197
- if ( jQuery("#gwolle_gb_start_export").attr('disabled') ) {
198
  // Not sure if this block is needed... Just in case.
199
  return;
200
  }
201
 
202
  // Reset for to initial state.
203
  jQuery( "#gwolle_gb_start_export" ).removeClass( 'button-primary' );
204
- jQuery( "#gwolle_gb_start_export" ).attr( 'disabled', true );
205
  jQuery( "input#start_export_enable" ).prop( 'checked', false );
206
  // Show that we are busy.
207
  jQuery( ".gwolle_gb_export_gif" ).css( 'visibility', 'visible' );
@@ -228,7 +227,7 @@ jQuery(document).ready(function($) {
228
  function() {
229
  jQuery("#gwolle_gb_export_part").val( part );
230
  var form = jQuery('form#gwolle_gb_export');
231
- form.submit();
232
  }, ( timeout )
233
  );
234
  }
@@ -244,14 +243,14 @@ jQuery(document).ready(function($) {
244
  /* Checking checkbox will enable the submit button */
245
  jQuery("input#start_export_user_enable").prop("checked", false); // init
246
 
247
- jQuery("input#start_export_user_enable").change(function() {
248
  var checked = jQuery( "input#start_export_user_enable" ).prop('checked');
249
  if ( checked == true ) {
250
  jQuery("#gwolle_gb_start_export_user").addClass( 'button-primary' );
251
- jQuery("#gwolle_gb_start_export_user").removeAttr('disabled');
252
  } else {
253
  jQuery("#gwolle_gb_start_export_user").removeClass( 'button-primary' );
254
- jQuery("#gwolle_gb_start_export_user").attr('disabled', true);
255
  }
256
  });
257
 
@@ -259,7 +258,7 @@ jQuery(document).ready(function($) {
259
  /* Click Event, submit the form through AJAX and receive a CSV-file.
260
  * Will request multi part files, every 5 seconds to be easy on the webserver.
261
  */
262
- jQuery( 'input#gwolle_gb_start_export_user' ).click(function(event) {
263
 
264
  if ( jQuery("#gwolle_gb_start_export_user").attr('disabled') ) {
265
  // Not sure if this block is needed... Just in case.
@@ -267,11 +266,11 @@ jQuery(document).ready(function($) {
267
  }
268
 
269
  var form = jQuery('form#gwolle_gb_export_user');
270
- form.submit();
271
 
272
  // Reset for to initial state.
273
  jQuery( "#gwolle_gb_start_export_user" ).removeClass( 'button-primary' );
274
- jQuery( "#gwolle_gb_start_export_user" ).attr( 'disabled', true );
275
  jQuery( "input#start_export_user_enable" ).prop( 'checked', false );
276
 
277
  event.preventDefault();
9
  jQuery(document).ready(function($) {
10
  jQuery('#gwolle_gb_editor_postbox_preview').addClass('closed');
11
 
12
+ jQuery('.gwolle_gb .postbox button.handlediv').on( 'click', function() {
13
  jQuery(this).closest('.postbox').toggleClass('closed');
14
  });
15
+
16
+ jQuery('.gwolle_gb .postbox h2').on( 'click', function() {
 
17
  jQuery(this).closest('.postbox').toggleClass('closed');
18
  });
19
  });
24
  */
25
  jQuery(document).ready(function($) {
26
 
27
+ jQuery("#gwolle_gb_entries input[name='check-all-top']").on('change', function() {
28
  gwolle_gb_toggleCheckboxes(jQuery("input[name='check-all-top']").is(":checked"));
29
  });
30
 
31
+ jQuery("#gwolle_gb_entries input[name='check-all-bottom']").on('change', function() {
32
  gwolle_gb_toggleCheckboxes(jQuery("input[name='check-all-bottom']").is(":checked"));
33
  });
34
 
46
 
47
  /* Edit metadata */
48
  jQuery(document).ready(function($) {
49
+ jQuery('.gwolle_gb_edit_meta').on( 'click', function() {
50
  jQuery('.gwolle_gb_editor_meta_inputs').toggle();
51
  return false;
52
  });
53
 
54
+ jQuery('.gwolle_gb_cancel_timestamp').on( 'click', function() {
55
  jQuery('.gwolle_gb_editor_meta_inputs').toggle();
56
  return false;
57
  });
58
 
59
+ jQuery('.gwolle_gb_save_timestamp').on( 'click', function() {
60
 
61
  var dd = jQuery("#dd").val();
62
  var mm = jQuery("#mm").find(":selected").val();
105
  /* Checking checkbox will enable the uninstall button */
106
  jQuery("input#gwolle_gb_uninstall_confirmed").prop("checked", false); // init
107
 
108
+ jQuery("input#gwolle_gb_uninstall_confirmed").on('change', function() {
109
  var checked = jQuery( "input#gwolle_gb_uninstall_confirmed" ).prop('checked');
110
  if ( checked == true ) {
111
  jQuery("#gwolle_gb_uninstall").addClass( 'button-primary' );
112
+ jQuery("#gwolle_gb_uninstall").prop('disabled', false);
113
  } else {
114
  jQuery("#gwolle_gb_uninstall").removeClass( 'button-primary' );
115
+ jQuery("#gwolle_gb_uninstall").prop('disabled', true);
116
  }
117
  });
118
 
127
  /* Checking checkbox will enable the submit button for DMS import */
128
  jQuery("input#gwolle_gb_dmsguestbook").prop("checked", false); // init
129
 
130
+ jQuery("input#gwolle_gb_dmsguestbook").on('change', function() {
131
  var checked = jQuery( "input#gwolle_gb_dmsguestbook" ).prop('checked');
132
  if ( checked == true ) {
133
  jQuery("#start_import_dms").addClass( 'button-primary' );
134
+ jQuery("#start_import_dms").prop('disabled', false);
135
  } else {
136
  jQuery("#start_import_dms").removeClass( 'button-primary' );
137
+ jQuery("#start_import_dms").prop('disabled', true);
138
  }
139
  });
140
 
142
  /* Checking radio-buttons will enable the submit button for Gwolle import */
143
  jQuery("input#gwolle_gb_importfrom").prop("checked", false); // init
144
 
145
+ jQuery("input#gwolle_gb_importfrom").on('change', function() {
146
  if ( jQuery(this).val() ) {
147
  jQuery("#start_import_wp").addClass( 'button-primary' );
148
+ jQuery("#start_import_wp").prop('disabled', false);
149
  } else {
150
  jQuery("#start_import_wp").removeClass( 'button-primary' );
151
+ jQuery("#start_import_wp").prop('disabled', true);
152
  }
153
  });
154
 
155
 
156
  /* Checking checkbox will enable the submit button for CSV-file */
157
+ jQuery("input#start_import_gwolle_file").on('change', function() {
158
  if ( jQuery(this).val() ) {
159
  jQuery("#start_import_gwolle").addClass( 'button-primary' );
160
+ jQuery("#start_import_gwolle").prop('disabled', false);
161
  } else {
162
  jQuery("#start_import_gwolle").removeClass( 'button-primary' );
163
+ jQuery("#start_import_gwolle").prop('disabled', true);
164
  }
165
  });
166
 
176
  jQuery("input#start_export_enable").prop("checked", false); // init
177
  jQuery("#gwolle_gb_export_part").val( 1 ); // init
178
 
179
+ jQuery("input#start_export_enable").on('change', function() {
180
  var checked = jQuery( "input#start_export_enable" ).prop('checked');
181
  if ( checked == true ) {
182
  jQuery("#gwolle_gb_start_export").addClass( 'button-primary' );
183
+ jQuery("#gwolle_gb_start_export").prop('disabled', false);
184
  } else {
185
  jQuery("#gwolle_gb_start_export").removeClass( 'button-primary' );
186
+ jQuery("#gwolle_gb_start_export").prop('disabled', true);
187
  }
188
  });
189
 
191
  /* Click Event, submit the form through AJAX and receive a CSV-file.
192
  * Will request multi part files, every 5 seconds to be easy on the webserver.
193
  */
194
+ jQuery( 'input#gwolle_gb_start_export' ).on( 'click', function(event) {
195
 
196
+ if ( jQuery("#gwolle_gb_start_export").prop('disabled') ) {
197
  // Not sure if this block is needed... Just in case.
198
  return;
199
  }
200
 
201
  // Reset for to initial state.
202
  jQuery( "#gwolle_gb_start_export" ).removeClass( 'button-primary' );
203
+ jQuery( "#gwolle_gb_start_export" ).prop( 'disabled', true );
204
  jQuery( "input#start_export_enable" ).prop( 'checked', false );
205
  // Show that we are busy.
206
  jQuery( ".gwolle_gb_export_gif" ).css( 'visibility', 'visible' );
227
  function() {
228
  jQuery("#gwolle_gb_export_part").val( part );
229
  var form = jQuery('form#gwolle_gb_export');
230
+ form.trigger('submit');
231
  }, ( timeout )
232
  );
233
  }
243
  /* Checking checkbox will enable the submit button */
244
  jQuery("input#start_export_user_enable").prop("checked", false); // init
245
 
246
+ jQuery("input#start_export_user_enable").on('change', function() {
247
  var checked = jQuery( "input#start_export_user_enable" ).prop('checked');
248
  if ( checked == true ) {
249
  jQuery("#gwolle_gb_start_export_user").addClass( 'button-primary' );
250
+ jQuery("#gwolle_gb_start_export_user").prop('disabled', false);
251
  } else {
252
  jQuery("#gwolle_gb_start_export_user").removeClass( 'button-primary' );
253
+ jQuery("#gwolle_gb_start_export_user").prop('disabled', true);
254
  }
255
  });
256
 
258
  /* Click Event, submit the form through AJAX and receive a CSV-file.
259
  * Will request multi part files, every 5 seconds to be easy on the webserver.
260
  */
261
+ jQuery( 'input#gwolle_gb_start_export_user' ).on( 'click', function(event) {
262
 
263
  if ( jQuery("#gwolle_gb_start_export_user").attr('disabled') ) {
264
  // Not sure if this block is needed... Just in case.
266
  }
267
 
268
  var form = jQuery('form#gwolle_gb_export_user');
269
+ form.trigger('submit');
270
 
271
  // Reset for to initial state.
272
  jQuery( "#gwolle_gb_start_export_user" ).removeClass( 'button-primary' );
273
+ jQuery( "#gwolle_gb_start_export_user" ).prop( 'disabled', true );
274
  jQuery( "input#start_export_user_enable" ).prop( 'checked', false );
275
 
276
  event.preventDefault();
frontend/js/gwolle-gb-frontend.js CHANGED
@@ -7,16 +7,15 @@
7
  * Event for clicking the button, and getting the form visible.
8
  */
9
  jQuery(document).ready(function($) {
10
- jQuery( "div.gwolle-gb-write-button input" ).click(function() {
11
  var main_div = jQuery( this ).closest( 'div.gwolle-gb' );
12
  jQuery("div.gwolle-gb-write-button", main_div).slideUp(1000);
13
  jQuery("form.gwolle-gb-write", main_div).slideDown(1000);
14
  return false;
15
  });
16
- });
17
- // And close it again.
18
- jQuery(document).ready(function($) {
19
- jQuery( "button.gb-notice-dismiss" ).click(function() {
20
  var main_div = jQuery( this ).closest( 'div.gwolle-gb' );
21
  jQuery("div.gwolle-gb-write-button", main_div).slideDown(1000);
22
  jQuery("form.gwolle-gb-write", main_div).slideUp(1000);
@@ -67,7 +66,7 @@ function gwolle_gb_metabox_handle() {
67
  jQuery('div.gb-metabox', entry_div).fadeToggle( 'fast', 'linear' );
68
  return false;
69
  });
70
- jQuery("div.gb-metabox-handle").keypress(function(e) {
71
  if (e.keyCode == 13) { // Enter key.
72
  var entry_div = jQuery(this).closest('div.gb-entry');
73
  jQuery('div.gb-metabox', entry_div).fadeToggle( 'fast', 'linear' );
@@ -206,7 +205,7 @@ var gwolle_gb_ajax_data = {
206
  };
207
 
208
  jQuery(document).ready(function($) {
209
- jQuery( '.gwolle_gb_form_ajax input.gwolle_gb_submit' ).click( function( submit_button ) {
210
  var main_div = jQuery( this ).closest( 'div.gwolle-gb' );
211
  jQuery( '.gwolle_gb_submit_ajax_icon', main_div ).css( 'display', 'inline' );
212
 
@@ -217,13 +216,13 @@ jQuery(document).ready(function($) {
217
  };
218
 
219
  jQuery('form.gwolle-gb-write input', main_div).each(function( index, value ) {
220
- var val = jQuery( this ).prop('value'); // For some reason, some hosts do not see any value here, and data does not get sent.
221
  var name = jQuery( this ).attr('name');
222
  var type = jQuery( this ).attr('type');
223
  if ( type == 'checkbox' ) {
224
  var checked = jQuery( this, main_div ).prop('checked');
225
  if ( checked == true ) {
226
- gwolle_gb_ajax_data[name] = 'on'; // Mimick standard post value.
227
  }
228
  } else if ( type == 'radio' ) {
229
  var checked = jQuery( this, main_div ).prop('checked');
7
  * Event for clicking the button, and getting the form visible.
8
  */
9
  jQuery(document).ready(function($) {
10
+ jQuery( "div.gwolle-gb-write-button input" ).on( 'click', function() {
11
  var main_div = jQuery( this ).closest( 'div.gwolle-gb' );
12
  jQuery("div.gwolle-gb-write-button", main_div).slideUp(1000);
13
  jQuery("form.gwolle-gb-write", main_div).slideDown(1000);
14
  return false;
15
  });
16
+
17
+ // And close it again.
18
+ jQuery( "button.gb-notice-dismiss" ).on( 'click', function() {
 
19
  var main_div = jQuery( this ).closest( 'div.gwolle-gb' );
20
  jQuery("div.gwolle-gb-write-button", main_div).slideDown(1000);
21
  jQuery("form.gwolle-gb-write", main_div).slideUp(1000);
66
  jQuery('div.gb-metabox', entry_div).fadeToggle( 'fast', 'linear' );
67
  return false;
68
  });
69
+ jQuery("div.gb-metabox-handle").on( 'keypress', function(e) {
70
  if (e.keyCode == 13) { // Enter key.
71
  var entry_div = jQuery(this).closest('div.gb-entry');
72
  jQuery('div.gb-metabox', entry_div).fadeToggle( 'fast', 'linear' );
205
  };
206
 
207
  jQuery(document).ready(function($) {
208
+ jQuery( '.gwolle_gb_form_ajax input.gwolle_gb_submit' ).on( 'click', function( submit_button ) {
209
  var main_div = jQuery( this ).closest( 'div.gwolle-gb' );
210
  jQuery( '.gwolle_gb_submit_ajax_icon', main_div ).css( 'display', 'inline' );
211
 
216
  };
217
 
218
  jQuery('form.gwolle-gb-write input', main_div).each(function( index, value ) {
219
+ var val = jQuery( this ).prop('value');
220
  var name = jQuery( this ).attr('name');
221
  var type = jQuery( this ).attr('type');
222
  if ( type == 'checkbox' ) {
223
  var checked = jQuery( this, main_div ).prop('checked');
224
  if ( checked == true ) {
225
+ gwolle_gb_ajax_data[name] = 'on'; // Mimick standard $_POST value.
226
  }
227
  } else if ( type == 'radio' ) {
228
  var checked = jQuery( this, main_div ).prop('checked');
frontend/js/sss/sss.js CHANGED
@@ -86,7 +86,7 @@ $.fn.sss = function(options) {
86
 
87
  $(window).on('load', function() {
88
 
89
- slider.css({paddingBottom: get_height(target)}).click(function(e) {
90
  clicked = $(e.target);
91
  if (clicked.is(next)) {
92
  next_slide()
@@ -97,7 +97,7 @@ $.fn.sss = function(options) {
97
 
98
  animate_slide(target);
99
 
100
- $(document).keydown(function(e) {
101
  key = e.keyCode;
102
  if (key === 39) {
103
  next_slide()
@@ -106,13 +106,13 @@ $.fn.sss = function(options) {
106
  }
107
  });
108
 
109
- $( wrapper ).hover(
110
- function() {
111
- $( wrapper ).addClass( 'sss-hover' );
112
- }, function() {
113
- $( wrapper ).removeClass( 'sss-hover' );
114
- }
115
- );
116
 
117
  });
118
  // End
86
 
87
  $(window).on('load', function() {
88
 
89
+ slider.css({paddingBottom: get_height(target)}).on('click',function(e) {
90
  clicked = $(e.target);
91
  if (clicked.is(next)) {
92
  next_slide()
97
 
98
  animate_slide(target);
99
 
100
+ $(document).on('keydown', function(e) {
101
  key = e.keyCode;
102
  if (key === 39) {
103
  next_slide()
106
  }
107
  });
108
 
109
+ $( wrapper ).on('mouseenter', function() {
110
+ $( wrapper ).addClass( 'sss-hover' );
111
+ });
112
+
113
+ $( wrapper ).on('mouseleave', function() {
114
+ $( wrapper ).removeClass( 'sss-hover' );
115
+ });
116
 
117
  });
118
  // End
frontend/markitup/jquery.markitup.js CHANGED
@@ -158,26 +158,26 @@
158
  if (options.resizeHandle === true && browser.safari !== true) {
159
  resizeHandle = jQuery('<div class="markItUpResizeHandle"></div>')
160
  .insertAfter(jQueryjQuery)
161
- .bind("mousedown.markItUp", function(e) {
162
  var h = jQueryjQuery.height(), y = e.clientY, mouseMove, mouseUp;
163
  mouseMove = function(e) {
164
  jQueryjQuery.css("height", Math.max(20, e.clientY+h-y)+"px");
165
  return false;
166
  };
167
  mouseUp = function(e) {
168
- jQuery("html").unbind("mousemove.markItUp", mouseMove).unbind("mouseup.markItUp", mouseUp);
169
  return false;
170
  };
171
- jQuery("html").bind("mousemove.markItUp", mouseMove).bind("mouseup.markItUp", mouseUp);
172
  });
173
  footer.append(resizeHandle);
174
  }
175
 
176
  // listen key events
177
- jQueryjQuery.bind('keydown.markItUp', keyPressed).bind('keyup', keyPressed);
178
 
179
  // bind an event to catch external calls
180
- jQueryjQuery.bind("insertion.markItUp", function(e, settings) {
181
  if (settings.target !== false) {
182
  get();
183
  }
@@ -187,7 +187,7 @@
187
  });
188
 
189
  // remember the last focus
190
- jQueryjQuery.bind('focus.markItUp', function() {
191
  jQuery.markItUp.focused = this;
192
  });
193
 
@@ -212,25 +212,25 @@
212
  t += levels[j]+"-";
213
  }
214
  li = jQuery('<li class="markItUpButton markItUpButton'+t+(i)+' '+(button.className||'')+'"><a href="" '+key+' title="'+title+'">'+(button.name||'')+'</a></li>')
215
- .bind("contextmenu.markItUp", function() { // prevent contextmenu on mac and allow ctrl+click
216
  return false;
217
- }).bind('click.markItUp', function(e) {
218
  e.preventDefault();
219
- }).bind("focusin.markItUp", function(){
220
- jQueryjQuery.focus();
221
- }).bind('mouseup', function() {
222
  if (button.call) {
223
  eval(button.call)();
224
  }
225
  setTimeout(function() { markup(button) },1);
226
  return false;
227
- }).bind('mouseenter.markItUp', function() {
228
  jQuery('> ul', this).show();
229
- jQuery(document).one('click', function() { // close dropmenu if click outside
230
  jQuery('ul ul', header).hide();
231
  }
232
  );
233
- }).bind('mouseleave.markItUp', function() {
234
  jQuery('> ul', this).hide();
235
  }).appendTo(ul);
236
  if (button.dropMenu) {
@@ -278,7 +278,7 @@
278
 
279
  // prepare action
280
  function prepare(action) {
281
- if (jQuery.isFunction(action)) {
282
  action = action(hash);
283
  }
284
  return magicMarkups(action);
@@ -358,7 +358,8 @@
358
  if ((ctrlKey === true && shiftKey === true)) {
359
  lines = selection.split(/\r?\n/);
360
  for (j = 0, n = lines.length, i = 0; i < n; i++) {
361
- if (jQuery.trim(lines[i]) !== '') {
 
362
  jQuery.extend(hash, { line:++j, selection:lines[i] } );
363
  lines[i] = build(lines[i]).block;
364
  } else {
@@ -526,7 +527,7 @@
526
  refreshPreview();
527
  }
528
  if (options.previewInWindow) {
529
- previewWindow.focus();
530
  }
531
  }
532
 
@@ -634,7 +635,7 @@
634
  }
635
 
636
  function remove() {
637
- jQueryjQuery.unbind(".markItUp").removeClass('markItUpEditor');
638
  jQueryjQuery.parent('div').parent('div.markItUp').parent('div').replaceWith(jQueryjQuery);
639
  jQueryjQuery.data('markItUp', null);
640
  }
@@ -655,7 +656,7 @@
655
  jQuery.extend(options, settings);
656
  if (options.target) {
657
  return jQuery(options.target).each(function() {
658
- jQuery(this).focus();
659
  jQuery(this).trigger('insertion', [options]);
660
  });
661
  } else {
@@ -700,7 +701,7 @@ jQuery(document).ready(function() {
700
 
701
 
702
  /* Slide the Emoji rows (frontend) */
703
- jQuery( '.gwolle-gb-write li.markItUpButton.emoji a' ).click(function() {
704
  var form = jQuery(this).closest('form.gwolle-gb-write');
705
  if ( jQuery('.gwolle_gb_emoji').css('display') == 'none' ) {
706
  jQuery('.gwolle_gb_emoji', form).slideDown("slow");
@@ -709,7 +710,7 @@ jQuery(document).ready(function() {
709
  }
710
  });
711
  /* Slide the Emoji rows (main editor) */
712
- jQuery( '#markItUpGwolle_gb_content li.markItUpButton.emoji a' ).click(function() {
713
  if ( jQuery('.gwolle_gb_emoji').css('display') == 'none' ) {
714
  jQuery('.gwolle_gb_emoji').slideDown("slow");
715
  } else {
@@ -717,7 +718,7 @@ jQuery(document).ready(function() {
717
  }
718
  });
719
  /* Slide the Emoji rows (admin_reply editor) */
720
- jQuery( '#markItUpGwolle_gb_admin_reply li.markItUpButton.emoji a' ).click(function() {
721
  if ( jQuery('.gwolle_gb_admin_reply_emoji').css('display') == 'none' ) {
722
  jQuery('.gwolle_gb_admin_reply_emoji').slideDown("slow");
723
  } else {
@@ -727,19 +728,19 @@ jQuery(document).ready(function() {
727
 
728
 
729
  /* Insert the Emoji symbol (frontend) */
730
- jQuery('.gwolle_gb_emoji a').click(function() {
731
  var form = jQuery(this).closest('form.gwolle-gb-write');
732
  var target = jQuery('.gwolle_gb_content', form);
733
  emoticon = jQuery(this).attr("title");
734
  jQuery.markItUp( { target:target, replaceWith:emoticon } );
735
  });
736
  /* Insert the Emoji symbol (main editor) */
737
- jQuery('.gwolle_gb_emoji a').click(function() {
738
  emoticon = jQuery(this).attr("title");
739
  jQuery.markItUp( { target:'#gwolle_gb_content', replaceWith:emoticon } );
740
  });
741
  /* Insert the Emoji symbol (admin_reply editor) */
742
- jQuery('.gwolle_gb_admin_reply_emoji a').click(function() {
743
  emoticon = jQuery(this).attr("title");
744
  jQuery.markItUp( { target:'#gwolle_gb_admin_reply', replaceWith:emoticon } );
745
  });
158
  if (options.resizeHandle === true && browser.safari !== true) {
159
  resizeHandle = jQuery('<div class="markItUpResizeHandle"></div>')
160
  .insertAfter(jQueryjQuery)
161
+ .on("mousedown.markItUp", function(e) {
162
  var h = jQueryjQuery.height(), y = e.clientY, mouseMove, mouseUp;
163
  mouseMove = function(e) {
164
  jQueryjQuery.css("height", Math.max(20, e.clientY+h-y)+"px");
165
  return false;
166
  };
167
  mouseUp = function(e) {
168
+ jQuery("html").off("mousemove.markItUp", mouseMove).off("mouseup.markItUp", mouseUp);
169
  return false;
170
  };
171
+ jQuery("html").on("mousemove.markItUp", mouseMove).on("mouseup.markItUp", mouseUp);
172
  });
173
  footer.append(resizeHandle);
174
  }
175
 
176
  // listen key events
177
+ jQueryjQuery.on('keydown.markItUp', keyPressed).on('keyup', keyPressed);
178
 
179
  // bind an event to catch external calls
180
+ jQueryjQuery.on("insertion.markItUp", function(e, settings) {
181
  if (settings.target !== false) {
182
  get();
183
  }
187
  });
188
 
189
  // remember the last focus
190
+ jQueryjQuery.on('focus.markItUp', function() {
191
  jQuery.markItUp.focused = this;
192
  });
193
 
212
  t += levels[j]+"-";
213
  }
214
  li = jQuery('<li class="markItUpButton markItUpButton'+t+(i)+' '+(button.className||'')+'"><a href="" '+key+' title="'+title+'">'+(button.name||'')+'</a></li>')
215
+ .on("contextmenu.markItUp", function() { // prevent contextmenu on mac and allow ctrl+click
216
  return false;
217
+ }).on('click.markItUp', function(e) {
218
  e.preventDefault();
219
+ }).on("focusin.markItUp", function(){
220
+ jQueryjQuery.trigger('focus');
221
+ }).on('mouseup', function() {
222
  if (button.call) {
223
  eval(button.call)();
224
  }
225
  setTimeout(function() { markup(button) },1);
226
  return false;
227
+ }).on('mouseenter.markItUp', function() {
228
  jQuery('> ul', this).show();
229
+ jQuery(document).on('click', function() { // close dropmenu if click outside
230
  jQuery('ul ul', header).hide();
231
  }
232
  );
233
+ }).on('mouseleave.markItUp', function() {
234
  jQuery('> ul', this).hide();
235
  }).appendTo(ul);
236
  if (button.dropMenu) {
278
 
279
  // prepare action
280
  function prepare(action) {
281
+ if (typeof action === 'function') {
282
  action = action(hash);
283
  }
284
  return magicMarkups(action);
358
  if ((ctrlKey === true && shiftKey === true)) {
359
  lines = selection.split(/\r?\n/);
360
  for (j = 0, n = lines.length, i = 0; i < n; i++) {
361
+ var str_line = lines[i];
362
+ if (str_line.trim() !== '') {
363
  jQuery.extend(hash, { line:++j, selection:lines[i] } );
364
  lines[i] = build(lines[i]).block;
365
  } else {
527
  refreshPreview();
528
  }
529
  if (options.previewInWindow) {
530
+ previewWindow.trigger('focus');
531
  }
532
  }
533
 
635
  }
636
 
637
  function remove() {
638
+ jQueryjQuery.off(".markItUp").removeClass('markItUpEditor');
639
  jQueryjQuery.parent('div').parent('div.markItUp').parent('div').replaceWith(jQueryjQuery);
640
  jQueryjQuery.data('markItUp', null);
641
  }
656
  jQuery.extend(options, settings);
657
  if (options.target) {
658
  return jQuery(options.target).each(function() {
659
+ jQuery(this).trigger('focus');
660
  jQuery(this).trigger('insertion', [options]);
661
  });
662
  } else {
701
 
702
 
703
  /* Slide the Emoji rows (frontend) */
704
+ jQuery( '.gwolle-gb-write li.markItUpButton.emoji a' ).on( 'click', function() {
705
  var form = jQuery(this).closest('form.gwolle-gb-write');
706
  if ( jQuery('.gwolle_gb_emoji').css('display') == 'none' ) {
707
  jQuery('.gwolle_gb_emoji', form).slideDown("slow");
710
  }
711
  });
712
  /* Slide the Emoji rows (main editor) */
713
+ jQuery( '#markItUpGwolle_gb_content li.markItUpButton.emoji a' ).on( 'click', function() {
714
  if ( jQuery('.gwolle_gb_emoji').css('display') == 'none' ) {
715
  jQuery('.gwolle_gb_emoji').slideDown("slow");
716
  } else {
718
  }
719
  });
720
  /* Slide the Emoji rows (admin_reply editor) */
721
+ jQuery( '#markItUpGwolle_gb_admin_reply li.markItUpButton.emoji a' ).on( 'click', function() {
722
  if ( jQuery('.gwolle_gb_admin_reply_emoji').css('display') == 'none' ) {
723
  jQuery('.gwolle_gb_admin_reply_emoji').slideDown("slow");
724
  } else {
728
 
729
 
730
  /* Insert the Emoji symbol (frontend) */
731
+ jQuery('.gwolle_gb_emoji a').on( 'click', function() {
732
  var form = jQuery(this).closest('form.gwolle-gb-write');
733
  var target = jQuery('.gwolle_gb_content', form);
734
  emoticon = jQuery(this).attr("title");
735
  jQuery.markItUp( { target:target, replaceWith:emoticon } );
736
  });
737
  /* Insert the Emoji symbol (main editor) */
738
+ jQuery('.gwolle_gb_emoji a').on( 'click', function() {
739
  emoticon = jQuery(this).attr("title");
740
  jQuery.markItUp( { target:'#gwolle_gb_content', replaceWith:emoticon } );
741
  });
742
  /* Insert the Emoji symbol (admin_reply editor) */
743
+ jQuery('.gwolle_gb_admin_reply_emoji a').on( 'click', function() {
744
  emoticon = jQuery(this).attr("title");
745
  jQuery.markItUp( { target:'#gwolle_gb_admin_reply', replaceWith:emoticon } );
746
  });
functions/gb-fields.php CHANGED
@@ -21,7 +21,9 @@ function gwolle_gb_get_field_name( $field ) {
21
  return 'gwolle_gb_' . $field;
22
  }
23
 
24
- $blog_url = get_bloginfo('wpurl');
 
 
25
  $key = 'gwolle_gb_' . $field . '_field_name_' . $blog_url;
26
  $field_name = wp_hash( $key, 'auth' );
27
  $field_name = 'gwolle_gb_' . $field_name;
21
  return 'gwolle_gb_' . $field;
22
  }
23
 
24
+ $blog_url = get_option( 'siteurl' );
25
+ // $blog_url = get_bloginfo('wpurl'); // Will be different depending on scheme (http/https).
26
+
27
  $key = 'gwolle_gb_' . $field . '_field_name_' . $blog_url;
28
  $field_name = wp_hash( $key, 'auth' );
29
  $field_name = 'gwolle_gb_' . $field_name;
gwolle-gb.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Gwolle Guestbook
4
  Plugin URI: https://wordpress.org/plugins/gwolle-gb/
5
  Description: Gwolle Guestbook is not just another guestbook for WordPress. The goal is to provide an easy and slim way to integrate a guestbook into your WordPress powered site. Don't use your 'comment' section the wrong way - install Gwolle Guestbook and have a real guestbook.
6
- Version: 4.1.0
7
  Author: Marcel Pol
8
  Author URI: https://zenoweb.nl
9
  License: GPLv2 or later
@@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31
 
32
 
33
  // Plugin Version
34
- define('GWOLLE_GB_VER', '4.1.0');
35
 
36
 
37
  /*
3
  Plugin Name: Gwolle Guestbook
4
  Plugin URI: https://wordpress.org/plugins/gwolle-gb/
5
  Description: Gwolle Guestbook is not just another guestbook for WordPress. The goal is to provide an easy and slim way to integrate a guestbook into your WordPress powered site. Don't use your 'comment' section the wrong way - install Gwolle Guestbook and have a real guestbook.
6
+ Version: 4.1.1
7
  Author: Marcel Pol
8
  Author URI: https://zenoweb.nl
9
  License: GPLv2 or later
31
 
32
 
33
  // Plugin Version
34
+ define('GWOLLE_GB_VER', '4.1.1');
35
 
36
 
37
  /*
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: Gwolle, mpol
3
  Tags: guestbook, guest book, livre d'or, Gästebuch, review
4
  Requires at least: 3.7
5
- Tested up to: 5.6
6
- Stable tag: 4.1.0
7
  License: GPLv2 or later
8
  Requires PHP: 5.3
9
 
@@ -424,6 +424,11 @@ But if you don't use standard comments, you can just as easily use the comment s
424
 
425
  == Changelog ==
426
 
 
 
 
 
 
427
  = 4.1.0 =
428
  * 2021-01-27
429
  * Add notification email on moderation.
@@ -491,7 +496,6 @@ But if you don't use standard comments, you can just as easily use the comment s
491
  * Set timestamp in editor to hidden again.
492
  * Make some CSS more specific.
493
 
494
-
495
  = 4.0.0 =
496
  * 2020-04-28
497
  * Many CSS ids and classes have changed, please review your custom CSS.
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.7
6
+ Stable tag: 4.1.1
7
  License: GPLv2 or later
8
  Requires PHP: 5.3
9
 
424
 
425
  == Changelog ==
426
 
427
+ = 4.1.1 =
428
+ * 2021-03-01
429
+ * Fix deprecated jQuery calls with WP 5.6 and jQuery 3.5.
430
+ * Fix form submission when using http on a https website or viceversa.
431
+
432
  = 4.1.0 =
433
  * 2021-01-27
434
  * Add notification email on moderation.
496
  * Set timestamp in editor to hidden again.
497
  * Make some CSS more specific.
498
 
 
499
  = 4.0.0 =
500
  * 2020-04-28
501
  * Many CSS ids and classes have changed, please review your custom CSS.