Plugin Directory

Changeset 3208808


Ignore:
Timestamp:
12/16/2024 10:21:36 PM (12 months ago)
Author:
google
Message:

Update to version 1.142.0 from GitHub

Location:
google-site-kit
Files:
98 added
92 deleted
38 edited
1 copied

Legend:

Unmodified
Added
Removed
  • google-site-kit/tags/1.142.0/dist/manifest.php

    r3201134 r3208808  
    1919    'analytics-advanced-tracking'                          => array( "analytics-advanced-tracking-ea84b2c367b69f5c094b.js", null ),
    2020    'googlesitekit-i18n'                                   => array( "googlesitekit-i18n-33cdd2dee5d1d1f4fb34.js", null ),
    21     'googlesitekit-admin-css'                              => array( "googlesitekit-admin-css-c7c4e28ef467fa74720d.min.css", null ),
    22     'googlesitekit-adminbar-css'                           => array( "googlesitekit-adminbar-css-6db776544b37175be17f.min.css", null ),
     21    'googlesitekit-admin-css'                              => array( "googlesitekit-admin-css-631051a6ae95dd6157e6.min.css", null ),
     22    'googlesitekit-adminbar-css'                           => array( "googlesitekit-adminbar-css-281d66e21d2b87430998.min.css", null ),
    2323    'googlesitekit-authorize-application-css'              => array( "googlesitekit-authorize-application-css-ce25e97404abc5a02921.min.css", null ),
    24     'googlesitekit-wp-dashboard-css'                       => array( "googlesitekit-wp-dashboard-css-c5417a27cb905717f9fc.min.css", null ),
    25     'googlesitekit-vendor'                                 => array( "googlesitekit-vendor-56e09129c0c5da07a38b.js", null ),
    26     'googlesitekit-runtime'                                => array( "runtime-28f15eb6ca67d1a2d920.js", null ),
    27     'googlesitekit-activation'                             => array( "googlesitekit-activation-f250ffdb179ce67acd13.js", null ),
    28     'googlesitekit-ad-blocking-recovery'                   => array( "googlesitekit-ad-blocking-recovery-f6e2202aedc4b9dec80a.js", null ),
    29     'googlesitekit-adminbar'                               => array( "googlesitekit-adminbar-309ccca4cdd85f61e57c.js", null ),
    30     'googlesitekit-api'                                    => array( "googlesitekit-api-51477bf3a499de73c6b0.js", null ),
    31     'googlesitekit-components'                             => array( array( "googlesitekit-components-gm2-d1deb8243b7fe27ddfd3.js", null ), array( "googlesitekit-components-gm3-26d6f652a561407fc1d9.js", null ) ),
    32     'googlesitekit-data'                                   => array( "googlesitekit-data-e2d57f0d3e8cbcde4f77.js", null ),
    33     'googlesitekit-datastore-forms'                        => array( "googlesitekit-datastore-forms-d673eb18908574ac23e4.js", null ),
    34     'googlesitekit-datastore-location'                     => array( "googlesitekit-datastore-location-b2b133386452785f40cd.js", null ),
    35     'googlesitekit-datastore-site'                         => array( "googlesitekit-datastore-site-d81c0033927d3f14fb1a.js", null ),
    36     'googlesitekit-datastore-ui'                           => array( "googlesitekit-datastore-ui-bca078eceaaa8c87948d.js", null ),
    37     'googlesitekit-datastore-user'                         => array( "googlesitekit-datastore-user-c9aee053073946d82bc6.js", null ),
    38     'googlesitekit-entity-dashboard'                       => array( "googlesitekit-entity-dashboard-909580c1ad26533618a7.js", null ),
    39     'googlesitekit-main-dashboard'                         => array( "googlesitekit-main-dashboard-00725d6f8918d582c7be.js", null ),
    40     'googlesitekit-modules'                                => array( "googlesitekit-modules-eeec4132d38e98b7da80.js", null ),
    41     'googlesitekit-modules-ads'                            => array( "googlesitekit-modules-ads-8fc1dc559868da9f2c36.js", null ),
    42     'googlesitekit-modules-adsense'                        => array( "googlesitekit-modules-adsense-e7fb25a5bd63d8fcdd08.js", null ),
    43     'googlesitekit-modules-analytics-4'                    => array( "googlesitekit-modules-analytics-4-f382f0563523da5f8023.js", null ),
    44     'googlesitekit-modules-pagespeed-insights'             => array( "googlesitekit-modules-pagespeed-insights-ac9df42867d70783b841.js", null ),
    45     'googlesitekit-modules-reader-revenue-manager'         => array( "googlesitekit-modules-reader-revenue-manager-fbbb8a6b54f8e8e6c506.js", null ),
    46     'googlesitekit-modules-search-console'                 => array( "googlesitekit-modules-search-console-7ef9910074ab8c22bab3.js", null ),
    47     'googlesitekit-modules-sign-in-with-google'            => array( "googlesitekit-modules-sign-in-with-google-5438d79c1a357d5f1552.js", null ),
    48     'googlesitekit-modules-tagmanager'                     => array( "googlesitekit-modules-tagmanager-7c01bc6dc43a4de58a7e.js", null ),
    49     'googlesitekit-notifications'                          => array( "googlesitekit-notifications-990bda6838a2b33db477.js", null ),
    50     'googlesitekit-polyfills'                              => array( "googlesitekit-polyfills-2ca995545dced5490968.js", null ),
    51     'googlesitekit-settings'                               => array( "googlesitekit-settings-3d397e7aeec169a6f6f7.js", null ),
    52     'googlesitekit-splash'                                 => array( "googlesitekit-splash-77f274ec773bb062bf6b.js", null ),
    53     'googlesitekit-user-input'                             => array( "googlesitekit-user-input-f2a4eab971b7ec745147.js", null ),
    54     'googlesitekit-widgets'                                => array( "googlesitekit-widgets-870e0a6fad71d1353b97.js", null ),
    55     'googlesitekit-wp-dashboard'                           => array( "googlesitekit-wp-dashboard-d26ef36f87825368c95d.js", null ),
     24    'googlesitekit-wp-dashboard-css'                       => array( "googlesitekit-wp-dashboard-css-0fc5cdb23e1da0303b0d.min.css", null ),
     25    'googlesitekit-vendor'                                 => array( "googlesitekit-vendor-6b24bb356fa23b3d09d7.js", null ),
     26    'googlesitekit-runtime'                                => array( "runtime-e5c5db16360d2c7a2c35.js", null ),
     27    'googlesitekit-activation'                             => array( "googlesitekit-activation-904456dfa45a7bf7611a.js", null ),
     28    'googlesitekit-ad-blocking-recovery'                   => array( "googlesitekit-ad-blocking-recovery-d71ee6df4e7addae69ec.js", null ),
     29    'googlesitekit-adminbar'                               => array( "googlesitekit-adminbar-9af92010e6777c6696f3.js", null ),
     30    'googlesitekit-api'                                    => array( "googlesitekit-api-19255a6b438f9ad0a040.js", null ),
     31    'googlesitekit-components'                             => array( array( "googlesitekit-components-gm2-6fe72015578197d038f1.js", null ), array( "googlesitekit-components-gm3-6af3039137f53dc8dd37.js", null ) ),
     32    'googlesitekit-data'                                   => array( "googlesitekit-data-050bcf046a0bf4e32143.js", null ),
     33    'googlesitekit-datastore-forms'                        => array( "googlesitekit-datastore-forms-52fa86100909ae62978e.js", null ),
     34    'googlesitekit-datastore-location'                     => array( "googlesitekit-datastore-location-178144613b0bcdf6a463.js", null ),
     35    'googlesitekit-datastore-site'                         => array( "googlesitekit-datastore-site-fe1cc3250299edf04507.js", null ),
     36    'googlesitekit-datastore-ui'                           => array( "googlesitekit-datastore-ui-ce7100e6b7d5cf5320f8.js", null ),
     37    'googlesitekit-datastore-user'                         => array( "googlesitekit-datastore-user-6e6dbf78ecfd97d63650.js", null ),
     38    'googlesitekit-entity-dashboard'                       => array( "googlesitekit-entity-dashboard-5b9b906ead2199337ada.js", null ),
     39    'googlesitekit-main-dashboard'                         => array( "googlesitekit-main-dashboard-06a04c1638abd60081ec.js", null ),
     40    'googlesitekit-metric-selection'                       => array( "googlesitekit-metric-selection-8622b3253697ec92bd12.js", null ),
     41    'googlesitekit-modules'                                => array( "googlesitekit-modules-b36d5dcc1fa33778aa8a.js", null ),
     42    'googlesitekit-modules-ads'                            => array( "googlesitekit-modules-ads-71257414eb8eb27b8478.js", null ),
     43    'googlesitekit-modules-adsense'                        => array( "googlesitekit-modules-adsense-9482d78b42d7ef29b823.js", null ),
     44    'googlesitekit-modules-analytics-4'                    => array( "googlesitekit-modules-analytics-4-80e726305b05bd06dacc.js", null ),
     45    'googlesitekit-modules-pagespeed-insights'             => array( "googlesitekit-modules-pagespeed-insights-06e61c09acfbcd9b87b7.js", null ),
     46    'googlesitekit-modules-reader-revenue-manager'         => array( "googlesitekit-modules-reader-revenue-manager-ba4e865f16154d2a121d.js", null ),
     47    'googlesitekit-modules-search-console'                 => array( "googlesitekit-modules-search-console-be4fffc3d4404b7d5978.js", null ),
     48    'googlesitekit-modules-sign-in-with-google'            => array( "googlesitekit-modules-sign-in-with-google-4b79763f0ae399c93438.js", null ),
     49    'googlesitekit-modules-tagmanager'                     => array( "googlesitekit-modules-tagmanager-8d556053c680ab6fed4b.js", null ),
     50    'googlesitekit-notifications'                          => array( "googlesitekit-notifications-16c629cb2b0e415158d4.js", null ),
     51    'googlesitekit-polyfills'                              => array( "googlesitekit-polyfills-fa5ebdaece9e2d991408.js", null ),
     52    'googlesitekit-settings'                               => array( "googlesitekit-settings-279994567e0f3a4dec37.js", null ),
     53    'googlesitekit-splash'                                 => array( "googlesitekit-splash-b1edbc0030571277701c.js", null ),
     54    'googlesitekit-user-input'                             => array( "googlesitekit-user-input-93f6eff03b4ad0efceb2.js", null ),
     55    'googlesitekit-widgets'                                => array( "googlesitekit-widgets-5059de819036d0cb61bd.js", null ),
     56    'googlesitekit-wp-dashboard'                           => array( "googlesitekit-wp-dashboard-f1dcc826e50bfdda1ea1.js", null ),
    5657);
  • google-site-kit/tags/1.142.0/google-site-kit.php

    r3201134 r3208808  
    1212 * Plugin URI:        https://sitekit.withgoogle.com
    1313 * Description:       Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
    14  * Version:           1.141.0
     14 * Version:           1.142.0
    1515 * Requires at least: 5.2
    1616 * Requires PHP:      7.4
     
    2727
    2828// Define most essential constants.
    29 define( 'GOOGLESITEKIT_VERSION', '1.141.0' );
     29define( 'GOOGLESITEKIT_VERSION', '1.142.0' );
    3030define( 'GOOGLESITEKIT_PLUGIN_MAIN_FILE', __FILE__ );
    3131define( 'GOOGLESITEKIT_PHP_MINIMUM', '7.4.0' );
  • google-site-kit/tags/1.142.0/includes/Core/Admin/Screens.php

    r3118692 r3208808  
    481481        );
    482482
     483        if ( Feature_Flags::enabled( 'conversionReporting' ) ) {
     484            $screens[] = new Screen(
     485                self::PREFIX . 'metric-selection',
     486                array(
     487                    'title'       => __( 'Select Key Metrics', 'google-site-kit' ),
     488                    'capability'  => Permissions::MANAGE_OPTIONS,
     489                    'parent_slug' => self::PARENT_SLUG_NULL,
     490                )
     491            );
     492        }
     493
    483494        return $screens;
    484495    }
  • google-site-kit/tags/1.142.0/includes/Core/Assets/Assets.php

    r3201134 r3208808  
    697697            ),
    698698        );
     699
     700        if ( Feature_Flags::enabled( 'conversionReporting' ) ) {
     701            $assets[] = new Script(
     702                'googlesitekit-metric-selection',
     703                array(
     704                    'src'          => $base_url . 'js/googlesitekit-metric-selection.js',
     705                    'dependencies' => $this->get_asset_dependencies( 'dashboard' ),
     706                )
     707            );
     708        }
    699709
    700710        /**
     
    748758            'productPostType'   => $this->get_product_post_type(),
    749759            'anyoneCanRegister' => (bool) get_option( 'users_can_register' ),
     760            'isMultisite'       => is_multisite(),
    750761        );
    751762
  • google-site-kit/tags/1.142.0/includes/Core/Consent_Mode/Consent_Mode.php

    r3201134 r3208808  
    1313use Google\Site_Kit\Context;
    1414use Google\Site_Kit\Core\Assets\Script;
     15use Google\Site_Kit\Core\Modules\Modules;
    1516use Google\Site_Kit\Core\Storage\Options;
    1617use Google\Site_Kit\Core\Util\BC_Functions;
     
    5758     *
    5859     * @since 1.122.0
     60     * @since 1.142.0 Introduced Modules instance as an argument.
    5961     *
    6062     * @param Context $context Plugin context.
     63     * @param Modules $modules Modules instance.
    6164     * @param Options $options Optional. Option API instance. Default is a new instance.
    6265     */
    63     public function __construct( Context $context, Options $options = null ) {
     66    public function __construct(
     67        Context $context,
     68        Modules $modules,
     69        Options $options = null
     70    ) {
    6471        $this->context               = $context;
    6572        $options                     = $options ?: new Options( $context );
    6673        $this->consent_mode_settings = new Consent_Mode_Settings( $options );
    67         $this->rest_controller       = new REST_Consent_Mode_Controller( $this->consent_mode_settings );
     74        $this->rest_controller       = new REST_Consent_Mode_Controller(
     75            $modules,
     76            $this->consent_mode_settings,
     77            $options
     78        );
    6879    }
    6980
  • google-site-kit/tags/1.142.0/includes/Core/Consent_Mode/REST_Consent_Mode_Controller.php

    r3127664 r3208808  
    1111namespace Google\Site_Kit\Core\Consent_Mode;
    1212
     13use Google\Site_Kit\Core\Modules\Modules;
    1314use Google\Site_Kit\Core\Permissions\Permissions;
    1415use Google\Site_Kit\Core\REST_API\REST_Route;
    1516use Google\Site_Kit\Core\REST_API\REST_Routes;
     17use Google\Site_Kit\Core\Storage\Options;
     18use Google\Site_Kit\Modules\Ads;
     19use Google\Site_Kit\Modules\Analytics_4;
     20use Google\Site_Kit\Modules\Analytics_4\Settings as Analytics_Settings;
     21use Google\Site_Kit\Modules\Tag_Manager\Settings as Tag_Manager_Settings;
     22use Google\Site_Kit\Modules\Tag_Manager;
    1623use WP_REST_Request;
    1724use WP_REST_Response;
     
    3643    private $consent_mode_settings;
    3744
     45    /**
     46     * Modules instance.
     47     *
     48     * @since 1.142.0
     49     * @var Modules
     50     */
     51    protected $modules;
     52
     53    /**
     54     * Options instance.
     55     *
     56     * @since 1.142.0
     57     * @var Options
     58     */
     59    protected $options;
     60
    3861        /**
    3962         * Constructor.
    4063         *
    4164         * @since 1.122.0
     65         * @since 1.142.0 Introduces Modules as an argument.
    4266         *
     67         * @param Modules               $modules               Modules instance.
    4368         * @param Consent_Mode_Settings $consent_mode_settings Consent_Mode_Settings instance.
     69         * @param Options               $options               Optional. Option API instance. Default is a new instance.
    4470         */
    45     public function __construct( Consent_Mode_Settings $consent_mode_settings ) {
     71    public function __construct(
     72        Modules $modules,
     73        Consent_Mode_Settings $consent_mode_settings,
     74        Options $options
     75    ) {
     76        $this->modules               = $modules;
    4677        $this->consent_mode_settings = $consent_mode_settings;
     78        $this->options               = $options;
    4779    }
    4880
     
    227259                ),
    228260            ),
     261            new REST_Route(
     262                'core/site/data/ads-measurement-status',
     263                array(
     264                    array(
     265                        'methods'             => WP_REST_Server::READABLE,
     266                        'callback'            => function () {
     267                            $ads_connected = apply_filters( 'googlesitekit_is_module_connected', false, Ads::MODULE_SLUG );
     268
     269                            if ( $ads_connected ) {
     270                                return new WP_REST_Response( array( 'connected' => true ) );
     271                            }
     272
     273                            $analytics_connected = apply_filters( 'googlesitekit_is_module_connected', false, Analytics_4::MODULE_SLUG );
     274                            if ( $analytics_connected ) {
     275                                $analytics_settings = ( new Analytics_Settings( $this->options ) )->get();
     276                                $adsense_linked     = $analytics_settings['adSenseLinked'] ?? false;
     277
     278                                if ( $adsense_linked ) {
     279                                    return new WP_REST_Response( array( 'connected' => true ) );
     280                                }
     281
     282                                $container_destination_ids = $analytics_settings['googleTagContainerDestinationIDs'] ?? false;
     283                                if ( is_array( $container_destination_ids ) ) {
     284                                    foreach ( $container_destination_ids as $destination_id ) {
     285                                        if ( substr( $destination_id, 0, 3 ) === 'AW-' ) {
     286                                            return new WP_REST_Response( array( 'connected' => true ) );
     287                                        }
     288                                    }
     289                                }
     290                            }
     291
     292                            $tag_manager_connected = apply_filters( 'googlesitekit_is_module_connected', false, Tag_Manager::MODULE_SLUG );
     293                            if ( $tag_manager_connected ) {
     294                                $tag_manager          = $this->modules->get_module( Tag_Manager::MODULE_SLUG );
     295                                $tag_manager_settings = ( new Tag_Manager_Settings( $this->options ) )->get();
     296
     297                                if ( ! $tag_manager || ! $tag_manager instanceof Tag_Manager ) {
     298                                    return new WP_REST_Response( array( 'connected' => false ) );
     299                                }
     300
     301                                $live_containers_versions = $tag_manager->get_tagmanager_service()->accounts_containers_versions->live(
     302                                    "accounts/{$tag_manager_settings['accountID']}/containers/{$tag_manager_settings['internalContainerID']}"
     303                                );
     304
     305                                if ( empty( $live_containers_versions->tag ) ) {
     306                                    return new WP_REST_Response( array( 'connected' => false ) );
     307                                }
     308
     309                                $has_ads_tag = array_search( 'awct', array_column( $live_containers_versions->tag, 'type' ), true );
     310                                if ( false !== $has_ads_tag ) {
     311                                    return new WP_REST_Response( array( 'connected' => true ) );
     312                                }
     313                            }
     314
     315                            return new WP_REST_Response( array( 'connected' => false ) );
     316                        },
     317                        'permission_callback' => $can_manage_options,
     318                    ),
     319                ),
     320            ),
    229321        );
    230322    }
  • google-site-kit/tags/1.142.0/includes/Core/Key_Metrics/Key_Metrics_Settings.php

    r3173125 r3208808  
    5050            'widgetSlugs'                      => array(),
    5151            'isWidgetHidden'                   => false,
    52             'includeConversionTailoredMetrics' => false,
     52            'includeConversionTailoredMetrics' => array(),
    5353        );
    5454    }
     
    106106
    107107            if ( isset( $settings['includeConversionTailoredMetrics'] ) ) {
    108                 $sanitized_settings['includeConversionTailoredMetrics'] = false !== $settings['includeConversionTailoredMetrics'];
     108                $sanitized_settings['includeConversionTailoredMetrics'] = Sanitize::sanitize_string_list( $settings['includeConversionTailoredMetrics'] );
    109109            }
    110110
  • google-site-kit/tags/1.142.0/includes/Core/Tags/First_Party_Mode/First_Party_Mode.php

    r3201134 r3208808  
    1212
    1313use Google\Site_Kit\Context;
     14use Google\Site_Kit\Core\Modules\Module_With_Debug_Fields;
    1415use Google\Site_Kit\Core\Storage\Options;
     16use Google\Site_Kit\Core\Tags\First_Party_Mode\First_Party_Mode_Cron;
    1517use Google\Site_Kit\Core\Util\Method_Proxy_Trait;
    1618
     
    2224 * @ignore
    2325 */
    24 class First_Party_Mode {
     26class First_Party_Mode implements Module_With_Debug_Fields {
    2527    use Method_Proxy_Trait;
    2628
     
    4850     */
    4951    protected $rest_controller;
     52
     53    /**
     54     * First_Party_Mode_Cron instance.
     55     *
     56     * @since 1.142.0
     57     * @var First_Party_Mode_Cron
     58     */
     59    private $cron;
    5060
    5161    /**
     
    6171        $options                         = $options ?: new Options( $context );
    6272        $this->first_party_mode_settings = new First_Party_Mode_Settings( $options );
    63         $this->rest_controller           = new REST_First_Party_Mode_Controller( $this->first_party_mode_settings );
     73        $this->rest_controller           = new REST_First_Party_Mode_Controller( $this, $this->first_party_mode_settings );
     74        $this->cron                      = new First_Party_Mode_Cron( array( $this, 'healthcheck' ) );
    6475    }
    6576
     
    7283        $this->first_party_mode_settings->register();
    7384        $this->rest_controller->register();
     85        $this->cron->register();
     86
     87        add_action( 'admin_init', fn () => $this->on_admin_init() );
     88    }
     89
     90    /**
     91     * Gets a healthcheck debug field display value.
     92     *
     93     * @since 1.142.0
     94     *
     95     * @param mixed $setting_value Setting value.
     96     * @return string
     97     */
     98    private function health_check_debug_field_value( $setting_value ) {
     99        if ( true === $setting_value ) {
     100            return __( 'Yes', 'google-site-kit' );
     101        } elseif ( false === $setting_value ) {
     102            return __( 'No', 'google-site-kit' );
     103        }
     104        return '-';
     105    }
     106
     107    /**
     108     * Gets a healthcheck debug field debug value.
     109     *
     110     * @since 1.142.0
     111     *
     112     * @param mixed $setting_value Setting value.
     113     * @return string
     114     */
     115    private function health_check_debug_field_debug( $setting_value ) {
     116        if ( true === $setting_value ) {
     117            return 'yes';
     118        } elseif ( false === $setting_value ) {
     119            return 'no';
     120        }
     121        return '-';
     122    }
     123
     124    /**
     125     * Gets an array of debug field definitions.
     126     *
     127     * @since 1.142.0
     128     *
     129     * @return array
     130     */
     131    public function get_debug_fields() {
     132        $settings = $this->first_party_mode_settings->get();
     133
     134        return array(
     135            'first_party_mode_is_enabled'               => array(
     136                'label' => __( 'First-Party Mode: Enabled', 'google-site-kit' ),
     137                'value' => $this->health_check_debug_field_value( $settings['isEnabled'] ),
     138                'debug' => $this->health_check_debug_field_debug( $settings['isEnabled'] ),
     139            ),
     140            'first_party_mode_is_fpm_healthy'           => array(
     141                'label' => __( 'First-Party Mode: Service healthy', 'google-site-kit' ),
     142                'value' => $this->health_check_debug_field_value( $settings['isFPMHealthy'] ),
     143                'debug' => $this->health_check_debug_field_debug( $settings['isFPMHealthy'] ),
     144            ),
     145            'first_party_mode_is_script_access_enabled' => array(
     146                'label' => __( 'First-Party Mode: Script accessible', 'google-site-kit' ),
     147                'value' => $this->health_check_debug_field_value( $settings['isScriptAccessEnabled'] ),
     148                'debug' => $this->health_check_debug_field_debug( $settings['isScriptAccessEnabled'] ),
     149            ),
     150        );
     151    }
     152
     153    /**
     154     * Checks the health of First Party Mode server requirements.
     155     *
     156     * @since 1.142.0
     157     *
     158     * @return void
     159     */
     160    public function healthcheck() {
     161        $is_fpm_healthy           = $this->is_endpoint_healthy( 'https://g-1234.fps.goog/mpath/healthy' );
     162        $is_script_access_enabled = $this->is_endpoint_healthy( add_query_arg( 'healthCheck', '1', plugins_url( 'fpm/measurement.php', GOOGLESITEKIT_PLUGIN_MAIN_FILE ) ) );
     163
     164        $this->first_party_mode_settings->merge(
     165            array(
     166                'isFPMHealthy'          => $is_fpm_healthy,
     167                'isScriptAccessEnabled' => $is_script_access_enabled,
     168            )
     169        );
     170    }
     171
     172    /**
     173     * Schedule cron on admin init.
     174     *
     175     * @since 1.142.0
     176     */
     177    public function on_admin_init() {
     178        $this->cron->maybe_schedule_cron();
     179    }
     180
     181    /**
     182     * Checks if an endpoint is healthy. The endpoint must return a `200 OK` response with the body `ok`.
     183     *
     184     * @since 1.141.0
     185     * @since 1.142.0 Relocated from REST_First_Party_Mode_Controller.
     186     *
     187     * @param string $endpoint The endpoint to check.
     188     * @return bool True if the endpoint is healthy, false otherwise.
     189     */
     190    protected function is_endpoint_healthy( $endpoint ) {
     191        try {
     192            // phpcs:ignore WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsUnknown,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
     193            $response = file_get_contents( $endpoint );
     194        } catch ( \Exception $e ) {
     195            return false;
     196        }
     197
     198        if ( 'ok' !== $response ) {
     199            return false;
     200        }
     201
     202        return strpos( $http_response_header[0], '200 OK' ) !== false;
    74203    }
    75204}
  • google-site-kit/tags/1.142.0/includes/Core/Tags/First_Party_Mode/First_Party_Mode_Settings.php

    r3201134 r3208808  
    4747    protected function get_default() {
    4848        return array(
    49             'isEnabled'             => null,
     49            'isEnabled'             => false,
    5050            'isFPMHealthy'          => null,
    5151            'isScriptAccessEnabled' => null,
  • google-site-kit/tags/1.142.0/includes/Core/Tags/First_Party_Mode/REST_First_Party_Mode_Controller.php

    r3201134 r3208808  
    1414use Google\Site_Kit\Core\REST_API\REST_Route;
    1515use Google\Site_Kit\Core\REST_API\REST_Routes;
     16use Google\Site_Kit\Core\Tags\First_Party_Mode\First_Party_Mode;
    1617use WP_REST_Request;
    1718use WP_REST_Response;
     
    2829
    2930    /**
     31     * First_Party_Mode instance.
     32     *
     33     * @since 1.142.0
     34     * @var First_Party_Mode
     35     */
     36    private $first_party_mode;
     37
     38    /**
    3039     * First_Party_Mode_Settings instance.
    3140     *
     
    4049     * @since 1.141.0
    4150     *
     51     * @param First_Party_Mode          $first_party_mode          First_Party_Mode instance.
    4252     * @param First_Party_Mode_Settings $first_party_mode_settings First_Party_Mode_Settings instance.
    4353     */
    44     public function __construct( First_Party_Mode_Settings $first_party_mode_settings ) {
     54    public function __construct( First_Party_Mode $first_party_mode, First_Party_Mode_Settings $first_party_mode_settings ) {
     55        $this->first_party_mode          = $first_party_mode;
    4556        $this->first_party_mode_settings = $first_party_mode_settings;
    4657    }
     
    135146                        'methods'             => WP_REST_Server::READABLE,
    136147                        'callback'            => function () {
    137                             $is_fpm_healthy = $this->is_endpoint_healthy( 'https://g-1234.fps.goog/mpath/healthy' );
    138                             $is_script_access_enabled = $this->is_endpoint_healthy( add_query_arg( 'healthCheck', '1', plugins_url( 'fpm/measurement.php', GOOGLESITEKIT_PLUGIN_MAIN_FILE ) ) );
    139 
    140                             $this->first_party_mode_settings->merge(
    141                                 array(
    142                                     'isFPMHealthy' => $is_fpm_healthy,
    143                                     'isScriptAccessEnabled' => $is_script_access_enabled,
    144                                 )
    145                             );
    146 
     148                            $this->first_party_mode->healthcheck();
    147149                            return new WP_REST_Response( $this->first_party_mode_settings->get() );
    148150                        },
     
    153155        );
    154156    }
    155 
    156     /**
    157      * Checks if an endpoint is healthy. The endpoint must return a `200 OK` response with the body `ok`.
    158      *
    159      * @since 1.141.0
    160      *
    161      * @param string $endpoint The endpoint to check.
    162      * @return bool True if the endpoint is healthy, false otherwise.
    163      */
    164     protected function is_endpoint_healthy( $endpoint ) {
    165         try {
    166             // phpcs:ignore WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsUnknown,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
    167             $response = file_get_contents( $endpoint );
    168         } catch ( \Exception $e ) {
    169             return false;
    170         }
    171 
    172         if ( 'ok' !== $response ) {
    173             return false;
    174         }
    175 
    176         return strpos( $http_response_header[0], '200 OK' ) !== false;
    177     }
    178157}
  • google-site-kit/tags/1.142.0/includes/Core/Tags/GTag.php

    r3118692 r3208808  
    1111namespace Google\Site_Kit\Core\Tags;
    1212
     13use Google\Site_Kit\Core\Storage\Options;
     14use Google\Site_Kit\Core\Tags\First_Party_Mode\First_Party_Mode_Settings;
     15use Google\Site_Kit\Core\Util\Feature_Flags;
    1316use Google\Site_Kit\Core\Util\Method_Proxy_Trait;
    1417
     
    2427
    2528    const HANDLE = 'google_gtagjs';
     29
     30    /**
     31     * Options instance.
     32     *
     33     * @var Options
     34     */
     35    private $options;
     36
    2637    /**
    2738     * Holds an array of gtag ID's and their inline config elements.
     
    3647     */
    3748    private $commands = array();
     49
     50    /**
     51     * Constructor.
     52     *
     53     * @since 1.142.0
     54     *
     55     * @param Options $options Option API instance.
     56     */
     57    public function __construct( Options $options ) {
     58        $this->options = $options;
     59    }
    3860
    3961    /**
     
    193215     *
    194216     * @since 1.124.0
     217     * @since 1.142.0 Provides support for first-party mode.
    195218     *
    196219     * @return string|false The gtag source URL. False if no tags are added.
     
    204227        // all registered tags will be set up with a config command regardless
    205228        // of which is used to load the source.
    206         return 'https://www.googletagmanager.com/gtag/js?id=' . rawurlencode( $this->tags[0]['tag_id'] );
     229        $tag_id = rawurlencode( $this->tags[0]['tag_id'] );
     230
     231        // If first-party mode is active, use the proxy URL to load the GTag script.
     232        if ( Feature_Flags::enabled( 'firstPartyMode' ) && $this->is_first_party_mode_active() ) {
     233            return add_query_arg(
     234                array(
     235                    'id' => $tag_id,
     236                    's'  => '/gtag/js',
     237                ),
     238                plugins_url( 'fpm/measurement.php', GOOGLESITEKIT_PLUGIN_MAIN_FILE )
     239            );
     240        }
     241
     242        return 'https://www.googletagmanager.com/gtag/js?id=' . $tag_id;
     243    }
     244
     245    /**
     246     * Checks if first-party mode is active.
     247     *
     248     * @since 1.142.0
     249     *
     250     * @return bool True if first-party mode is active, false otherwise.
     251     */
     252    protected function is_first_party_mode_active() {
     253        $first_party_mode_settings = new First_Party_Mode_Settings( $this->options );
     254
     255        $settings = $first_party_mode_settings->get();
     256
     257        $required_settings = array( 'isEnabled', 'isFPMHealthy', 'isScriptAccessEnabled' );
     258
     259        foreach ( $required_settings as $setting ) {
     260            if ( ! isset( $settings[ $setting ] ) || ! $settings[ $setting ] ) {
     261                return false;
     262            }
     263        }
     264
     265        return true;
    207266    }
    208267}
  • google-site-kit/tags/1.142.0/includes/Core/Util/Uninstallation.php

    r3191565 r3208808  
    1818use Google\Site_Kit\Core\Authentication\Clients\OAuth_Client;
    1919use Google\Site_Kit\Core\Remote_Features\Remote_Features_Cron;
     20use Google\Site_Kit\Core\Tags\First_Party_Mode\First_Party_Mode_Cron;
    2021use Google\Site_Kit\Modules\Analytics_4\Conversion_Reporting\Conversion_Reporting_Cron;
    2122use Google\Site_Kit\Modules\Analytics_4\Synchronize_AdSenseLinked;
     
    6162        Synchronize_AdsLinked::CRON_SYNCHRONIZE_ADS_LINKED,
    6263        Synchronize_Property::CRON_SYNCHRONIZE_PROPERTY,
     64        First_Party_Mode_Cron::CRON_ACTION,
    6365    );
    6466
  • google-site-kit/tags/1.142.0/includes/Modules/Ads.php

    r3201134 r3208808  
    2929use Google\Site_Kit\Core\Permissions\Permissions;
    3030use Google\Site_Kit\Core\Site_Health\Debug_Data;
     31use Google\Site_Kit\Core\Tags\First_Party_Mode\First_Party_Mode;
    3132use Google\Site_Kit\Modules\Ads\PAX_Config;
    3233use Google\Site_Kit\Modules\Ads\Settings;
     
    308309        $settings = $this->get_settings()->get();
    309310
    310         return array(
     311        $debug_fields = array(
    311312            'ads_conversion_tracking_id' => array(
    312313                'label' => __( 'Ads: Conversion Tracking ID', 'google-site-kit' ),
     
    315316            ),
    316317        );
     318
     319        // Add fields from First-party Mode.
     320        // Note: fields are added in both Analytics and Ads so that the debug fields will show if either module is enabled.
     321        if ( Feature_Flags::enabled( 'firstPartyMode' ) ) {
     322            $first_party_mode             = new First_Party_Mode( $this->context );
     323            $fields_from_first_party_mode = $first_party_mode->get_debug_fields();
     324
     325            $debug_fields = array_merge( $debug_fields, $fields_from_first_party_mode );
     326        }
     327
     328        return $debug_fields;
    317329    }
    318330
  • google-site-kit/tags/1.142.0/includes/Modules/Analytics_4.php

    r3201134 r3208808  
    9090use Google\Site_Kit_Dependencies\Psr\Http\Message\RequestInterface;
    9191use Google\Site_Kit\Core\REST_API\REST_Routes;
     92use Google\Site_Kit\Core\Tags\First_Party_Mode\First_Party_Mode;
    9293use Google\Site_Kit\Modules\Analytics_4\Conversion_Reporting\Conversion_Reporting_Cron;
    9394use Google\Site_Kit\Modules\Analytics_4\Conversion_Reporting\Conversion_Reporting_Events_Sync;
     
    592593                    : join( ', ', $site_kit_audiences ),
    593594            );
     595        }
     596
     597        // Add fields from First-party Mode.
     598        // Note: fields are added in both Analytics and Ads so that the debug fields will show if either module is enabled.
     599        if ( Feature_Flags::enabled( 'firstPartyMode' ) ) {
     600            $first_party_mode             = new First_Party_Mode( $this->context );
     601            $fields_from_first_party_mode = $first_party_mode->get_debug_fields();
     602
     603            $debug_fields = array_merge( $debug_fields, $fields_from_first_party_mode );
    594604        }
    595605
  • google-site-kit/tags/1.142.0/includes/Modules/Sign_In_With_Google.php

    r3201134 r3208808  
    1111namespace Google\Site_Kit\Modules;
    1212
     13use Google\Site_Kit\Context;
    1314use Google\Site_Kit\Core\Assets\Asset;
     15use Google\Site_Kit\Core\Assets\Assets;
    1416use Google\Site_Kit\Core\Assets\Script;
     17use Google\Site_Kit\Core\Authentication\Authentication;
    1518use Google\Site_Kit\Core\Conversion_Tracking\Conversion_Event_Providers\WooCommerce;
    1619use Google\Site_Kit\Core\Modules\Module;
     
    3235use Google\Site_Kit\Modules\Sign_In_With_Google\Authenticator;
    3336use Google\Site_Kit\Modules\Sign_In_With_Google\Authenticator_Interface;
     37use Google\Site_Kit\Modules\Sign_In_With_Google\Existing_Client_ID;
    3438use Google\Site_Kit\Modules\Sign_In_With_Google\Hashed_User_ID;
    3539use Google\Site_Kit\Modules\Sign_In_With_Google\Profile_Reader;
     
    6973
    7074    /**
     75     * Existing_Client_ID instance.
     76     *
     77     * @since 1.142.0
     78     * @var Existing_Client_ID
     79     */
     80    protected $existing_client_id;
     81
     82    /**
     83     * Constructor.
     84     *
     85     * @since 1.142.0
     86     *
     87     * @param Context        $context        Plugin context.
     88     * @param Options        $options        Optional. Option API instance. Default is a new instance.
     89     * @param User_Options   $user_options   Optional. User Option API instance. Default is a new instance.
     90     * @param Authentication $authentication Optional. Authentication instance. Default is a new instance.
     91     * @param Assets         $assets  Optional. Assets API instance. Default is a new instance.
     92     */
     93    public function __construct(
     94        Context $context,
     95        Options $options = null,
     96        User_Options $user_options = null,
     97        Authentication $authentication = null,
     98        Assets $assets = null
     99    ) {
     100        parent::__construct( $context, $options, $user_options, $authentication, $assets );
     101        $this->existing_client_id = new Existing_Client_ID( $this->options );
     102    }
     103
     104    /**
    71105     * Registers functionality through WordPress hooks.
    72106     *
     
    76110    public function register() {
    77111        add_filter( 'wp_login_errors', array( $this, 'handle_login_errors' ) );
     112
     113        add_filter( 'googlesitekit_inline_modules_data', $this->get_method_proxy( 'inline_existing_client_id' ), 10 );
    78114
    79115        add_action(
     
    97133
    98134        add_action( 'woocommerce_login_form_start', $this->get_method_proxy( 'render_signin_button' ) );
     135
     136        // Delete client ID stored from previous module connection on module reconnection.
     137        add_action(
     138            'googlesitekit_save_settings_' . self::MODULE_SLUG,
     139            function () {
     140                if ( $this->is_connected() ) {
     141                    $this->existing_client_id->delete();
     142                }
     143            }
     144        );
    99145    }
    100146
     
    138184        switch ( $error_code ) {
    139185            case Authenticator::ERROR_INVALID_REQUEST:
    140                 $error->add( self::MODULE_SLUG, __( 'Sign in with Google failed.', 'google-site-kit' ) );
     186                /* translators: %s: Sign in with Google service name */
     187                $error->add( self::MODULE_SLUG, sprintf( __( 'Login with %s failed.', 'google-site-kit' ), _x( 'Sign in with Google', 'Service name', 'google-site-kit' ) ) );
    141188                break;
    142189            case Authenticator::ERROR_SIGNIN_FAILED:
     
    153200     * Cleans up when the module is deactivated.
    154201     *
     202     * Persist the clientID on module disconnection, so it can be
     203     * reused if the module were to be reconnected.
     204     *
    155205     * @since 1.137.0
    156206     */
    157207    public function on_deactivation() {
     208        $pre_deactivation_settings = $this->get_settings()->get();
     209
     210        if ( ! empty( $pre_deactivation_settings['clientID'] ) ) {
     211            $this->existing_client_id->set( $pre_deactivation_settings['clientID'] );
     212        }
     213
    158214        $this->get_settings()->delete();
    159215    }
     
    170226            'slug'        => self::MODULE_SLUG,
    171227            'name'        => _x( 'Sign in with Google', 'Service name', 'google-site-kit' ),
    172             'description' => __( 'Improve user engagement, trust, and data privacy, while creating a simple, secure, and personalized experience for your visitors', 'google-site-kit' ),
     228            'description' => __( 'Improve user engagement, trust and data privacy, while creating a simple, secure and personalized experience for your visitors', 'google-site-kit' ),
    173229            'order'       => 10,
    174230            'homepage'    => __( 'https://developers.google.com/identity/gsi/web/guides/overview', 'google-site-kit' ),
     
    263319
    264320        // Render the Sign in with Google button and related inline styles.
    265         printf( "\n<!-- %s -->\n", esc_html__( 'Sign in with Google button added by Site Kit', 'google-site-kit' ) );
     321        print(
     322            // Purposely not translated as this is a technical comment.
     323            //
     324            // See: https://github.com/google/site-kit-wp/pull/9826#discussion_r1876026945.
     325            "\n<!-- Sign in with Google button added by Site Kit -->\n"
     326        );
    266327        BC_Functions::wp_print_script_tag( array( 'src' => 'https://accounts.google.com/gsi/client' ) );
    267328        ob_start();
     
    345406        $debug_fields = array(
    346407            'sign_in_with_google_client_id'                => array(
    347                 'label' => __( 'Sign in with Google: Client ID', 'google-site-kit' ),
     408                /* translators: %s: Sign in with Google service name */
     409                'label' => sprintf( __( '%s: Client ID', 'google-site-kit' ), _x( 'Sign in with Google', 'Service name', 'google-site-kit' ) ),
    348410                'value' => $settings['clientID'],
    349411                'debug' => Debug_Data::redact_debug_value( $settings['clientID'] ),
    350412            ),
    351413            'sign_in_with_google_shape'                    => array(
    352                 'label' => __( 'Sign in with Google: Shape', 'google-site-kit' ),
     414                /* translators: %s: Sign in with Google service name */
     415                'label' => sprintf( __( '%s: Shape', 'google-site-kit' ), _x( 'Sign in with Google', 'Service name', 'google-site-kit' ) ),
    353416                'value' => $this->get_settings()->get_label( 'shape', $settings['shape'] ),
    354417                'debug' => $settings['shape'],
    355418            ),
    356419            'sign_in_with_google_text'                     => array(
    357                 'label' => __( 'Sign in with Google: Text', 'google-site-kit' ),
     420                /* translators: %s: Sign in with Google service name */
     421                'label' => sprintf( __( '%s: Text', 'google-site-kit' ), _x( 'Sign in with Google', 'Service name', 'google-site-kit' ) ),
    358422                'value' => $this->get_settings()->get_label( 'text', $settings['text'] ),
    359423                'debug' => $settings['text'],
    360424            ),
    361425            'sign_in_with_google_theme'                    => array(
    362                 'label' => __( 'Sign in with Google: Theme', 'google-site-kit' ),
     426                /* translators: %s: Sign in with Google service name */
     427                'label' => sprintf( __( '%s: Theme', 'google-site-kit' ), _x( 'Sign in with Google', 'Service name', 'google-site-kit' ) ),
    363428                'value' => $this->get_settings()->get_label( 'theme', $settings['theme'] ),
    364429                'debug' => $settings['theme'],
    365430            ),
    366431            'sign_in_with_google_use_snippet'              => array(
    367                 'label' => __( 'Sign in with Google: One-tap Enabled', 'google-site-kit' ),
     432                /* translators: %s: Sign in with Google service name */
     433                'label' => sprintf( __( '%s: One-tap Enabled', 'google-site-kit' ), _x( 'Sign in with Google', 'Service name', 'google-site-kit' ) ),
    368434                'value' => $settings['oneTapEnabled'] ? __( 'Yes', 'google-site-kit' ) : __( 'No', 'google-site-kit' ),
    369435                'debug' => $settings['oneTapEnabled'] ? 'yes' : 'no',
    370436            ),
    371437            'sign_in_with_google_authenticated_user_count' => array(
    372                 'label' => __( 'Sign in with Google: Number of users who have authenticated using Sign in with Google', 'google-site-kit' ),
     438                /* translators: %1$s: Sign in with Google service name */
     439                'label' => sprintf( __( '%1$s: Number of users who have authenticated using %1$s', 'google-site-kit' ), _x( 'Sign in with Google', 'Service name', 'google-site-kit' ) ),
    373440                'value' => $authenticated_user_count,
    374441                'debug' => $authenticated_user_count,
     
    443510        $search_string              = 'Sign in with Google button added by Site Kit';
    444511        $search_translatable_string =
    445             __( 'Sign in with Google button added by Site Kit', 'google-site-kit' );
     512            /* translators: %s: Sign in with Google service name */
     513            sprintf( __( '%s button added by Site Kit', 'google-site-kit' ), _x( 'Sign in with Google', 'Service name', 'google-site-kit' ) );
    446514
    447515        if ( strpos( $content, $search_string ) !== false || strpos( $content, $search_translatable_string ) !== false ) {
     
    519587        ?>
    520588<div id="googlesitekit-sign-in-with-google-disconnect">
    521     <h2><?php esc_html_e( 'Sign in with Google via Site Kit by Google', 'google-site-kit' ); ?></h2>
     589    <h2>
     590        <?php
     591        /* translators: %s: Sign in with Google service name */
     592        esc_html( sprintf( __( '%s via Site Kit by Google', 'google-site-kit' ), _x( 'Sign in with Google', 'Service name', 'google-site-kit' ) ) );
     593        ?>
     594    </h2>
    522595    <p>
    523596        <?php
     
    546619        <?php
    547620    }
     621
     622    /**
     623     * Exposes an existing client ID from a previous connection
     624     * to JS via _googlesitekitModulesData.
     625     *
     626     * @since 1.142.0
     627     *
     628     * @param array $modules_data Inline modules data.
     629     * @return array Inline modules data.
     630     */
     631    protected function inline_existing_client_id( $modules_data ) {
     632        $existing_client_id = $this->existing_client_id->get();
     633
     634        if ( $existing_client_id ) {
     635            // Add the data under the `sign-in-with-google` key to make it clear it's scoped to this module.
     636            $modules_data['sign-in-with-google'] = array(
     637                'existingClientID' => $existing_client_id,
     638            );
     639        }
     640
     641        return $modules_data;
     642    }
    548643}
  • google-site-kit/tags/1.142.0/includes/Modules/Tag_Manager.php

    r3201134 r3208808  
    446446     *
    447447     * @since 1.2.0
     448     * @since 1.142.0 Made method public.
    448449     *
    449450     * @return Google_Service_TagManager instance.
    450451     * @throws Exception Thrown if the module did not correctly set up the service.
    451452     */
    452     private function get_tagmanager_service() {
     453    public function get_tagmanager_service() {
    453454        return $this->get_service( 'tagmanager' );
    454455    }
  • google-site-kit/tags/1.142.0/includes/Plugin.php

    r3201134 r3208808  
    224224                ( new Core\Key_Metrics\Key_Metrics( $this->context, $user_options, $options ) )->register();
    225225                ( new Core\Prompts\Prompts( $this->context, $user_options ) )->register();
    226                 ( new Core\Consent_Mode\Consent_Mode( $this->context, $options ) )->register();
    227                 ( new Core\Tags\GTag() )->register();
     226                ( new Core\Consent_Mode\Consent_Mode( $this->context, $modules, $options ) )->register();
     227                ( new Core\Tags\GTag( $options ) )->register();
    228228                ( new Core\Conversion_Tracking\Conversion_Tracking( $this->context, $options ) )->register();
    229229                if ( Feature_Flags::enabled( 'firstPartyMode' ) ) {
  • google-site-kit/tags/1.142.0/includes/vendor/composer/autoload_classmap.php

    r3201134 r3208808  
    178178    'Google\\Site_Kit\\Core\\Tags\\Blockable_Tag_Interface' => $baseDir . '/Core/Tags/Blockable_Tag_Interface.php',
    179179    'Google\\Site_Kit\\Core\\Tags\\First_Party_Mode\\First_Party_Mode' => $baseDir . '/Core/Tags/First_Party_Mode/First_Party_Mode.php',
     180    'Google\\Site_Kit\\Core\\Tags\\First_Party_Mode\\First_Party_Mode_Cron' => $baseDir . '/Core/Tags/First_Party_Mode/First_Party_Mode_Cron.php',
    180181    'Google\\Site_Kit\\Core\\Tags\\First_Party_Mode\\First_Party_Mode_Settings' => $baseDir . '/Core/Tags/First_Party_Mode/First_Party_Mode_Settings.php',
    181182    'Google\\Site_Kit\\Core\\Tags\\First_Party_Mode\\REST_First_Party_Mode_Controller' => $baseDir . '/Core/Tags/First_Party_Mode/REST_First_Party_Mode_Controller.php',
     
    313314    'Google\\Site_Kit\\Modules\\Sign_In_With_Google\\Authenticator' => $baseDir . '/Modules/Sign_In_With_Google/Authenticator.php',
    314315    'Google\\Site_Kit\\Modules\\Sign_In_With_Google\\Authenticator_Interface' => $baseDir . '/Modules/Sign_In_With_Google/Authenticator_Interface.php',
     316    'Google\\Site_Kit\\Modules\\Sign_In_With_Google\\Existing_Client_ID' => $baseDir . '/Modules/Sign_In_With_Google/Existing_Client_ID.php',
    315317    'Google\\Site_Kit\\Modules\\Sign_In_With_Google\\Hashed_User_ID' => $baseDir . '/Modules/Sign_In_With_Google/Hashed_User_ID.php',
    316318    'Google\\Site_Kit\\Modules\\Sign_In_With_Google\\Profile_Reader' => $baseDir . '/Modules/Sign_In_With_Google/Profile_Reader.php',
  • google-site-kit/tags/1.142.0/readme.txt

    r3201134 r3208808  
    55Tested up to:      6.7
    66Requires PHP:      7.4
    7 Stable tag:        1.141.0
     7Stable tag:        1.142.0
    88License:           Apache License 2.0
    99License URI:       https://www.apache.org/licenses/LICENSE-2.0
     
    110110== Changelog ==
    111111
    112 = 1.141.0 =
     112= 1.142.0 =
    113113
    114114**Added**
    115115
    116 * Add Sign in with Google to WooCommerce login page. See [#9340](https://github.com/google/site-kit-wp/issues/9340).
     116* Add Analytics events to Sign in with Google. See [#9747](https://github.com/google/site-kit-wp/issues/9747).
    117117
    118118**Enhanced**
    119119
    120 * Update Sign in with Google descriptions in Site Health. See [#9680](https://github.com/google/site-kit-wp/issues/9680).
    121 * Update the Sign in with Google login to use the popup approach. See [#9677](https://github.com/google/site-kit-wp/issues/9677).
    122 * Integrate the First-party mode proxy script that will allow Analytics events to be tracked via requests made from the browser to the user's site rather than directly to Google's servers. See [#9665](https://github.com/google/site-kit-wp/issues/9665).
    123 * Add info to the "One-tap" option in Sign in with Google settings. See [#9643](https://github.com/google/site-kit-wp/issues/9643).
    124 * Do not show "Maybe later" in Key Metrics Admin Settings callout banner. See [#9636](https://github.com/google/site-kit-wp/issues/9636).
    125 * Implement the `fetchGetFPMServerRequirementStatus()` Redux action used to retrieve the FPM server requirement status. See [#9634](https://github.com/google/site-kit-wp/issues/9634).
    126 * Add an `fpm-server-requirement-status` API endpoint to verify First-Party Mode readiness by performing FPFE health checks and verifying direct PHP script access. See [#9632](https://github.com/google/site-kit-wp/issues/9632).
    127 * Add a partial datastore for First-Party Mode in the `core/site` datastore to manage its settings. See [#9628](https://github.com/google/site-kit-wp/issues/9628).
    128 * Add REST endpoints for First-Party Mode module settings. See [#9625](https://github.com/google/site-kit-wp/issues/9625).
    129 * Update "Get your Client ID" link in Sign in with Google setup. See [#9621](https://github.com/google/site-kit-wp/issues/9621).
    130 * Ensure tailored metrics override previous metrics when switching from manually-selected metrics. See [#9613](https://github.com/google/site-kit-wp/issues/9613).
    131 * Improve the accuracy of the mechanism that scrolls the user to a widget area. See [#9603](https://github.com/google/site-kit-wp/issues/9603).
    132 * Improve visitor groups selection panel to prevent a console warning. See [#9602](https://github.com/google/site-kit-wp/issues/9602).
    133 * Add an external icon to external links in the audience selection panel and placeholder tile. See [#9598](https://github.com/google/site-kit-wp/issues/9598).
    134 * Remove visitor groups setup success notifications when the user chooses not to display visitor groups in dashboard. See [#9596](https://github.com/google/site-kit-wp/issues/9596).
    135 * Introduce grouping of notification queues. See [#9568](https://github.com/google/site-kit-wp/issues/9568).
    136 * Add notice for users who used a legacy answer in Key Metrics settings. See [#9518](https://github.com/google/site-kit-wp/issues/9518).
    137 * Split the "Sell products or services" answer in the User Input app. See [#9489](https://github.com/google/site-kit-wp/issues/9489).
    138 * Persist selection group in Key Metrics selection panel. See [#9385](https://github.com/google/site-kit-wp/issues/9385).
    139 * Add support for disconnecting associated Google account for sign in from WordPress user edit screen. See [#9380](https://github.com/google/site-kit-wp/issues/9380).
    140 * Implement new subtle notification banner in KMW dashboard area. See [#9371](https://github.com/google/site-kit-wp/issues/9371).
    141 * Move on-demand onboarding state synchronization to the server side, avoiding the need to reload the full list of publications. See [#9363](https://github.com/google/site-kit-wp/issues/9363).
    142 * Improve selection panels so that they perform actions only when in view. See [#9312](https://github.com/google/site-kit-wp/issues/9312).
    143 * Improve Reader Revenue Manager publication onboarding state synchronization. See [#9149](https://github.com/google/site-kit-wp/issues/9149).
    144 * Add Key Metrics info to Site Health report. See [#9112](https://github.com/google/site-kit-wp/issues/9112).
    145 
    146 **Changed**
    147 
    148 * Implement settings view for Sign in with Google. See [#9477](https://github.com/google/site-kit-wp/issues/9477).
    149 * Implement Sign in with Google token response login handling. See [#9339](https://github.com/google/site-kit-wp/issues/9339).
     120* Fix the "improve your measurement" section's layout in mobile viewports. See [#9830](https://github.com/google/site-kit-wp/issues/9830).
     121* Update the default value of the First-party mode `isEnabled` setting to `false`. See [#9828](https://github.com/google/site-kit-wp/issues/9828).
     122* Add periodic server requirement health checks for first-party mode. See [#9768](https://github.com/google/site-kit-wp/issues/9768).
     123* Always display the "Anyone can register" WordPress setting in Sign in with Google settings. See [#9735](https://github.com/google/site-kit-wp/issues/9735).
     124* Update learn more link in Sign in with Google module settings. See [#9734](https://github.com/google/site-kit-wp/issues/9734).
     125* Update copy in Sign in with Google "Connect more services" UI. See [#9733](https://github.com/google/site-kit-wp/issues/9733).
     126* Update Sign in with Google setup success notification UI. See [#9724](https://github.com/google/site-kit-wp/issues/9724).
     127* Automatically dismiss the First-Party Mode setup banner notification when the toggle is enabled from the settings screen, preventing redundant notifications. See [#9698](https://github.com/google/site-kit-wp/issues/9698).
     128* Add a selector to detect changes and an action to reset First-party mode settings, integrated with Analytics and Ads rollback and validation processes. See [#9688](https://github.com/google/site-kit-wp/issues/9688).
     129* Add FPFE health check and script access statuses to Site Kit’s Site Health section, displaying whether these checks are enabled or disabled. See [#9668](https://github.com/google/site-kit-wp/issues/9668).
     130* Add First-Party Mode status to Site Kit’s Site Health section, displaying whether the feature is enabled or not when either the Analytics or Ads modules are connected and the `firstPartyMode` feature flag is active. See [#9667](https://github.com/google/site-kit-wp/issues/9667).
     131* Add support for gtag to load in first-party mode when enabled. See [#9664](https://github.com/google/site-kit-wp/issues/9664).
     132* Display the First-party mode enabled status in the Ads settings view. See [#9659](https://github.com/google/site-kit-wp/issues/9659).
     133* Display the First-party mode enabled status in the Analytics settings view. See [#9658](https://github.com/google/site-kit-wp/issues/9658).
     134* Integrate the First-party mode toggle into the Ads module’s settings form, allowing users to enable or disable First-party mode. See [#9655](https://github.com/google/site-kit-wp/issues/9655).
     135* Integrate the First-party mode toggle into the Analytics module’s settings form, allowing users to enable or disable First-party mode. See [#9654](https://github.com/google/site-kit-wp/issues/9654).
     136* Group measurement toggles together on the settings screen in the Ads and Analytics module edit sections. See [#9651](https://github.com/google/site-kit-wp/issues/9651).
     137* Add a "Beta" badge to the First-party mode toggle. See [#9650](https://github.com/google/site-kit-wp/issues/9650).
     138* Implement the First-party mode toggle as a component which is presented in Storybook. See [#9649](https://github.com/google/site-kit-wp/issues/9649).
     139* Add first-party mode setup success notification. See [#9648](https://github.com/google/site-kit-wp/issues/9648).
     140* Add the First-party mode setup banner to let users know about the feature and enable it from the dashboard. See [#9647](https://github.com/google/site-kit-wp/issues/9647).
     141* Update spacing between CTA actions for consistency. See [#9600](https://github.com/google/site-kit-wp/issues/9600).
     142* Add notification banner when event data has been missing for ninety days. See [#9578](https://github.com/google/site-kit-wp/issues/9578).
     143* Improve notifications rendering performance. See [#9488](https://github.com/google/site-kit-wp/issues/9488).
     144* Add full size selection panel on the new screen. See [#9375](https://github.com/google/site-kit-wp/issues/9375).
     145* Update Analytics Conversion Report notifications to be more context-aware. See [#9373](https://github.com/google/site-kit-wp/issues/9373).
     146* Ensure Analytics Conversion Reports notification appears for users who set up Key Metrics manually. See [#9372](https://github.com/google/site-kit-wp/issues/9372).
     147* Ensure that the setup flow for a module is automatically continued when clicking the "Redo setup" CTA on the "Site Kit can’t access necessary data" unsatisfied scopes notification. See [#9261](https://github.com/google/site-kit-wp/issues/9261).
     148* Extend Consent Mode conditions logic. See [#9147](https://github.com/google/site-kit-wp/issues/9147).
    150149
    151150**Fixed**
    152151
    153 * Fix a bug that caused a custom dimension to not be created while setting up visitor groups. See [#9597](https://github.com/google/site-kit-wp/issues/9597).
     152* Update the Sign in with Google module to suggest using the previous client ID when re-connecting the module. See [#9744](https://github.com/google/site-kit-wp/issues/9744).
     153* Ensure Sign in with Google translations are consistent. See [#9738](https://github.com/google/site-kit-wp/issues/9738).
     154* Add Sign in with Google live preview in settings. See [#9718](https://github.com/google/site-kit-wp/issues/9718).
     155* Update layout of Top Content widget in smaller viewports to use a tab per metric column. See [#7563](https://github.com/google/site-kit-wp/issues/7563).
    154156
    155157[See changelog for all versions](https://raw.githubusercontent.com/google/site-kit-wp/main/changelog.txt).
  • google-site-kit/trunk/dist/manifest.php

    r3201134 r3208808  
    1919    'analytics-advanced-tracking'                          => array( "analytics-advanced-tracking-ea84b2c367b69f5c094b.js", null ),
    2020    'googlesitekit-i18n'                                   => array( "googlesitekit-i18n-33cdd2dee5d1d1f4fb34.js", null ),
    21     'googlesitekit-admin-css'                              => array( "googlesitekit-admin-css-c7c4e28ef467fa74720d.min.css", null ),
    22     'googlesitekit-adminbar-css'                           => array( "googlesitekit-adminbar-css-6db776544b37175be17f.min.css", null ),
     21    'googlesitekit-admin-css'                              => array( "googlesitekit-admin-css-631051a6ae95dd6157e6.min.css", null ),
     22    'googlesitekit-adminbar-css'                           => array( "googlesitekit-adminbar-css-281d66e21d2b87430998.min.css", null ),
    2323    'googlesitekit-authorize-application-css'              => array( "googlesitekit-authorize-application-css-ce25e97404abc5a02921.min.css", null ),
    24     'googlesitekit-wp-dashboard-css'                       => array( "googlesitekit-wp-dashboard-css-c5417a27cb905717f9fc.min.css", null ),
    25     'googlesitekit-vendor'                                 => array( "googlesitekit-vendor-56e09129c0c5da07a38b.js", null ),
    26     'googlesitekit-runtime'                                => array( "runtime-28f15eb6ca67d1a2d920.js", null ),
    27     'googlesitekit-activation'                             => array( "googlesitekit-activation-f250ffdb179ce67acd13.js", null ),
    28     'googlesitekit-ad-blocking-recovery'                   => array( "googlesitekit-ad-blocking-recovery-f6e2202aedc4b9dec80a.js", null ),
    29     'googlesitekit-adminbar'                               => array( "googlesitekit-adminbar-309ccca4cdd85f61e57c.js", null ),
    30     'googlesitekit-api'                                    => array( "googlesitekit-api-51477bf3a499de73c6b0.js", null ),
    31     'googlesitekit-components'                             => array( array( "googlesitekit-components-gm2-d1deb8243b7fe27ddfd3.js", null ), array( "googlesitekit-components-gm3-26d6f652a561407fc1d9.js", null ) ),
    32     'googlesitekit-data'                                   => array( "googlesitekit-data-e2d57f0d3e8cbcde4f77.js", null ),
    33     'googlesitekit-datastore-forms'                        => array( "googlesitekit-datastore-forms-d673eb18908574ac23e4.js", null ),
    34     'googlesitekit-datastore-location'                     => array( "googlesitekit-datastore-location-b2b133386452785f40cd.js", null ),
    35     'googlesitekit-datastore-site'                         => array( "googlesitekit-datastore-site-d81c0033927d3f14fb1a.js", null ),
    36     'googlesitekit-datastore-ui'                           => array( "googlesitekit-datastore-ui-bca078eceaaa8c87948d.js", null ),
    37     'googlesitekit-datastore-user'                         => array( "googlesitekit-datastore-user-c9aee053073946d82bc6.js", null ),
    38     'googlesitekit-entity-dashboard'                       => array( "googlesitekit-entity-dashboard-909580c1ad26533618a7.js", null ),
    39     'googlesitekit-main-dashboard'                         => array( "googlesitekit-main-dashboard-00725d6f8918d582c7be.js", null ),
    40     'googlesitekit-modules'                                => array( "googlesitekit-modules-eeec4132d38e98b7da80.js", null ),
    41     'googlesitekit-modules-ads'                            => array( "googlesitekit-modules-ads-8fc1dc559868da9f2c36.js", null ),
    42     'googlesitekit-modules-adsense'                        => array( "googlesitekit-modules-adsense-e7fb25a5bd63d8fcdd08.js", null ),
    43     'googlesitekit-modules-analytics-4'                    => array( "googlesitekit-modules-analytics-4-f382f0563523da5f8023.js", null ),
    44     'googlesitekit-modules-pagespeed-insights'             => array( "googlesitekit-modules-pagespeed-insights-ac9df42867d70783b841.js", null ),
    45     'googlesitekit-modules-reader-revenue-manager'         => array( "googlesitekit-modules-reader-revenue-manager-fbbb8a6b54f8e8e6c506.js", null ),
    46     'googlesitekit-modules-search-console'                 => array( "googlesitekit-modules-search-console-7ef9910074ab8c22bab3.js", null ),
    47     'googlesitekit-modules-sign-in-with-google'            => array( "googlesitekit-modules-sign-in-with-google-5438d79c1a357d5f1552.js", null ),
    48     'googlesitekit-modules-tagmanager'                     => array( "googlesitekit-modules-tagmanager-7c01bc6dc43a4de58a7e.js", null ),
    49     'googlesitekit-notifications'                          => array( "googlesitekit-notifications-990bda6838a2b33db477.js", null ),
    50     'googlesitekit-polyfills'                              => array( "googlesitekit-polyfills-2ca995545dced5490968.js", null ),
    51     'googlesitekit-settings'                               => array( "googlesitekit-settings-3d397e7aeec169a6f6f7.js", null ),
    52     'googlesitekit-splash'                                 => array( "googlesitekit-splash-77f274ec773bb062bf6b.js", null ),
    53     'googlesitekit-user-input'                             => array( "googlesitekit-user-input-f2a4eab971b7ec745147.js", null ),
    54     'googlesitekit-widgets'                                => array( "googlesitekit-widgets-870e0a6fad71d1353b97.js", null ),
    55     'googlesitekit-wp-dashboard'                           => array( "googlesitekit-wp-dashboard-d26ef36f87825368c95d.js", null ),
     24    'googlesitekit-wp-dashboard-css'                       => array( "googlesitekit-wp-dashboard-css-0fc5cdb23e1da0303b0d.min.css", null ),
     25    'googlesitekit-vendor'                                 => array( "googlesitekit-vendor-6b24bb356fa23b3d09d7.js", null ),
     26    'googlesitekit-runtime'                                => array( "runtime-e5c5db16360d2c7a2c35.js", null ),
     27    'googlesitekit-activation'                             => array( "googlesitekit-activation-904456dfa45a7bf7611a.js", null ),
     28    'googlesitekit-ad-blocking-recovery'                   => array( "googlesitekit-ad-blocking-recovery-d71ee6df4e7addae69ec.js", null ),
     29    'googlesitekit-adminbar'                               => array( "googlesitekit-adminbar-9af92010e6777c6696f3.js", null ),
     30    'googlesitekit-api'                                    => array( "googlesitekit-api-19255a6b438f9ad0a040.js", null ),
     31    'googlesitekit-components'                             => array( array( "googlesitekit-components-gm2-6fe72015578197d038f1.js", null ), array( "googlesitekit-components-gm3-6af3039137f53dc8dd37.js", null ) ),
     32    'googlesitekit-data'                                   => array( "googlesitekit-data-050bcf046a0bf4e32143.js", null ),
     33    'googlesitekit-datastore-forms'                        => array( "googlesitekit-datastore-forms-52fa86100909ae62978e.js", null ),
     34    'googlesitekit-datastore-location'                     => array( "googlesitekit-datastore-location-178144613b0bcdf6a463.js", null ),
     35    'googlesitekit-datastore-site'                         => array( "googlesitekit-datastore-site-fe1cc3250299edf04507.js", null ),
     36    'googlesitekit-datastore-ui'                           => array( "googlesitekit-datastore-ui-ce7100e6b7d5cf5320f8.js", null ),
     37    'googlesitekit-datastore-user'                         => array( "googlesitekit-datastore-user-6e6dbf78ecfd97d63650.js", null ),
     38    'googlesitekit-entity-dashboard'                       => array( "googlesitekit-entity-dashboard-5b9b906ead2199337ada.js", null ),
     39    'googlesitekit-main-dashboard'                         => array( "googlesitekit-main-dashboard-06a04c1638abd60081ec.js", null ),
     40    'googlesitekit-metric-selection'                       => array( "googlesitekit-metric-selection-8622b3253697ec92bd12.js", null ),
     41    'googlesitekit-modules'                                => array( "googlesitekit-modules-b36d5dcc1fa33778aa8a.js", null ),
     42    'googlesitekit-modules-ads'                            => array( "googlesitekit-modules-ads-71257414eb8eb27b8478.js", null ),
     43    'googlesitekit-modules-adsense'                        => array( "googlesitekit-modules-adsense-9482d78b42d7ef29b823.js", null ),
     44    'googlesitekit-modules-analytics-4'                    => array( "googlesitekit-modules-analytics-4-80e726305b05bd06dacc.js", null ),
     45    'googlesitekit-modules-pagespeed-insights'             => array( "googlesitekit-modules-pagespeed-insights-06e61c09acfbcd9b87b7.js", null ),
     46    'googlesitekit-modules-reader-revenue-manager'         => array( "googlesitekit-modules-reader-revenue-manager-ba4e865f16154d2a121d.js", null ),
     47    'googlesitekit-modules-search-console'                 => array( "googlesitekit-modules-search-console-be4fffc3d4404b7d5978.js", null ),
     48    'googlesitekit-modules-sign-in-with-google'            => array( "googlesitekit-modules-sign-in-with-google-4b79763f0ae399c93438.js", null ),
     49    'googlesitekit-modules-tagmanager'                     => array( "googlesitekit-modules-tagmanager-8d556053c680ab6fed4b.js", null ),
     50    'googlesitekit-notifications'                          => array( "googlesitekit-notifications-16c629cb2b0e415158d4.js", null ),
     51    'googlesitekit-polyfills'                              => array( "googlesitekit-polyfills-fa5ebdaece9e2d991408.js", null ),
     52    'googlesitekit-settings'                               => array( "googlesitekit-settings-279994567e0f3a4dec37.js", null ),
     53    'googlesitekit-splash'                                 => array( "googlesitekit-splash-b1edbc0030571277701c.js", null ),
     54    'googlesitekit-user-input'                             => array( "googlesitekit-user-input-93f6eff03b4ad0efceb2.js", null ),
     55    'googlesitekit-widgets'                                => array( "googlesitekit-widgets-5059de819036d0cb61bd.js", null ),
     56    'googlesitekit-wp-dashboard'                           => array( "googlesitekit-wp-dashboard-f1dcc826e50bfdda1ea1.js", null ),
    5657);
  • google-site-kit/trunk/google-site-kit.php

    r3201134 r3208808  
    1212 * Plugin URI:        https://sitekit.withgoogle.com
    1313 * Description:       Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
    14  * Version:           1.141.0
     14 * Version:           1.142.0
    1515 * Requires at least: 5.2
    1616 * Requires PHP:      7.4
     
    2727
    2828// Define most essential constants.
    29 define( 'GOOGLESITEKIT_VERSION', '1.141.0' );
     29define( 'GOOGLESITEKIT_VERSION', '1.142.0' );
    3030define( 'GOOGLESITEKIT_PLUGIN_MAIN_FILE', __FILE__ );
    3131define( 'GOOGLESITEKIT_PHP_MINIMUM', '7.4.0' );
  • google-site-kit/trunk/includes/Core/Admin/Screens.php

    r3118692 r3208808  
    481481        );
    482482
     483        if ( Feature_Flags::enabled( 'conversionReporting' ) ) {
     484            $screens[] = new Screen(
     485                self::PREFIX . 'metric-selection',
     486                array(
     487                    'title'       => __( 'Select Key Metrics', 'google-site-kit' ),
     488                    'capability'  => Permissions::MANAGE_OPTIONS,
     489                    'parent_slug' => self::PARENT_SLUG_NULL,
     490                )
     491            );
     492        }
     493
    483494        return $screens;
    484495    }
  • google-site-kit/trunk/includes/Core/Assets/Assets.php

    r3201134 r3208808  
    697697            ),
    698698        );
     699
     700        if ( Feature_Flags::enabled( 'conversionReporting' ) ) {
     701            $assets[] = new Script(
     702                'googlesitekit-metric-selection',
     703                array(
     704                    'src'          => $base_url . 'js/googlesitekit-metric-selection.js',
     705                    'dependencies' => $this->get_asset_dependencies( 'dashboard' ),
     706                )
     707            );
     708        }
    699709
    700710        /**
     
    748758            'productPostType'   => $this->get_product_post_type(),
    749759            'anyoneCanRegister' => (bool) get_option( 'users_can_register' ),
     760            'isMultisite'       => is_multisite(),
    750761        );
    751762
  • google-site-kit/trunk/includes/Core/Consent_Mode/Consent_Mode.php

    r3201134 r3208808  
    1313use Google\Site_Kit\Context;
    1414use Google\Site_Kit\Core\Assets\Script;
     15use Google\Site_Kit\Core\Modules\Modules;
    1516use Google\Site_Kit\Core\Storage\Options;
    1617use Google\Site_Kit\Core\Util\BC_Functions;
     
    5758     *
    5859     * @since 1.122.0
     60     * @since 1.142.0 Introduced Modules instance as an argument.
    5961     *
    6062     * @param Context $context Plugin context.
     63     * @param Modules $modules Modules instance.
    6164     * @param Options $options Optional. Option API instance. Default is a new instance.
    6265     */
    63     public function __construct( Context $context, Options $options = null ) {
     66    public function __construct(
     67        Context $context,
     68        Modules $modules,
     69        Options $options = null
     70    ) {
    6471        $this->context               = $context;
    6572        $options                     = $options ?: new Options( $context );
    6673        $this->consent_mode_settings = new Consent_Mode_Settings( $options );
    67         $this->rest_controller       = new REST_Consent_Mode_Controller( $this->consent_mode_settings );
     74        $this->rest_controller       = new REST_Consent_Mode_Controller(
     75            $modules,
     76            $this->consent_mode_settings,
     77            $options
     78        );
    6879    }
    6980
  • google-site-kit/trunk/includes/Core/Consent_Mode/REST_Consent_Mode_Controller.php

    r3127664 r3208808  
    1111namespace Google\Site_Kit\Core\Consent_Mode;
    1212
     13use Google\Site_Kit\Core\Modules\Modules;
    1314use Google\Site_Kit\Core\Permissions\Permissions;
    1415use Google\Site_Kit\Core\REST_API\REST_Route;
    1516use Google\Site_Kit\Core\REST_API\REST_Routes;
     17use Google\Site_Kit\Core\Storage\Options;
     18use Google\Site_Kit\Modules\Ads;
     19use Google\Site_Kit\Modules\Analytics_4;
     20use Google\Site_Kit\Modules\Analytics_4\Settings as Analytics_Settings;
     21use Google\Site_Kit\Modules\Tag_Manager\Settings as Tag_Manager_Settings;
     22use Google\Site_Kit\Modules\Tag_Manager;
    1623use WP_REST_Request;
    1724use WP_REST_Response;
     
    3643    private $consent_mode_settings;
    3744
     45    /**
     46     * Modules instance.
     47     *
     48     * @since 1.142.0
     49     * @var Modules
     50     */
     51    protected $modules;
     52
     53    /**
     54     * Options instance.
     55     *
     56     * @since 1.142.0
     57     * @var Options
     58     */
     59    protected $options;
     60
    3861        /**
    3962         * Constructor.
    4063         *
    4164         * @since 1.122.0
     65         * @since 1.142.0 Introduces Modules as an argument.
    4266         *
     67         * @param Modules               $modules               Modules instance.
    4368         * @param Consent_Mode_Settings $consent_mode_settings Consent_Mode_Settings instance.
     69         * @param Options               $options               Optional. Option API instance. Default is a new instance.
    4470         */
    45     public function __construct( Consent_Mode_Settings $consent_mode_settings ) {
     71    public function __construct(
     72        Modules $modules,
     73        Consent_Mode_Settings $consent_mode_settings,
     74        Options $options
     75    ) {
     76        $this->modules               = $modules;
    4677        $this->consent_mode_settings = $consent_mode_settings;
     78        $this->options               = $options;
    4779    }
    4880
     
    227259                ),
    228260            ),
     261            new REST_Route(
     262                'core/site/data/ads-measurement-status',
     263                array(
     264                    array(
     265                        'methods'             => WP_REST_Server::READABLE,
     266                        'callback'            => function () {
     267                            $ads_connected = apply_filters( 'googlesitekit_is_module_connected', false, Ads::MODULE_SLUG );
     268
     269                            if ( $ads_connected ) {
     270                                return new WP_REST_Response( array( 'connected' => true ) );
     271                            }
     272
     273                            $analytics_connected = apply_filters( 'googlesitekit_is_module_connected', false, Analytics_4::MODULE_SLUG );
     274                            if ( $analytics_connected ) {
     275                                $analytics_settings = ( new Analytics_Settings( $this->options ) )->get();
     276                                $adsense_linked     = $analytics_settings['adSenseLinked'] ?? false;
     277
     278                                if ( $adsense_linked ) {
     279                                    return new WP_REST_Response( array( 'connected' => true ) );
     280                                }
     281
     282                                $container_destination_ids = $analytics_settings['googleTagContainerDestinationIDs'] ?? false;
     283                                if ( is_array( $container_destination_ids ) ) {
     284                                    foreach ( $container_destination_ids as $destination_id ) {
     285                                        if ( substr( $destination_id, 0, 3 ) === 'AW-' ) {
     286                                            return new WP_REST_Response( array( 'connected' => true ) );
     287                                        }
     288                                    }
     289                                }
     290                            }
     291
     292                            $tag_manager_connected = apply_filters( 'googlesitekit_is_module_connected', false, Tag_Manager::MODULE_SLUG );
     293                            if ( $tag_manager_connected ) {
     294                                $tag_manager          = $this->modules->get_module( Tag_Manager::MODULE_SLUG );
     295                                $tag_manager_settings = ( new Tag_Manager_Settings( $this->options ) )->get();
     296
     297                                if ( ! $tag_manager || ! $tag_manager instanceof Tag_Manager ) {
     298                                    return new WP_REST_Response( array( 'connected' => false ) );
     299                                }
     300
     301                                $live_containers_versions = $tag_manager->get_tagmanager_service()->accounts_containers_versions->live(
     302                                    "accounts/{$tag_manager_settings['accountID']}/containers/{$tag_manager_settings['internalContainerID']}"
     303                                );
     304
     305                                if ( empty( $live_containers_versions->tag ) ) {
     306                                    return new WP_REST_Response( array( 'connected' => false ) );
     307                                }
     308
     309                                $has_ads_tag = array_search( 'awct', array_column( $live_containers_versions->tag, 'type' ), true );
     310                                if ( false !== $has_ads_tag ) {
     311                                    return new WP_REST_Response( array( 'connected' => true ) );
     312                                }
     313                            }
     314
     315                            return new WP_REST_Response( array( 'connected' => false ) );
     316                        },
     317                        'permission_callback' => $can_manage_options,
     318                    ),
     319                ),
     320            ),
    229321        );
    230322    }
  • google-site-kit/trunk/includes/Core/Key_Metrics/Key_Metrics_Settings.php

    r3173125 r3208808  
    5050            'widgetSlugs'                      => array(),
    5151            'isWidgetHidden'                   => false,
    52             'includeConversionTailoredMetrics' => false,
     52            'includeConversionTailoredMetrics' => array(),
    5353        );
    5454    }
     
    106106
    107107            if ( isset( $settings['includeConversionTailoredMetrics'] ) ) {
    108                 $sanitized_settings['includeConversionTailoredMetrics'] = false !== $settings['includeConversionTailoredMetrics'];
     108                $sanitized_settings['includeConversionTailoredMetrics'] = Sanitize::sanitize_string_list( $settings['includeConversionTailoredMetrics'] );
    109109            }
    110110
  • google-site-kit/trunk/includes/Core/Tags/First_Party_Mode/First_Party_Mode.php

    r3201134 r3208808  
    1212
    1313use Google\Site_Kit\Context;
     14use Google\Site_Kit\Core\Modules\Module_With_Debug_Fields;
    1415use Google\Site_Kit\Core\Storage\Options;
     16use Google\Site_Kit\Core\Tags\First_Party_Mode\First_Party_Mode_Cron;
    1517use Google\Site_Kit\Core\Util\Method_Proxy_Trait;
    1618
     
    2224 * @ignore
    2325 */
    24 class First_Party_Mode {
     26class First_Party_Mode implements Module_With_Debug_Fields {
    2527    use Method_Proxy_Trait;
    2628
     
    4850     */
    4951    protected $rest_controller;
     52
     53    /**
     54     * First_Party_Mode_Cron instance.
     55     *
     56     * @since 1.142.0
     57     * @var First_Party_Mode_Cron
     58     */
     59    private $cron;
    5060
    5161    /**
     
    6171        $options                         = $options ?: new Options( $context );
    6272        $this->first_party_mode_settings = new First_Party_Mode_Settings( $options );
    63         $this->rest_controller           = new REST_First_Party_Mode_Controller( $this->first_party_mode_settings );
     73        $this->rest_controller           = new REST_First_Party_Mode_Controller( $this, $this->first_party_mode_settings );
     74        $this->cron                      = new First_Party_Mode_Cron( array( $this, 'healthcheck' ) );
    6475    }
    6576
     
    7283        $this->first_party_mode_settings->register();
    7384        $this->rest_controller->register();
     85        $this->cron->register();
     86
     87        add_action( 'admin_init', fn () => $this->on_admin_init() );
     88    }
     89
     90    /**
     91     * Gets a healthcheck debug field display value.
     92     *
     93     * @since 1.142.0
     94     *
     95     * @param mixed $setting_value Setting value.
     96     * @return string
     97     */
     98    private function health_check_debug_field_value( $setting_value ) {
     99        if ( true === $setting_value ) {
     100            return __( 'Yes', 'google-site-kit' );
     101        } elseif ( false === $setting_value ) {
     102            return __( 'No', 'google-site-kit' );
     103        }
     104        return '-';
     105    }
     106
     107    /**
     108     * Gets a healthcheck debug field debug value.
     109     *
     110     * @since 1.142.0
     111     *
     112     * @param mixed $setting_value Setting value.
     113     * @return string
     114     */
     115    private function health_check_debug_field_debug( $setting_value ) {
     116        if ( true === $setting_value ) {
     117            return 'yes';
     118        } elseif ( false === $setting_value ) {
     119            return 'no';
     120        }
     121        return '-';
     122    }
     123
     124    /**
     125     * Gets an array of debug field definitions.
     126     *
     127     * @since 1.142.0
     128     *
     129     * @return array
     130     */
     131    public function get_debug_fields() {
     132        $settings = $this->first_party_mode_settings->get();
     133
     134        return array(
     135            'first_party_mode_is_enabled'               => array(
     136                'label' => __( 'First-Party Mode: Enabled', 'google-site-kit' ),
     137                'value' => $this->health_check_debug_field_value( $settings['isEnabled'] ),
     138                'debug' => $this->health_check_debug_field_debug( $settings['isEnabled'] ),
     139            ),
     140            'first_party_mode_is_fpm_healthy'           => array(
     141                'label' => __( 'First-Party Mode: Service healthy', 'google-site-kit' ),
     142                'value' => $this->health_check_debug_field_value( $settings['isFPMHealthy'] ),
     143                'debug' => $this->health_check_debug_field_debug( $settings['isFPMHealthy'] ),
     144            ),
     145            'first_party_mode_is_script_access_enabled' => array(
     146                'label' => __( 'First-Party Mode: Script accessible', 'google-site-kit' ),
     147                'value' => $this->health_check_debug_field_value( $settings['isScriptAccessEnabled'] ),
     148                'debug' => $this->health_check_debug_field_debug( $settings['isScriptAccessEnabled'] ),
     149            ),
     150        );
     151    }
     152
     153    /**
     154     * Checks the health of First Party Mode server requirements.
     155     *
     156     * @since 1.142.0
     157     *
     158     * @return void
     159     */
     160    public function healthcheck() {
     161        $is_fpm_healthy           = $this->is_endpoint_healthy( 'https://g-1234.fps.goog/mpath/healthy' );
     162        $is_script_access_enabled = $this->is_endpoint_healthy( add_query_arg( 'healthCheck', '1', plugins_url( 'fpm/measurement.php', GOOGLESITEKIT_PLUGIN_MAIN_FILE ) ) );
     163
     164        $this->first_party_mode_settings->merge(
     165            array(
     166                'isFPMHealthy'          => $is_fpm_healthy,
     167                'isScriptAccessEnabled' => $is_script_access_enabled,
     168            )
     169        );
     170    }
     171
     172    /**
     173     * Schedule cron on admin init.
     174     *
     175     * @since 1.142.0
     176     */
     177    public function on_admin_init() {
     178        $this->cron->maybe_schedule_cron();
     179    }
     180
     181    /**
     182     * Checks if an endpoint is healthy. The endpoint must return a `200 OK` response with the body `ok`.
     183     *
     184     * @since 1.141.0
     185     * @since 1.142.0 Relocated from REST_First_Party_Mode_Controller.
     186     *
     187     * @param string $endpoint The endpoint to check.
     188     * @return bool True if the endpoint is healthy, false otherwise.
     189     */
     190    protected function is_endpoint_healthy( $endpoint ) {
     191        try {
     192            // phpcs:ignore WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsUnknown,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
     193            $response = file_get_contents( $endpoint );
     194        } catch ( \Exception $e ) {
     195            return false;
     196        }
     197
     198        if ( 'ok' !== $response ) {
     199            return false;
     200        }
     201
     202        return strpos( $http_response_header[0], '200 OK' ) !== false;
    74203    }
    75204}
  • google-site-kit/trunk/includes/Core/Tags/First_Party_Mode/First_Party_Mode_Settings.php

    r3201134 r3208808  
    4747    protected function get_default() {
    4848        return array(
    49             'isEnabled'             => null,
     49            'isEnabled'             => false,
    5050            'isFPMHealthy'          => null,
    5151            'isScriptAccessEnabled' => null,
  • google-site-kit/trunk/includes/Core/Tags/First_Party_Mode/REST_First_Party_Mode_Controller.php

    r3201134 r3208808  
    1414use Google\Site_Kit\Core\REST_API\REST_Route;
    1515use Google\Site_Kit\Core\REST_API\REST_Routes;
     16use Google\Site_Kit\Core\Tags\First_Party_Mode\First_Party_Mode;
    1617use WP_REST_Request;
    1718use WP_REST_Response;
     
    2829
    2930    /**
     31     * First_Party_Mode instance.
     32     *
     33     * @since 1.142.0
     34     * @var First_Party_Mode
     35     */
     36    private $first_party_mode;
     37
     38    /**
    3039     * First_Party_Mode_Settings instance.
    3140     *
     
    4049     * @since 1.141.0
    4150     *
     51     * @param First_Party_Mode          $first_party_mode          First_Party_Mode instance.
    4252     * @param First_Party_Mode_Settings $first_party_mode_settings First_Party_Mode_Settings instance.
    4353     */
    44     public function __construct( First_Party_Mode_Settings $first_party_mode_settings ) {
     54    public function __construct( First_Party_Mode $first_party_mode, First_Party_Mode_Settings $first_party_mode_settings ) {
     55        $this->first_party_mode          = $first_party_mode;
    4556        $this->first_party_mode_settings = $first_party_mode_settings;
    4657    }
     
    135146                        'methods'             => WP_REST_Server::READABLE,
    136147                        'callback'            => function () {
    137                             $is_fpm_healthy = $this->is_endpoint_healthy( 'https://g-1234.fps.goog/mpath/healthy' );
    138                             $is_script_access_enabled = $this->is_endpoint_healthy( add_query_arg( 'healthCheck', '1', plugins_url( 'fpm/measurement.php', GOOGLESITEKIT_PLUGIN_MAIN_FILE ) ) );
    139 
    140                             $this->first_party_mode_settings->merge(
    141                                 array(
    142                                     'isFPMHealthy' => $is_fpm_healthy,
    143                                     'isScriptAccessEnabled' => $is_script_access_enabled,
    144                                 )
    145                             );
    146 
     148                            $this->first_party_mode->healthcheck();
    147149                            return new WP_REST_Response( $this->first_party_mode_settings->get() );
    148150                        },
     
    153155        );
    154156    }
    155 
    156     /**
    157      * Checks if an endpoint is healthy. The endpoint must return a `200 OK` response with the body `ok`.
    158      *
    159      * @since 1.141.0
    160      *
    161      * @param string $endpoint The endpoint to check.
    162      * @return bool True if the endpoint is healthy, false otherwise.
    163      */
    164     protected function is_endpoint_healthy( $endpoint ) {
    165         try {
    166             // phpcs:ignore WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsUnknown,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
    167             $response = file_get_contents( $endpoint );
    168         } catch ( \Exception $e ) {
    169             return false;
    170         }
    171 
    172         if ( 'ok' !== $response ) {
    173             return false;
    174         }
    175 
    176         return strpos( $http_response_header[0], '200 OK' ) !== false;
    177     }
    178157}
  • google-site-kit/trunk/includes/Core/Tags/GTag.php

    r3118692 r3208808  
    1111namespace Google\Site_Kit\Core\Tags;
    1212
     13use Google\Site_Kit\Core\Storage\Options;
     14use Google\Site_Kit\Core\Tags\First_Party_Mode\First_Party_Mode_Settings;
     15use Google\Site_Kit\Core\Util\Feature_Flags;
    1316use Google\Site_Kit\Core\Util\Method_Proxy_Trait;
    1417
     
    2427
    2528    const HANDLE = 'google_gtagjs';
     29
     30    /**
     31     * Options instance.
     32     *
     33     * @var Options
     34     */
     35    private $options;
     36
    2637    /**
    2738     * Holds an array of gtag ID's and their inline config elements.
     
    3647     */
    3748    private $commands = array();
     49
     50    /**
     51     * Constructor.
     52     *
     53     * @since 1.142.0
     54     *
     55     * @param Options $options Option API instance.
     56     */
     57    public function __construct( Options $options ) {
     58        $this->options = $options;
     59    }
    3860
    3961    /**
     
    193215     *
    194216     * @since 1.124.0
     217     * @since 1.142.0 Provides support for first-party mode.
    195218     *
    196219     * @return string|false The gtag source URL. False if no tags are added.
     
    204227        // all registered tags will be set up with a config command regardless
    205228        // of which is used to load the source.
    206         return 'https://www.googletagmanager.com/gtag/js?id=' . rawurlencode( $this->tags[0]['tag_id'] );
     229        $tag_id = rawurlencode( $this->tags[0]['tag_id'] );
     230
     231        // If first-party mode is active, use the proxy URL to load the GTag script.
     232        if ( Feature_Flags::enabled( 'firstPartyMode' ) && $this->is_first_party_mode_active() ) {
     233            return add_query_arg(
     234                array(
     235                    'id' => $tag_id,
     236                    's'  => '/gtag/js',
     237                ),
     238                plugins_url( 'fpm/measurement.php', GOOGLESITEKIT_PLUGIN_MAIN_FILE )
     239            );
     240        }
     241
     242        return 'https://www.googletagmanager.com/gtag/js?id=' . $tag_id;
     243    }
     244
     245    /**
     246     * Checks if first-party mode is active.
     247     *
     248     * @since 1.142.0
     249     *
     250     * @return bool True if first-party mode is active, false otherwise.
     251     */
     252    protected function is_first_party_mode_active() {
     253        $first_party_mode_settings = new First_Party_Mode_Settings( $this->options );
     254
     255        $settings = $first_party_mode_settings->get();
     256
     257        $required_settings = array( 'isEnabled', 'isFPMHealthy', 'isScriptAccessEnabled' );
     258
     259        foreach ( $required_settings as $setting ) {
     260            if ( ! isset( $settings[ $setting ] ) || ! $settings[ $setting ] ) {
     261                return false;
     262            }
     263        }
     264
     265        return true;
    207266    }
    208267}
  • google-site-kit/trunk/includes/Core/Util/Uninstallation.php

    r3191565 r3208808  
    1818use Google\Site_Kit\Core\Authentication\Clients\OAuth_Client;
    1919use Google\Site_Kit\Core\Remote_Features\Remote_Features_Cron;
     20use Google\Site_Kit\Core\Tags\First_Party_Mode\First_Party_Mode_Cron;
    2021use Google\Site_Kit\Modules\Analytics_4\Conversion_Reporting\Conversion_Reporting_Cron;
    2122use Google\Site_Kit\Modules\Analytics_4\Synchronize_AdSenseLinked;
     
    6162        Synchronize_AdsLinked::CRON_SYNCHRONIZE_ADS_LINKED,
    6263        Synchronize_Property::CRON_SYNCHRONIZE_PROPERTY,
     64        First_Party_Mode_Cron::CRON_ACTION,
    6365    );
    6466
  • google-site-kit/trunk/includes/Modules/Ads.php

    r3201134 r3208808  
    2929use Google\Site_Kit\Core\Permissions\Permissions;
    3030use Google\Site_Kit\Core\Site_Health\Debug_Data;
     31use Google\Site_Kit\Core\Tags\First_Party_Mode\First_Party_Mode;
    3132use Google\Site_Kit\Modules\Ads\PAX_Config;
    3233use Google\Site_Kit\Modules\Ads\Settings;
     
    308309        $settings = $this->get_settings()->get();
    309310
    310         return array(
     311        $debug_fields = array(
    311312            'ads_conversion_tracking_id' => array(
    312313                'label' => __( 'Ads: Conversion Tracking ID', 'google-site-kit' ),
     
    315316            ),
    316317        );
     318
     319        // Add fields from First-party Mode.
     320        // Note: fields are added in both Analytics and Ads so that the debug fields will show if either module is enabled.
     321        if ( Feature_Flags::enabled( 'firstPartyMode' ) ) {
     322            $first_party_mode             = new First_Party_Mode( $this->context );
     323            $fields_from_first_party_mode = $first_party_mode->get_debug_fields();
     324
     325            $debug_fields = array_merge( $debug_fields, $fields_from_first_party_mode );
     326        }
     327
     328        return $debug_fields;
    317329    }
    318330
  • google-site-kit/trunk/includes/Modules/Analytics_4.php

    r3201134 r3208808  
    9090use Google\Site_Kit_Dependencies\Psr\Http\Message\RequestInterface;
    9191use Google\Site_Kit\Core\REST_API\REST_Routes;
     92use Google\Site_Kit\Core\Tags\First_Party_Mode\First_Party_Mode;
    9293use Google\Site_Kit\Modules\Analytics_4\Conversion_Reporting\Conversion_Reporting_Cron;
    9394use Google\Site_Kit\Modules\Analytics_4\Conversion_Reporting\Conversion_Reporting_Events_Sync;
     
    592593                    : join( ', ', $site_kit_audiences ),
    593594            );
     595        }
     596
     597        // Add fields from First-party Mode.
     598        // Note: fields are added in both Analytics and Ads so that the debug fields will show if either module is enabled.
     599        if ( Feature_Flags::enabled( 'firstPartyMode' ) ) {
     600            $first_party_mode             = new First_Party_Mode( $this->context );
     601            $fields_from_first_party_mode = $first_party_mode->get_debug_fields();
     602
     603            $debug_fields = array_merge( $debug_fields, $fields_from_first_party_mode );
    594604        }
    595605
  • google-site-kit/trunk/includes/Modules/Sign_In_With_Google.php

    r3201134 r3208808  
    1111namespace Google\Site_Kit\Modules;
    1212
     13use Google\Site_Kit\Context;
    1314use Google\Site_Kit\Core\Assets\Asset;
     15use Google\Site_Kit\Core\Assets\Assets;
    1416use Google\Site_Kit\Core\Assets\Script;
     17use Google\Site_Kit\Core\Authentication\Authentication;
    1518use Google\Site_Kit\Core\Conversion_Tracking\Conversion_Event_Providers\WooCommerce;
    1619use Google\Site_Kit\Core\Modules\Module;
     
    3235use Google\Site_Kit\Modules\Sign_In_With_Google\Authenticator;
    3336use Google\Site_Kit\Modules\Sign_In_With_Google\Authenticator_Interface;
     37use Google\Site_Kit\Modules\Sign_In_With_Google\Existing_Client_ID;
    3438use Google\Site_Kit\Modules\Sign_In_With_Google\Hashed_User_ID;
    3539use Google\Site_Kit\Modules\Sign_In_With_Google\Profile_Reader;
     
    6973
    7074    /**
     75     * Existing_Client_ID instance.
     76     *
     77     * @since 1.142.0
     78     * @var Existing_Client_ID
     79     */
     80    protected $existing_client_id;
     81
     82    /**
     83     * Constructor.
     84     *
     85     * @since 1.142.0
     86     *
     87     * @param Context        $context        Plugin context.
     88     * @param Options        $options        Optional. Option API instance. Default is a new instance.
     89     * @param User_Options   $user_options   Optional. User Option API instance. Default is a new instance.
     90     * @param Authentication $authentication Optional. Authentication instance. Default is a new instance.
     91     * @param Assets         $assets  Optional. Assets API instance. Default is a new instance.
     92     */
     93    public function __construct(
     94        Context $context,
     95        Options $options = null,
     96        User_Options $user_options = null,
     97        Authentication $authentication = null,
     98        Assets $assets = null
     99    ) {
     100        parent::__construct( $context, $options, $user_options, $authentication, $assets );
     101        $this->existing_client_id = new Existing_Client_ID( $this->options );
     102    }
     103
     104    /**
    71105     * Registers functionality through WordPress hooks.
    72106     *
     
    76110    public function register() {
    77111        add_filter( 'wp_login_errors', array( $this, 'handle_login_errors' ) );
     112
     113        add_filter( 'googlesitekit_inline_modules_data', $this->get_method_proxy( 'inline_existing_client_id' ), 10 );
    78114
    79115        add_action(
     
    97133
    98134        add_action( 'woocommerce_login_form_start', $this->get_method_proxy( 'render_signin_button' ) );
     135
     136        // Delete client ID stored from previous module connection on module reconnection.
     137        add_action(
     138            'googlesitekit_save_settings_' . self::MODULE_SLUG,
     139            function () {
     140                if ( $this->is_connected() ) {
     141                    $this->existing_client_id->delete();
     142                }
     143            }
     144        );
    99145    }
    100146
     
    138184        switch ( $error_code ) {
    139185            case Authenticator::ERROR_INVALID_REQUEST:
    140                 $error->add( self::MODULE_SLUG, __( 'Sign in with Google failed.', 'google-site-kit' ) );
     186                /* translators: %s: Sign in with Google service name */
     187                $error->add( self::MODULE_SLUG, sprintf( __( 'Login with %s failed.', 'google-site-kit' ), _x( 'Sign in with Google', 'Service name', 'google-site-kit' ) ) );
    141188                break;
    142189            case Authenticator::ERROR_SIGNIN_FAILED:
     
    153200     * Cleans up when the module is deactivated.
    154201     *
     202     * Persist the clientID on module disconnection, so it can be
     203     * reused if the module were to be reconnected.
     204     *
    155205     * @since 1.137.0
    156206     */
    157207    public function on_deactivation() {
     208        $pre_deactivation_settings = $this->get_settings()->get();
     209
     210        if ( ! empty( $pre_deactivation_settings['clientID'] ) ) {
     211            $this->existing_client_id->set( $pre_deactivation_settings['clientID'] );
     212        }
     213
    158214        $this->get_settings()->delete();
    159215    }
     
    170226            'slug'        => self::MODULE_SLUG,
    171227            'name'        => _x( 'Sign in with Google', 'Service name', 'google-site-kit' ),
    172             'description' => __( 'Improve user engagement, trust, and data privacy, while creating a simple, secure, and personalized experience for your visitors', 'google-site-kit' ),
     228            'description' => __( 'Improve user engagement, trust and data privacy, while creating a simple, secure and personalized experience for your visitors', 'google-site-kit' ),
    173229            'order'       => 10,
    174230            'homepage'    => __( 'https://developers.google.com/identity/gsi/web/guides/overview', 'google-site-kit' ),
     
    263319
    264320        // Render the Sign in with Google button and related inline styles.
    265         printf( "\n<!-- %s -->\n", esc_html__( 'Sign in with Google button added by Site Kit', 'google-site-kit' ) );
     321        print(
     322            // Purposely not translated as this is a technical comment.
     323            //
     324            // See: https://github.com/google/site-kit-wp/pull/9826#discussion_r1876026945.
     325            "\n<!-- Sign in with Google button added by Site Kit -->\n"
     326        );
    266327        BC_Functions::wp_print_script_tag( array( 'src' => 'https://accounts.google.com/gsi/client' ) );
    267328        ob_start();
     
    345406        $debug_fields = array(
    346407            'sign_in_with_google_client_id'                => array(
    347                 'label' => __( 'Sign in with Google: Client ID', 'google-site-kit' ),
     408                /* translators: %s: Sign in with Google service name */
     409                'label' => sprintf( __( '%s: Client ID', 'google-site-kit' ), _x( 'Sign in with Google', 'Service name', 'google-site-kit' ) ),
    348410                'value' => $settings['clientID'],
    349411                'debug' => Debug_Data::redact_debug_value( $settings['clientID'] ),
    350412            ),
    351413            'sign_in_with_google_shape'                    => array(
    352                 'label' => __( 'Sign in with Google: Shape', 'google-site-kit' ),
     414                /* translators: %s: Sign in with Google service name */
     415                'label' => sprintf( __( '%s: Shape', 'google-site-kit' ), _x( 'Sign in with Google', 'Service name', 'google-site-kit' ) ),
    353416                'value' => $this->get_settings()->get_label( 'shape', $settings['shape'] ),
    354417                'debug' => $settings['shape'],
    355418            ),
    356419            'sign_in_with_google_text'                     => array(
    357                 'label' => __( 'Sign in with Google: Text', 'google-site-kit' ),
     420                /* translators: %s: Sign in with Google service name */
     421                'label' => sprintf( __( '%s: Text', 'google-site-kit' ), _x( 'Sign in with Google', 'Service name', 'google-site-kit' ) ),
    358422                'value' => $this->get_settings()->get_label( 'text', $settings['text'] ),
    359423                'debug' => $settings['text'],
    360424            ),
    361425            'sign_in_with_google_theme'                    => array(
    362                 'label' => __( 'Sign in with Google: Theme', 'google-site-kit' ),
     426                /* translators: %s: Sign in with Google service name */
     427                'label' => sprintf( __( '%s: Theme', 'google-site-kit' ), _x( 'Sign in with Google', 'Service name', 'google-site-kit' ) ),
    363428                'value' => $this->get_settings()->get_label( 'theme', $settings['theme'] ),
    364429                'debug' => $settings['theme'],
    365430            ),
    366431            'sign_in_with_google_use_snippet'              => array(
    367                 'label' => __( 'Sign in with Google: One-tap Enabled', 'google-site-kit' ),
     432                /* translators: %s: Sign in with Google service name */
     433                'label' => sprintf( __( '%s: One-tap Enabled', 'google-site-kit' ), _x( 'Sign in with Google', 'Service name', 'google-site-kit' ) ),
    368434                'value' => $settings['oneTapEnabled'] ? __( 'Yes', 'google-site-kit' ) : __( 'No', 'google-site-kit' ),
    369435                'debug' => $settings['oneTapEnabled'] ? 'yes' : 'no',
    370436            ),
    371437            'sign_in_with_google_authenticated_user_count' => array(
    372                 'label' => __( 'Sign in with Google: Number of users who have authenticated using Sign in with Google', 'google-site-kit' ),
     438                /* translators: %1$s: Sign in with Google service name */
     439                'label' => sprintf( __( '%1$s: Number of users who have authenticated using %1$s', 'google-site-kit' ), _x( 'Sign in with Google', 'Service name', 'google-site-kit' ) ),
    373440                'value' => $authenticated_user_count,
    374441                'debug' => $authenticated_user_count,
     
    443510        $search_string              = 'Sign in with Google button added by Site Kit';
    444511        $search_translatable_string =
    445             __( 'Sign in with Google button added by Site Kit', 'google-site-kit' );
     512            /* translators: %s: Sign in with Google service name */
     513            sprintf( __( '%s button added by Site Kit', 'google-site-kit' ), _x( 'Sign in with Google', 'Service name', 'google-site-kit' ) );
    446514
    447515        if ( strpos( $content, $search_string ) !== false || strpos( $content, $search_translatable_string ) !== false ) {
     
    519587        ?>
    520588<div id="googlesitekit-sign-in-with-google-disconnect">
    521     <h2><?php esc_html_e( 'Sign in with Google via Site Kit by Google', 'google-site-kit' ); ?></h2>
     589    <h2>
     590        <?php
     591        /* translators: %s: Sign in with Google service name */
     592        esc_html( sprintf( __( '%s via Site Kit by Google', 'google-site-kit' ), _x( 'Sign in with Google', 'Service name', 'google-site-kit' ) ) );
     593        ?>
     594    </h2>
    522595    <p>
    523596        <?php
     
    546619        <?php
    547620    }
     621
     622    /**
     623     * Exposes an existing client ID from a previous connection
     624     * to JS via _googlesitekitModulesData.
     625     *
     626     * @since 1.142.0
     627     *
     628     * @param array $modules_data Inline modules data.
     629     * @return array Inline modules data.
     630     */
     631    protected function inline_existing_client_id( $modules_data ) {
     632        $existing_client_id = $this->existing_client_id->get();
     633
     634        if ( $existing_client_id ) {
     635            // Add the data under the `sign-in-with-google` key to make it clear it's scoped to this module.
     636            $modules_data['sign-in-with-google'] = array(
     637                'existingClientID' => $existing_client_id,
     638            );
     639        }
     640
     641        return $modules_data;
     642    }
    548643}
  • google-site-kit/trunk/includes/Modules/Tag_Manager.php

    r3201134 r3208808  
    446446     *
    447447     * @since 1.2.0
     448     * @since 1.142.0 Made method public.
    448449     *
    449450     * @return Google_Service_TagManager instance.
    450451     * @throws Exception Thrown if the module did not correctly set up the service.
    451452     */
    452     private function get_tagmanager_service() {
     453    public function get_tagmanager_service() {
    453454        return $this->get_service( 'tagmanager' );
    454455    }
  • google-site-kit/trunk/includes/Plugin.php

    r3201134 r3208808  
    224224                ( new Core\Key_Metrics\Key_Metrics( $this->context, $user_options, $options ) )->register();
    225225                ( new Core\Prompts\Prompts( $this->context, $user_options ) )->register();
    226                 ( new Core\Consent_Mode\Consent_Mode( $this->context, $options ) )->register();
    227                 ( new Core\Tags\GTag() )->register();
     226                ( new Core\Consent_Mode\Consent_Mode( $this->context, $modules, $options ) )->register();
     227                ( new Core\Tags\GTag( $options ) )->register();
    228228                ( new Core\Conversion_Tracking\Conversion_Tracking( $this->context, $options ) )->register();
    229229                if ( Feature_Flags::enabled( 'firstPartyMode' ) ) {
  • google-site-kit/trunk/includes/vendor/composer/autoload_classmap.php

    r3201134 r3208808  
    178178    'Google\\Site_Kit\\Core\\Tags\\Blockable_Tag_Interface' => $baseDir . '/Core/Tags/Blockable_Tag_Interface.php',
    179179    'Google\\Site_Kit\\Core\\Tags\\First_Party_Mode\\First_Party_Mode' => $baseDir . '/Core/Tags/First_Party_Mode/First_Party_Mode.php',
     180    'Google\\Site_Kit\\Core\\Tags\\First_Party_Mode\\First_Party_Mode_Cron' => $baseDir . '/Core/Tags/First_Party_Mode/First_Party_Mode_Cron.php',
    180181    'Google\\Site_Kit\\Core\\Tags\\First_Party_Mode\\First_Party_Mode_Settings' => $baseDir . '/Core/Tags/First_Party_Mode/First_Party_Mode_Settings.php',
    181182    'Google\\Site_Kit\\Core\\Tags\\First_Party_Mode\\REST_First_Party_Mode_Controller' => $baseDir . '/Core/Tags/First_Party_Mode/REST_First_Party_Mode_Controller.php',
     
    313314    'Google\\Site_Kit\\Modules\\Sign_In_With_Google\\Authenticator' => $baseDir . '/Modules/Sign_In_With_Google/Authenticator.php',
    314315    'Google\\Site_Kit\\Modules\\Sign_In_With_Google\\Authenticator_Interface' => $baseDir . '/Modules/Sign_In_With_Google/Authenticator_Interface.php',
     316    'Google\\Site_Kit\\Modules\\Sign_In_With_Google\\Existing_Client_ID' => $baseDir . '/Modules/Sign_In_With_Google/Existing_Client_ID.php',
    315317    'Google\\Site_Kit\\Modules\\Sign_In_With_Google\\Hashed_User_ID' => $baseDir . '/Modules/Sign_In_With_Google/Hashed_User_ID.php',
    316318    'Google\\Site_Kit\\Modules\\Sign_In_With_Google\\Profile_Reader' => $baseDir . '/Modules/Sign_In_With_Google/Profile_Reader.php',
  • google-site-kit/trunk/readme.txt

    r3201134 r3208808  
    55Tested up to:      6.7
    66Requires PHP:      7.4
    7 Stable tag:        1.141.0
     7Stable tag:        1.142.0
    88License:           Apache License 2.0
    99License URI:       https://www.apache.org/licenses/LICENSE-2.0
     
    110110== Changelog ==
    111111
    112 = 1.141.0 =
     112= 1.142.0 =
    113113
    114114**Added**
    115115
    116 * Add Sign in with Google to WooCommerce login page. See [#9340](https://github.com/google/site-kit-wp/issues/9340).
     116* Add Analytics events to Sign in with Google. See [#9747](https://github.com/google/site-kit-wp/issues/9747).
    117117
    118118**Enhanced**
    119119
    120 * Update Sign in with Google descriptions in Site Health. See [#9680](https://github.com/google/site-kit-wp/issues/9680).
    121 * Update the Sign in with Google login to use the popup approach. See [#9677](https://github.com/google/site-kit-wp/issues/9677).
    122 * Integrate the First-party mode proxy script that will allow Analytics events to be tracked via requests made from the browser to the user's site rather than directly to Google's servers. See [#9665](https://github.com/google/site-kit-wp/issues/9665).
    123 * Add info to the "One-tap" option in Sign in with Google settings. See [#9643](https://github.com/google/site-kit-wp/issues/9643).
    124 * Do not show "Maybe later" in Key Metrics Admin Settings callout banner. See [#9636](https://github.com/google/site-kit-wp/issues/9636).
    125 * Implement the `fetchGetFPMServerRequirementStatus()` Redux action used to retrieve the FPM server requirement status. See [#9634](https://github.com/google/site-kit-wp/issues/9634).
    126 * Add an `fpm-server-requirement-status` API endpoint to verify First-Party Mode readiness by performing FPFE health checks and verifying direct PHP script access. See [#9632](https://github.com/google/site-kit-wp/issues/9632).
    127 * Add a partial datastore for First-Party Mode in the `core/site` datastore to manage its settings. See [#9628](https://github.com/google/site-kit-wp/issues/9628).
    128 * Add REST endpoints for First-Party Mode module settings. See [#9625](https://github.com/google/site-kit-wp/issues/9625).
    129 * Update "Get your Client ID" link in Sign in with Google setup. See [#9621](https://github.com/google/site-kit-wp/issues/9621).
    130 * Ensure tailored metrics override previous metrics when switching from manually-selected metrics. See [#9613](https://github.com/google/site-kit-wp/issues/9613).
    131 * Improve the accuracy of the mechanism that scrolls the user to a widget area. See [#9603](https://github.com/google/site-kit-wp/issues/9603).
    132 * Improve visitor groups selection panel to prevent a console warning. See [#9602](https://github.com/google/site-kit-wp/issues/9602).
    133 * Add an external icon to external links in the audience selection panel and placeholder tile. See [#9598](https://github.com/google/site-kit-wp/issues/9598).
    134 * Remove visitor groups setup success notifications when the user chooses not to display visitor groups in dashboard. See [#9596](https://github.com/google/site-kit-wp/issues/9596).
    135 * Introduce grouping of notification queues. See [#9568](https://github.com/google/site-kit-wp/issues/9568).
    136 * Add notice for users who used a legacy answer in Key Metrics settings. See [#9518](https://github.com/google/site-kit-wp/issues/9518).
    137 * Split the "Sell products or services" answer in the User Input app. See [#9489](https://github.com/google/site-kit-wp/issues/9489).
    138 * Persist selection group in Key Metrics selection panel. See [#9385](https://github.com/google/site-kit-wp/issues/9385).
    139 * Add support for disconnecting associated Google account for sign in from WordPress user edit screen. See [#9380](https://github.com/google/site-kit-wp/issues/9380).
    140 * Implement new subtle notification banner in KMW dashboard area. See [#9371](https://github.com/google/site-kit-wp/issues/9371).
    141 * Move on-demand onboarding state synchronization to the server side, avoiding the need to reload the full list of publications. See [#9363](https://github.com/google/site-kit-wp/issues/9363).
    142 * Improve selection panels so that they perform actions only when in view. See [#9312](https://github.com/google/site-kit-wp/issues/9312).
    143 * Improve Reader Revenue Manager publication onboarding state synchronization. See [#9149](https://github.com/google/site-kit-wp/issues/9149).
    144 * Add Key Metrics info to Site Health report. See [#9112](https://github.com/google/site-kit-wp/issues/9112).
    145 
    146 **Changed**
    147 
    148 * Implement settings view for Sign in with Google. See [#9477](https://github.com/google/site-kit-wp/issues/9477).
    149 * Implement Sign in with Google token response login handling. See [#9339](https://github.com/google/site-kit-wp/issues/9339).
     120* Fix the "improve your measurement" section's layout in mobile viewports. See [#9830](https://github.com/google/site-kit-wp/issues/9830).
     121* Update the default value of the First-party mode `isEnabled` setting to `false`. See [#9828](https://github.com/google/site-kit-wp/issues/9828).
     122* Add periodic server requirement health checks for first-party mode. See [#9768](https://github.com/google/site-kit-wp/issues/9768).
     123* Always display the "Anyone can register" WordPress setting in Sign in with Google settings. See [#9735](https://github.com/google/site-kit-wp/issues/9735).
     124* Update learn more link in Sign in with Google module settings. See [#9734](https://github.com/google/site-kit-wp/issues/9734).
     125* Update copy in Sign in with Google "Connect more services" UI. See [#9733](https://github.com/google/site-kit-wp/issues/9733).
     126* Update Sign in with Google setup success notification UI. See [#9724](https://github.com/google/site-kit-wp/issues/9724).
     127* Automatically dismiss the First-Party Mode setup banner notification when the toggle is enabled from the settings screen, preventing redundant notifications. See [#9698](https://github.com/google/site-kit-wp/issues/9698).
     128* Add a selector to detect changes and an action to reset First-party mode settings, integrated with Analytics and Ads rollback and validation processes. See [#9688](https://github.com/google/site-kit-wp/issues/9688).
     129* Add FPFE health check and script access statuses to Site Kit’s Site Health section, displaying whether these checks are enabled or disabled. See [#9668](https://github.com/google/site-kit-wp/issues/9668).
     130* Add First-Party Mode status to Site Kit’s Site Health section, displaying whether the feature is enabled or not when either the Analytics or Ads modules are connected and the `firstPartyMode` feature flag is active. See [#9667](https://github.com/google/site-kit-wp/issues/9667).
     131* Add support for gtag to load in first-party mode when enabled. See [#9664](https://github.com/google/site-kit-wp/issues/9664).
     132* Display the First-party mode enabled status in the Ads settings view. See [#9659](https://github.com/google/site-kit-wp/issues/9659).
     133* Display the First-party mode enabled status in the Analytics settings view. See [#9658](https://github.com/google/site-kit-wp/issues/9658).
     134* Integrate the First-party mode toggle into the Ads module’s settings form, allowing users to enable or disable First-party mode. See [#9655](https://github.com/google/site-kit-wp/issues/9655).
     135* Integrate the First-party mode toggle into the Analytics module’s settings form, allowing users to enable or disable First-party mode. See [#9654](https://github.com/google/site-kit-wp/issues/9654).
     136* Group measurement toggles together on the settings screen in the Ads and Analytics module edit sections. See [#9651](https://github.com/google/site-kit-wp/issues/9651).
     137* Add a "Beta" badge to the First-party mode toggle. See [#9650](https://github.com/google/site-kit-wp/issues/9650).
     138* Implement the First-party mode toggle as a component which is presented in Storybook. See [#9649](https://github.com/google/site-kit-wp/issues/9649).
     139* Add first-party mode setup success notification. See [#9648](https://github.com/google/site-kit-wp/issues/9648).
     140* Add the First-party mode setup banner to let users know about the feature and enable it from the dashboard. See [#9647](https://github.com/google/site-kit-wp/issues/9647).
     141* Update spacing between CTA actions for consistency. See [#9600](https://github.com/google/site-kit-wp/issues/9600).
     142* Add notification banner when event data has been missing for ninety days. See [#9578](https://github.com/google/site-kit-wp/issues/9578).
     143* Improve notifications rendering performance. See [#9488](https://github.com/google/site-kit-wp/issues/9488).
     144* Add full size selection panel on the new screen. See [#9375](https://github.com/google/site-kit-wp/issues/9375).
     145* Update Analytics Conversion Report notifications to be more context-aware. See [#9373](https://github.com/google/site-kit-wp/issues/9373).
     146* Ensure Analytics Conversion Reports notification appears for users who set up Key Metrics manually. See [#9372](https://github.com/google/site-kit-wp/issues/9372).
     147* Ensure that the setup flow for a module is automatically continued when clicking the "Redo setup" CTA on the "Site Kit can’t access necessary data" unsatisfied scopes notification. See [#9261](https://github.com/google/site-kit-wp/issues/9261).
     148* Extend Consent Mode conditions logic. See [#9147](https://github.com/google/site-kit-wp/issues/9147).
    150149
    151150**Fixed**
    152151
    153 * Fix a bug that caused a custom dimension to not be created while setting up visitor groups. See [#9597](https://github.com/google/site-kit-wp/issues/9597).
     152* Update the Sign in with Google module to suggest using the previous client ID when re-connecting the module. See [#9744](https://github.com/google/site-kit-wp/issues/9744).
     153* Ensure Sign in with Google translations are consistent. See [#9738](https://github.com/google/site-kit-wp/issues/9738).
     154* Add Sign in with Google live preview in settings. See [#9718](https://github.com/google/site-kit-wp/issues/9718).
     155* Update layout of Top Content widget in smaller viewports to use a tab per metric column. See [#7563](https://github.com/google/site-kit-wp/issues/7563).
    154156
    155157[See changelog for all versions](https://raw.githubusercontent.com/google/site-kit-wp/main/changelog.txt).
Note: See TracChangeset for help on using the changeset viewer.