rdPress.com.
*
* @param int Jetpack Blog ID.
*
* @since 1.7.0
* @since-jetpack 4.2.0
*/
do_action( 'jetpack_client_authorized', Jetpack_Options::get_option( 'id' ) );
$tracking->record_user_event( 'jpc_client_authorize_success' );
}
$fallback_redirect = apply_filters( '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.
*
* @return never
*/
protected function do_exit() {
exit( 0 );
}
/**
* 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';
$skip_pricing = filter_input( INPUT_GET, 'skip_pricing', FILTER_VALIDATE_BOOLEAN );
// 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 ) );
if ( $skip_pricing ) {
$connect_url = add_query_arg( 'skip_pricing', '1', $connect_url );
}
// 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 {
if ( 'connect-after-checkout' === $from && $redirect ) {
wp_safe_redirect( $redirect );
$this->do_exit();
}
$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 /home/hexcom/public_html/gameshop/wp-content/plugins/woocommerce/vendor/automattic/jetpack-connection/src/class-manager.php:161
Stack trace:
#0 /home/hexcom/public_html/gameshop/wp-content/plugins/woocommerce/vendor/automattic/jetpack-config/src/class-config.php(266): Automattic\Jetpack\Connection\Manager::configure()
#1 /home/hexcom/public_html/gameshop/wp-content/plugins/woocommerce/vendor/automattic/jetpack-config/src/class-config.php(217): Automattic\Jetpack\Config->enable_connection()
#2 /home/hexcom/public_html/gameshop/wp-content/plugins/woocommerce/vendor/automattic/jetpack-config/src/class-config.php(107): Automattic\Jetpack\Config->ensure_feature()
#3 /home/hexcom/public_html/gameshop/wp-includes/class-wp-hook.php(353): Automattic\Jetpack\Config->on_plugins_loaded()
#4 /home/hexcom/public_html/gameshop/wp-includes/class-wp-hook.php(377): WP_Hook->apply_filters()
#5 /home/hexcom/public_html/gameshop/wp-includes/plugin.php(523): WP_Hook->do_action()
#6 /home/hexcom/public_html/gameshop/wp-settings.php(630): do_action()
#7 /home/hexcom/public_html/gameshop/wp-config.php(100): require_once('/home/hexcom/pu...')
#8 /home/hexcom/public_html/gameshop/wp-load.php(50): require_once('/home/hexcom/pu...')
#9 /home/hexcom/public_html/gameshop/wp-blog-header.php(13): require_once('/home/hexcom/pu...')
#10 /home/hexcom/public_html/gameshop/index.php(17): require('/home/hexcom/pu...')
#11 {main}
thrown in /home/hexcom/public_html/gameshop/wp-content/plugins/woocommerce/vendor/automattic/jetpack-connection/src/class-manager.php on line 161