PluginProbe
Booking Calendar / 11.8.4
Booking Calendar v11.8.4
11.8.4 11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 All 204 releases
← All changes | core/admin/wpbc-dashboard.php +199 -100 10.1.311.8.4 View file →
@@ -49,10 +49,11 @@
49 49 . " WHERE {$trash_bookings} " ;
50 50 if ($my_resources!='') $sql_req .= " AND bk.booking_type IN ({$my_resources}) ";
51 51
52 52 $sql_req .= "ORDER BY dt.booking_date" ;
53 + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter
54 + $sql_results = $wpdb->get_results( $sql_req );
53 55
54 - $sql_results = $wpdb->get_results( $sql_req );
55 56 // </editor-fold>
56 57
57 58
58 59 // <editor-fold defaultstate="collapsed" desc=" Count bookings " >
@@ -62,8 +63,10 @@
62 63
63 64 if ( !isset( $bk_array[$v->id] ) )
64 65 $bk_array[$v->id] = array(
65 66 'dates' => array()
67 + , 'check_in_date' => array()
68 + , 'check_out_date' => array()
66 69 , 'bk_today' => 0
67 70 , 'm_today' => 0
68 71 );
69 72 $bk_array[$v->id]['id'] = $v->id;
@@ -68,8 +71,15 @@
68 71 );
69 72 $bk_array[$v->id]['id'] = $v->id;
70 73 $bk_array[$v->id]['approved'] = $v->approved;
71 74 $bk_array[$v->id]['dates'][] = $v->booking_date;
75 +
76 + if ( intval( substr( $v->booking_date, -1 ) ) == 1 ) {
77 + $bk_array[$v->id]['check_in_date'][] = $v->booking_date;
78 + }
79 + if ( intval( substr( $v->booking_date, -1 ) ) == 2 ) {
80 + $bk_array[$v->id]['check_out_date'][] = $v->booking_date;
81 + }
72 82 $bk_array[$v->id]['m_date'] = $v->m_date; // Modification Booking date
73 83 $bk_array[$v->id]['new'] = $v->new;
74 84 if ( wpbc_is_today_date( $v->booking_date ) ) {
75 85 $bk_array[ $v->id ]['bk_today'] = 1;
@@ -85,8 +95,12 @@
85 95 , 'pending' => 0
86 96 , 'approved' => 0
87 97 , 'booking_today' => 0
88 98 , 'was_made_today' => 0
99 + , 'check_in_today' => 0
100 + , 'check_out_today' => 0
101 + , 'check_in_tomorrow' => 0
102 + , 'check_out_tomorrow' => 0
89 103 );
90 104 foreach ( $bk_array as $k => $v ) {
91 105
92 106 $counter['all']++;
@@ -103,8 +117,49 @@
103 117 $counter['approved'] ++;
104 118 } else {
105 119 $counter['pending'] ++;
106 120 }
121 +
122 +
123 + // Check in
124 + if ( ! empty( $v['check_in_date'] ) ) {
125 + foreach ( $v['check_in_date'] as $check_in ) {
126 + if ( wpbc_is_today_date( $check_in ) ) {
127 + $counter['check_in_today']++;
128 + }
129 + if ( wpbc_is_tomorrow_date( $check_in ) ) {
130 + $counter['check_in_tomorrow']++;
131 + }
132 + }
133 + } else {
134 + $check_in = $v['dates'][0];
135 + if ( wpbc_is_today_date( $check_in ) ) {
136 + $counter['check_in_today']++;
137 + }
138 + if ( wpbc_is_tomorrow_date( $check_in ) ) {
139 + $counter['check_in_tomorrow']++;
140 + }
141 + }
142 + // Check out
143 + if ( ! empty( $v['check_out_date'] ) ) {
144 + foreach ( $v['check_out_date'] as $check_out ) {
145 + if ( wpbc_is_today_date( $check_out ) ) {
146 + $counter['check_out_today']++;
147 + }
148 + if ( wpbc_is_tomorrow_date( $check_out ) ) {
149 + $counter['check_out_tomorrow']++;
150 + }
151 + }
152 + } else {
153 + $check_out = $v['dates'][ ( count( $v['dates'] ) - 1 ) ];
154 + if ( wpbc_is_today_date( $check_out ) ) {
155 + $counter['check_out_today']++;
156 + }
157 + if ( wpbc_is_tomorrow_date( $check_out ) ) {
158 + $counter['check_out_tomorrow']++;
159 + }
160 + }
161 +
107 162 }
108 163 // </editor-fold>
109 164
110 165
@@ -119,9 +174,9 @@
119 174 /** Setup Widget for Dashboard */
120 175 function wpbc_dashboard_widget_setup(){
121 176
122 177 // Check, if we have permission to show Widget ///////////////////////////
123 - $is_user_activated = apply_bk_filter('multiuser_is_current_user_active', true ); //FixIn: 6.0.1.17
178 + $is_user_activated = apply_bk_filter('multiuser_is_current_user_active', true ); // FixIn: 6.0.1.17.
124 179 if ( ! $is_user_activated )
125 180 return false;
126 181
127 182 $user_role = get_bk_option( 'booking_user_role_booking' );
@@ -160,9 +215,9 @@
160 215
161 216 /** Show Booking Dashboard Widget content */
162 217 function wpbc_dashboard_widget_show() {
163 218
164 - $is_panel_visible = wpbc_is_dismissed_panel_visible( 'wpbc_dashboard_section_statistic' ); //FixIn: 9.9.0.8
219 + $is_panel_visible = wpbc_is_dismissed_panel_visible( 'wpbc_dashboard_section_statistic' ); // FixIn: 9.9.0.8.
165 220 $counter = $is_panel_visible ? wpbc_db_dashboard_get_bookings_count_arr() : array();
166 221
167 222 wpbc_dashboard_widget_css();
168 223
@@ -171,17 +226,17 @@
171 226
172 227
173 228 wpbc_dashboard_section_statistic( $counter );
174 229
175 - ?><div style="clear:both;margin-bottom:20px;"></div><?php
176 -
177 - wpbc_dashboard_section_news();
178 -
179 230 ?><div style="clear:both;"></div><?php
180 231 wpbc_dashboard_section_version();
181 232
182 233 wpbc_dashboard_section_support();
234 + ?><div style="clear:both;margin-bottom:20px;"></div><?php
183 235
236 + wpbc_dashboard_section_news();
237 +
238 +/*
184 239 ?><div style="clear:both;"></div><?php
185 240
186 241
187 242 wpbc_dashboard_section_video_f();
@@ -186,11 +241,11 @@
186 241
187 242 wpbc_dashboard_section_video_f();
188 243
189 244 wpbc_dashboard_section_video_p();
245 +*/
190 246
191 247
192 -
193 248 ?><div style="clear:both;"></div>
194 249
195 250 </div>
196 251 <div style="clear:both;"></div>
@@ -323,14 +378,15 @@
323 378 ////////////////////////////////////////////////////////////////////////////////
324 379 // S e c t i o n s
325 380 ////////////////////////////////////////////////////////////////////////////////
326 381
327 -//FixIn: 8.1.3.11
382 +// FixIn: 8.1.3.11.
328 383 /** Dashboard Section - Video 1 */
329 384 function wpbc_dashboard_section_video_f() {
385 + return;
330 386 ?>
331 387 <div id='wpbc_dashboard_section_video_f' class="wpbc_dashboard_section bk_left">
332 - <span class="bk_header"><?php _e('Video guide' ,'booking');?> (free):</span>
388 + <span class="bk_header"><?php esc_html_e('Video guide' ,'booking'); ?> (free):</span>
333 389 <?php wpbc_is_dismissed( 'wpbc_dashboard_section_video_f' ); //FixIn: 8.1.3.10 ?>
334 390 <?php // Free ?>
335 391 <div style="text-align: center;margin:10px 0;"><iframe style="width:90%;height:auto;" src="https://www.youtube.com/embed/videoseries?list=PLabuVtqCh9dwLA5cpz1p2RrZOitLuVupR&amp;start=28&amp;rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>
336 392 </div>
@@ -336,15 +392,16 @@
336 392 </div>
337 393 <?php
338 394 }
339 395
340 -//FixIn: 8.1.3.11
396 +// FixIn: 8.1.3.11.
341 397 /** Dashboard Section - Video 2 */
342 398 function wpbc_dashboard_section_video_p() {
399 + return;
343 400 ?>
344 401 <div id='wpbc_dashboard_section_video_p' class="wpbc_dashboard_section bk_right">
345 402 <?php wpbc_is_dismissed( 'wpbc_dashboard_section_video_p' ); //FixIn: 8.1.3.10 ?>
346 - <span class="bk_header"><?php _e('Video guide' ,'booking');?> (premium):</span>
403 + <span class="bk_header"><?php esc_html_e('Video guide' ,'booking'); ?> (premium):</span>
347 404 <?php // Premium ?>
348 405 <div style="text-align: center;margin:10px 0;"><iframe style="width:90%;height:auto;" src="https://www.youtube.com/embed/videoseries?list=PLabuVtqCh9dyc_EO8L_1FKJyLpBuIv21_&amp;rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>
349 406 </div>
350 407 <?php
@@ -353,9 +410,9 @@
353 410 /** Dashboard Support Section */
354 411 function wpbc_dashboard_section_support() {
355 412 ?>
356 413 <div id="wpbc_dashboard_section_support" class="wpbc_dashboard_section bk_right">
357 - <span class="bk_header"><?php _e('Support' ,'booking');?>:</span>
414 + <span class="bk_header"><?php esc_html_e('Support' ,'booking'); ?>:</span>
358 415 <?php wpbc_is_dismissed( 'wpbc_dashboard_section_support', array( 'css' => 'padding: 0 20px;' ) ); //FixIn: 8.1.3.10 ?>
359 416 <?php /* ?>
360 417 <?php // Free ?>
361 418 <div style="text-align: center;margin:10px 0;"><iframe style="width:90%;height:auto;" src="https://www.youtube.com/embed/videoseries?list=PLabuVtqCh9dwLA5cpz1p2RrZOitLuVupR&amp;start=28&amp;rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>
@@ -363,23 +420,28 @@
363 420 <div style="text-align: center;margin:10px 0;"><iframe style="width:90%;height:auto;" src="https://www.youtube.com/embed/videoseries?list=PLabuVtqCh9dyc_EO8L_1FKJyLpBuIv21_&amp;rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>
364 421 <?php */ ?>
365 422 <table class="bk_table">
366 423 <tr class="first">
367 - <td style="text-align:center;" class="bk_spec_font"><a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'wpbc-getting-started' ), 'index.php' ) ) ); ?>"
368 - ><?php _e('Getting Started' ,'booking');?></a>
424 + <td style="text-align:center;" class="bk_spec_font"><a href="<?php echo 'https://wpbookingcalendar.com/faq/#using'; //echo esc_url( admin_url( add_query_arg( array( 'page' => 'wpbc-getting-started' ), 'index.php' ) ) ); ?>"
425 + ><?php esc_html_e('Getting Started' ,'booking'); ?></a>
369 426 </td>
370 427 </tr>
371 428 <tr>
372 - <td style="text-align:center;" class="bk_spec_font"><a target="_blank" href="https://wpbookingcalendar.com/help/"><?php _e('Help Info' ,'booking');?></a></td>
429 + <td style="text-align:center;" class="bk_spec_font"><a target="_blank" href="https://wpbookingcalendar.com/wn/"><?php esc_html_e('What\'s New' ,'booking'); ?></a></td>
373 430 </tr>
431 + <?php if ( class_exists('wpdev_bk_personal') ){ ?>
374 432 <tr>
375 - <td style="text-align:center;" class="bk_spec_font"><a target="_blank" href="https://wpbookingcalendar.com/faq/"><?php _e('FAQ' ,'booking');?></a></td>
433 + <td style="text-align:center;" class="bk_spec_font"><a target="_blank" href="https://wpbookingcalendar.com/request-update/"><?php esc_html_e('Request Update' ,'booking'); ?></a></td>
376 434 </tr>
435 + <?php } ?>
377 436 <tr>
378 - <td style="text-align:center;" class="bk_spec_font"><a href="mailto:support@wpbookingcalendar.com"><?php _e('Contact email' ,'booking');?></a></td>
437 + <td style="text-align:center;" class="bk_spec_font"><a target="_blank" href="https://wpbookingcalendar.com/faq/"><?php esc_html_e('FAQ' ,'booking'); ?></a></td>
438 + </tr>
439 + <tr>
440 + <td style="text-align:center;" class="bk_spec_font"><a href="mailto:support@wpbookingcalendar.com"><?php esc_html_e('Contact email' ,'booking'); ?></a></td>
379 441 </tr>
380 442 <tr>
381 - <td style="text-align:center;" class="bk_spec_font"><a target="_blank" href="https://wordpress.org/plugins/booking/"><?php _e('Rate plugin (thanks:)' ,'booking');?></a></td>
443 + <td style="text-align:center;" class="bk_spec_font"><a target="_blank" href="https://wordpress.org/plugins/booking/"><?php esc_html_e('Rate plugin (thanks:)' ,'booking'); ?></a></td>
382 444 </tr>
383 445 </table>
384 446 </div>
385 447 <?php
@@ -397,25 +459,26 @@
397 459 <div style="width:95%;border:none;clear:both;margin:10px 6px;" id="bk_news_section">
398 460 <div style="width: 99%;margin-right:0;" >
399 461 <span class="bk_header" style="padding: 0;">Booking Calendar News:</span><?php
400 462
401 - wpbc_is_dismissed( 'wpbc_dashboard_section_news' ); //FixIn: 8.1.3.10
402 -
403 - ?><br/><br/>
404 - <div id="bk_news" class="rssSummary"> <span style="font-size:13px;text-align:center;">Loading...</span></div>
405 - <div id="ajax_bk_respond" class="rssSummary" style="display:none;"></div>
406 - <script type="text/javascript">
407 - jQuery.ajax({
408 - url: '<?php echo admin_url( 'admin-ajax.php' ); ?>',
409 - type:'POST',
410 - success: function (data, textStatus){ if( textStatus == 'success' ) jQuery('#ajax_bk_respond').html( data ); },
411 - error: function (XMLHttpRequest, textStatus, errorThrown){ window.status = 'Ajax sending Error status:' + textStatus; },
412 - data:{
413 - action: 'CHECK_BK_NEWS',
414 - wpbc_nonce: document.getElementById('wpbc_admin_panel_nonce_dashboard').value
415 - }
416 - });
417 - </script>
463 + $is_panel_visible = wpbc_is_dismissed( 'wpbc_dashboard_section_news' ); // FixIn: 10.10.3.1.
464 + if ( $is_panel_visible ) {
465 + ?><br/><br/>
466 + <div id="bk_news" class="rssSummary"> <span style="font-size:13px;text-align:center;">Loading...</span></div>
467 + <div id="ajax_bk_respond" class="rssSummary" style="display:none;"></div>
468 + <script type="text/javascript">
469 + jQuery.ajax({
470 + url: '<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>',
471 + type:'POST',
472 + success: function (data, textStatus){ if( textStatus == 'success' ) jQuery('#ajax_bk_respond').html( data ); },
473 + error: function (XMLHttpRequest, textStatus, errorThrown){ window.status = 'Ajax sending Error status:' + textStatus; },
474 + data:{
475 + action: 'CHECK_BK_NEWS',
476 + wpbc_nonce: document.getElementById('wpbc_admin_panel_nonce_dashboard').value
477 + }
478 + });
479 + </script>
480 + <?php } ?>
418 481 </div>
419 482 </div>
420 483
421 484 </div>
@@ -447,12 +510,18 @@
447 510 }
448 511
449 512 function wpbc_dashboard_info_get_version_type_sites() {
450 513
514 + $json_version = wpbc_get_json_property_from_meta( 'max usage' );
515 + if ( ! empty( $json_version ) ) {
516 + // $json_edition = wpbc_get_json_property_from_meta( 'edition' ); if ( ! empty( $json_edition ) ) { $json_version = $json_version . ' | ' . $json_edition; }
517 + return $json_version;
518 + }
519 +
451 520 $v_type = '';
452 - if ( strpos( strtolower( WPDEV_BK_VERSION ), 'multisite' ) !== false ) {
521 + if ( false !== strpos( strtolower( WPDEV_BK_VERSION ), 'multisite' ) ) {
453 522 $v_type = '5';
454 - } else if ( strpos( strtolower( WPDEV_BK_VERSION ), 'develop' ) !== false ) {
523 + } else if ( false !== strpos( strtolower( WPDEV_BK_VERSION ), 'develop' ) ) {
455 524 $v_type = '2';
456 525 }
457 526
458 527 if ( ! empty( $v_type ) ) {
@@ -457,9 +526,9 @@
457 526
458 527 if ( ! empty( $v_type ) ) {
459 528 return ' ' . $v_type . ' ' . __( 'websites', 'booking' );
460 529 } else {
461 - return ' 1' . ' ' . __( 'website', 'booking' );
530 + return ' 1' . ' ' . __( 'website', 'booking' );
462 531 }
463 532 }
464 533
465 534 function wpbc_dashboard_info_get_version_number() {
@@ -467,11 +536,15 @@
467 536 if ( substr( WPDEV_BK_VERSION, 0, 3 ) == '11.' ) {
468 537
469 538 $show_version = substr( WPDEV_BK_VERSION, 3 );
470 539
540 + if ( ( '' === trim( $show_version ) ) || ( '0' === trim( $show_version ) ) ) {
541 + return esc_attr( WP_BK_VERSION_NUM );
542 + }
543 +
471 544 if ( substr( $show_version, ( - 1 * ( strlen( WP_BK_VERSION_NUM ) ) ) ) === WP_BK_VERSION_NUM ) {
472 545 $show_version = substr( $show_version, 0, ( - 1 * ( strlen( WP_BK_VERSION_NUM ) ) - 1 ) );
473 - $show_version = str_replace( '.', ' ', $show_version ) . " <sup><strong style='font-size:12px;'>" . WP_BK_VERSION_NUM . "</strong></sup>";
546 + $show_version = str_replace( '.', ' ', $show_version ) . " <sup><strong style='font-size:12px;'>" . esc_attr( WP_BK_VERSION_NUM ) . "</strong></sup>";
474 547 }
475 548 return $show_version;
476 549 } else {
477 550 return WPDEV_BK_VERSION;
@@ -487,15 +560,15 @@
487 560
488 561 /*
489 562
490 563 Disbale hidded notice about Upgrade to higher version in paid versions
491 - //FixIn: 8.0.1.6
564 + // FixIn: 8.0.1.6.
492 565 if ( ( $version !== 'free' ) && ( class_exists('wpdev_bk_multiuser') === false ) ) { ?>
493 - <div class="wpbc_dashboard_section border_orrange" id="bk_upgrade_section">
566 + <div class="wpbc_dashboard_section border_orrange" id="bk_upgrade_section">
494 567 <div style="padding:0px 10px;width:96%;">
495 - <h4><?php _e('Upgrade to higher versions' ,'booking') ?>:</h4>
568 + <h4><?php esc_html_e('Upgrade to higher versions' , 'booking' ); ?>:</h4>
496 569 <p>Check additional advanced functionality, which exist in higher versions and can be interesting for you <a href="https://wpbookingcalendar.com/features/" target="_blank">here &raquo;</a></p>
497 - <p><a class="button button-primary" style="margin-top: 10px;font-weight: 600;" href="<?php echo wpbc_up_link(); ?>" target="_blank"><?php if ( wpbc_get_ver_sufix() == '' ) { _e('Purchase' ,'booking'); } else { _e('Upgrade Now' ,'booking'); } ?></a> </p>
570 + <p><a class="button button-primary" style="margin-top: 10px;font-weight: 600;" href="<?php echo wpbc_up_link(); ?>" target="_blank"><?php if ( wpbc_get_ver_sufix() == '' ) { esc_html_e('Purchase' ,'booking'); } else { esc_html_e('Upgrade Now' ,'booking'); } ?></a> </p>
498 571 </div>
499 572 </div>
500 573 <div style="clear:both;"></div>
501 574 <?php if ( wpbc_get_ver_sufix() != '' ) { ?>
@@ -504,25 +577,25 @@
504 577 jQuery('#bk_upgrade_section').animate({opacity:1},7000).fadeOut(2000);
505 578 });
506 579 </script>
507 580 <?php } ?>
508 - <?php }
581 + <?php }
509 582 */
510 583 ?>
511 584 <div id="wpbc_dashboard_section_current_version" class="wpbc_dashboard_section" >
512 - <span class="bk_header"><?php _e('Current version' ,'booking');?>:</span>
585 + <span class="bk_header"><?php esc_html_e('Current version' ,'booking'); ?>:</span>
513 586 <table class="bk_table">
514 587 <?php if ( wpbc_is_this_demo() ) { ?>
515 588 <tr class="first">
516 589 <td></td>
517 - <td style="font-weight: 600; text-align: left;"><?php _e('Demo' ,'booking');?></td>
590 + <td style="font-weight: 600; text-align: left;"><?php esc_html_e('Demo' ,'booking'); ?></td>
518 591 </tr>
519 592 <?php } ?>
520 593 <tr class="first">
521 - <td style="width:35%;text-align: right;;" class=""><?php _e('Version' ,'booking');?>:</td>
522 - <td style="color: #e50;font-size: 13px;font-weight: 600;text-align: left;text-shadow: 0 -1px 0 #eee;;"
523 - class="bk_spec_font"><?php
524 -
594 + <td style="width:35%;text-align: right;;" class=""><?php esc_html_e('Version' ,'booking'); ?>:</td>
595 + <td style="color: #e50;font-size: 13px;font-weight: 600;text-align: left;text-shadow: 0 -1px 0 #eee;;"
596 + class="bk_spec_font"><?php
597 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
525 598 echo wpbc_dashboard_info_get_version_number();
526 599
527 600 ?></td>
528 601 </tr>
@@ -527,37 +600,42 @@
527 600 ?></td>
528 601 </tr>
529 602 <?php if ($version != 'free') { ?>
530 603 <tr>
531 - <td style="width:35%;text-align: right;" class="first b"><?php _e('Type' ,'booking');?>:</td>
604 + <td style="width:35%;text-align: right;" class="first b"><?php esc_html_e('Type' ,'booking'); ?>:</td>
532 605 <td style="text-align: left; font-weight: 600;" class="bk_spec_font"><?php
606 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
533 607 echo wpbc_dashboard_info_get_version_type_readable();
534 608 ?></td>
535 609 </tr>
536 610 <tr>
537 - <td style="width:35%;text-align: right;" class="first b"><?php _e('Used for' ,'booking');?>:</td>
538 - <td style="text-align: left; font-weight: 600;" class="bk_spec_font"><?php
611 + <td style="width:35%;text-align: right;" class="first b"><?php esc_html_e('Used for' ,'booking'); ?>:</td>
612 + <td style="text-align: left; font-weight: 600;" class="bk_spec_font"><?php
613 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
539 614 echo wpbc_dashboard_info_get_version_type_sites();
540 615 ?></td>
541 616 </tr>
542 617 <?php } ?>
543 618 <tr>
544 - <td style="width:35%;text-align: right;" class="first b"><?php _e('Release date' ,'booking');?>:</td>
545 - <td style="text-align: left; font-weight: 600;" class="bk_spec_font"><?php echo date ("d.m.Y", filemtime(WPBC_FILE)); ?></td>
619 + <td style="width:35%;text-align: right;" class="first b"><?php esc_html_e('Release date' ,'booking'); ?>:</td>
620 + <td style="text-align: left; font-weight: 600;" class="bk_spec_font"><?php
621 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
622 + echo wpbc_date_localized( gmdate( 'Y-m-d', filemtime( WPBC_FILE ) ) );
623 + ?></td>
546 624 </tr>
547 625 </table>
548 626 <div id="wpbc_dashboard_section_current_version_upgrade">
549 627
550 - <table class="bk_table"style="border:none;">
628 + <table class="bk_table" style="border:none;">
551 629 <tr>
552 630 <td colspan="2" style="border:none;text-align:center;" class=""><?php
553 631 ?><?php wpbc_is_dismissed( 'wpbc_dashboard_section_current_version_upgrade' , array( 'css' => 'padding: 0 0px;' ) ); //FixIn: 8.1.3.10 ?><?php
554 632 if ($version == 'free') {
555 - ?><a class="button-primary button" style="font-weight:600;" target="_blank" href="https://wpbookingcalendar.com/features/"><?php _e('Check Premium Features' ,'booking');?></a><?php
633 + ?><a class="button-primary button" style="font-weight:600;" target="_blank" href="https://wpbookingcalendar.com/features/"><?php esc_html_e('Check Premium Features' ,'booking'); ?></a><?php
556 634 } elseif ( wpbc_get_ver_sufix() != '' ) {
557 - ?><a class="button-primary button" href="<?php echo wpbc_get_settings_url(); ?>&tab=upgrade"><?php _e('Upgrade' ,'booking');?></a><?php
635 + ?><a class="button-primary button" href="<?php echo esc_url( wpbc_get_settings_url() . '&tab=upgrade' ); ?>"><?php esc_html_e('Upgrade' ,'booking'); ?></a><?php
558 636 } else {
559 - ?><a class="button-primary button" target="_blank" href="https://wpbookingcalendar.com/features/"><?php _e('Explore Premium Features' ,'booking');?></a><?php
637 + ?><a class="button-primary button" target="_blank" href="https://wpbookingcalendar.com/features/"><?php esc_html_e('Explore Premium Features' ,'booking'); ?></a><?php
560 638 }
561 639 ?></td>
562 640 </tr>
563 641 </table>
@@ -562,47 +640,64 @@
562 640 </tr>
563 641 </table>
564 642 </div>
565 643 </div>
566 -
567 - <?php
644 +
645 + <?php
568 646 }
569 647
570 648
571 649 /** Dashboard Statistic Section */
572 650 function wpbc_dashboard_section_statistic( $counter ) {
573 - //FixIn: 9.3.1.7
651 + // FixIn: 9.3.1.7.
574 652 $bk_admin_url = wpbc_get_bookings_url() . '&wh_approved=';
575 653 ?>
576 654 <div id='wpbc_dashboard_section_statistic'>
577 655 <?php
578 - $is_panel_visible = wpbc_is_dismissed( 'wpbc_dashboard_section_statistic' ); //FixIn: 9.9.0.8
656 + $is_panel_visible = wpbc_is_dismissed( 'wpbc_dashboard_section_statistic' ); // FixIn: 9.9.0.8.
579 657 if ( $is_panel_visible ) {
580 658 ?>
581 659 <div class="wpbc_dashboard_section bk_right">
582 - <span class="bk_header"><?php _e('Statistic' ,'booking');?>:</span>
660 + <span class="bk_header"><?php esc_html_e('Statistic' ,'booking'); ?>:</span>
583 661 <table class="bk_table">
662 + <tr>
663 + <td class="first"> <a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=1&tab=vm_booking_listing&overwrite=1' ); ?>"><span><?php echo esc_html( $counter['booking_today'] ); ?></span></a> </td>
664 + <td class="actual-bookings"> <a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=1&tab=vm_booking_listing&overwrite=1' ); ?>" class=""><?php esc_html_e('Bookings for today' ,'booking'); ?></a> </td>
665 + </tr>
584 666 <tr class="first">
585 - <td class="first"> <a href="<?php echo $bk_admin_url,'&wh_what_bookings=new&wh_trash=0&wh_booking_date[]=3&view_mode=vm_listing&overwrite=1'; ?>"><span class=""><?php echo $counter['new']; ?></span></a> </td>
586 - <td class=""> <a href="<?php echo $bk_admin_url,'&wh_what_bookings=new&wh_trash=0&wh_booking_date[]=3&view_mode=vm_listing&overwrite=1'; ?>"><?php _e('New (unverified) booking(s)' ,'booking');?></a></td>
667 + <td class="first"> <a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_modification_date[]=1&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>"><span><?php echo esc_html( $counter['was_made_today'] ); ?></span></a> </td>
668 + <td class="new-bookings"><a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_modification_date[]=1&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>" class=""><?php esc_html_e('New booking(s) made today' ,'booking'); ?></a> </td>
587 669 </tr>
670 + <tr class="first">
671 + <td class="first"> <a href="<?php echo esc_url( $bk_admin_url.'&wh_what_bookings=new&wh_trash=0&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>"><span class=""><?php echo esc_html( $counter['new'] ); ?></span></a> </td>
672 + <td class=""> <a href="<?php echo esc_url( $bk_admin_url.'&wh_what_bookings=new&wh_trash=0&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>"><?php esc_html_e('New (unverified) booking(s)' ,'booking'); ?></a></td>
673 + </tr>
588 674 <tr>
589 - <td class="first"> <a href="<?php echo $bk_admin_url,'&wh_approved=0&wh_trash=0&wh_booking_date[]=3&view_mode=vm_listing&overwrite=1'; ?>"><span class=""><?php echo $counter['pending']; ?></span></a></td>
590 - <td class="pending"><a href="<?php echo $bk_admin_url,'&wh_approved=0&wh_trash=0&wh_booking_date[]=3&view_mode=vm_listing&overwrite=1'; ?>" class=""><?php _e('Pending booking(s)' ,'booking');?></a></td>
675 + <td class="first"> <a href="<?php echo esc_url( $bk_admin_url.'&wh_approved=0&wh_trash=0&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>"><span class=""><?php echo esc_html( $counter['pending'] ); ?></span></a></td>
676 + <td class="pending"><a href="<?php echo esc_url( $bk_admin_url.'&wh_approved=0&wh_trash=0&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>" class=""><?php esc_html_e('Pending booking(s)' ,'booking'); ?></a></td>
591 677 </tr>
592 678 </table>
593 679 </div>
594 680 <div class="wpbc_dashboard_section" >
595 - <span class="bk_header"><?php _e('Agenda' ,'booking');?>:</span>
681 + <span class="bk_header"><?php esc_html_e('Agenda' ,'booking'); ?>:</span>
596 682 <table class="bk_table">
597 - <tr class="first">
598 - <td class="first"> <a href="<?php echo $bk_admin_url,'&wh_trash=0&wh_modification_date[]=1&wh_booking_date[]=3&view_mode=vm_listing&overwrite=1'; ?>"><span><?php echo $counter['was_made_today']; ?></span></a> </td>
599 - <td class="new-bookings"><a href="<?php echo $bk_admin_url,'&wh_trash=0&wh_modification_date[]=1&wh_booking_date[]=3&view_mode=vm_listing&overwrite=1'; ?>" class=""><?php _e('New booking(s) made today' ,'booking');?></a> </td>
683 + <tr>
684 + <td class="first"> <a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=10&tab=vm_booking_listing&overwrite=1' ); ?>"><span class=""><?php echo esc_html( $counter['check_in_today'] ); ?></span></a></td>
685 + <td class="pending"><a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=10&tab=vm_booking_listing&overwrite=1' ); ?>" class=""><?php esc_html_e('Check in - Today', 'booking'); ?></a></td>
600 686 </tr>
601 687 <tr>
602 - <td class="first"> <a href="<?php echo $bk_admin_url,'&wh_trash=0&wh_booking_date[]=1&view_mode=vm_listing&overwrite=1'; ?>"><span><?php echo $counter['booking_today']; ?></span></a> </td>
603 - <td class="actual-bookings"> <a href="<?php echo $bk_admin_url,'&wh_trash=0&wh_booking_date[]=1&view_mode=vm_listing&overwrite=1'; ?>" class=""><?php _e('Bookings for today' ,'booking');?></a> </td>
688 + <td class="first"> <a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=11&tab=vm_booking_listing&overwrite=1' ); ?>"><span class=""><?php echo esc_html( $counter['check_out_today'] ); ?></span></a></td>
689 + <td class=""><a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=11&tab=vm_booking_listing&overwrite=1' ); ?>" class=""><?php esc_html_e('Check out - Today', 'booking'); ?></a></td>
604 690 </tr>
691 + <tr>
692 + <td class="first"> <a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=7&tab=vm_booking_listing&overwrite=1' ); ?>"><span class=""><?php echo esc_html( $counter['check_in_tomorrow'] ); ?></span></a></td>
693 + <td class="new-bookings"><a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=7&tab=vm_booking_listing&overwrite=1' ); ?>" class=""><?php esc_html_e('Check in - Tomorrow', 'booking'); ?></a></td>
694 + </tr>
695 + <tr>
696 + <td class="first"> <a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=8&tab=vm_booking_listing&overwrite=1' ); ?>"><span class=""><?php echo esc_html( $counter['check_out_tomorrow'] ); ?></span></a></td>
697 + <td class="actual-bookings"><a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=8&tab=vm_booking_listing&overwrite=1' ); ?>" class=""><?php esc_html_e('Check out - Tomorrow', 'booking'); ?></a></td>
698 + </tr>
699 +
605 700 </table>
606 701 </div>
607 702 <?php } ?>
608 703 </div>
@@ -627,9 +722,8 @@
627 722
628 723 /** Show Flex Dashboard Conatiner */
629 724 function wpbc_flex_dashboard_show(){
630 725
631 - //FixIn: 9.9.0.40
632 726 if (
633 727 ( ! empty( $GLOBALS['pagenow'] ) )
634 728 && ( is_admin() )
635 729 && (
@@ -635,11 +729,11 @@
635 729 && (
636 730 ( 'index.php' === $GLOBALS['pagenow'] )
637 731 || (
638 732 ( 'admin.php' === $GLOBALS['pagenow'] )
639 - && ( ! empty( $_GET['page'] ) )
640 - && ( 'wpbc-settings' === $_GET['page'] )
641 - && ( ( ! isset( $_GET['tab'] ) ) || ( 'general' === $_GET['tab'] ) )
733 + && ( ! empty( $_GET['page'] ) ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
734 + && ( 'wpbc-settings' === $_GET['page'] ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
735 + && ( ( ! isset( $_GET['tab'] ) ) || ( 'general' === $_GET['tab'] ) ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
642 736 )
643 737 )
644 738 ) {
645 739
@@ -647,9 +741,9 @@
647 741 return;
648 742 }
649 743
650 744
651 - $is_panel_visible = wpbc_is_dismissed_panel_visible( 'wpbc_dashboard_section_statistic' ); //FixIn: 9.9.0.8
745 + $is_panel_visible = wpbc_is_dismissed_panel_visible( 'wpbc_dashboard_section_statistic' ); // FixIn: 9.9.0.8.
652 746
653 747 $counter = ( $is_panel_visible ) ? wpbc_db_dashboard_get_bookings_count_arr() : array();
654 748
655 749 wpbc_flex_dashboard_widget_css();
@@ -750,15 +844,15 @@
750 844 // Was made today -----------------------------------------------------------------------------------------------------
751 845 ?>
752 846 <div class="wpbc_flex_dashboard_item">
753 847 <div class="wpbc_flex_dashboard_item_number">
754 - <a href="<?php echo $bk_admin_url,'&wh_trash=0&wh_modification_date[]=1&wh_booking_date[]=3&view_mode=vm_listing&overwrite=1'; ?>">
755 - <span><?php echo $counter['was_made_today']; ?></span>
848 + <a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_modification_date[]=1&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>">
849 + <span><?php echo esc_html( $counter['was_made_today'] ); ?></span>
756 850 </a>
757 851 </div>
758 852 <div class="wpbc_flex_dashboard_item_text wpbc_flex_dashboard_item_text_was_made_today">
759 - <a href="<?php echo $bk_admin_url,'&wh_trash=0&wh_modification_date[]=1&wh_booking_date[]=3&view_mode=vm_listing&overwrite=1'; ?>" class="">
760 - <?php _e('New booking(s) made today' ,'booking');?>
853 + <a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_modification_date[]=1&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>" class="">
854 + <?php esc_html_e('New booking(s) made today' ,'booking');?>
761 855 </a>
762 856 </div>
763 857 </div>
764 858 <?php
@@ -766,15 +860,15 @@
766 860 // For today ---------------------------------------------------------------------------------------------------
767 861 ?>
768 862 <div class="wpbc_flex_dashboard_item">
769 863 <div class="wpbc_flex_dashboard_item_number">
770 - <a href="<?php echo $bk_admin_url,'&wh_trash=0&wh_booking_date[]=1&view_mode=vm_listing&overwrite=1'; ?>">
771 - <span><?php echo $counter['booking_today']; ?></span>
864 + <a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=1&tab=vm_booking_listing&overwrite=1' ); ?>">
865 + <span><?php echo esc_html( $counter['booking_today'] ); ?></span>
772 866 </a>
773 867 </div>
774 868 <div class="wpbc_flex_dashboard_item_text wpbc_flex_dashboard_item_text_made_for_today">
775 - <a href="<?php echo $bk_admin_url,'&wh_trash=0&wh_booking_date[]=1&view_mode=vm_listing&overwrite=1'; ?>" class="">
776 - <?php _e('Booking(s) for today' ,'booking');?>
869 + <a href="<?php echo esc_url( $bk_admin_url.'&wh_trash=0&wh_booking_date[]=1&tab=vm_booking_listing&overwrite=1' ); ?>" class="">
870 + <?php esc_html_e('Booking(s) for today' ,'booking');?>
777 871 </a>
778 872 </div>
779 873 </div>
780 874 <?php
@@ -782,15 +876,15 @@
782 876 // Pending -----------------------------------------------------------------------------------------------------
783 877 ?>
784 878 <div class="wpbc_flex_dashboard_item">
785 879 <div class="wpbc_flex_dashboard_item_number">
786 - <a href="<?php echo $bk_admin_url,'&wh_approved=0&wh_trash=0&wh_booking_date[]=3&view_mode=vm_listing&overwrite=1'; ?>">
787 - <span class=""><?php echo $counter['pending']; ?></span>
880 + <a href="<?php echo esc_url( $bk_admin_url.'&wh_approved=0&wh_trash=0&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>">
881 + <span class=""><?php echo esc_html( $counter['pending'] ); ?></span>
788 882 </a>
789 883 </div>
790 884 <div class="wpbc_flex_dashboard_item_text wpbc_flex_dashboard_item_text_pending">
791 - <a href="<?php echo $bk_admin_url,'&wh_approved=0&wh_trash=0&wh_booking_date[]=3&view_mode=vm_listing&overwrite=1'; ?>" class="">
792 - <?php _e('Pending booking(s)' ,'booking');?>
885 + <a href="<?php echo esc_url( $bk_admin_url.'&wh_approved=0&wh_trash=0&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>" class="">
886 + <?php esc_html_e('Pending booking(s)' ,'booking');?>
793 887 </a>
794 888 </div>
795 889 </div>
796 890 <?php
@@ -799,15 +893,14 @@
799 893 // New ---------------------------------------------------------------------------------------------------------
800 894 ?>
801 895 <div class="wpbc_flex_dashboard_item">
802 896 <div class="wpbc_flex_dashboard_item_number">
803 - <a href="<?php echo $bk_admin_url,'&wh_what_bookings=new&wh_trash=0&wh_booking_date[]=3&view_mode=vm_listing&overwrite=1'; ?>">
804 - <span class=""><?php echo $counter['new']; ?></span>
897 + <a href="<?php echo esc_url( $bk_admin_url.'&wh_what_bookings=new&wh_trash=0&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>">
898 + <span class=""><?php echo esc_html( $counter['new'] ); ?></span>
805 899 </a>
806 900 </div>
807 901 <div class="wpbc_flex_dashboard_item_text wpbc_flex_dashboard_item_text_new">
808 - <a href="<?php echo $bk_admin_url, '&wh_what_bookings=new&wh_trash=0&wh_booking_date[]=3&view_mode=vm_listing&overwrite=1'; ?>">
809 - <?php _e( 'New (unverified) booking(s)', 'booking' ); ?>
902 + <a href="<?php echo esc_url( $bk_admin_url. '&wh_what_bookings=new&wh_trash=0&wh_booking_date[]=3&tab=vm_booking_listing&overwrite=1' ); ?>"> <?php esc_html_e( 'New (unverified) booking(s)', 'booking' ); ?>
810 903 </a>
811 904 </div>
812 905 </div>
813 906 <?php
@@ -816,11 +909,14 @@
816 909 // Version ---------------------------------------------------------------------------------------------------------
817 910 ?>
818 911 <div class="wpbc_flex_dashboard_item">
819 912 <div class="wpbc_flex_dashboard_item_text wpbc_flex_dashboard_item_version_type">
820 - <a href="https://wpbookingcalendar.com/faq/difference-single-developer-multi-site/#<?php echo wpbc_get_slug_format( trim( wpbc_dashboard_info_get_version_type_readable() . '_' . wpbc_dashboard_info_get_version_type_sites() . '_' . WP_BK_VERSION_NUM ) ); ?>">
913 + <a href="https://wpbookingcalendar.com/faq/difference-single-developer-multi-site/#<?php
914 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
915 + echo esc_attr( wpbc_get_slug_format( trim( wpbc_dashboard_info_get_version_type_readable() . '_' . wpbc_dashboard_info_get_version_type_sites() . '_' . WP_BK_VERSION_NUM ) ) ); ?>">
821 916 <?php
822 917 if ( class_exists( 'wpdev_bk_personal' ) ) {
918 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
823 919 echo wpbc_dashboard_info_get_version_type_readable();
824 920 }
825 921 if ( wpbc_is_this_demo() ) {
826 922 echo ' (Demo)';
@@ -825,8 +921,9 @@
825 921 if ( wpbc_is_this_demo() ) {
826 922 echo ' (Demo)';
827 923 } else {
828 924 if ( 'free' != wpbc_dashboard_info_get_version_type() ) {
925 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
829 926 echo ' (' . __( 'for', 'booking' ) . ' ' . trim( wpbc_dashboard_info_get_version_type_sites() ) . ')';
830 927 }
831 928 }
832 929 ?>
@@ -832,12 +929,14 @@
832 929 ?>
833 930 </a>
834 931 </div>
835 932 <div class="wpbc_flex_dashboard_item_number wpbc_flex_dashboard_item_version_number">
836 - <a href="https://wpbookingcalendar.com/changelog/#<?php echo wpbc_get_slug_format( trim( wpbc_dashboard_info_get_version_type_readable() . '_' . wpbc_dashboard_info_get_version_type_sites() . '_' . WP_BK_VERSION_NUM ) ); ?>">
837 - <span class=""><?php echo WP_BK_VERSION_NUM; ?></span>
933 + <a href="https://wpbookingcalendar.com/changelog/#<?php
934 + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
935 + echo wpbc_get_slug_format( trim( wpbc_dashboard_info_get_version_type_readable() . '_' . wpbc_dashboard_info_get_version_type_sites() . '_' . WP_BK_VERSION_NUM ) ); ?>">
936 + <span class=""><?php echo esc_attr(WP_BK_VERSION_NUM); ?></span>
838 937 </a>
839 938 </div>
840 939 </div>
841 940 <?php
842 941
843 - }
942 + }