Restaurant Reservations - Version v2.1.18

Version Description

Download this release

Release Info

Developer Rustaurius
Plugin Icon 128x128 Restaurant Reservations
Version v2.1.18
Comparing to
See all releases

Code changes from version 2.1.17 to v2.1.18

assets/css/admin.css CHANGED
@@ -2599,4 +2599,46 @@ NEW STYLING FOR ADD/DELETE AREAS LIKE CUSTOM FIELDS
2599
  .bookings_page_rtb-settings .wrap form .form-table .sap-infinite-table input[type="number"],
2600
  .bookings_page_rtb-settings .wrap form .form-table .sap-infinite-table input[type="text"] {
2601
  width: 64px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2602
  }
2599
  .bookings_page_rtb-settings .wrap form .form-table .sap-infinite-table input[type="number"],
2600
  .bookings_page_rtb-settings .wrap form .form-table .sap-infinite-table input[type="text"] {
2601
  width: 64px;
2602
+ }
2603
+
2604
+
2605
+ /*********************************/
2606
+ /*** TRIAL MODAL ***/
2607
+ /*********************************/
2608
+ .rtb-trial-version-select-modal {
2609
+ padding: 0 8px;
2610
+ }
2611
+ .rtb-trial-version-select-modal-title {
2612
+ margin: 10px 0 16px;
2613
+ position: relative;
2614
+ display: inline-block;
2615
+ color: #7CA3BF;
2616
+ text-transform: uppercase;
2617
+ font-weight: bold;
2618
+ }
2619
+ .rtb-trial-version-select-modal-option {
2620
+ display: block;
2621
+ margin-bottom: 4px;
2622
+ font-weight: bold;
2623
+ }
2624
+ .rtb-trial-version-select-modal-explanation {
2625
+ display: block;
2626
+ margin: 16px 0;
2627
+ font-style: italic;
2628
+ padding-left: 10px;
2629
+ border-left: 3px solid #7CA3BF;
2630
+ }
2631
+ .rtb-trial-version-select-modal-submit {
2632
+ display: inline-block;
2633
+ background: #7CA3BF;
2634
+ color: #fff;
2635
+ padding: 6px 0;
2636
+ border-radius: 2px;
2637
+ width: 100%;
2638
+ text-align: center;
2639
+ margin-bottom: 10px;
2640
+ cursor: pointer;
2641
+ }
2642
+ .rtb-trial-version-select-modal-submit:hover {
2643
+ background: #91B5CE;
2644
  }
assets/js/admin.js CHANGED
@@ -1144,7 +1144,9 @@ function rtb_table_section_added() {
1144
  var section_id = new_row.find( '.sap-infinite-table-section_id' ).val();
1145
  var section_name = new_row.find( '.sap-infinite-table-name' ).val();
1146
 
1147
- jQuery( '.sap-infinite-table-section' ).append( '<option value="' + section_id + '">' + section_name + '</option>' );
 
 
1148
 
1149
  rtb_table_section_name_handler();
1150
  rtb_table_selection_delete_handler();
@@ -1171,4 +1173,24 @@ function rtb_table_selection_delete_handler() {
1171
 
1172
  jQuery( '.sap-infinite-table-section option[value="' + section_id + '"]' ).remove();
1173
  });
1174
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1144
  var section_id = new_row.find( '.sap-infinite-table-section_id' ).val();
1145
  var section_name = new_row.find( '.sap-infinite-table-name' ).val();
1146
 
1147
+ if ( ! jQuery('.sap-infinite-table-section option[value="' + section_id + '"]' ).length ) {
1148
+ jQuery( '.sap-infinite-table-section' ).append( '<option value="' + section_id + '">' + section_name + '</option>' );
1149
+ }
1150
 
1151
  rtb_table_section_name_handler();
1152
  rtb_table_selection_delete_handler();
1173
 
1174
  jQuery( '.sap-infinite-table-section option[value="' + section_id + '"]' ).remove();
1175
  });
1176
+ }
1177
+
1178
+ /* Handle Trial Type Selection */
1179
+ jQuery(document).ready(function($) {
1180
+
1181
+ jQuery( '.fsp-premium-helper-dashboard-new-trial-button' ).on('click', function() {
1182
+
1183
+ jQuery( '.rtb-trial-version-select-modal-background , .rtb-trial-version-select-modal' ).removeClass( 'rtb-hidden' );
1184
+
1185
+ return false;
1186
+ });
1187
+
1188
+ jQuery( '.rtb-trial-version-select-modal-submit' ).on( 'click', function() {
1189
+
1190
+ var selected_version = jQuery( 'input[name="rtb-trial-version"]:checked' ).val();
1191
+
1192
+ if ( selected_version == 'ultimate' ) { jQuery( 'input[name="plugin_name"]').val( 'RTU' ); }
1193
+
1194
+ jQuery( '#fsp-trial-form' ).submit();
1195
+ });
1196
+ });
includes/AdminBookings.class.php CHANGED
@@ -849,7 +849,7 @@ class rtbAdminBookings {
849
  * @since 2.0.0
850
  */
851
  public function set_booking_arrived() {
852
- $booking_id = isset($_POST['booking_id']) ? $_POST['booking_id'] : 0;
853
 
854
  $booking_id = wp_update_post(array(
855
  'ID' => $booking_id,
849
  * @since 2.0.0
850
  */
851
  public function set_booking_arrived() {
852
+ $booking_id = isset($_POST['booking_id']) ? intval( $_POST['booking_id'] ) : 0;
853
 
854
  $booking_id = wp_update_post(array(
855
  'ID' => $booking_id,
includes/Ajax.class.php CHANGED
@@ -47,8 +47,8 @@ if ( !class_exists( 'rtbAJAX' ) ) {
47
  add_action( 'wp_ajax_rtb_find_reservations', array( $this, 'get_reservations' ) );
48
  add_action( 'wp_ajax_nopriv_rtb_find_reservations', array( $this, 'get_reservations' ) );
49
 
50
- add_action( 'wp_ajax_rtb_cancel_reservations', array( $this, 'cancel_reservation' ) );
51
- add_action( 'wp_ajax_nopriv_rtb_cancel_reservations', array( $this, 'cancel_reservation' ) );
52
 
53
  add_action( 'wp_ajax_rtb_get_available_party_size', array( $this, 'get_available_party_size' ) );
54
  add_action( 'wp_ajax_nopriv_rtb_get_available_party_size', array( $this, 'get_available_party_size' ) );
@@ -80,7 +80,7 @@ if ( !class_exists( 'rtbAJAX' ) ) {
80
  require_once( RTB_PLUGIN_DIR . '/includes/Booking.class.php' );
81
 
82
  $bookings = array();
83
- $booking_ids = $wpdb->get_results($wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key='rtb' AND meta_value LIKE %s", '%' . $email . '%'));
84
  foreach ( $booking_ids as $booking_id ) {
85
  $booking = new rtbBooking();
86
  if ( $booking->load_post( $booking_id->post_id ) ) {
@@ -118,8 +118,8 @@ if ( !class_exists( 'rtbAJAX' ) ) {
118
  * Cancel a reservation based on its ID, with the email address used for confirmation
119
  * @since 2.1.0
120
  */
121
- public function cancel_reservation( $non_ajax = true ) {
122
- global $rtb_controller;
123
 
124
  $booking_id = isset($_REQUEST['booking_id']) ? absint( $_REQUEST['booking_id'] ) : '';
125
  $booking_email = isset($_REQUEST['booking_email']) ? sanitize_email( $_REQUEST['booking_email'] ) : '';
@@ -161,8 +161,6 @@ if ( !class_exists( 'rtbAJAX' ) ) {
161
  )
162
  );
163
  }
164
-
165
- die();
166
  }
167
  elseif ( $success ) {
168
  $booking_page_id = $rtb_controller->settings->get_setting( 'booking-page' );
@@ -177,6 +175,7 @@ if ( !class_exists( 'rtbAJAX' ) ) {
177
 
178
  header( 'location:' . $cancelled_url );
179
  }
 
180
  }
181
 
182
  /**
@@ -186,6 +185,8 @@ if ( !class_exists( 'rtbAJAX' ) ) {
186
  public function get_time_slots() {
187
  global $rtb_controller;
188
 
 
 
189
  $max_reservations_setting = $rtb_controller->settings->get_setting( 'rtb-max-tables-count' );
190
  $max_reservations = substr( $max_reservations_setting, 0, strpos( $max_reservations_setting, '_' ) );
191
 
@@ -260,7 +261,7 @@ if ( !class_exists( 'rtbAJAX' ) ) {
260
  $current_times[] = $booking_time;
261
  $party_sizes[] = (int) $booking->party;
262
 
263
- while ( sizeOf( $current_times ) > 0 and reset( $current_times ) < $booking_time - $dining_block_seconds ) {
264
  //save the time to know when the blocking potentially ends
265
  $removed_time = reset( $current_times );
266
 
@@ -268,15 +269,15 @@ if ( !class_exists( 'rtbAJAX' ) ) {
268
  array_shift( $current_times );
269
  array_shift( $party_sizes );
270
 
271
- // remove the block if we've dropped below the max people count
272
- if ( $blocked and array_sum($party_sizes) < $max_people ) {
273
  $blocked = false;
274
  $blocked_times[] = $removed_time + $dining_block_seconds;
275
  }
276
  }
277
 
278
- // Check if we're at or above the maximum number of people
279
- if ( ! $blocked and array_sum($party_sizes) >= $max_people ) {
280
  $blocked = true;
281
  $blocked_times[] = $booking_time - $dining_block_seconds;
282
  }
47
  add_action( 'wp_ajax_rtb_find_reservations', array( $this, 'get_reservations' ) );
48
  add_action( 'wp_ajax_nopriv_rtb_find_reservations', array( $this, 'get_reservations' ) );
49
 
50
+ add_action( 'wp_ajax_rtb_cancel_reservations', array( $this, 'cancel_reservation' ), 10, 0 );
51
+ add_action( 'wp_ajax_nopriv_rtb_cancel_reservations', array( $this, 'cancel_reservation' ), 10, 0 );
52
 
53
  add_action( 'wp_ajax_rtb_get_available_party_size', array( $this, 'get_available_party_size' ) );
54
  add_action( 'wp_ajax_nopriv_rtb_get_available_party_size', array( $this, 'get_available_party_size' ) );
80
  require_once( RTB_PLUGIN_DIR . '/includes/Booking.class.php' );
81
 
82
  $bookings = array();
83
+ $booking_ids = $wpdb->get_results($wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key='rtb' AND meta_value LIKE %s", '%' . sanitize_email( $email ) . '%'));
84
  foreach ( $booking_ids as $booking_id ) {
85
  $booking = new rtbBooking();
86
  if ( $booking->load_post( $booking_id->post_id ) ) {
118
  * Cancel a reservation based on its ID, with the email address used for confirmation
119
  * @since 2.1.0
120
  */
121
+ public function cancel_reservation( $ajax = true ) {
122
+ global $rtb_controller;
123
 
124
  $booking_id = isset($_REQUEST['booking_id']) ? absint( $_REQUEST['booking_id'] ) : '';
125
  $booking_email = isset($_REQUEST['booking_email']) ? sanitize_email( $_REQUEST['booking_email'] ) : '';
161
  )
162
  );
163
  }
 
 
164
  }
165
  elseif ( $success ) {
166
  $booking_page_id = $rtb_controller->settings->get_setting( 'booking-page' );
175
 
176
  header( 'location:' . $cancelled_url );
177
  }
178
+
179
  }
180
 
181
  /**
185
  public function get_time_slots() {
186
  global $rtb_controller;
187
 
188
+ $min_party_size = $rtb_controller->settings->get_setting( 'party-size-min' );
189
+
190
  $max_reservations_setting = $rtb_controller->settings->get_setting( 'rtb-max-tables-count' );
191
  $max_reservations = substr( $max_reservations_setting, 0, strpos( $max_reservations_setting, '_' ) );
192
 
261
  $current_times[] = $booking_time;
262
  $party_sizes[] = (int) $booking->party;
263
 
264
+ while ( sizeOf( $current_times ) > 0 and reset( $current_times ) < ( $booking_time - $dining_block_seconds ) ) {
265
  //save the time to know when the blocking potentially ends
266
  $removed_time = reset( $current_times );
267
 
269
  array_shift( $current_times );
270
  array_shift( $party_sizes );
271
 
272
+ // remove the block if we've dropped below the max people count - min party size
273
+ if ( $blocked and array_sum($party_sizes) <= ( $max_people - $min_party_size ) ) {
274
  $blocked = false;
275
  $blocked_times[] = $removed_time + $dining_block_seconds;
276
  }
277
  }
278
 
279
+ // Check if we're above the maximum number of people - min party size
280
+ if ( ! $blocked and array_sum($party_sizes) > ( $max_people - $min_party_size ) ) {
281
  $blocked = true;
282
  $blocked_times[] = $booking_time - $dining_block_seconds;
283
  }
includes/Cron.class.php CHANGED
@@ -67,7 +67,7 @@ class rtbCron {
67
  public function handle_late_arrivals_task() {
68
  global $rtb_controller;
69
 
70
- if ( ! $rtb_controller->settings->get_setting( 'time-reminder-user' ) ) { return; }
71
 
72
  require_once( RTB_PLUGIN_DIR . '/includes/Notification.class.php' );
73
  require_once( RTB_PLUGIN_DIR . '/includes/Notification.Email.class.php' );
67
  public function handle_late_arrivals_task() {
68
  global $rtb_controller;
69
 
70
+ if ( ! $rtb_controller->settings->get_setting( 'time-late-user' ) ) { return; }
71
 
72
  require_once( RTB_PLUGIN_DIR . '/includes/Notification.class.php' );
73
  require_once( RTB_PLUGIN_DIR . '/includes/Notification.Email.class.php' );
includes/Dashboard.class.php CHANGED
@@ -14,10 +14,6 @@ class rtbDashboard {
14
 
15
  public function __construct() {
16
  add_action( 'admin_menu', array( $this, 'add_dashboard_to_menu' ), 99 );
17
- if ( isset($_POST['RTB_Upgrade_To_Full']) ) { add_action( 'init', array( $this, 'check_upgrade_code' ) ); }
18
- if ( get_option( 'RTB_Trial_Happening' ) == 'Yes' ) {
19
- add_action('admin_init', array( $this, 'check_trial_status' ) );
20
- }
21
 
22
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
23
 
@@ -73,99 +69,6 @@ class rtbDashboard {
73
  }
74
  }
75
 
76
- public function check_upgrade_code() {
77
- global $rtb_controller;
78
-
79
- $key = trim($_POST['Key']);
80
-
81
- if ($key == "FSP Trial" and !get_option("RTB_Trial_Happening")) {
82
- $this->message = __("Trial successfully started!", 'restaurant-reservations');
83
-
84
- update_option("RTB_Trial_Expiry_Time", time() + (7*24*60*60));
85
- update_option("RTB_Trial_Happening", "Yes");
86
-
87
- update_option( "rtb-pre-permission-level", get_option( 'rtb-permission-level' ) );
88
- update_option( "rtb-permission-level", 2 );
89
- $rtb_controller->permissions->update_permissions();
90
-
91
- $Admin_Email = get_option('admin_email');
92
-
93
- $opts = array('http'=>array('method'=>"GET"));
94
- $context = stream_context_create($opts);
95
- $Response = file_get_contents("http://www.fivestarplugins.com/key-check/Register_Trial.php?Plugin=RTB&Admin_Email=" . $Admin_Email . "&Site=" . get_bloginfo('wpurl'), false, $context);
96
- }
97
- elseif ($key == "FSP Trial") {
98
- $this->status = false;
99
- $this->message = __('Trial has already been used.', 'restaurant-reservations');
100
- }
101
- elseif (strlen($key) < 18 or strlen($key) > 22) {
102
- $this->status = false;
103
- $this->message = __('Invalid License Key', 'restaurant-reservations');
104
- }
105
- elseif ($key != "FSP Trial") {
106
- $opts = array('http'=>array('method'=>"GET"));
107
- $context = stream_context_create($opts);
108
- $Response = unserialize(file_get_contents("http://www.fivestarplugins.com/key-check/FSP_RTB_KeyCheck.php?Key=" . $key . "&Site=" . get_bloginfo('wpurl'), false, $context));
109
-
110
- if ($Response['Message_Type'] == "Error") {
111
- $this->status = false;
112
- $this->message = $Response['Message'];
113
- }
114
- else {
115
- $this->message = $Response['Message'];
116
- update_option("RTB_Trial_Happening", "No");
117
- delete_option("RTB_Trial_Expiry_Time");
118
-
119
- if ( is_array($Response) and isset($Response['Permission_Level']) and $Response['Permission_Level'] == 3 ) {
120
- update_option( 'rtb-ultimate-license-key', $key );
121
- update_option( "rtb-permission-level", 3 );
122
- }
123
- else { update_option( "rtb-permission-level", 2 ); }
124
- $rtb_controller->permissions->update_permissions();
125
- }
126
- }
127
-
128
- add_action( 'admin_notices', array( $this, 'display_notice' ) );
129
- }
130
-
131
- public function check_trial_status() {
132
- global $rtb_controller;
133
-
134
- if ( get_option("RTB_Trial_Happening") == "Yes" and get_option( 'RTB_Trial_Expiry_Time' ) < time() ) {
135
- update_option( 'RTB_Trial_Happening', 'No');
136
-
137
- $rtb_controller->settings->set_setting( 'view-bookings-page', '' );
138
- $rtb_controller->settings->set_setting( 'rtb-enable-max-tables', false );
139
- $rtb_controller->settings->set_setting( 'auto-confirm-max-reservations', '' );
140
- $rtb_controller->settings->set_setting( 'auto-confirm-max-seats', '' );
141
- $rtb_controller->settings->set_setting( 'mc-lists', '' );
142
- $rtb_controller->settings->set_setting( 'rtb-styling-layout', 'default' );
143
- $rtb_controller->settings->set_setting( 'rtb-styling-section-title-font-family', '' );
144
- $rtb_controller->settings->set_setting( 'rtb-styling-section-title-font-size', '' );
145
- $rtb_controller->settings->set_setting( 'rtb-styling-section-title-color', '' );
146
- $rtb_controller->settings->set_setting( 'rtb-styling-section-background-color', '' );
147
- $rtb_controller->settings->set_setting( 'rtb-styling-section-border-size', '' );
148
- $rtb_controller->settings->set_setting( 'rtb-styling-section-border-color', '' );
149
- $rtb_controller->settings->set_setting( 'rtb-styling-label-font-family', '' );
150
- $rtb_controller->settings->set_setting( 'rtb-styling-label-font-size', '' );
151
- $rtb_controller->settings->set_setting( 'rtb-styling-label-color', '' );
152
- $rtb_controller->settings->set_setting( 'rtb-styling-add-message-button-background-color', '' );
153
- $rtb_controller->settings->set_setting( 'rtb-styling-add-message-button-background-hover-color', '' );
154
- $rtb_controller->settings->set_setting( 'rtb-styling-add-message-button-text-color', '' );
155
- $rtb_controller->settings->set_setting( 'rtb-styling-add-message-button-text-hover-color', '' );
156
- $rtb_controller->settings->set_setting( 'rtb-styling-request-booking-button-background-color', '' );
157
- $rtb_controller->settings->set_setting( 'rtb-styling-request-booking-button-background-hover-color', '' );
158
- $rtb_controller->settings->set_setting( 'rtb-styling-request-booking-button-text-color', '' );
159
- $rtb_controller->settings->set_setting( 'rtb-styling-request-booking-button-text-hover-color', '' );
160
- $rtb_controller->settings->save_settings();
161
-
162
- ajax_reset_all( true );
163
-
164
- update_option( 'rtb-permission-level', get_option( 'rtb-pre-permission-level' ) );
165
- $rtb_controller->permissions->update_permissions();
166
- }
167
- }
168
-
169
  public function display_dashboard_screen() {
170
  global $rtb_controller;
171
 
@@ -177,23 +80,26 @@ class rtbDashboard {
177
 
178
  <div id="rtb-dashboard-content-left">
179
 
180
- <?php if ( ! $permission or ! $ultimate or get_option("RTB_Trial_Happening") == "Yes") { ?>
181
- <div id="rtb-dashboard-upgrade-box" class="rtb-dashboard-new-widget-box ewd-widget-box-full <?php echo ( get_option( 'rtb-hide-upgrade-box' ) ? 'rtb-hidden' : '' ); ?>">
182
- <div class="rtb-dashboard-new-widget-box-top">
183
- <?php if ( $permission ) { ?>
184
- <div class="rtb-ultimate-notification">
185
- <?php _e( 'Thanks for being a premium user! <strong>If you\'re looking to upgrade to our ultimate version, enter your new product key below.</strong>', 'restaurant-reservations' ); ?>
186
- </div>
187
- <div class="rtb-ultimate-upgrade-dismiss"></div>
188
- <?php } ?>
189
- <form method="post" action="admin.php?page=rtb-dashboard" class="rtb-dashboard-key-widget">
190
- <input class="rtb-dashboard-key-widget-input" name="Key" type="text" placeholder="<?php _e('Enter License Key Here', 'restaurant-reservations'); ?>">
191
- <input class="rtb-dashboard-key-widget-submit" name="RTB_Upgrade_To_Full" type="submit" value="<?php echo ( ! $permission ? __('UNLOCK PREMIUM', 'restaurant-reservations') : __('UNLOCK ULTIMATE', 'restaurant-reservations') ) ?>">
192
- <div class="rtb-dashboard-key-widget-text">Don't have a key? <a href="https://www.fivestarplugins.com/license-payment/?Selected=RTB&Quantity=1" target="_blank">Upgrade Now</a> to unlock all <?php echo (! $permission ? 'premium' : 'ultimate'); ?> features.</div>
193
- </form>
194
- </div>
195
- </div>
196
- <?php } ?>
 
 
 
197
 
198
  <div class="rtb-dashboard-new-widget-box ewd-widget-box-full" id="rtb-dashboard-support-widget-box">
199
  <div class="rtb-dashboard-new-widget-box-top">Get Support<span id="rtb-dash-mobile-support-down-caret">&nbsp;&nbsp;&#9660;</span><span id="rtb-dash-mobile-support-up-caret">&nbsp;&nbsp;&#9650;</span></div>
@@ -316,7 +222,7 @@ class rtbDashboard {
316
  </div>
317
  <?php } */ ?>
318
 
319
- <?php if ( ! $permission or get_option("RTB_Trial_Happening") == "Yes" ) { ?>
320
  <div class="rtb-dashboard-new-widget-box ewd-widget-box-full" id="rtb-dashboard-guarantee-widget-box">
321
  <div class="rtb-dashboard-new-widget-box-top">
322
  <div class="rtb-dashboard-guarantee">
@@ -331,26 +237,15 @@ class rtbDashboard {
331
 
332
  <div id="rtb-dashboard-content-right">
333
 
334
- <?php if ( ! $permission or get_option("RTB_Trial_Happening") == "Yes" ) { ?>
335
  <div class="rtb-dashboard-new-widget-box ewd-widget-box-full" id="rtb-dashboard-get-premium-widget-box">
336
  <div class="rtb-dashboard-new-widget-box-top">Get Premium</div>
337
- <?php if(get_option("RTB_Trial_Happening") == "Yes"){
338
- $trialExpireTime = get_option("RTB_Trial_Expiry_Time");
339
- $currentTime = time();
340
- $trialTimeLeft = $trialExpireTime - $currentTime;
341
- $trialTimeLeftDays = ( date("d", $trialTimeLeft) ) - 1;
342
- $trialTimeLeftHours = date("H", $trialTimeLeft);
343
- ?>
344
- <div class="rtb-dashboard-new-widget-box-bottom">
345
- <div class="rtb-dashboard-get-premium-widget-trial-time">
346
- <div class="rtb-dashboard-get-premium-widget-trial-days"><?php echo $trialTimeLeftDays; ?><span>days</span></div>
347
- <div class="rtb-dashboard-get-premium-widget-trial-hours"><?php echo $trialTimeLeftHours; ?><span>hours</span></div>
348
- </div>
349
- <div class="rtb-dashboard-get-premium-widget-trial-time-left">LEFT IN TRIAL</div>
350
- </div>
351
- <?php } ?>
352
  <div class="rtb-dashboard-new-widget-box-bottom">
353
- <div class="rtb-dashboard-get-premium-widget-features-title"<?php echo ( get_option("RTB_Trial_Happening") == "Yes" ? "style='padding-top: 20px;'" : ""); ?>>GET FULL ACCESS WITH OUR PREMIUM VERSION AND GET:</div>
354
  <ul class="rtb-dashboard-get-premium-widget-features">
355
  <li>Multiple Layouts</li>
356
  <li>Custom Fields</li>
@@ -359,13 +254,25 @@ class rtbDashboard {
359
  <li>+ More</li>
360
  </ul>
361
  <a href="https://www.fivestarplugins.com/license-payment/?Selected=RTB&Quantity=1" class="rtb-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
362
- <?php if (!get_option("RTB_Trial_Happening")) { ?>
363
- <form method="post" action="admin.php?page=rtb-dashboard">
364
- <input name="Key" type="hidden" value='FSP Trial'>
365
- <input name="RTB_Upgrade_To_Full" type="hidden" value='RTB_Upgrade_To_Full'>
366
- <button class="rtb-dashboard-get-premium-widget-button rtb-dashboard-new-trial-button">GET FREE 7-DAY TRIAL</button>
367
- </form>
368
- <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
369
  </div>
370
  </div>
371
  <?php } ?>
@@ -396,7 +303,7 @@ class rtbDashboard {
396
 
397
  </div> <!-- rtb-dashboard-content-area -->
398
 
399
- <?php if ( ! $permission or get_option("RTB_Trial_Happening") == "Yes" ) { ?>
400
  <div id="rtb-dashboard-new-footer-one">
401
  <div class="rtb-dashboard-new-footer-one-inside">
402
  <div class="rtb-dashboard-new-footer-one-left">
14
 
15
  public function __construct() {
16
  add_action( 'admin_menu', array( $this, 'add_dashboard_to_menu' ), 99 );
 
 
 
 
17
 
18
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
19
 
69
  }
70
  }
71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  public function display_dashboard_screen() {
73
  global $rtb_controller;
74
 
80
 
81
  <div id="rtb-dashboard-content-left">
82
 
83
+ <?php if ( ! $permission or ! $ultimate or get_option("RTB_Trial_Happening") == "Yes" or get_option("RTU_Trial_Happening") == "Yes" ) {
84
+ $premium_info = '<div class="rtb-dashboard-new-widget-box ewd-widget-box-full">';
85
+ $premium_info .= '<div class="rtb-dashboard-new-widget-box-top">';
86
+ $premium_info .= sprintf( __( '<a href="%s" target="_blank">Visit our website</a> to learn how to upgrade to premium.'), 'https://www.fivestarplugins.com/premium-upgrade-instructions/' );
87
+ $premium_info .= '</div>';
88
+ $premium_info .= '</div>';
89
+
90
+ $premium_info = apply_filters( 'fsp_dashboard_top', $premium_info, 'RTB', 'https://www.fivestarplugins.com/license-payment/?Selected=RTB&Quantity=1' );
91
+
92
+ if ( $permission and get_option("RTU_Trial_Happening") != "Yes" ) {
93
+ $ultimate_premium_notice = '<div class="rtb-ultimate-notification">';
94
+ $ultimate_premium_notice .= __( 'Thanks for being a premium user! <strong>If you\'re looking to upgrade to our ultimate version, enter your new product key below.</strong>', 'restaurant-reservations' );
95
+ $ultimate_premium_notice .= '</div>';
96
+ $ultimate_premium_notice .= '<div class="rtb-ultimate-upgrade-dismiss"></div>';
97
+
98
+ $premium_info = str_replace('<div class="fsp-premium-helper-dashboard-new-widget-box-top">', '<div class="fsp-premium-helper-dashboard-new-widget-box-top">' . $ultimate_premium_notice, $premium_info);
99
+ }
100
+
101
+ echo $premium_info;
102
+ } ?>
103
 
104
  <div class="rtb-dashboard-new-widget-box ewd-widget-box-full" id="rtb-dashboard-support-widget-box">
105
  <div class="rtb-dashboard-new-widget-box-top">Get Support<span id="rtb-dash-mobile-support-down-caret">&nbsp;&nbsp;&#9660;</span><span id="rtb-dash-mobile-support-up-caret">&nbsp;&nbsp;&#9650;</span></div>
222
  </div>
223
  <?php } */ ?>
224
 
225
+ <?php if ( ! $permission or get_option("RTB_Trial_Happening") == "Yes" or get_option("RTU_Trial_Happening") == "Yes" ) { ?>
226
  <div class="rtb-dashboard-new-widget-box ewd-widget-box-full" id="rtb-dashboard-guarantee-widget-box">
227
  <div class="rtb-dashboard-new-widget-box-top">
228
  <div class="rtb-dashboard-guarantee">
237
 
238
  <div id="rtb-dashboard-content-right">
239
 
240
+ <?php if ( ! $permission or get_option("RTB_Trial_Happening") == "Yes" or get_option("RTU_Trial_Happening") == "Yes" ) { ?>
241
  <div class="rtb-dashboard-new-widget-box ewd-widget-box-full" id="rtb-dashboard-get-premium-widget-box">
242
  <div class="rtb-dashboard-new-widget-box-top">Get Premium</div>
243
+
244
+ <?php if ( get_option( "RTB_Trial_Happening" ) == "Yes" ) { do_action( 'fsp_trial_happening', 'RTB' ); } ?>
245
+ <?php if ( get_option( "RTU_Trial_Happening" ) == "Yes" ) { do_action( 'fsp_trial_happening', 'RTU' ); } ?>
246
+
 
 
 
 
 
 
 
 
 
 
 
247
  <div class="rtb-dashboard-new-widget-box-bottom">
248
+ <div class="rtb-dashboard-get-premium-widget-features-title"<?php echo ( ( get_option("RTB_Trial_Happening") == "Yes" or get_option("RTU_Trial_Happening") == "Yes" ) ? "style='padding-top: 20px;'" : ""); ?>>GET FULL ACCESS WITH OUR PREMIUM VERSION AND GET:</div>
249
  <ul class="rtb-dashboard-get-premium-widget-features">
250
  <li>Multiple Layouts</li>
251
  <li>Custom Fields</li>
254
  <li>+ More</li>
255
  </ul>
256
  <a href="https://www.fivestarplugins.com/license-payment/?Selected=RTB&Quantity=1" class="rtb-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
257
+
258
+ <?php if ( ! get_option("RTB_Trial_Happening") and ! get_option("RTU_Trial_Happening") ) {
259
+ $trial_info = sprintf( __( '<a href="%s" target="_blank">Visit our website</a> to learn how to get a free 7-day trial of the premium plugin.'), 'https://www.fivestarplugins.com/premium-upgrade-instructions/' );
260
+
261
+ $version_select_modal = '<div class="rtb-trial-version-select-modal-background rtb-hidden"></div>';
262
+ $version_select_modal .= '<div class="rtb-trial-version-select-modal rtb-hidden">';
263
+ $version_select_modal .= '<div class="rtb-trial-version-select-modal-title">' . __( 'Select version to trial', 'restaurant-reservations' ) . '</div>';
264
+ $version_select_modal .= '<div class="rtb-trial-version-select-modal-option"><input type="radio" value="premium" name="rtb-trial-version" checked /> ' . __( 'Premium', 'restaurant-reservations' ) . '</div>';
265
+ $version_select_modal .= '<div class="rtb-trial-version-select-modal-option"><input type="radio" value="ultimate" name="rtb-trial-version" /> ' . __( 'Ultimate', 'restaurant-reservations' ) . '</div>';
266
+ $version_select_modal .= '<div class="rtb-trial-version-select-modal-explanation">' . __( 'SMS messaging will not work in the ultimate version trial.', 'restaurant-reservations' ) . '</div>';
267
+ $version_select_modal .= '<div class="rtb-trial-version-select-modal-submit">' . __( 'Select', 'restaurant-reservations' ) . '</div>';
268
+ $version_select_modal .= '</div>';
269
+
270
+ $trial_info = apply_filters( 'fsp_trial_button', $trial_info, 'RTB' );
271
+
272
+ $trial_info = str_replace( '</form>', '</form>' . $version_select_modal, $trial_info );
273
+
274
+ echo $trial_info;
275
+ } ?>
276
  </div>
277
  </div>
278
  <?php } ?>
303
 
304
  </div> <!-- rtb-dashboard-content-area -->
305
 
306
+ <?php if ( ! $permission or get_option("RTB_Trial_Happening") == "Yes" or get_option("RTU_Trial_Happening") == "Yes" ) { ?>
307
  <div id="rtb-dashboard-new-footer-one">
308
  <div class="rtb-dashboard-new-footer-one-inside">
309
  <div class="rtb-dashboard-new-footer-one-left">
includes/InstallationWalkthrough.class.php CHANGED
@@ -56,7 +56,7 @@ class rtbInstallationWalkthrough {
56
 
57
  public function add_reservations_page() {
58
  $reservations_page = wp_insert_post(array(
59
- 'post_title' => (isset($_POST['reservations_page_title']) ? stripslashes_deep($_POST['reservations_page_title']) : ''),
60
  'post_content' => '',
61
  'post_status' => 'publish',
62
  'post_type' => 'page'
56
 
57
  public function add_reservations_page() {
58
  $reservations_page = wp_insert_post(array(
59
+ 'post_title' => (isset($_POST['reservations_page_title']) ? sanitize_text_field( $_POST['reservations_page_title'] ) : ''),
60
  'post_content' => '',
61
  'post_status' => 'publish',
62
  'post_type' => 'page'
includes/MultipleLocations.class.php CHANGED
@@ -307,6 +307,7 @@ if ( ! class_exists( 'rtbMultipleLocations', false ) ) {
307
  'callback_args' => array(
308
  'options' => $this->get_location_options(),
309
  ),
 
310
  'required' => true,
311
  )
312
  ),
307
  'callback_args' => array(
308
  'options' => $this->get_location_options(),
309
  ),
310
+ 'empty_option' => true,
311
  'required' => true,
312
  )
313
  ),
includes/Query.class.php CHANGED
@@ -188,7 +188,7 @@ class rtbQuery {
188
  }
189
 
190
  if ( !empty( $_REQUEST['order'] ) && $_REQUEST['order'] === 'desc' ) {
191
- $args['order'] = $_REQUEST['orderby'];
192
  }
193
 
194
  if ( !empty( $_REQUEST['date_range'] ) ) {
188
  }
189
 
190
  if ( !empty( $_REQUEST['order'] ) && $_REQUEST['order'] === 'desc' ) {
191
+ $args['order'] = $_REQUEST['order'];
192
  }
193
 
194
  if ( !empty( $_REQUEST['date_range'] ) ) {
includes/WP_List_Table.BookingsTable.class.php CHANGED
@@ -199,8 +199,8 @@ class rtbBookingsTable extends WP_List_Table {
199
  $this->query_string = add_query_arg( array( 'end_date' => $this->filter_end_date ), $this->query_string );
200
  }
201
 
202
- $this->filter_location = !isset( $_GET['location'] ) ? 0 : absint( $_GET['location'] );
203
- $this->filter_location = !isset( $_POST['location'] ) ? $this->filter_location : absint( $_POST['location'] );
204
  $this->query_string = remove_query_arg( 'location', $this->query_string );
205
  if ( !empty( $this->filter_location ) ) {
206
  $this->query_string = add_query_arg( array( 'location' => $this->filter_location ), $this->query_string );
@@ -618,19 +618,19 @@ class rtbBookingsTable extends WP_List_Table {
618
  $results = array();
619
  foreach ( $ids as $id ) {
620
  if ( 'delete' === $action ) {
621
- $results[$id] = $rtb_controller->cpts->delete_booking( $id );
622
  }
623
 
624
  if ( 'set-status-confirmed' === $action ) {
625
- $results[$id] = $rtb_controller->cpts->update_booking_status( $id, 'confirmed' );
626
  }
627
 
628
  if ( 'set-status-pending' === $action ) {
629
- $results[$id] = $rtb_controller->cpts->update_booking_status( $id, 'pending' );
630
  }
631
 
632
  if ( 'set-status-closed' === $action ) {
633
- $results[$id] = $rtb_controller->cpts->update_booking_status( $id, 'closed' );
634
  }
635
 
636
  $results = apply_filters( 'rtb_bookings_table_bulk_action', $results, $id, $action );
@@ -661,7 +661,7 @@ class rtbBookingsTable extends WP_List_Table {
661
 
662
  $results = array();
663
 
664
- $id = !empty( $_REQUEST['booking'] ) ? $_REQUEST['booking'] : false;
665
 
666
  if ( $_REQUEST['rtb-quicklink'] == 'confirm' ) {
667
  $results[$id] = $rtb_controller->cpts->update_booking_status( $id, 'confirmed' );
@@ -839,7 +839,7 @@ class rtbBookingsTable extends WP_List_Table {
839
 
840
  $status = '';
841
  if ( !empty( $_GET['status'] ) ) {
842
- $status = $_GET['status'];
843
  if ( $status == 'trash' ) {
844
  $notifications['status'] = __( "You're viewing bookings that have been moved to the trash.", 'restaurant-reservations' );
845
  } elseif ( !empty( $rtb_controller->cpts->booking_statuses[ $status ] ) ) {
199
  $this->query_string = add_query_arg( array( 'end_date' => $this->filter_end_date ), $this->query_string );
200
  }
201
 
202
+ $this->filter_location = ! isset( $_GET['location'] ) ? 0 : intval( $_GET['location'] );
203
+ $this->filter_location = ! isset( $_POST['location'] ) ? $this->filter_location : intval( $_POST['location'] );
204
  $this->query_string = remove_query_arg( 'location', $this->query_string );
205
  if ( !empty( $this->filter_location ) ) {
206
  $this->query_string = add_query_arg( array( 'location' => $this->filter_location ), $this->query_string );
618
  $results = array();
619
  foreach ( $ids as $id ) {
620
  if ( 'delete' === $action ) {
621
+ $results[$id] = $rtb_controller->cpts->delete_booking( intval( $id ) );
622
  }
623
 
624
  if ( 'set-status-confirmed' === $action ) {
625
+ $results[$id] = $rtb_controller->cpts->update_booking_status( intval( $id ), 'confirmed' );
626
  }
627
 
628
  if ( 'set-status-pending' === $action ) {
629
+ $results[$id] = $rtb_controller->cpts->update_booking_status( intval( $id ), 'pending' );
630
  }
631
 
632
  if ( 'set-status-closed' === $action ) {
633
+ $results[$id] = $rtb_controller->cpts->update_booking_status( intval( $id ), 'closed' );
634
  }
635
 
636
  $results = apply_filters( 'rtb_bookings_table_bulk_action', $results, $id, $action );
661
 
662
  $results = array();
663
 
664
+ $id = !empty( $_REQUEST['booking'] ) ? intval( $_REQUEST['booking'] ) : false;
665
 
666
  if ( $_REQUEST['rtb-quicklink'] == 'confirm' ) {
667
  $results[$id] = $rtb_controller->cpts->update_booking_status( $id, 'confirmed' );
839
 
840
  $status = '';
841
  if ( !empty( $_GET['status'] ) ) {
842
+ $status = sanitize_text_field( $_GET['status'] );
843
  if ( $status == 'trash' ) {
844
  $notifications['status'] = __( "You're viewing bookings that have been moved to the trash.", 'restaurant-reservations' );
845
  } elseif ( !empty( $rtb_controller->cpts->booking_statuses[ $status ] ) ) {
includes/template-functions.php CHANGED
@@ -99,7 +99,7 @@ function rtb_print_booking_form( $args = array() ) {
99
  <div class="rtb-booking-form">
100
  <?php if ( ( $rtb_controller->request->request_inserted === true and ! $rtb_controller->settings->get_setting( 'require-deposit' ) ) or ( isset($_GET['payment']) and $_GET['payment'] == 'paid' ) ) : ?>
101
 
102
- <?php $post_status = isset($_GET['booking_id']) ? get_post_status( intval( $_GET['booking_id'] ) ) : $rtb_controller->request->post_status; ?>
103
 
104
  <?php
105
  if ( $post_status == 'confirmed' ) {
@@ -187,6 +187,10 @@ function rtb_print_booking_form( $args = array() ) {
187
  $callback_args = array_merge( $callback_args, array( 'required' => $field['required'] ) );
188
  }
189
 
 
 
 
 
190
  call_user_func( $field['callback'], $slug, $field['title'], $field['request_input'], $callback_args );
191
  }
192
  ?>
@@ -470,7 +474,7 @@ function rtb_handle_paypal_ipn() {
470
  $payment_amount = $_POST['mc_gross'];
471
 
472
  parse_str($_POST['custom'], $custom_vars);
473
- $booking_id = $custom_vars['booking_id'];
474
 
475
  require_once( RTB_PLUGIN_DIR . '/includes/Booking.class.php' );
476
 
@@ -479,8 +483,8 @@ function rtb_handle_paypal_ipn() {
479
 
480
  if ( ! $booking ) { return; }
481
 
482
- $booking->deposit = $payment_amount;
483
- $booking->receipt_id = $paypal_receipt_number;
484
 
485
  $booking->determine_status( true );
486
 
@@ -886,7 +890,8 @@ function rtb_print_form_select_field( $slug, $title, $value, $args ) {
886
  $classes = isset( $args['classes'] ) ? $args['classes'] : array();
887
  $classes[] = 'rtb-select';
888
  $required = isset( $args['required'] ) && $args['required'] ? ' required aria-required="true"' : '';
889
-
 
890
  ?>
891
 
892
  <div <?php echo rtb_print_element_class( $slug, $classes ); ?>>
@@ -895,7 +900,7 @@ function rtb_print_form_select_field( $slug, $title, $value, $args ) {
895
  <?php echo $title; ?>
896
  </label>
897
  <select name="rtb-<?php echo $slug; ?>" id="rtb-<?php echo $slug; ?>"<?php echo $required; ?> <?php echo ( isset( $args['disabled'] ) and $args['disabled'] ) ? 'disabled' : ''; ?>>
898
- <?php if ( isset( $args['empty_option'] ) and $args['empty_option'] ) { ?> <option></option> <?php } ?>
899
  <?php foreach ( $options as $opt_value => $opt_label ) : ?>
900
  <option value="<?php echo esc_attr( $opt_value ); ?>" <?php ! is_array( $value ) ? selected( $opt_value, $value ) : false; ?>><?php echo esc_attr( $opt_label ); ?></option>
901
  <?php endforeach; ?>
@@ -1194,6 +1199,8 @@ if ( ! function_exists( 'rtb_get_valid_tables') ) {
1194
  $request_time_end = $request_time + $dining_block_seconds;
1195
 
1196
  foreach ( $bookings as $booking ) {
 
 
1197
  $booking_time = strtotime( $booking->date );
1198
 
1199
  if ( $booking_time < $request_time_start or $booking_time > $request_time_end ) { continue; }
99
  <div class="rtb-booking-form">
100
  <?php if ( ( $rtb_controller->request->request_inserted === true and ! $rtb_controller->settings->get_setting( 'require-deposit' ) ) or ( isset($_GET['payment']) and $_GET['payment'] == 'paid' ) ) : ?>
101
 
102
+ <?php $post_status = isset( $_GET['booking_id'] ) ? get_post_status( intval( $_GET['booking_id'] ) ) : $rtb_controller->request->post_status; ?>
103
 
104
  <?php
105
  if ( $post_status == 'confirmed' ) {
187
  $callback_args = array_merge( $callback_args, array( 'required' => $field['required'] ) );
188
  }
189
 
190
+ if ( !empty( $field['empty_option'] ) ) {
191
+ $callback_args = array_merge( $callback_args, array( 'empty_option' => $field['empty_option'] ) );
192
+ }
193
+
194
  call_user_func( $field['callback'], $slug, $field['title'], $field['request_input'], $callback_args );
195
  }
196
  ?>
474
  $payment_amount = $_POST['mc_gross'];
475
 
476
  parse_str($_POST['custom'], $custom_vars);
477
+ $booking_id = intval( $custom_vars['booking_id'] );
478
 
479
  require_once( RTB_PLUGIN_DIR . '/includes/Booking.class.php' );
480
 
483
 
484
  if ( ! $booking ) { return; }
485
 
486
+ $booking->deposit = sanitize_text_field( $payment_amount );
487
+ $booking->receipt_id = sanitize_text_field( $paypal_receipt_number );
488
 
489
  $booking->determine_status( true );
490
 
890
  $classes = isset( $args['classes'] ) ? $args['classes'] : array();
891
  $classes[] = 'rtb-select';
892
  $required = isset( $args['required'] ) && $args['required'] ? ' required aria-required="true"' : '';
893
+ $empty_option = isset( $args['empty_option'] ) ? true : false;
894
+
895
  ?>
896
 
897
  <div <?php echo rtb_print_element_class( $slug, $classes ); ?>>
900
  <?php echo $title; ?>
901
  </label>
902
  <select name="rtb-<?php echo $slug; ?>" id="rtb-<?php echo $slug; ?>"<?php echo $required; ?> <?php echo ( isset( $args['disabled'] ) and $args['disabled'] ) ? 'disabled' : ''; ?>>
903
+ <?php if ( $empty_option ) { ?> <option></option> <?php } ?>
904
  <?php foreach ( $options as $opt_value => $opt_label ) : ?>
905
  <option value="<?php echo esc_attr( $opt_value ); ?>" <?php ! is_array( $value ) ? selected( $opt_value, $value ) : false; ?>><?php echo esc_attr( $opt_label ); ?></option>
906
  <?php endforeach; ?>
1199
  $request_time_end = $request_time + $dining_block_seconds;
1200
 
1201
  foreach ( $bookings as $booking ) {
1202
+ if ( $booking->post_status == 'cancelled' ) { continue; }
1203
+
1204
  $booking_time = strtotime( $booking->date );
1205
 
1206
  if ( $booking_time < $request_time_start or $booking_time > $request_time_end ) { continue; }
readme.txt CHANGED
@@ -196,6 +196,15 @@ Find answers to even more questions in the [FAQ](http://doc.fivestarplugins.com/
196
 
197
  == Changelog ==
198
 
 
 
 
 
 
 
 
 
 
199
  = 2.1.17 (2020-07-20) =
200
  - Adding a {table} template tag for notification emails
201
  - Correcting an issue causing the selected table to not display in the edit booking window
196
 
197
  == Changelog ==
198
 
199
+ = 2.1.18 (2020-08-06) =
200
+ - Correcting issue that sometimes allowed overbooking when there was one place left for a time slot, but the minimum party size was set to two or more.
201
+ - Correcting issue where there would be no action or submit message after a customer cancelled their order on the front end.
202
+ - Adds a blank/empty option for the Location dropdown in the booking form.
203
+ - CSS/styling updates for the admin.
204
+ - Dashboard updates for the the ultimate version.
205
+ - Enhanced upgrade process.
206
+ - A trial of the ultimate version is now available.
207
+
208
  = 2.1.17 (2020-07-20) =
209
  - Adding a {table} template tag for notification emails
210
  - Correcting an issue causing the selected table to not display in the edit booking window
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.1.17
7
  * Author: FiveStarPlugins
8
  * Author URI: https://profiles.wordpress.org/fivestarplugins/
9
  * Text Domain: restaurant-reservations
@@ -271,7 +271,7 @@ class rtbInit {
271
 
272
  if ( $screenID != $admin_page_hooks['rtb-bookings'] . '_page_rtb-settings' && $screenID != 'toplevel_page_rtb-bookings' && $screenID != $admin_page_hooks['rtb-bookings'] . '_page_rtb-dashboard' && $screenID != $admin_page_hooks['rtb-bookings'] . '_page_cffrtb-editor' ) {return;}
273
 
274
- if ( ! $rtb_controller->permissions->check_permission( 'styling' ) || get_option("RTB_Trial_Happening") == "Yes" ) {
275
  ?>
276
  <div class="rtb-dashboard-new-upgrade-banner">
277
  <div class="rtb-dashboard-banner-icon"></div>
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.1.18
7
  * Author: FiveStarPlugins
8
  * Author URI: https://profiles.wordpress.org/fivestarplugins/
9
  * Text Domain: restaurant-reservations
271
 
272
  if ( $screenID != $admin_page_hooks['rtb-bookings'] . '_page_rtb-settings' && $screenID != 'toplevel_page_rtb-bookings' && $screenID != $admin_page_hooks['rtb-bookings'] . '_page_rtb-dashboard' && $screenID != $admin_page_hooks['rtb-bookings'] . '_page_cffrtb-editor' ) {return;}
273
 
274
+ if ( ! $rtb_controller->permissions->check_permission( 'styling' ) or get_option("RTB_Trial_Happening") == "Yes" or get_option("RTU_Trial_Happening") == "Yes" ) {
275
  ?>
276
  <div class="rtb-dashboard-new-upgrade-banner">
277
  <div class="rtb-dashboard-banner-icon"></div>