$payload ); } /** * Get the handoff form data for a client-side submit. * * The Lite Welcome screen POSTs the handshake from JS after its AJAX * round-trip, so it needs the form action and payload rather than a * rendered document. * * @since 2.0.1 * * @param string $exit_url Where to send the user on close. * @param string $restart_url Where to send the user on restart. * * @return array{action: string, payload: array} */ public function get_handoff_data( string $exit_url, string $restart_url ): array { return [ 'action' => $this->get_handoff_url(), 'payload' => $this->build_payload( $exit_url, $restart_url ), ]; } /** * Whether the wizard SPA is reachable and healthy right now. * * Server-side preflight run before the handoff: a top-level form POST * abandons the bridge page, so a client-side timeout cannot recover once the * browser has navigated to a broken SPA. Probing the co-located health route * here lets the orchestrator fall back to the Welcome page instead. The probe * runs on every launch (which is infrequent) and is intentionally not cached, * so a changed handoff URL or a down SPA is reflected immediately. * * @since 2.0.0 * * @return bool */ public function is_spa_reachable(): bool { /** * Short-circuit the SPA health probe. * * Return a boolean to force the result (e.g. true in local development * against a sail-hosted Product API, or false to exercise the fallback). * * @since 2.0.0 * * @param bool|null $reachable Forced result, or null to run the probe. */ $forced = apply_filters( 'wpforms_setup_wizard_bridge_spa_reachable', null ); if ( is_bool( $forced ) ) { return $forced; } $health_url = $this->get_health_url(); if ( $health_url === '' ) { return false; } $response = wp_remote_get( $health_url, [ 'timeout' => 5, 'sslverify' => true, ] ); return ! is_wp_error( $response ) && wp_remote_retrieve_response_code( $response ) === 200; } /** * Get the SPA health probe URL, co-located with the handoff endpoint. * * @since 2.0.0 * * @return string */ private function get_health_url(): string { return trailingslashit( $this->get_handoff_url() ) . 'health'; } /** * Get the SPA endpoint that consumes the handshake POST. * * The `WPFORMS_SETUP_WIZARD_URL` constant overrides the default for local * development against a sail-hosted Product API. * * @since 2.0.0 * * @return string */ private function get_handoff_url(): string { if ( defined( 'WPFORMS_SETUP_WIZARD_URL' ) ) { return (string) WPFORMS_SETUP_WIZARD_URL; } return 'https://wpformsapi.com/setupwizard/v1'; } }
Fatal error: Uncaught Error: Class "WPForms\SetupWizard\Bridge" not found in /htdocs/ongola.com/wp-content/plugins/wpforms-lite/src/SetupWizard/SetupWizard.php:198 Stack trace: #0 /htdocs/ongola.com/wp-content/plugins/wpforms-lite/src/SetupWizard/SetupWizard.php(171): WPForms\SetupWizard\SetupWizard->load_dependency('WPForms\\SetupWi...', Array) #1 /htdocs/ongola.com/wp-content/plugins/wpforms-lite/src/SetupWizard/SetupWizard.php(153): WPForms\SetupWizard\SetupWizard->load_dependencies() #2 /htdocs/ongola.com/wp-content/plugins/wpforms-lite/src/WPForms.php(433): WPForms\SetupWizard\SetupWizard->init() #3 /htdocs/ongola.com/wp-includes/class-wp-hook.php(353): WPForms\WPForms->{closure:WPForms\WPForms::register():422}('') #4 /htdocs/ongola.com/wp-includes/class-wp-hook.php(377): WP_Hook->apply_filters(NULL, Array) #5 /htdocs/ongola.com/wp-includes/plugin.php(523): WP_Hook->do_action(Array) #6 /htdocs/ongola.com/wp-settings.php(779): do_action('init') #7 /htdocs/ongola.com/wp-config.php(95): require_once('/htdocs/ongola....') #8 /htdocs/ongola.com/wp-load.php(50): require_once('/htdocs/ongola....') #9 /htdocs/ongola.com/wp-blog-header.php(13): require_once('/htdocs/ongola....') #10 /htdocs/ongola.com/index.php(17): require('/htdocs/ongola....') #11 {main} thrown in /htdocs/ongola.com/wp-content/plugins/wpforms-lite/src/SetupWizard/SetupWizard.php on line 198