Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* AnalyticsActivationErrorNotification component stories.
* InitialSetupErrorNotification component stories.
*
* Site Kit by Google, Copyright 2026 Google LLC
*
Expand All @@ -20,16 +20,16 @@
* Internal dependencies
*/
import { Story } from '@/js/types/Story';
import AnalyticsActivationErrorNotification from './AnalyticsActivationErrorNotification';
import InitialSetupErrorNotification from './InitialSetupErrorNotification';

function Template() {
return <AnalyticsActivationErrorNotification onRetry={ () => {} } />;
return <InitialSetupErrorNotification onRetry={ () => {} } />;
}

export const Default = Template.bind( {} ) as Story;
Default.storyName = 'AnalyticsActivationErrorNotification';
Default.storyName = 'InitialSetupErrorNotification';
Default.scenario = {};

export default {
title: 'Setup/Using Proxy With Sign-in/Components/AnalyticsActivationErrorNotification',
title: 'Setup/Using Proxy With Sign-in/Components/InitialSetupErrorNotification',
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* SetupUsingProxyWithSignIn AnalyticsActivationErrorNotification component.
* SetupUsingProxyWithSignIn InitialSetupErrorNotification component.
*
* Site Kit by Google, Copyright 2026 Google LLC
*
Expand Down Expand Up @@ -32,19 +32,19 @@ import { __ } from '@wordpress/i18n';
import Notice from '@/js/components/Notice';
import { NOTICE_TYPES } from '@/js/components/Notice/constants';

interface AnalyticsActivationErrorNotificationProps {
interface InitialSetupErrorNotificationProps {
onRetry?: () => void;
}

export const ANALYTICS_ACTIVATION_ERROR_NOTIFICATION =
'analytics-activation-error-notification';
export const INITIAL_SETUP_ERROR_NOTIFICATION =
'initial-setup-error-notification';

const AnalyticsActivationErrorNotification: FC<
AnalyticsActivationErrorNotificationProps
> = ( { onRetry }: AnalyticsActivationErrorNotificationProps ) => {
const InitialSetupErrorNotification: FC<
InitialSetupErrorNotificationProps
> = ( { onRetry }: InitialSetupErrorNotificationProps ) => {
return (
<Notice
className="googlesitekit-setup__analytics-activation-error-notification"
className="googlesitekit-setup__initial-setup-error-notification"
title={ __( 'Connecting Site Kit failed', 'google-site-kit' ) }
description={ __(
'Something went wrong while connecting Site Kit to your site. Please try again.',
Expand All @@ -59,4 +59,4 @@ const AnalyticsActivationErrorNotification: FC<
);
};

export default AnalyticsActivationErrorNotification;
export default InitialSetupErrorNotification;
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import { withQuery } from '@storybook/addon-queryparams';
*/
import { Provider as ViewContextProvider } from '@/js/components/Root/ViewContextContext';
import SetupUsingProxyWithSignIn from '@/js/components/setup/SetupUsingProxyWithSignIn';
import AnalyticsActivationErrorNotification, {
ANALYTICS_ACTIVATION_ERROR_NOTIFICATION,
} from '@/js/components/setup/SetupUsingProxyWithSignIn/AnalyticsActivationErrorNotification';
import InitialSetupErrorNotification, {
INITIAL_SETUP_ERROR_NOTIFICATION,
} from '@/js/components/setup/SetupUsingProxyWithSignIn/InitialSetupErrorNotification';
import { VIEW_CONTEXT_MAIN_DASHBOARD } from '@/js/googlesitekit/constants';
import {
CORE_USER,
Expand Down Expand Up @@ -343,9 +343,9 @@ SecondaryAdminWithSharedServices.parameters = {
};
SecondaryAdminWithSharedServices.scenario = {};

export const AnalyticsActivationError = Template.bind( {} );
AnalyticsActivationError.storyName = 'Analytics activation error';
AnalyticsActivationError.args = {
export const InitialSetupError = Template.bind( {} );
InitialSetupError.storyName = 'Initial setup error';
InitialSetupError.args = {
setupRegistry: ( registry ) => {
provideSiteConnection( registry, {
hasConnectedAdmins: false,
Expand All @@ -362,11 +362,9 @@ AnalyticsActivationError.args = {

registry
.dispatch( CORE_NOTIFICATIONS )
.registerNotification( ANALYTICS_ACTIVATION_ERROR_NOTIFICATION, {
.registerNotification( INITIAL_SETUP_ERROR_NOTIFICATION, {
Component: () => (
<AnalyticsActivationErrorNotification
onRetry={ () => null }
/>
<InitialSetupErrorNotification onRetry={ () => null } />
),
priority: PRIORITY.ERROR_HIGH,
areaSlug: NOTIFICATION_AREAS.SPLASH_CONTENT,
Expand All @@ -377,11 +375,11 @@ AnalyticsActivationError.args = {
},
};

AnalyticsActivationError.parameters = {
InitialSetupError.parameters = {
features: [ 'setupFlowRefresh', 'setupFlowRefreshPhase4' ],
};

AnalyticsActivationError.scenario = {};
InitialSetupError.scenario = {};

export default {
title: 'Setup / Using Proxy With Sign-in and setupFlowRefresh enabled',
Expand Down
10 changes: 5 additions & 5 deletions assets/js/components/setup/SetupUsingProxyWithSignIn/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ import {
ANALYTICS_NOTICE_CHECKBOX,
ANALYTICS_NOTICE_FORM_NAME,
} from '@/js/components/setup/constants';
import AnalyticsActivationErrorNotification, {
ANALYTICS_ACTIVATION_ERROR_NOTIFICATION,
} from '@/js/components/setup/SetupUsingProxyWithSignIn/AnalyticsActivationErrorNotification';
import InitialSetupErrorNotification, {
INITIAL_SETUP_ERROR_NOTIFICATION,
} from '@/js/components/setup/SetupUsingProxyWithSignIn/InitialSetupErrorNotification';
import { setItem } from '@/js/googlesitekit/api/cache';
import { CORE_LOCATION } from '@/js/googlesitekit/datastore/location/constants';
import { CORE_SITE } from '@/js/googlesitekit/datastore/site/constants';
Expand Down Expand Up @@ -181,9 +181,9 @@ export default function SetupUsingProxyWithSignIn() {
return;
}

registerNotification( ANALYTICS_ACTIVATION_ERROR_NOTIFICATION, {
registerNotification( INITIAL_SETUP_ERROR_NOTIFICATION, {
Component: () => (
<AnalyticsActivationErrorNotification
<InitialSetupErrorNotification
onRetry={ onButtonClick }
/>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ describe( 'SetupUsingProxyWithSignIn', () => {
expect( console ).toHaveErrored();
} );

it( 'should retry plugin setup when the Analytics activation error notification CTA is clicked', async () => {
it( 'should retry plugin setup when the initial setup error notification CTA is clicked', async () => {
fetchMock.postOnce(
new RegExp(
'^/google-site-kit/v1/core/modules/data/activation'
Expand Down
6 changes: 3 additions & 3 deletions bin/check-commit-msg.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ function has_color_support() {

if ( DIRECTORY_SEPARATOR === '\\' ) {
return ( function_exists( 'sapi_windows_vt100_support' ) && sapi_windows_vt100_support( STDERR ) ) // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctions.sapi_windows_vt100_supportFound
|| false !== getenv( 'ANSICON' )
|| 'ON' === getenv( 'ConEmuANSI' )
|| 'xterm' === getenv( 'TERM' );
|| false !== getenv( 'ANSICON' )
|| 'ON' === getenv( 'ConEmuANSI' )
|| 'xterm' === getenv( 'TERM' );
}

if ( function_exists( 'stream_isatty' ) ) {
Expand Down
14 changes: 7 additions & 7 deletions includes/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ private function get_amp_mode_from_amp_plugin() {
}

$exposes_support_mode = defined( 'AMP_Theme_Support::STANDARD_MODE_SLUG' )
&& defined( 'AMP_Theme_Support::TRANSITIONAL_MODE_SLUG' )
&& defined( 'AMP_Theme_Support::READER_MODE_SLUG' );
&& defined( 'AMP_Theme_Support::TRANSITIONAL_MODE_SLUG' )
&& defined( 'AMP_Theme_Support::READER_MODE_SLUG' );

if ( defined( 'AMP__VERSION' ) ) {
$amp_plugin_version = AMP__VERSION;
Expand All @@ -369,12 +369,12 @@ private function get_amp_mode_from_amp_plugin() {

if ( $amp_plugin_version_2_or_higher ) {
$exposes_support_mode = class_exists( 'AMP_Options_Manager' )
&& method_exists( 'AMP_Options_Manager', 'get_option' )
&& $exposes_support_mode;
&& method_exists( 'AMP_Options_Manager', 'get_option' )
&& $exposes_support_mode;
} else {
$exposes_support_mode = class_exists( 'AMP_Theme_Support' )
&& method_exists( 'AMP_Theme_Support', 'get_support_mode' )
&& $exposes_support_mode;
&& method_exists( 'AMP_Theme_Support', 'get_support_mode' )
&& $exposes_support_mode;
}

if ( $exposes_support_mode ) {
Expand Down Expand Up @@ -419,7 +419,7 @@ public function is_network_active() {

// Consider MU plugins and network-activated plugins as network-active.
$this->network_active = strpos( wp_normalize_path( __FILE__ ), wp_normalize_path( WPMU_PLUGIN_DIR ) ) === 0
|| in_array( WP_PLUGIN_DIR . '/' . GOOGLESITEKIT_PLUGIN_BASENAME, $network_active_plugins, true );
|| in_array( WP_PLUGIN_DIR . '/' . GOOGLESITEKIT_PLUGIN_BASENAME, $network_active_plugins, true );
} else {
$this->network_active = false;
}
Expand Down
14 changes: 7 additions & 7 deletions includes/Core/Admin/Available_Tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ private function render_tool_box() {
<div class="card">
<h2 class="title"><?php esc_html_e( 'Reset Site Kit', 'google-site-kit' ); ?></h2>
<p>
<?php
esc_html_e(
'Resetting will disconnect all users and remove all Site Kit settings and data within WordPress. You and any other users who wish to use Site Kit will need to reconnect to restore access.',
'google-site-kit'
)
?>
<?php
esc_html_e(
'Resetting will disconnect all users and remove all Site Kit settings and data within WordPress. You and any other users who wish to use Site Kit will need to reconnect to restore access.',
'google-site-kit'
)
?>
</p>
<p>
<a
class="button button-primary"
href="<?php echo esc_url( Reset::url() ); ?>"
>
<?php esc_html_e( 'Reset Site Kit', 'google-site-kit' ); ?>
<?php esc_html_e( 'Reset Site Kit', 'google-site-kit' ); ?>
</a>
</p>
</div>
Expand Down
42 changes: 21 additions & 21 deletions includes/Core/Admin/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,30 +176,30 @@ private function render_googlesitekit_wp_dashboard() {
?>
<div id="js-googlesitekit-wp-dashboard" data-view-only="<?php echo esc_attr( $is_view_only ); ?>" class="googlesitekit-plugin <?php echo esc_attr( $class_names ); ?>">
<div class="googlesitekit-wp-dashboard googlesitekit-wp-dashboard-loading">
<?php
<?php

$this->render_loading_container( 'googlesitekit-wp-dashboard__cta' );
?>
$this->render_loading_container( 'googlesitekit-wp-dashboard__cta' );
?>

<div class="googlesitekit-wp-dashboard-stats">
<?php
if ( $display_analytics_data ) {
$this->render_loading_container( 'googlesitekit-wp-dashboard-loading__can_view_analytics' );
}

if ( $display_search_console_data ) {
$this->render_loading_container( 'googlesitekit-wp-dashboard-loading__search_console_active_and_connected' );
}

if ( $display_analytics_cta ) {
$this->render_loading_container( 'googlesitekit-wp-dashboard-stats__cta' );
}

if ( $display_analytics_data ) {
$this->render_loading_container( 'googlesitekit-unique-visitors-chart-widget' );
$this->render_loading_container( 'googlesitekit-search-console-widget' );
}
?>
<?php
if ( $display_analytics_data ) {
$this->render_loading_container( 'googlesitekit-wp-dashboard-loading__can_view_analytics' );
}

if ( $display_search_console_data ) {
$this->render_loading_container( 'googlesitekit-wp-dashboard-loading__search_console_active_and_connected' );
}

if ( $display_analytics_cta ) {
$this->render_loading_container( 'googlesitekit-wp-dashboard-stats__cta' );
}

if ( $display_analytics_data ) {
$this->render_loading_container( 'googlesitekit-unique-visitors-chart-widget' );
$this->render_loading_container( 'googlesitekit-search-console-widget' );
}
?>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion includes/Core/Admin/Notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function render() {

?>
<div id="<?php echo esc_attr( 'googlesitekit-notice-' . $this->slug ); ?>" class="<?php echo esc_attr( $class ); ?>">
<?php echo $content; /* phpcs:ignore WordPress.Security.EscapeOutput */ ?>
<?php echo $content; /* phpcs:ignore WordPress.Security.EscapeOutput */ ?>
</div>
<?php
}
Expand Down
20 changes: 10 additions & 10 deletions includes/Core/Admin/Screen.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,10 @@ public function enqueue_assets( Assets $assets ) {
$assets->enqueue_asset( 'googlesitekit-admin-css' );

$cb = is_callable( $this->args['enqueue_callback'] )
? $this->args['enqueue_callback']
: function ( Assets $assets ) {
$assets->enqueue_asset( $this->slug );
};
? $this->args['enqueue_callback']
: function ( Assets $assets ) {
$assets->enqueue_asset( $this->slug );
};

call_user_func( $cb, $assets );
}
Expand All @@ -247,14 +247,14 @@ public function enqueue_assets( Assets $assets ) {
*/
private function render( Context $context ) {
$cb = is_callable( $this->args['render_callback'] )
? $this->args['render_callback']
: function () {
printf( '<div id="js-%s" class="googlesitekit-page"></div>', esc_attr( $this->slug ) );
};
? $this->args['render_callback']
: function () {
printf( '<div id="js-%s" class="googlesitekit-page"></div>', esc_attr( $this->slug ) );
};

echo '<div class="googlesitekit-plugin">';
$this->render_noscript_html();
call_user_func( $cb, $context );
$this->render_noscript_html();
call_user_func( $cb, $context );
echo '</div>';
}
}
34 changes: 17 additions & 17 deletions includes/Core/Admin_Bar/Admin_Bar.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,29 +292,29 @@ private function menu_markup() {

?>
<div class="googlesitekit-plugin ab-sub-wrapper">
<?php $this->render_noscript_html(); ?>
<?php $this->render_noscript_html(); ?>

<div id="js-googlesitekit-adminbar" data-view-only="<?php echo esc_attr( $is_view_only ); ?>" class="googlesitekit-adminbar">

<?php
/**
* Display server rendered content before JS-based adminbar modules.
*
* @since 1.0.0
*/
do_action( 'googlesitekit_adminbar_modules_before' );
?>
<?php
/**
* Display server rendered content before JS-based adminbar modules.
*
* @since 1.0.0
*/
do_action( 'googlesitekit_adminbar_modules_before' );
?>

<section id="js-googlesitekit-adminbar-modules" class="googlesitekit-adminbar-modules"></section>

<?php
/**
* Display server rendered content after JS-based adminbar modules.
*
* @since 1.0.0
*/
do_action( 'googlesitekit_adminbar_modules_after' );
?>
<?php
/**
* Display server rendered content after JS-based adminbar modules.
*
* @since 1.0.0
*/
do_action( 'googlesitekit_adminbar_modules_after' );
?>
</div>
</div>
<?php
Expand Down
4 changes: 2 additions & 2 deletions includes/Core/Authentication/Clients/OAuth_Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,8 @@ private function get_authorize_user_redirect_url_for_error() {
}

return current_user_can( Permissions::VIEW_DASHBOARD )
? $this->context->admin_url( 'dashboard' )
: $this->context->admin_url( 'splash' );
? $this->context->admin_url( 'dashboard' )
: $this->context->admin_url( 'splash' );
}

/**
Expand Down
4 changes: 2 additions & 2 deletions includes/Core/Authentication/Google_Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ private function request( $uri, $credentials, array $args = array() ) {
*/
public function get_site_fields() {
$return_uri = Feature_Flags::enabled( 'setupFlowRefresh' )
? admin_url( 'index.php' )
: $this->context->admin_url( 'splash' );
? admin_url( 'index.php' )
: $this->context->admin_url( 'splash' );
$analytics_redirect_uri = add_query_arg( 'gatoscallback', 1, admin_url( 'index.php' ) );

if ( Feature_Flags::enabled( 'setupFlowRefresh' ) ) {
Expand Down
Loading