'jetpack_client_authorize_fallback_url', admin_url() ); $redirect = wp_validate_redirect( $redirect ) ? $redirect : $fallback_redirect; wp_safe_redirect( $redirect ); } /** * The authorhize_redirect webhook handler */ public function handle_authorize_redirect() { $authorize_redirect_handler = new Webhooks\Authorize_Redirect( $this->connection ); $authorize_redirect_handler->handle(); } /** * The `exit` is wrapped into a method so we could mock it. */ protected function do_exit() { exit; } /** * Handle the `connect_url_redirect` action, * which is usually called to repeat an attempt for user to authorize the connection. * * @return void */ public function handle_connect_url_redirect() { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- no site changes. $from = ! empty( $_GET['from'] ) ? sanitize_text_field( wp_unslash( $_GET['from'] ) ) : 'iframe'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- no site changes, sanitization happens in get_authorization_url() $redirect = ! empty( $_GET['redirect_after_auth'] ) ? wp_unslash( $_GET['redirect_after_auth'] ) : false; add_filter( 'allowed_redirect_hosts', array( Host::class, 'allow_wpcom_environments' ) ); if ( ! $this->connection->is_user_connected() ) { if ( ! $this->connection->is_connected() ) { $this->connection->register(); } $connect_url = add_query_arg( 'from', $from, $this->connection->get_authorization_url( null, $redirect ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- no site changes. if ( isset( $_GET['notes_iframe'] ) ) { $connect_url .= '¬es_iframe'; } wp_safe_redirect( $connect_url ); $this->do_exit(); } elseif ( ! isset( $_GET['calypso_env'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- no site changes. ( new CookieState() )->state( 'message', 'already_authorized' ); wp_safe_redirect( $redirect ); $this->do_exit(); } else { $connect_url = add_query_arg( array( 'from' => $from, 'already_authorized' => true, ), $this->connection->get_authorization_url() ); wp_safe_redirect( $connect_url ); $this->do_exit(); } } }
Fatal error: Uncaught Error: Class "Automattic\Jetpack\Connection\Webhooks" not found in /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-connection/src/class-manager.php:127 Stack trace: #0 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-config/src/class-config.php(267): Automattic\Jetpack\Connection\Manager::configure() #1 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-config/src/class-config.php(219): Automattic\Jetpack\Config->enable_connection() #2 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-config/src/class-config.php(109): Automattic\Jetpack\Config->ensure_feature('connection') #3 /htdocs/wp-includes/class-wp-hook.php(310): Automattic\Jetpack\Config->on_plugins_loaded('') #4 /htdocs/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array) #5 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #6 /htdocs/wp-settings.php(495): do_action('plugins_loaded') #7 /htdocs/wp-config.php(96): require_once('/htdocs/wp-sett...') #8 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #9 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #10 /htdocs/index.php(17): require('/htdocs/wp-blog...') #11 {main} thrown in /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-connection/src/class-manager.php on line 127