PluginProbe
Booking Calendar / 11.9
Booking Calendar v11.9
11.9 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 All 205 releases
← All changes | core/class/wpbc-class-welcome.php +109 -252 10.10.2 → 11.9 View file →
@@ -1,4 +1,4 @@
1 1 <?php
2 2 /**
3 3 * Welcome Page Class
4 4 * Shows a feature overview for the new version (major).
@@ -26,9 +26,8 @@
26 26 * @var string
27 27 */
28 28 public $asset_path = ( true ) ? 'https://wpbookingcalendar.com/assets/' : 'http://beta/assets/';
29 29
30 -
31 30 /**
32 31 * Constructor
33 32 */
34 33 public function __construct() {
@@ -46,134 +45,12 @@
46 45 $title = 'Welcome to Booking Calendar';
47 46 }
48 47 }
49 48
50 - private function css() {
51 -
52 - ?><style type="text/css">
53 - .feature-section.three-col,
54 - .feature-section.two-col {
55 - display: flex;
56 - flex-direction: row;
57 - justify-content: space-between;
58 - align-items: flex-start;
59 - }
60 - .feature-section.two-col .col.col-1{
61 - width:100%;
62 - }
63 - .feature-section.two-col .col.col-2{
64 - width: 70%;
65 - padding: 0 0 0 7%;
66 - box-sizing: border-box;
67 - }
68 - @media (max-width: 782px) {
69 - /* iPad mini and all iPhones and other Mobile Devices */
70 - .feature-section.three-col,
71 - .feature-section.two-col {
72 - display: block;
73 - }
74 - }
49 + public function show_separator() {
50 + echo '<div class="clear" style="height:1px;border-bottom:1px solid #DFDFDF;"></div>';
51 + }
75 52
76 - /* Welcome Page ***************************************************************/
77 - .wpbc-welcome-page .about-text {
78 - margin-right:0px;
79 - margin-bottom:0px;
80 - min-height: 50px;
81 - }
82 - .wpbc-welcome-page .wpbc-section-image {
83 - border:none;
84 - box-shadow: 0 1px 3px #777777;
85 - }
86 - .wpbc-welcome-page .versions {
87 - color: #999999;
88 - font-size: 12px;
89 - font-style: normal;
90 - margin: 0;
91 - text-align: right;
92 - text-shadow: 0 -1px 0 #EEEEEE;
93 - }
94 - .wpbc-welcome-page .versions a,
95 - .wpbc-welcome-page .versions a:hover{
96 - color: #999;
97 - text-decoration:none;
98 - }
99 - .wpbc-welcome-page .update-nag {
100 - border-color: #E3C58E;
101 - border-radius: 5px;
102 - -moz-border-radius: 5px;
103 - -webkit-border-radius: 5px;
104 - box-shadow: 0 1px 3px #EEEEEE;
105 - color: #998877;
106 - font-size: 12px;
107 - font-weight: 600;
108 - margin: 15px 0 0;
109 - width:90%;
110 - }
111 - .wpbc-welcome-page .feature-section {
112 - margin-top:20px;
113 - border:none;
114 - }
115 - .wpbc-welcome-page .feature-section div {
116 - line-height: 1.5em;
117 - }
118 - .about-wrap.wpbc-welcome-page .feature-section .last-feature {
119 - margin-right:0;
120 - }
121 - .about-wrap.wpbc-welcome-page .changelog {
122 - margin-bottom: 10px;
123 - }
124 - .about-wrap.wpbc-welcome-page .feature-section h4 {
125 - font-size: 1.2em;
126 - margin-bottom: 0.6em;
127 - margin-left: 0;
128 - margin-right: 0;
129 - margin-top: 1.4em;
130 - }
131 - .about-wrap.wpbc-welcome-page .feature-section {
132 - overflow-x: hidden;
133 - overflow-y: hidden;
134 - padding-bottom: 20px;
135 - }
136 - .about-wrap.wpbc-welcome-page [class$="-col"]{
137 - align-items: initial;
138 - }
139 - @media (max-width: 782px) { /* iPad mini and all iPhones and other Mobile Devices */
140 - .wpbc-welcome-page .feature-section.one-col > div,
141 - .wpbc-welcome-page .feature-section.three-col > div,
142 - .wpbc-welcome-page .feature-section.two-col > div {
143 - border-bottom: none;
144 - margin:0px !important;
145 - }
146 - .wpbc-welcome-page .feature-section img{
147 - /*width:98% !important;*/
148 - /*margin:0 1% !important;*/
149 - margin:0!important;
150 - width: auto !important;
151 - max-height: 285px;
152 - overflow: hidden;
153 - }
154 - .about-wrap.wpbc-welcome-page .feature-section div.col {
155 - display:block;
156 - float:none;
157 - width: 100% !important;
158 - padding: 0;
159 - }
160 - }
161 - .wpbc-welcome-page li.big_numbers::marker{
162 - font-size:1.2em;
163 - font-weight: 600;
164 - line-height: 2.1em;
165 - }
166 -
167 - </style><?php
168 - }
169 - // SUPPORT /////////////////////////////////////////////////////////////////
170 -
171 - public function show_separator() {
172 - ?><div class="clear" style="height:1px;border-bottom:1px solid #DFDFDF;"></div><?php
173 - }
174 -
175 -
176 53 public function show_header( $text = '', $header_type = 'h3', $style = '' ) {
177 54 echo '<', esc_attr( $header_type );
178 55 if ( ! empty( $style ) ) {
179 56 echo " style='" . esc_attr( $style ) . "'";
@@ -182,9 +59,8 @@
182 59 echo wp_kses_post( wpbc_replace_to_strong_symbols( $text ) );
183 60 echo '</', esc_attr( $header_type ), '>';
184 61 }
185 62
186 -
187 63 public function show_col_section( $sections_array = array() ) {
188 64
189 65 $columns_num = count( $sections_array );
190 66
@@ -264,9 +140,8 @@
264 140 </div>
265 141 <?php
266 142 }
267 143
268 -
269 144 public function get_img( $img, $img_style = '' ) {
270 145
271 146 $is_full_link = strpos( $img, 'http' );
272 147 if ( false === $is_full_link ) {
@@ -295,10 +170,8 @@
295 170
296 171 // Head.
297 172 public function admin_head() {
298 173 remove_submenu_page( 'index.php', 'wpbc-about' );
299 - //remove_submenu_page( 'index.php', 'wpbc-getting-started' );
300 - //remove_submenu_page( 'index.php', 'wpbc-about-premium' );
301 174 }
302 175
303 176 // Title
304 177 public function title_section() {
@@ -347,9 +220,9 @@
347 220 }
348 221
349 222 list( $display_version ) = explode( '-', WPDEV_BK_VERSION );
350 223 ?>
351 - <div class="changelog point-releases" style="margin-top: 45px;">
224 + <div class="changelog point-releases" style="margin: 40px 0 50px;">
352 225 <h3><?php
353 226 echo( "Maintenance Release" ); ?></h3>
354 227 <p><strong><?php
355 228 echo wp_kses_post( sprintf( 'Version %s', $display_version ) ); ?></strong> <?php
@@ -368,22 +241,59 @@
368 241 $booking_activation_process = get_bk_option( 'booking_activation_process' );
369 242 if ( $booking_activation_process == 'On' )
370 243 return;
371 244
372 - // Bail if no activation redirect transient is set
373 - if ( ! get_transient( '_booking_activation_redirect' ) ) { // $.
245 + if ( function_exists( 'wp_doing_ajax' ) && wp_doing_ajax() ) {
374 246 return;
375 247 }
376 248
249 + $legacy_redirect = get_transient( '_booking_activation_redirect' );
250 + $redirect_intent = class_exists( 'WPBC_Setup_Wizard_First_Install_State' )
251 + ? get_transient( WPBC_Setup_Wizard_First_Install_State::ACTIVATION_INTENT_TRANSIENT )
252 + : false;
253 + $is_whats_new_intent = class_exists( 'WPBC_Setup_Wizard_First_Install_State' )
254 + && WPBC_Setup_Wizard_First_Install_State::is_whats_new_redirect_intent( $redirect_intent );
255 +
256 + // A genuine first-install intent belongs exclusively to the earlier Setup Wizard redirect handler.
257 + if (
258 + class_exists( 'WPBC_Setup_Wizard_First_Install_State' )
259 + && WPBC_Setup_Wizard_First_Install_State::is_first_install_redirect_intent( $redirect_intent )
260 + ) {
261 + return;
262 + }
263 +
264 + // Bail if neither the released boolean nor a current structured intent is set.
265 + if ( ! $legacy_redirect && ! $is_whats_new_intent ) { // $.
266 + return;
267 + }
268 + if (
269 + $is_whats_new_intent
270 + && ! WPBC_Setup_Wizard_First_Install_State::is_redirect_intent_for_current_user( $redirect_intent )
271 + ) {
272 + return;
273 + }
274 +
377 275 // Delete the redirect transient
378 276 delete_transient( '_booking_activation_redirect' );
277 + if ( class_exists( 'WPBC_Setup_Wizard_First_Install_State' ) ) {
278 + delete_transient( WPBC_Setup_Wizard_First_Install_State::ACTIVATION_INTENT_TRANSIENT );
279 + }
379 280
380 - // Bail if DEMO or activating from network, or bulk, or within an iFrame.
281 + // Bail for environments where automatic activation navigation is disabled.
282 + $is_redirect_restricted = class_exists( 'WPBC_Setup_Wizard_First_Install_State' )
283 + ? WPBC_Setup_Wizard_First_Install_State::is_automatic_onboarding_restricted()
284 + : (
285 + wpbc_is_this_demo()
286 + || ( defined( 'WPBC_IS_PLAYGROUND' ) && true === WPBC_IS_PLAYGROUND )
287 + || is_network_admin()
288 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only activation context detection.
289 + || isset( $_GET['activate-multi'] )
290 + || defined( 'IFRAME_REQUEST' )
291 + );
292 + if ( $is_redirect_restricted ) {
293 + return;
294 + }
381 295
382 - // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing
383 - if ( wpbc_is_this_demo() || is_network_admin() || isset( $_GET[ 'activate-multi' ] ) || defined( 'IFRAME_REQUEST' ) )
384 - return;
385 -
386 296 // Set mark, that we already redirected to About screen //FixIn: 5.4.5
387 297 $redirect_for_version = get_bk_option( 'booking_activation_redirect_for_version' );
388 298 if ( $redirect_for_version == WP_BK_VERSION_NUM )
389 299 return;
@@ -395,134 +305,80 @@
395 305 }
396 306
397 307
398 308 // CONTENT /////////////////////////////////////////////////////////////////
399 -
400 - public function content_whats_new() {
401 309
402 - //$this->css();
403 -if(0){
404 - ?>
405 - <style type="text/css">
406 - .feature-section.two-col {
407 - display: flex;
408 - flex-direction: row;
409 - justify-content: space-between;
410 - align-items: flex-start;
411 - }
412 - .feature-section.two-col .col.col-1{
413 - width:100%;
414 - }
415 - .feature-section.two-col .col.col-2{
416 - width: 70%;
417 - padding: 0 0 0 7%;
418 - box-sizing: border-box;
419 - }
420 - @media (max-width: 782px) {
421 - /* iPad mini and all iPhones and other Mobile Devices */
422 - .feature-section.two-col {
423 - display: block;
310 + public function show_go_links() {
311 + ?>
312 + <div style="display: flex;flex-flow: row wrap;justify-content: center;gap: 2em;margin: 3em 0 1em;">
313 + <a class="button button-primary"
314 + href="<?php
315 + echo esc_url( wpbc_get_bookings_url() . '&tab=vm_booking_listing' ); ?>"
316 + style="font-size: 20px;padding: 0 1em;height: 44px;line-height: 40px;"><?php
317 + esc_html_e( 'Go to Booking Admin Panel', 'booking' ); ?></a>
318 + <?php
319 + $wpbc_starter_pages = function_exists( 'wpbc_get_published_activation_booking_pages' ) ? wpbc_get_published_activation_booking_pages() : array();
320 + if ( ! empty( $wpbc_starter_pages ) ) {
321 + foreach ( $wpbc_starter_pages as $wpbc_starter_page ) {
322 + ?>
323 + <a class="button button-secondary"
324 + style="font-size: 20px;padding: 0 1em;height: 44px;line-height: 40px;"
325 + href="<?php
326 + echo esc_url( $wpbc_starter_page['url'] ); ?>"
327 + ><?php
328 + echo esc_html( $wpbc_starter_page['button_title'] ); ?></a>
329 + <?php
424 330 }
425 - }
331 + } else {
332 + $wp_post_booking_absolute = false;
333 + if ( ! empty( $wp_post_booking_absolute ) ) {
334 + ?>
335 + <a class="button button-secondary"
336 + style="font-size: 20px;padding: 0 1em;height: 44px;line-height: 40px;"
337 + href="<?php
338 + echo esc_url( $wp_post_booking_absolute ); ?>"
339 + ><?php
340 + esc_html_e( 'Go to page with booking form', 'booking' ); ?></a>
341 + <?php
342 + }
343 + } ?>
344 + </div>
345 + <?php
346 + }
426 347
427 - .wpbc-changelog-list ul {
428 - list-style: outside;
429 - }
430 - .wpbc-changelog-list ul li{
431 - margin-bottom: 0.5em;
432 - line-height: 1.5em;
433 - }
434 - .wpbc-changelog-list ul li strong{
435 - padding:0 5px;
436 - }
437 - .wpbc_expand_section_link,
438 - a.wpbc_expand_section_link:hover,
439 - a.wpbc_expand_section_link:focus {
440 - color:#21759b;
441 - cursor: pointer;
442 - outline: 0;
443 - border:none;
444 - border-bottom:1px dashed #21759B;
445 - text-decoration: none;
446 - }
447 - </style><?php
448 -}
449 - ?>
450 - <div class="wrap about-wrap wpbc-welcome-page">
348 + public function content_whats_new() {
451 349
452 - <?php $this->title_section(); ?>
350 + echo '<div class="wrap about-wrap wpbc-welcome-page">';
453 351
454 - <table class="about-text" style="margin-bottom:-40px;height:auto;font-size:1em;width:100%;" >
455 - <tr>
456 - <td>
457 - <?php list( $display_version ) = explode( '-', WPDEV_BK_VERSION ); ?>
458 - <!--Thank you for updating to the latest version. <strong><code><?php echo esc_html( $display_version ); ?></code></strong>
459 - <br/>Booking Calendar has become more polished, powerful and easy to use than ever before.-->
460 - </td>
461 - <!--td style="width:10%">
462 - <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'wpbc-getting-started' ), 'index.php' ) ) ); ?>"
463 - style="float: right; height: 36px; line-height: 34px;"
464 - class="button-primary"
465 - >&nbsp;<strong>Get Started</strong> <span style="font-size: 20px;line-height: 18px;padding-left: 5px;">&rsaquo;&rsaquo;&rsaquo;</span>
466 - </a>
467 - </td-->
468 - </tr>
469 - </table>
470 - <?php
352 + $this->title_section();
471 353
472 - $this->maintence_section();
354 + $this->show_go_links();
473 355
474 - $this->section_9_8_css();
356 + $this->maintence_section();
475 357
476 - wpbc_welcome_section_10_10( $this );
358 + $this->section_9_8_css();
477 359
478 - wpbc_welcome_section_10_9( $this );
360 + wpbc_welcome_section_11_9( $this );
361 + wpbc_welcome_section_11_8_1( $this );
362 + wpbc_welcome_section_11_8( $this );
363 + wpbc_welcome_section_11_7( $this );
364 + wpbc_welcome_section_11_6( $this );
365 + wpbc_welcome_section_11_5( $this );
366 + wpbc_welcome_section_11_4( $this );
367 + wpbc_welcome_section_11_3( $this );
368 + wpbc_welcome_section_11_2( $this );
369 + wpbc_welcome_section_11_1( $this );
370 + wpbc_welcome_section_11_0( $this );
371 + wpbc_welcome_section_10_15( $this );
372 + wpbc_welcome_section_10_14( $this );
373 + wpbc_welcome_section_10_13( $this );
479 374
480 - wpbc_welcome_section_10_8( $this );
375 + $this->show_go_links();
481 376
482 - wpbc_welcome_section_10_7( $this );
377 + echo '<div';
378 + }
483 379
484 - wpbc_welcome_section_10_6( $this );
485 380
486 - wpbc_welcome_section_10_5( $this );
487 -
488 - wpbc_welcome_section_10_4( $this );
489 -
490 - wpbc_welcome_section_10_3( $this );
491 -
492 - wpbc_welcome_section_10_2( $this );
493 -
494 - wpbc_welcome_section_10_1( $this );
495 -
496 - wpbc_welcome_section_10_0( $this );
497 -
498 - wpbc_welcome_section_9_9( $this );
499 -
500 - wpbc_welcome_section_9_8( $this );
501 -
502 - ////////////////////////////////////////////////////////////////////////////////////////////////////////////
503 - // Footer
504 - ////////////////////////////////////////////////////////////////////////////////////////////////////////////
505 - ?>
506 - <table class="about-text" style="margin-bottom:30px;height:auto;font-size:1em;width:100%;" >
507 - <tr>
508 - <td>
509 -
510 - </td>
511 - <!--td style="width:10%">
512 - <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'wpbc-getting-started' ), 'index.php' ) ) ); ?>"
513 - style="float: right; height: 36px; line-height: 34px;"
514 - class="button-primary"
515 - >&nbsp;<strong>Get Started</strong> <span style="font-size: 20px;line-height: 18px;padding-left: 5px;">&rsaquo;&rsaquo;&rsaquo;</span>
516 - </a>
517 - </td-->
518 - </tr>
519 - </table>
520 -
521 - </div><?php
522 - }
523 -
524 -
525 381 function expand_section_start( $section_param_arr ) {
526 382
527 383 ?>
528 384 <div class="clear" style="margin-top:20px;"></div><?php
@@ -563,8 +419,9 @@
563 419 }
564 420
565 421
566 422 function section_img_url( $relative_path_to_img ) {
423 +
567 424 return esc_url( $this->asset_path . $relative_path_to_img );
568 425 }
569 426
570 427
@@ -647,5 +504,5 @@
647 504 <?php
648 505 }
649 506 }
650 507
651 -$wpbc_welcome = new WPBC_Welcome();
508 +$wpbc_welcome = new WPBC_Welcome();