Restaurant Reservations - Version 2.4.13

Version Description

(2022-02-09) = - Updated escaping and sanitizing. - Fixed an issue with checkbox type custom fields not saving/displaying correctly. - Updated a condition that, in one case, incorrectly displayed a message that the deposit payment would be held.

Download this release

Release Info

Developer Rustaurius
Plugin Icon 128x128 Restaurant Reservations
Version 2.4.13
Comparing to
See all releases

Code changes from version 2.4.12 to 2.4.13

includes/Addons.class.php CHANGED
@@ -48,7 +48,7 @@ class rtbAddons {
48
  <?php do_action( 'rtb_addons_pre' ); ?>
49
  <div class="rtb-addons">
50
  <div class="addon addon-custom-fields">
51
- <a href="https://themeofthecrop.com/plugins/restaurant-reservations/custom-fields/<?php echo $url_params; ?>">
52
  <img src="<?php echo RTB_PLUGIN_URL . '/assets/img/custom-fields.png'; ?>">
53
  </a>
54
  <h3><?php esc_html_e( 'Custom Fields', 'restaurant-reservations' ); ?></h3>
@@ -57,14 +57,14 @@ class rtbAddons {
57
  <?php esc_html_e( 'Plan your dinner service better by asking for special seating requests, dietary needs and more when customers book online.', 'restaurant-reservations' ); ?>
58
  </div>
59
  <div class="action">
60
- <a href="https://themeofthecrop.com/plugins/restaurant-reservations/custom-fields/<?php echo $url_params; ?>" class="button button-primary" target="_blank">
61
  <?php esc_html_e( 'Learn More', 'restaurant-reservations' ); ?>
62
  </a>
63
  </div>
64
  </div>
65
  </div>
66
  <div class="addon addon-export-bookings">
67
- <a href="https://themeofthecrop.com/plugins/restaurant-reservations/export-bookings/<?php echo $url_params; ?>">
68
  <img src="<?php echo RTB_PLUGIN_URL . '/assets/img/export-bookings.png'; ?>">
69
  </a>
70
  <h3><?php esc_html_e( 'Export Bookings', 'restaurant-reservations' ); ?></h3>
@@ -73,14 +73,14 @@ class rtbAddons {
73
  <?php esc_html_e( 'Easily print your bookings in a PDF or export them to an Excel/CSV file so you can analyze patterns, cull customer data and import bookings into other services.', 'restaurant-reservations' ); ?>
74
  </div>
75
  <div class="action">
76
- <a href="https://themeofthecrop.com/plugins/restaurant-reservations/export-bookings/<?php echo $url_params; ?>" class="button button-primary" target="_blank">
77
  <?php esc_html_e( 'Learn More', 'restaurant-reservations' ); ?>
78
  </a>
79
  </div>
80
  </div>
81
  </div>
82
  <div class="addon addon-email-templates">
83
- <a href="https://themeofthecrop.com/plugins/restaurant-reservations/email-templates/<?php echo $url_params; ?>">
84
  <img src="<?php echo RTB_PLUGIN_URL . '/assets/img/email-templates.png'; ?>">
85
  </a>
86
  <h3><?php esc_html_e( 'Email Templates', 'restaurant-reservations' ); ?></h3>
@@ -89,14 +89,14 @@ class rtbAddons {
89
  <?php esc_html_e( 'Send beautiful email notifications with your own logo and brand colors when your customers make a reservation.', 'restaurant-reservations' ); ?>
90
  </div>
91
  <div class="action">
92
- <a href="https://themeofthecrop.com/plugins/restaurant-reservations/email-templates/<?php echo $url_params; ?>" class="button button-primary" target="_blank">
93
  <?php esc_html_e( 'Learn More', 'restaurant-reservations' ); ?>
94
  </a>
95
  </div>
96
  </div>
97
  </div>
98
  <div class="addon addon-mailchimp">
99
- <a href="https://themeofthecrop.com/plugins/restaurant-reservations/mailchimp/<?php echo $url_params; ?>">
100
  <img src="<?php echo RTB_PLUGIN_URL . '/assets/img/mailchimp.png'; ?>">
101
  </a>
102
  <h3><?php esc_html_e( 'MailChimp', 'restaurant-reservations' ); ?></h3>
@@ -105,7 +105,7 @@ class rtbAddons {
105
  <?php esc_html_e( 'Subscribe requests to your MailChimp mailing list and watch your subscription rates grow effortlessly.', 'restaurant-reservations' ); ?>
106
  </div>
107
  <div class="action">
108
- <a href="https://themeofthecrop.com/plugins/restaurant-reservations/mailchimp/<?php echo $url_params; ?>" class="button button-primary" target="_blank">
109
  <?php esc_html_e( 'Learn More', 'restaurant-reservations' ); ?>
110
  </a>
111
  </div>
@@ -116,7 +116,7 @@ class rtbAddons {
116
  <p>The following restaurant themes integrate beautifully with Restaurant Reservations, providing a clean, stylized booking form that matches your site's design.</p>
117
  <div class="rtb-addons">
118
  <div class="addon addon-themes">
119
- <a href="https://themeofthecrop.com/themes/augustan<?php echo $url_params; ?>">
120
  <img src="<?php echo RTB_PLUGIN_URL . '/assets/img/theme-augustan.jpg'; ?>">
121
  </a>
122
  <h3><?php esc_html_e( 'Augustan', 'restaurant-reservations' ); ?></h3>
@@ -125,17 +125,17 @@ class rtbAddons {
125
  <?php esc_html_e( 'A traditionally elegant theme for high-class restaurants, with simple setup and powerful features.', 'restaurant-reservations' ); ?>
126
  </div>
127
  <div class="action">
128
- <a href="https://themeofthecrop.com/themes/augustan<?php echo $url_params; ?>" class="button" target="_blank">
129
  <?php esc_html_e( 'View Theme', 'restaurant-reservations' ); ?>
130
  </a>
131
  <span class="rtb-by">
132
- by <a href="https://themeofthecrop.com/<?php echo $url_params; ?>">Theme of the Crop</a>
133
  </span>
134
  </div>
135
  </div>
136
  </div>
137
  <div class="addon addon-themes">
138
- <a href="https://themeofthecrop.com/themes/luigi<?php echo $url_params; ?>">
139
  <img src="<?php echo RTB_PLUGIN_URL . '/assets/img/theme-luigi.jpg'; ?>">
140
  </a>
141
  <h3><?php esc_html_e( 'Luigi', 'restaurant-reservations' ); ?></h3>
@@ -144,17 +144,17 @@ class rtbAddons {
144
  <?php esc_html_e( 'A smart theme for upscale bistros and fine Italian restaurants. Get up and running quickly.', 'restaurant-reservations' ); ?>
145
  </div>
146
  <div class="action">
147
- <a href="https://themeofthecrop.com/themes/luigi<?php echo $url_params; ?>" class="button" target="_blank">
148
  <?php esc_html_e( 'View Theme', 'restaurant-reservations' ); ?>
149
  </a>
150
  <span class="rtb-by">
151
- by <a href="https://themeofthecrop.com/<?php echo $url_params; ?>">Theme of the Crop</a>
152
  </span>
153
  </div>
154
  </div>
155
  </div>
156
  <div class="addon addon-themes">
157
- <a href="https://themeofthecrop.com/themes/the-spot<?php echo $url_params; ?>">
158
  <img src="<?php echo RTB_PLUGIN_URL . '/assets/img/theme-the-spot.jpg'; ?>">
159
  </a>
160
  <h3><?php esc_html_e( 'The Spot', 'restaurant-reservations' ); ?></h3>
@@ -163,17 +163,17 @@ class rtbAddons {
163
  <?php esc_html_e( 'A vibrant theme for bars, pubs and destination restaurants with an attention-grabbing homepage.', 'restaurant-reservations' ); ?>
164
  </div>
165
  <div class="action">
166
- <a href="https://themeofthecrop.com/themes/the-spot<?php echo $url_params; ?>" class="button" target="_blank">
167
  <?php esc_html_e( 'View Theme', 'restaurant-reservations' ); ?>
168
  </a>
169
  <span class="rtb-by">
170
- by <a href="https://themeofthecrop.com/<?php echo $url_params; ?>">Theme of the Crop</a>
171
  </span>
172
  </div>
173
  </div>
174
  </div>
175
  <div class="addon addon-themes">
176
- <a href="https://themeofthecrop.com/themes/plate-up<?php echo $url_params; ?>">
177
  <img src="<?php echo RTB_PLUGIN_URL . '/assets/img/theme-plate-up.jpg'; ?>">
178
  </a>
179
  <h3><?php esc_html_e( 'Plate Up', 'restaurant-reservations' ); ?></h3>
@@ -182,11 +182,11 @@ class rtbAddons {
182
  <?php esc_html_e( 'A refined theme for sophisticated, modern restaurants to drive customers to your booking form.', 'restaurant-reservations' ); ?>
183
  </div>
184
  <div class="action">
185
- <a href="https://themeofthecrop.com/themes/plate-up<?php echo $url_params; ?>" class="button" target="_blank">
186
  <?php esc_html_e( 'View Theme', 'restaurant-reservations' ); ?>
187
  </a>
188
  <span class="rtb-by">
189
- by <a href="https://themeofthecrop.com/<?php echo $url_params; ?>">Theme of the Crop</a>
190
  </span>
191
  </div>
192
  </div>
@@ -332,7 +332,7 @@ class rtbAddons {
332
  }
333
 
334
  /**
335
- * Add a prompt for users to subscribe to the Theme of the Crop mailing list
336
  * below the addons list.
337
  *
338
  * @since 0.1
@@ -344,12 +344,12 @@ class rtbAddons {
344
  <p>
345
  <?php
346
  echo sprintf(
347
- esc_html_x( 'Find out when new addons are available by subscribing to the %smonthly newsletter%s, liking %sTheme of the Crop%s on Facebook, or following %sTheme of the Crop%s on Twitter.', 'restaurant-reservations' ),
348
- '<a target="_blank" href="https://themeofthecrop.com/about/mailing-list/?utm_source=Plugin&utm_medium=Addon%20List&utm_campaign=Restaurant%20Reservations">',
349
  '</a>',
350
- '<a target="_blank" href="https://www.facebook.com/themeofthecrop/">',
351
  '</a>',
352
- '<a target="_blank" href="http://twitter.com/themeofthecrop">',
353
  '</a>'
354
  );
355
  ?>
48
  <?php do_action( 'rtb_addons_pre' ); ?>
49
  <div class="rtb-addons">
50
  <div class="addon addon-custom-fields">
51
+ <a href="https://www.fivestarplugins.com/plugins/five-star-restaurant-reservations/">
52
  <img src="<?php echo RTB_PLUGIN_URL . '/assets/img/custom-fields.png'; ?>">
53
  </a>
54
  <h3><?php esc_html_e( 'Custom Fields', 'restaurant-reservations' ); ?></h3>
57
  <?php esc_html_e( 'Plan your dinner service better by asking for special seating requests, dietary needs and more when customers book online.', 'restaurant-reservations' ); ?>
58
  </div>
59
  <div class="action">
60
+ <a href="https://www.fivestarplugins.com/plugins/five-star-restaurant-reservations/" class="button button-primary" target="_blank">
61
  <?php esc_html_e( 'Learn More', 'restaurant-reservations' ); ?>
62
  </a>
63
  </div>
64
  </div>
65
  </div>
66
  <div class="addon addon-export-bookings">
67
+ <a href="https://www.fivestarplugins.com/plugins/five-star-restaurant-reservations/">
68
  <img src="<?php echo RTB_PLUGIN_URL . '/assets/img/export-bookings.png'; ?>">
69
  </a>
70
  <h3><?php esc_html_e( 'Export Bookings', 'restaurant-reservations' ); ?></h3>
73
  <?php esc_html_e( 'Easily print your bookings in a PDF or export them to an Excel/CSV file so you can analyze patterns, cull customer data and import bookings into other services.', 'restaurant-reservations' ); ?>
74
  </div>
75
  <div class="action">
76
+ <a href="https://www.fivestarplugins.com/plugins/five-star-restaurant-reservations/" class="button button-primary" target="_blank">
77
  <?php esc_html_e( 'Learn More', 'restaurant-reservations' ); ?>
78
  </a>
79
  </div>
80
  </div>
81
  </div>
82
  <div class="addon addon-email-templates">
83
+ <a href="https://www.fivestarplugins.com/plugins/five-star-restaurant-reservations/">
84
  <img src="<?php echo RTB_PLUGIN_URL . '/assets/img/email-templates.png'; ?>">
85
  </a>
86
  <h3><?php esc_html_e( 'Email Templates', 'restaurant-reservations' ); ?></h3>
89
  <?php esc_html_e( 'Send beautiful email notifications with your own logo and brand colors when your customers make a reservation.', 'restaurant-reservations' ); ?>
90
  </div>
91
  <div class="action">
92
+ <a href="https://www.fivestarplugins.com/plugins/five-star-restaurant-reservations/" class="button button-primary" target="_blank">
93
  <?php esc_html_e( 'Learn More', 'restaurant-reservations' ); ?>
94
  </a>
95
  </div>
96
  </div>
97
  </div>
98
  <div class="addon addon-mailchimp">
99
+ <a href="https://www.fivestarplugins.com/plugins/five-star-restaurant-reservations/">
100
  <img src="<?php echo RTB_PLUGIN_URL . '/assets/img/mailchimp.png'; ?>">
101
  </a>
102
  <h3><?php esc_html_e( 'MailChimp', 'restaurant-reservations' ); ?></h3>
105
  <?php esc_html_e( 'Subscribe requests to your MailChimp mailing list and watch your subscription rates grow effortlessly.', 'restaurant-reservations' ); ?>
106
  </div>
107
  <div class="action">
108
+ <a href="https://www.fivestarplugins.com/plugins/five-star-restaurant-reservations/" class="button button-primary" target="_blank">
109
  <?php esc_html_e( 'Learn More', 'restaurant-reservations' ); ?>
110
  </a>
111
  </div>
116
  <p>The following restaurant themes integrate beautifully with Restaurant Reservations, providing a clean, stylized booking form that matches your site's design.</p>
117
  <div class="rtb-addons">
118
  <div class="addon addon-themes">
119
+ <a href="https://www.fivestarplugins.com/">
120
  <img src="<?php echo RTB_PLUGIN_URL . '/assets/img/theme-augustan.jpg'; ?>">
121
  </a>
122
  <h3><?php esc_html_e( 'Augustan', 'restaurant-reservations' ); ?></h3>
125
  <?php esc_html_e( 'A traditionally elegant theme for high-class restaurants, with simple setup and powerful features.', 'restaurant-reservations' ); ?>
126
  </div>
127
  <div class="action">
128
+ <a href="https://www.fivestarplugins.com/" class="button" target="_blank">
129
  <?php esc_html_e( 'View Theme', 'restaurant-reservations' ); ?>
130
  </a>
131
  <span class="rtb-by">
132
+ by <a href="https://www.fivestarplugins.com/<?php echo esc_url( $url_params ); ?>">Five Star Plugins</a>
133
  </span>
134
  </div>
135
  </div>
136
  </div>
137
  <div class="addon addon-themes">
138
+ <a href="https://www.fivestarplugins.com/">
139
  <img src="<?php echo RTB_PLUGIN_URL . '/assets/img/theme-luigi.jpg'; ?>">
140
  </a>
141
  <h3><?php esc_html_e( 'Luigi', 'restaurant-reservations' ); ?></h3>
144
  <?php esc_html_e( 'A smart theme for upscale bistros and fine Italian restaurants. Get up and running quickly.', 'restaurant-reservations' ); ?>
145
  </div>
146
  <div class="action">
147
+ <a href="https://www.fivestarplugins.com/" class="button" target="_blank">
148
  <?php esc_html_e( 'View Theme', 'restaurant-reservations' ); ?>
149
  </a>
150
  <span class="rtb-by">
151
+ by <a href="https://www.fivestarplugins.com/">Five Star Plugins</a>
152
  </span>
153
  </div>
154
  </div>
155
  </div>
156
  <div class="addon addon-themes">
157
+ <a href="https://www.fivestarplugins.com/">
158
  <img src="<?php echo RTB_PLUGIN_URL . '/assets/img/theme-the-spot.jpg'; ?>">
159
  </a>
160
  <h3><?php esc_html_e( 'The Spot', 'restaurant-reservations' ); ?></h3>
163
  <?php esc_html_e( 'A vibrant theme for bars, pubs and destination restaurants with an attention-grabbing homepage.', 'restaurant-reservations' ); ?>
164
  </div>
165
  <div class="action">
166
+ <a href="https://www.fivestarplugins.com/" class="button" target="_blank">
167
  <?php esc_html_e( 'View Theme', 'restaurant-reservations' ); ?>
168
  </a>
169
  <span class="rtb-by">
170
+ by <a href="https://www.fivestarplugins.com/">Five Star Plugins</a>
171
  </span>
172
  </div>
173
  </div>
174
  </div>
175
  <div class="addon addon-themes">
176
+ <a href="https://www.fivestarplugins.com/">
177
  <img src="<?php echo RTB_PLUGIN_URL . '/assets/img/theme-plate-up.jpg'; ?>">
178
  </a>
179
  <h3><?php esc_html_e( 'Plate Up', 'restaurant-reservations' ); ?></h3>
182
  <?php esc_html_e( 'A refined theme for sophisticated, modern restaurants to drive customers to your booking form.', 'restaurant-reservations' ); ?>
183
  </div>
184
  <div class="action">
185
+ <a href="https://www.fivestarplugins.com/" class="button" target="_blank">
186
  <?php esc_html_e( 'View Theme', 'restaurant-reservations' ); ?>
187
  </a>
188
  <span class="rtb-by">
189
+ by <a href="https://www.fivestarplugins.com/">Five Star Plugins</a>
190
  </span>
191
  </div>
192
  </div>
332
  }
333
 
334
  /**
335
+ * Add a prompt for users to subscribe to the Five Star Plugins mailing list
336
  * below the addons list.
337
  *
338
  * @since 0.1
344
  <p>
345
  <?php
346
  echo sprintf(
347
+ esc_html_x( 'Find out when new addons are available by subscribing to the %smonthly newsletter%s, liking %sFive Star Plugins%s on Facebook, or following %sFive Star Plugins%s on Twitter.', 'restaurant-reservations' ),
348
+ '<a target="_blank" href="https://www.fivestarplugins.com/">',
349
  '</a>',
350
+ '<a target="_blank" href="https://www.facebook.com/fivestarplugins/">',
351
  '</a>',
352
+ '<a target="_blank" href="http://twitter.com/fivestarplugins">',
353
  '</a>'
354
  );
355
  ?>
includes/AdminBookings.class.php CHANGED
@@ -368,7 +368,7 @@ class rtbAdminBookings {
368
  ?>
369
 
370
  <?php foreach( $fields as $fieldset => $contents ) : ?>
371
- <fieldset class="<?php echo $fieldset; ?>">
372
  <?php
373
  foreach( $contents['fields'] as $slug => $field ) {
374
 
@@ -445,7 +445,7 @@ class rtbAdminBookings {
445
  $description = empty( $args['description'] ) || empty( $args['description']['prompt'] ) || empty( $args['description']['text'] ) ? null : $args['description'];
446
  ?>
447
 
448
- <div class="<?php echo $slug; ?>">
449
  <?php echo rtb_print_form_error( $slug ); ?>
450
  <label>
451
  <input type="checkbox" name="rtb-<?php echo esc_attr( $slug ); ?>" value="1"<?php checked( $value ); ?>>
@@ -651,15 +651,15 @@ class rtbAdminBookings {
651
  $_POST[ $field['name'] ] = $field['value'];
652
  }
653
 
654
- $ids = ( isset( $_POST['ID'] ) and $_POST['ID'] != '' ) ? explode( ',', $_POST['ID'] ) : array();
655
  $subject = stripcslashes( sanitize_text_field( $_POST['rtb-email-subject'] ) );
656
  $message = stripcslashes( wp_kses_post( $_POST['rtb-email-message'] ) );
657
 
658
  if ( empty( $message ) ) {
659
  wp_send_json_error(
660
  array(
661
- 'error' => 'email_missing_message',
662
- 'msg' => __( 'Please enter a message before sending the email.', 'restaurant-reservations' ),
663
  )
664
  );
665
  }
@@ -667,8 +667,8 @@ class rtbAdminBookings {
667
  if ( empty( $ids ) ) {
668
  wp_send_json_error(
669
  array(
670
- 'error' => 'email_missing_data',
671
- 'msg' => __( 'The email could not be sent because some critical information was missing.', 'restaurant-reservations' ),
672
  )
673
  );
674
  }
368
  ?>
369
 
370
  <?php foreach( $fields as $fieldset => $contents ) : ?>
371
+ <fieldset class="<?php echo esc_attr( $fieldset ); ?>">
372
  <?php
373
  foreach( $contents['fields'] as $slug => $field ) {
374
 
445
  $description = empty( $args['description'] ) || empty( $args['description']['prompt'] ) || empty( $args['description']['text'] ) ? null : $args['description'];
446
  ?>
447
 
448
+ <div class="<?php echo esc_attr( $slug ); ?>">
449
  <?php echo rtb_print_form_error( $slug ); ?>
450
  <label>
451
  <input type="checkbox" name="rtb-<?php echo esc_attr( $slug ); ?>" value="1"<?php checked( $value ); ?>>
651
  $_POST[ $field['name'] ] = $field['value'];
652
  }
653
 
654
+ $ids = ( isset( $_POST['ID'] ) and $_POST['ID'] != '' ) ? array_map( 'intval', explode( ',', $_POST['ID'] ) ) : array();
655
  $subject = stripcslashes( sanitize_text_field( $_POST['rtb-email-subject'] ) );
656
  $message = stripcslashes( wp_kses_post( $_POST['rtb-email-message'] ) );
657
 
658
  if ( empty( $message ) ) {
659
  wp_send_json_error(
660
  array(
661
+ 'error' => 'email_missing_message',
662
+ 'msg' => __( 'Please enter a message before sending the email.', 'restaurant-reservations' ),
663
  )
664
  );
665
  }
667
  if ( empty( $ids ) ) {
668
  wp_send_json_error(
669
  array(
670
+ 'error' => 'email_missing_data',
671
+ 'msg' => __( 'The email could not be sent because some critical information was missing.', 'restaurant-reservations' ),
672
  )
673
  );
674
  }
includes/Booking.class.php CHANGED
@@ -723,10 +723,14 @@ class rtbBooking {
723
  */
724
  public function is_field_empty( $slug ) {
725
 
726
- $input = isset( $_POST['rtb-' . $slug ] ) ? $_POST['rtb-' . $slug] : '';
727
-
728
- if ( ( is_string( $input ) && trim( $input ) == '' ) ||
729
- ( is_array( $input ) && empty( $input ) ) ) {
 
 
 
 
730
  return true;
731
  }
732
 
723
  */
724
  public function is_field_empty( $slug ) {
725
 
726
+ $field_key = 'rtb-' . $slug;
727
+
728
+ if (
729
+ ! isset( $_POST[ $field_key ] )
730
+ || ( is_string( $_POST[ $field_key ] ) && trim( $_POST[ $field_key ] ) == '' )
731
+ || ( is_array( $_POST[ $field_key ] ) && empty( $_POST[ $field_key ] ) )
732
+ )
733
+ {
734
  return true;
735
  }
736
 
includes/Dashboard.class.php CHANGED
@@ -156,14 +156,14 @@ class rtbDashboard {
156
 
157
  if (sizeOf($bookings) == 0) {echo "<tr><td colspan='4'>" . __("No bookings to display yet. Create a booking for it to be displayed here.", 'restaurant-reservations') . "</td></tr>";}
158
  else {
159
- foreach ($bookings as $booking) {
160
  ?>
161
 
162
  <tr>
163
- <td><?php echo $booking->date; ?></td>
164
- <td><?php echo $booking->party; ?></td>
165
- <td><?php echo $booking->name; ?></td>
166
- <td><?php echo $booking_statuses[$booking->post_status]['label']; ?></td>
167
  </tr>
168
  <?php }
169
  }
156
 
157
  if (sizeOf($bookings) == 0) {echo "<tr><td colspan='4'>" . __("No bookings to display yet. Create a booking for it to be displayed here.", 'restaurant-reservations') . "</td></tr>";}
158
  else {
159
+ foreach ($bookings as $booking) {
160
  ?>
161
 
162
  <tr>
163
+ <td><?php echo esc_html( $booking->date ); ?></td>
164
+ <td><?php echo esc_html( $booking->party ); ?></td>
165
+ <td><?php echo esc_html( $booking->name ); ?></td>
166
+ <td><?php echo esc_html( $booking_statuses[$booking->post_status]['label'] ); ?></td>
167
  </tr>
168
  <?php }
169
  }
includes/Field.class.php CHANGED
@@ -540,7 +540,9 @@ class cffrtbField {
540
  }
541
 
542
  $input = isset( $_POST['rtb-' . $this->slug ] )
543
- ? sanitize_text_field( $_POST['rtb-' . $this->slug] )
 
 
544
  : '';
545
 
546
  // Skip empty fields but do not skip checkboxes.
@@ -560,7 +562,7 @@ class cffrtbField {
560
  return;
561
  }
562
  }
563
-
564
  // Option fields
565
  if ( $this->type == 'options' ) {
566
 
@@ -586,14 +588,13 @@ class cffrtbField {
586
  $booking->custom_fields[ $this->slug ] = $val;
587
  }
588
  } elseif ( $this->subtype === 'checkbox' ) {
589
- $val = array_map( 'absint', $input );
590
- $new_val = array();
591
- foreach( $val as $i ) {
592
- if ( isset( $this->options[ $i ] ) ) {
593
- $new_val[] = $i;
594
  }
595
  }
596
- $booking->custom_fields[ $this->slug ] = $new_val;
597
  }
598
 
599
  // Confirm fields (always true if we've reached this stage)
540
  }
541
 
542
  $input = isset( $_POST['rtb-' . $this->slug ] )
543
+ ? ( is_array( $_POST['rtb-' . $this->slug ] )
544
+ ? array_map( 'absint', $_POST['rtb-' . $this->slug ] )
545
+ : sanitize_text_field( $_POST['rtb-' . $this->slug] ) )
546
  : '';
547
 
548
  // Skip empty fields but do not skip checkboxes.
562
  return;
563
  }
564
  }
565
+
566
  // Option fields
567
  if ( $this->type == 'options' ) {
568
 
588
  $booking->custom_fields[ $this->slug ] = $val;
589
  }
590
  } elseif ( $this->subtype === 'checkbox' ) {
591
+ $val = array();
592
+ foreach( $input as $input_i ) {
593
+ if ( isset( $this->options[ $input_i ] ) ) {
594
+ $val[] = $input_i;
 
595
  }
596
  }
597
+ $booking->custom_fields[ $this->slug ] = $val;
598
  }
599
 
600
  // Confirm fields (always true if we've reached this stage)
includes/PaymentGatewayStripe.class.php CHANGED
@@ -692,7 +692,8 @@ class rtbPaymentGatewayStripe implements rtbPaymentGateway {
692
  public function payment_summary()
693
  {
694
  global $rtb_controller;
695
- if( $rtb_controller->settings->get_setting( 'rtb-stripe-hold' ) ) {
 
696
  echo '<p class="stripe-payment-hold-msg">' . __( 'We are only placing a hold for the above amount on your payment instrument. You will be charged later.', 'restaurant-reservations' ) . '</p>';
697
  }
698
  }
692
  public function payment_summary()
693
  {
694
  global $rtb_controller;
695
+
696
+ if( $rtb_controller->settings->get_setting('rtb-stripe-sca') && $rtb_controller->settings->get_setting( 'rtb-stripe-hold' ) ) {
697
  echo '<p class="stripe-payment-hold-msg">' . __( 'We are only placing a hold for the above amount on your payment instrument. You will be charged later.', 'restaurant-reservations' ) . '</p>';
698
  }
699
  }
includes/Settings.class.php CHANGED
@@ -2418,10 +2418,10 @@ If you were not the one to cancel this booking, please contact us.
2418
  'rtb-stripe-payment',
2419
  'toggle',
2420
  array(
2421
- 'id' => 'rtb-stripe-hold',
2422
- 'title' => __( 'Hold & Charge Separately', 'restaurant-reservations' ),
2423
- 'description' => __( 'With this enabled, the deposit will be taken as a hold and not charged right away. The payment can then be charged/captured manually later. If not captured, the hold on the amount will be released after 7 days.', 'restaurant-reservations' ),
2424
- 'conditional_on' => 'rtb-stripe-sca',
2425
  'conditional_on_value' => true
2426
  )
2427
  );
2418
  'rtb-stripe-payment',
2419
  'toggle',
2420
  array(
2421
+ 'id' => 'rtb-stripe-hold',
2422
+ 'title' => __( 'Hold & Charge Separately', 'restaurant-reservations' ),
2423
+ 'description' => __( 'With this enabled, the deposit will be taken as a hold and not charged right away. The payment can then be charged/captured manually later. If not captured, the hold on the amount will be released after 7 days. <em>SCA (option above this one) must be enabled to use this hold feature.</em>', 'restaurant-reservations' ),
2424
+ 'conditional_on' => 'rtb-stripe-sca',
2425
  'conditional_on_value' => true
2426
  )
2427
  );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: FiveStarPlugins
3
  Requires at Least: 4.4
4
  Tested Up To: 5.9
5
  Tags: reservation, reservations, restaurant reservations, reservation form, restaurant booking, restaurant reservation form, restaurant booking form, restaurant booking system, reservation system, online reservations, online restaurant booking, dinner reservations, restaurant form, gutenberg reservations, gutenberg restaurant reservations, gutenberg restaurant booking, mobile reservations, responsive reservations, table reservations, open table, book table, reserve table, easy reservations, simple reservations, quick restaurant reservations, custom reservation form, custom restaurant reservations
6
- Stable tag: 2.4.12
7
  License: GPLv3
8
  License URI:http://www.gnu.org/licenses/gpl-3.0.html
9
  Donate Link: https://www.etoilewebdesign.com/plugin-donations/
@@ -197,6 +197,11 @@ Find answers to even more questions in the [FAQ](http://doc.fivestarplugins.com/
197
 
198
  == Changelog ==
199
 
 
 
 
 
 
200
  = 2.4.12 (2022-02-05) =
201
  - Updated nonces, sanitizing and escaping
202
  - Added a new feature to the Stripe payment/deposit to place a hold on a card. This lets you separate authorization and capture, so you can create a charge now (at the time of booking), but capture the funds later.
3
  Requires at Least: 4.4
4
  Tested Up To: 5.9
5
  Tags: reservation, reservations, restaurant reservations, reservation form, restaurant booking, restaurant reservation form, restaurant booking form, restaurant booking system, reservation system, online reservations, online restaurant booking, dinner reservations, restaurant form, gutenberg reservations, gutenberg restaurant reservations, gutenberg restaurant booking, mobile reservations, responsive reservations, table reservations, open table, book table, reserve table, easy reservations, simple reservations, quick restaurant reservations, custom reservation form, custom restaurant reservations
6
+ Stable tag: 2.4.13
7
  License: GPLv3
8
  License URI:http://www.gnu.org/licenses/gpl-3.0.html
9
  Donate Link: https://www.etoilewebdesign.com/plugin-donations/
197
 
198
  == Changelog ==
199
 
200
+ = 2.4.13 (2022-02-09) =
201
+ - Updated escaping and sanitizing.
202
+ - Fixed an issue with checkbox type custom fields not saving/displaying correctly.
203
+ - Updated a condition that, in one case, incorrectly displayed a message that the deposit payment would be held.
204
+
205
  = 2.4.12 (2022-02-05) =
206
  - Updated nonces, sanitizing and escaping
207
  - Added a new feature to the Stripe payment/deposit to place a hold on a card. This lets you separate authorization and capture, so you can create a charge now (at the time of booking), but capture the funds later.
restaurant-reservations.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Five Star Restaurant Reservations - WordPress Booking Plugin
4
  * Plugin URI: http://www.fivestarplugins.com/plugins/five-star-restaurant-reservations/
5
  * Description: Restaurant reservations made easy. Accept bookings online. Quickly confirm or reject reservations, send email notifications, set booking times and more.
6
- * Version: 2.4.12
7
  * Author: FiveStarPlugins
8
  * Author URI: https://profiles.wordpress.org/fivestarplugins/
9
  * Text Domain: restaurant-reservations
@@ -39,7 +39,7 @@ class rtbInit {
39
  public function __construct() {
40
 
41
  // Common strings
42
- define( 'RTB_VERSION', '2.4.12' );
43
  define( 'RTB_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
44
  define( 'RTB_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
45
  define( 'RTB_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
3
  * Plugin Name: Five Star Restaurant Reservations - WordPress Booking Plugin
4
  * Plugin URI: http://www.fivestarplugins.com/plugins/five-star-restaurant-reservations/
5
  * Description: Restaurant reservations made easy. Accept bookings online. Quickly confirm or reject reservations, send email notifications, set booking times and more.
6
+ * Version: 2.4.13
7
  * Author: FiveStarPlugins
8
  * Author URI: https://profiles.wordpress.org/fivestarplugins/
9
  * Text Domain: restaurant-reservations
39
  public function __construct() {
40
 
41
  // Common strings
42
+ define( 'RTB_VERSION', '2.4.13' );
43
  define( 'RTB_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
44
  define( 'RTB_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
45
  define( 'RTB_PLUGIN_FNAME', plugin_basename( __FILE__ ) );