From e9150b21a7746e510e4c6c369b47ea38c81a5b86 Mon Sep 17 00:00:00 2001 From: Vraja Das Date: Mon, 20 Jan 2025 16:20:15 +0200 Subject: [PATCH] fix link and current step --- .../google-site-kit-connection-widget.js | 19 ++++++++++++------- .../configuration/dashboard-configuration.php | 6 +++--- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/packages/js/src/dashboard/components/google-site-kit-connection-widget.js b/packages/js/src/dashboard/components/google-site-kit-connection-widget.js index 92755ecd394..49599b4a496 100644 --- a/packages/js/src/dashboard/components/google-site-kit-connection-widget.js +++ b/packages/js/src/dashboard/components/google-site-kit-connection-widget.js @@ -21,15 +21,20 @@ import classNames from "classnames"; * @returns {Object} The button and stepper props. */ const getButtonAndStepperProps = ( active, installed, setup, connected, installUrl, activateUrl, setupUrl ) => { - let buttonProps = { - children: __( "Install Site Kit by Google", "wordpress-seo" ), - as: "a", - href: installUrl, - }; - let currentStep = 1; - let isComplete = false; + let buttonProps; + let currentStep; + let isComplete; switch ( true ) { + case ( ! installed ): + currentStep = 1; + isComplete = false; + buttonProps = { + children: __( "Install Site Kit by Google", "wordpress-seo" ), + as: "a", + href: installUrl, + }; + break; case ( ! active && installed ): currentStep = 2; buttonProps = { diff --git a/src/dashboard/application/configuration/dashboard-configuration.php b/src/dashboard/application/configuration/dashboard-configuration.php index dfbd550da0e..8264317c7a9 100644 --- a/src/dashboard/application/configuration/dashboard-configuration.php +++ b/src/dashboard/application/configuration/dashboard-configuration.php @@ -157,9 +157,9 @@ public function get_google_site_kit_configuration(): array { 'setup' => \get_option( 'googlesitekit_has_connected_admins', false ) === '1', 'connected' => $this->options_helper->get( 'google_site_kit_connected', false ), 'featureActive' => $this->google_site_kit_conditional->is_met(), - 'installUrl' => $google_site_kit_install_url, - 'activateUrl' => $google_site_kit_activate_url, - 'setupUrl' => $google_site_kit_setup_url, + 'installUrl' => \html_entity_decode( $google_site_kit_install_url ), + 'activateUrl' => \html_entity_decode( $google_site_kit_activate_url ), + 'setupUrl' => \html_entity_decode( $google_site_kit_setup_url ), ]; } }