sion, 'pro' => aioseo()->pro ] ); } /** * Validate the trust token and tells the microservice that we can reauthenticate. * * @since 4.3.0 * * @return void */ public function reauthenticate() { foreach ( [ 'key', 'token', 'tt' ] as $arg ) { if ( empty( $_REQUEST[ $arg ] ) ) { wp_send_json_error( [ 'error' => 'authenticate_missing_arg', 'message' => 'Authentication request missing parameter: ' . $arg, 'version' => aioseo()->version, 'pro' => aioseo()->pro ] ); } } $trustToken = ! empty( $_REQUEST['tt'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['tt'] ) ) : ''; if ( ! aioseo()->searchStatistics->api->trustToken->validate( $trustToken ) ) { wp_send_json_error( [ 'error' => 'authenticate_invalid_tt', 'message' => 'Invalid TT sent', 'version' => aioseo()->version, 'pro' => aioseo()->pro ] ); } // If the trust token is validated, send a success response to trigger the regular auth process. wp_send_json_success(); } /** * Saves the authenticated account, clear the existing data and redirect back to the settings page. * * @since 4.3.0 * * @return void */ private function saveAndRedirect( $profile ) { // Reset the search statistics data. aioseo()->searchStatistics->reset(); // Save the authenticated profile. aioseo()->searchStatistics->api->auth->setProfile( $profile ); // Reset dismissed alerts. $dismissedAlerts = aioseo()->settings->dismissedAlerts; foreach ( $dismissedAlerts as $key => $alert ) { if ( in_array( $key, [ 'searchConsoleNotConnected', 'searchConsoleSitemapErrors' ], true ) ) { $dismissedAlerts[ $key ] = false; } } aioseo()->settings->dismissedAlerts = $dismissedAlerts; // Maybe verifies the site. aioseo()->searchStatistics->site->maybeVerify(); // Redirects to the original page. wp_safe_redirect( $this->getRedirectUrl() ); exit; } /** * Returns the authenticated domain. * * @since 4.3.0 * * @return string The authenticated domain. */ private function getAuthenticatedDomain() { if ( empty( $_REQUEST['authedsite'] ) ) { return ''; } $authedSite = sanitize_text_field( wp_unslash( $_REQUEST['authedsite'] ) ); if ( false !== aioseo()->helpers->stringIndex( $authedSite, 'sc-domain:' ) ) { $authedSite = str_replace( 'sc-domain:', '', $authedSite ); } return $authedSite; } /** * Gets the redirect URL. * * @since 4.6.2 * * @return string The redirect URL. */ private function getRedirectUrl() { $returnTo = ! empty( $_REQUEST['return-to'] ) ? sanitize_key( $_REQUEST['return-to'] ) : ''; $redirectUrl = 'admin.php?page=aioseo'; switch ( $returnTo ) { case 'webmaster-tools': $redirectUrl = 'admin.php?page=aioseo-settings#/webmaster-tools?activetool=googleSearchConsole'; break; case 'setup-wizard': $redirectUrl = 'index.php?page=aioseo-setup-wizard#/' . aioseo()->standalone->setupWizard->getNextStage(); break; case 'search-statistics': $redirectUrl = 'admin.php?page=aioseo-search-statistics/#search-statistics'; break; } return admin_url( $redirectUrl ); } }
Fatal error: Uncaught Error: Class "AIOSEO\Plugin\Common\SearchStatistics\Api\Listener" not found in /htdocs/wp-content/plugins/all-in-one-seo-pack/app/Common/SearchStatistics/Api/Api.php:69 Stack trace: #0 /htdocs/wp-content/plugins/all-in-one-seo-pack/app/Common/SearchStatistics/SearchStatistics.php(57): AIOSEO\Plugin\Common\SearchStatistics\Api\Api->__construct() #1 /htdocs/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(317): AIOSEO\Plugin\Common\SearchStatistics\SearchStatistics->__construct() #2 /htdocs/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(97): AIOSEO\Plugin\AIOSEO->load() #3 /htdocs/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(76): AIOSEO\Plugin\AIOSEO->init() #4 /htdocs/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(414): AIOSEO\Plugin\AIOSEO::instance() #5 /htdocs/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php(96): aioseo() #6 /htdocs/wp-settings.php(526): include_once('/htdocs/wp-cont...') #7 /htdocs/wp-config.php(85): 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/all-in-one-seo-pack/app/Common/SearchStatistics/Api/Api.php on line 69