| @@ -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). |
| @@ -241,22 +241,59 @@ | ||
| 241 | 241 | $booking_activation_process = get_bk_option( 'booking_activation_process' ); |
| 242 | 242 | if ( $booking_activation_process == 'On' ) |
| 243 | 243 | return; |
| 244 | 244 | |
| 245 | - // Bail if no activation redirect transient is set | |
| 246 | - if ( ! get_transient( '_booking_activation_redirect' ) ) { // $. | |
| 245 | + if ( function_exists( 'wp_doing_ajax' ) && wp_doing_ajax() ) { | |
| 247 | 246 | return; |
| 248 | 247 | } |
| 249 | 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 | + | |
| 250 | 275 | // Delete the redirect transient |
| 251 | 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 | + } | |
| 252 | 280 | |
| 253 | - // 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 | + } | |
| 254 | 295 | |
| 255 | - // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing | |
| 256 | - if ( wpbc_is_this_demo() || is_network_admin() || isset( $_GET[ 'activate-multi' ] ) || defined( 'IFRAME_REQUEST' ) ) | |
| 257 | - return; | |
| 258 | - | |
| 259 | 296 | // Set mark, that we already redirected to About screen //FixIn: 5.4.5 |
| 260 | 297 | $redirect_for_version = get_bk_option( 'booking_activation_redirect_for_version' ); |
| 261 | 298 | if ( $redirect_for_version == WP_BK_VERSION_NUM ) |
| 262 | 299 | return; |
| @@ -291,11 +328,9 @@ | ||
| 291 | 328 | echo esc_html( $wpbc_starter_page['button_title'] ); ?></a> |
| 292 | 329 | <?php |
| 293 | 330 | } |
| 294 | 331 | } else { |
| 295 | - $wp_post_booking_absolute = function_exists( 'wpbc_stp_wiz__is_exist_published_page_with_booking_form' ) | |
| 296 | - ? wpbc_stp_wiz__is_exist_published_page_with_booking_form() | |
| 297 | - : false; | |
| 332 | + $wp_post_booking_absolute = false; | |
| 298 | 333 | if ( ! empty( $wp_post_booking_absolute ) ) { |
| 299 | 334 | ?> |
| 300 | 335 | <a class="button button-secondary" |
| 301 | 336 | style="font-size: 20px;padding: 0 1em;height: 44px;line-height: 40px;" |
| @@ -321,8 +356,14 @@ | ||
| 321 | 356 | $this->maintence_section(); |
| 322 | 357 | |
| 323 | 358 | $this->section_9_8_css(); |
| 324 | 359 | |
| 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 ); | |
| 325 | 366 | wpbc_welcome_section_11_4( $this ); |
| 326 | 367 | wpbc_welcome_section_11_3( $this ); |
| 327 | 368 | wpbc_welcome_section_11_2( $this ); |
| 328 | 369 | wpbc_welcome_section_11_1( $this ); |