Plugin Directory

Changeset 3335509


Ignore:
Timestamp:
07/28/2025 05:32:12 PM (5 months ago)
Author:
google
Message:

Update to version 1.158.0 from GitHub

Location:
google-site-kit
Files:
118 added
72 deleted
40 edited
1 copied

Legend:

Unmodified
Added
Removed
  • google-site-kit/tags/1.158.0/dist/config.php

    r3327728 r3335509  
    88
    99return array(
    10     'features' => array( 'adsPax','ecEuID','googleTagGateway','privacySandboxModule' ),
     10    'features' => array( 'adsPax','gtagUserData','googleTagGateway','privacySandboxModule' ),
    1111);
  • google-site-kit/tags/1.158.0/dist/manifest.php

    r3327728 r3335509  
    1515    'googlesitekit-events-provider-optin-monster'                     => array( "googlesitekit-events-provider-optin-monster-820bf8319bf22417c912.js", null ),
    1616    'googlesitekit-events-provider-popup-maker'                       => array( "googlesitekit-events-provider-popup-maker-38c8b97d166ddb055277.js", null ),
    17     'googlesitekit-events-provider-woocommerce'                       => array( "googlesitekit-events-provider-woocommerce-4c846ed50de2fbdd0624.js", null ),
     17    'googlesitekit-events-provider-woocommerce'                       => array( "googlesitekit-events-provider-woocommerce-af479f5dec39653944f3.js", null ),
    1818    'googlesitekit-events-provider-wpforms'                           => array( "googlesitekit-events-provider-wpforms-3b23b71ea60c39fa1552.js", null ),
    1919    'analytics-advanced-tracking'                                     => array( "analytics-advanced-tracking-b1e2a9b411d0c0942c55.js", null ),
     
    2828    'sign-in-with-google/editor-styles'                               => array( "sign-in-with-google/editor-styles.js", null ),
    2929    'sign-in-with-google/index'                                       => array( "sign-in-with-google/index.js", null ),
    30     'googlesitekit-admin-css'                                         => array( "googlesitekit-admin-css-2272f8f368438dca6b5c.min.css", null ),
    31     'googlesitekit-adminbar-css'                                      => array( "googlesitekit-adminbar-css-e9bad4695e968f579f39.min.css", null ),
     30    'googlesitekit-admin-css'                                         => array( "googlesitekit-admin-css-5ba14eeed9dd5a211767.min.css", null ),
     31    'googlesitekit-adminbar-css'                                      => array( "googlesitekit-adminbar-css-09a51a307c5c0cf52174.min.css", null ),
    3232    'googlesitekit-authorize-application-css'                         => array( "googlesitekit-authorize-application-css-ce25e97404abc5a02921.min.css", null ),
    33     'googlesitekit-wp-dashboard-css'                                  => array( "googlesitekit-wp-dashboard-css-6d6c1fc11d7b56b589f9.min.css", null ),
    34     'googlesitekit-vendor'                                            => array( "googlesitekit-vendor-70729eab17f8db649c1b.js", null ),
     33    'googlesitekit-wp-dashboard-css'                                  => array( "googlesitekit-wp-dashboard-css-1ef21b3eb782445a6d52.min.css", null ),
     34    'googlesitekit-vendor'                                            => array( "googlesitekit-vendor-103670c413b29de4a6ca.js", null ),
    3535    'googlesitekit-runtime'                                           => array( "runtime-09b709733bacd5275e3c.js", null ),
    36     'googlesitekit-activation'                                        => array( "googlesitekit-activation-53842cf7768b2ed03989.js", null ),
    37     'googlesitekit-ad-blocking-recovery'                              => array( "googlesitekit-ad-blocking-recovery-4deb8c3ab72a618f67bf.js", null ),
    38     'googlesitekit-adminbar'                                          => array( "googlesitekit-adminbar-0a1f5323d9b3f5ce9b45.js", null ),
    39     'googlesitekit-api'                                               => array( "googlesitekit-api-92bf92ed00193e6b4a90.js", null ),
    40     'googlesitekit-components'                                        => array( "googlesitekit-components-d40f6814efd3b0106a9b.js", null ),
    41     'googlesitekit-data'                                              => array( "googlesitekit-data-97bc64da2a434bebd120.js", null ),
    42     'googlesitekit-datastore-forms'                                   => array( "googlesitekit-datastore-forms-bd246d82cae9f2f4ea5d.js", null ),
    43     'googlesitekit-datastore-location'                                => array( "googlesitekit-datastore-location-ffd7ded2110817eee969.js", null ),
    44     'googlesitekit-datastore-site'                                    => array( "googlesitekit-datastore-site-1f3dbc0c381be6096c8b.js", null ),
    45     'googlesitekit-datastore-ui'                                      => array( "googlesitekit-datastore-ui-3f0eac02cb0cec9473c1.js", null ),
    46     'googlesitekit-datastore-user'                                    => array( "googlesitekit-datastore-user-bf2bcd783d1545e330c3.js", null ),
    47     'googlesitekit-entity-dashboard'                                  => array( "googlesitekit-entity-dashboard-e05a3ae6f7ff10f70235.js", null ),
    48     'googlesitekit-main-dashboard'                                    => array( "googlesitekit-main-dashboard-7949d6a93c1996c46251.js", null ),
    49     'googlesitekit-metric-selection'                                  => array( "googlesitekit-metric-selection-d670cc66a68d7dfab58c.js", null ),
    50     'googlesitekit-modules'                                           => array( "googlesitekit-modules-42397debe377e019fa15.js", null ),
    51     'googlesitekit-modules-ads'                                       => array( "googlesitekit-modules-ads-6dfc70b5141bf4e9f9e2.js", null ),
    52     'googlesitekit-modules-adsense'                                   => array( "googlesitekit-modules-adsense-6198231c32545d0f5d1d.js", null ),
    53     'googlesitekit-modules-analytics-4'                               => array( "googlesitekit-modules-analytics-4-a49e7aa860fc3e5f586c.js", null ),
    54     'googlesitekit-modules-pagespeed-insights'                        => array( "googlesitekit-modules-pagespeed-insights-f51b9070a6c20c6c9e22.js", null ),
    55     'googlesitekit-modules-reader-revenue-manager'                    => array( "googlesitekit-modules-reader-revenue-manager-cedfce01c125ec659aca.js", null ),
    56     'googlesitekit-modules-search-console'                            => array( "googlesitekit-modules-search-console-49b1f41e04ad1418b7cb.js", null ),
    57     'googlesitekit-modules-sign-in-with-google'                       => array( "googlesitekit-modules-sign-in-with-google-73dd928c06fd73fed09d.js", null ),
    58     'googlesitekit-modules-tagmanager'                                => array( "googlesitekit-modules-tagmanager-35db19c6d36bab469a2b.js", null ),
    59     'googlesitekit-notifications'                                     => array( "googlesitekit-notifications-cc58dae44b405ee08538.js", null ),
     36    'googlesitekit-activation'                                        => array( "googlesitekit-activation-fb23218ee42894aade1a.js", null ),
     37    'googlesitekit-ad-blocking-recovery'                              => array( "googlesitekit-ad-blocking-recovery-16a88737554e8a9df698.js", null ),
     38    'googlesitekit-adminbar'                                          => array( "googlesitekit-adminbar-5fedb9466fbdbfc53402.js", null ),
     39    'googlesitekit-api'                                               => array( "googlesitekit-api-5c760348d491f1a2cb8d.js", null ),
     40    'googlesitekit-components'                                        => array( "googlesitekit-components-ee34c13b1d4ec46078f8.js", null ),
     41    'googlesitekit-data'                                              => array( "googlesitekit-data-60772d34bc6b72ca9b56.js", null ),
     42    'googlesitekit-datastore-forms'                                   => array( "googlesitekit-datastore-forms-3d7b950a67758c5ffdd3.js", null ),
     43    'googlesitekit-datastore-location'                                => array( "googlesitekit-datastore-location-fd230b5596c06760e62c.js", null ),
     44    'googlesitekit-datastore-site'                                    => array( "googlesitekit-datastore-site-a1c63e14c127e1809db4.js", null ),
     45    'googlesitekit-datastore-ui'                                      => array( "googlesitekit-datastore-ui-d27352e6d00f36d9e090.js", null ),
     46    'googlesitekit-datastore-user'                                    => array( "googlesitekit-datastore-user-347965424ad9fa0d4ce6.js", null ),
     47    'googlesitekit-entity-dashboard'                                  => array( "googlesitekit-entity-dashboard-7d5f6df732c4f75360a5.js", null ),
     48    'googlesitekit-main-dashboard'                                    => array( "googlesitekit-main-dashboard-776ea6393adec9c961bd.js", null ),
     49    'googlesitekit-metric-selection'                                  => array( "googlesitekit-metric-selection-61e71d5994b20ce34f67.js", null ),
     50    'googlesitekit-modules'                                           => array( "googlesitekit-modules-af1870f3059cb60eca67.js", null ),
     51    'googlesitekit-modules-ads'                                       => array( "googlesitekit-modules-ads-9f969f0ab0bd901c6901.js", null ),
     52    'googlesitekit-modules-adsense'                                   => array( "googlesitekit-modules-adsense-376af6a0a36693e308cd.js", null ),
     53    'googlesitekit-modules-analytics-4'                               => array( "googlesitekit-modules-analytics-4-6fafb356b46edcd112b9.js", null ),
     54    'googlesitekit-modules-pagespeed-insights'                        => array( "googlesitekit-modules-pagespeed-insights-2f4961a3aee77aea283b.js", null ),
     55    'googlesitekit-modules-reader-revenue-manager'                    => array( "googlesitekit-modules-reader-revenue-manager-ba49855d50ca89fc94b0.js", null ),
     56    'googlesitekit-modules-search-console'                            => array( "googlesitekit-modules-search-console-a4c68a77854ac3c5cc90.js", null ),
     57    'googlesitekit-modules-sign-in-with-google'                       => array( "googlesitekit-modules-sign-in-with-google-9f0b585a4eedc65fd195.js", null ),
     58    'googlesitekit-modules-tagmanager'                                => array( "googlesitekit-modules-tagmanager-7ab6384176e3e41f7bbf.js", null ),
     59    'googlesitekit-notifications'                                     => array( "googlesitekit-notifications-965a4dee05b070cf4b79.js", null ),
    6060    'googlesitekit-polyfills'                                         => array( "googlesitekit-polyfills-147c5aa43487b444ac6c.js", null ),
    61     'googlesitekit-settings'                                          => array( "googlesitekit-settings-82a069053610de3fd360.js", null ),
    62     'googlesitekit-splash'                                            => array( "googlesitekit-splash-e27cc3dc368bc5d035ac.js", null ),
    63     'googlesitekit-user-input'                                        => array( "googlesitekit-user-input-24b783e55d2a889ba924.js", null ),
    64     'googlesitekit-widgets'                                           => array( "googlesitekit-widgets-b04e348bfb69205aee30.js", null ),
    65     'googlesitekit-wp-dashboard'                                      => array( "googlesitekit-wp-dashboard-0ed4244208f40a8879a4.js", null ),
     61    'googlesitekit-settings'                                          => array( "googlesitekit-settings-3e5ba76730e6f56b2fab.js", null ),
     62    'googlesitekit-splash'                                            => array( "googlesitekit-splash-b458e422274b887fad88.js", null ),
     63    'googlesitekit-user-input'                                        => array( "googlesitekit-user-input-8a84cc50ad2ee9af88af.js", null ),
     64    'googlesitekit-widgets'                                           => array( "googlesitekit-widgets-00d9085ff2312d995f80.js", null ),
     65    'googlesitekit-wp-dashboard'                                      => array( "googlesitekit-wp-dashboard-29238e989c8865c2dabc.js", null ),
    6666);
  • google-site-kit/tags/1.158.0/google-site-kit.php

    r3327728 r3335509  
    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.157.0
     14 * Version:           1.158.0
    1515 * Requires at least: 5.2
    1616 * Requires PHP:      7.4
     
    2727
    2828// Define most essential constants.
    29 define( 'GOOGLESITEKIT_VERSION', '1.157.0' );
     29define( 'GOOGLESITEKIT_VERSION', '1.158.0' );
    3030define( 'GOOGLESITEKIT_PLUGIN_MAIN_FILE', __FILE__ );
    3131define( 'GOOGLESITEKIT_PHP_MINIMUM', '7.4.0' );
  • google-site-kit/tags/1.158.0/includes/Core/Assets/Assets.php

    r3288001 r3335509  
    10151015        }
    10161016
    1017         // Abort adding async/defer for scripts that have this script as a dependency.
     1017        // Abort adding async/defer for scripts that have this script as a dependency, unless it is an alias.
    10181018        foreach ( wp_scripts()->registered as $script ) {
    1019             if ( in_array( $handle, $script->deps, true ) ) {
     1019            if ( $script->src && in_array( $handle, $script->deps, true ) ) {
    10201020                return $tag;
    10211021            }
  • google-site-kit/tags/1.158.0/includes/Core/Authentication/Clients/OAuth_Client.php

    r3268141 r3335509  
    1919use Google\Site_Kit\Core\Authentication\Profile;
    2020use Google\Site_Kit\Core\Authentication\Token;
    21 use Google\Site_Kit\Core\Dashboard_Sharing\Activity_Metrics\Activity_Metrics;
    22 use Google\Site_Kit\Core\Dashboard_Sharing\Activity_Metrics\Active_Consumers;
    2321use Google\Site_Kit\Core\Permissions\Permissions;
    2422use Google\Site_Kit\Core\Storage\Options;
     
    5250     */
    5351    private $owner_id;
    54 
    55     /**
    56      * Activity_Metrics instance.
    57      *
    58      * @since 1.87.0
    59      * @var Activity_Metrics
    60      */
    61     private $activity_metrics;
    62 
    63     /**
    64      * Active_Consumers instance.
    65      *
    66      * @since 1.87.0
    67      * @var Active_Consumers
    68      */
    69     private $active_consumers;
    7052
    7153    /**
     
    11193        );
    11294
    113         $this->owner_id         = new Owner_ID( $this->options );
    114         $this->activity_metrics = new Activity_Metrics( $this->context, $this->user_options );
    115         $this->active_consumers = new Active_Consumers( $this->user_options );
    116         $this->transients       = $transients ?: new Transients( $this->context );
     95        $this->owner_id   = new Owner_ID( $this->options );
     96        $this->transients = $transients ?: new Transients( $this->context );
    11797    }
    11898
     
    134114        }
    135115
    136         $active_consumers = $this->activity_metrics->get_for_refresh_token();
    137 
    138116        try {
    139             $token_response = $this->get_client()->fetchAccessTokenWithRefreshToken( $token['refresh_token'], $active_consumers );
     117            $token_response = $this->get_client()->fetchAccessTokenWithRefreshToken( $token['refresh_token'] );
    140118        } catch ( \Exception $e ) {
    141119            $this->handle_fetch_token_exception( $e );
     
    148126        }
    149127
    150         $this->active_consumers->delete();
    151128        $this->set_token( $token_response );
    152129    }
     
    689666            : $this->context->admin_url( 'splash' );
    690667    }
    691 
    692     /**
    693      * Adds a user to the active consumers list.
    694      *
    695      * @since 1.87.0
    696      *
    697      * @param WP_User $user User object.
    698      */
    699     public function add_active_consumer( WP_User $user ) {
    700         $this->active_consumers->add( $user->ID, $user->roles );
    701     }
    702668}
  • google-site-kit/tags/1.158.0/includes/Core/Dashboard_Sharing/Dashboard_Sharing.php

    r3118692 r3335509  
    1111namespace Google\Site_Kit\Core\Dashboard_Sharing;
    1212
    13 use Google\Site_Kit\Context;
    14 use Google\Site_Kit\Core\Storage\User_Options;
    15 use Google\Site_Kit\Core\Dashboard_Sharing\Activity_Metrics\Activity_Metrics;
    16 
    1713/**
    1814 * Class for handling Dashboard Sharing.
     
    2319 */
    2420class Dashboard_Sharing {
    25 
    26     /**
    27      * Plugin context.
    28      *
    29      * @since 1.82.0
    30      * @var Context
    31      */
    32     private $context;
    33 
    34     /**
    35      * User_Options object.
    36      *
    37      * @since 1.82.0
    38      *
    39      * @var User_Options
    40      */
    41     private $user_options = null;
    42 
    43     /**
    44      * Activity_Metrics instance.
    45      *
    46      * @since 1.82.0
    47      * @var Activity_Metrics
    48      */
    49     protected $activity_metrics;
    50 
    5121    /**
    5222     * View_Only_Pointer instance.
     
    6131     *
    6232     * @since 1.82.0
    63      *
    64      * @param Context      $context      Plugin context.
    65      * @param User_Options $user_options Optional. User Option API instance. Default is a new instance.
     33     * @since 1.158.0 Remove $user_options and $context params.
    6634     */
    67     public function __construct( Context $context, User_Options $user_options = null ) {
    68         $this->context           = $context;
    69         $this->user_options      = $user_options ?: new User_Options( $this->context );
    70         $this->activity_metrics  = new Activity_Metrics( $this->context, $this->user_options );
     35    public function __construct() {
    7136        $this->view_only_pointer = new View_Only_Pointer();
    7237    }
     
    7843     */
    7944    public function register() {
    80         $this->activity_metrics->register();
    8145        $this->view_only_pointer->register();
    8246    }
  • google-site-kit/tags/1.158.0/includes/Core/Modules/Module.php

    r3118692 r3335509  
    358358
    359359                $current_user = wp_get_current_user();
    360                 // Adds the current user to the active consumers list.
    361                 $oauth_client->add_active_consumer( $current_user );
    362360            }
    363361
  • google-site-kit/tags/1.158.0/includes/Core/Tags/GTag.php

    r3327728 r3335509  
    1313use Google\Site_Kit\Core\Storage\Options;
    1414use Google\Site_Kit\Core\Tags\Google_Tag_Gateway\Google_Tag_Gateway_Settings;
     15use Google\Site_Kit\Core\Util\BC_Functions;
    1516use Google\Site_Kit\Core\Util\Feature_Flags;
    1617use Google\Site_Kit\Core\Util\Method_Proxy_Trait;
     
    6364     *
    6465     * @since 1.124.0
    65      * @access public
    66      *
    67      * @return void
    6866     */
    6967    public function register() {
    70         add_action( 'wp_enqueue_scripts', $this->get_method_proxy( 'enqueue_gtag_script' ), 20 );
     68        add_action( 'wp_enqueue_scripts', fn() => $this->enqueue_gtag_script(), 20 );
     69        // The wp_enqueue_scripts action is hooked on wp_head @ 1;
     70        // The hat script needs to be hooked in after for tag state to be available.
     71        // This also avoids printing from within the "enqueue" action.
     72        add_action( 'wp_head', fn() => $this->maybe_print_hat_script(), 2 );
    7173
    7274        add_filter(
     
    8587
    8688    /**
     89     * Prints the first party tag hat script if GTG is enabled.
     90     */
     91    private function maybe_print_hat_script() {
     92        if ( ! $this->is_google_tag_gateway_active() ) {
     93            return;
     94        }
     95
     96        $tag_ids = wp_list_pluck( $this->tags, 'tag_id' );
     97
     98        if ( ! $tag_ids ) {
     99            return;
     100        }
     101
     102        $js = <<<'JS'
     103(function(w,i,g){w[g]=w[g]||[];if(typeof w[g].push=='function')w[g].push.apply(w[g],i)})
     104(window,%s,'google_tags_first_party');
     105JS;
     106
     107        printf( "\n<!-- %s -->\n", esc_html__( 'Google tag gateway for advertisers snippet added by Site Kit', 'google-site-kit' ) );
     108        BC_Functions::wp_print_inline_script_tag(
     109            sprintf( $js, wp_json_encode( $tag_ids ) )
     110        );
     111    }
     112
     113    /**
    87114     * Method to add a gtag ID and config for output rendering.
    88115     *
     
    139166        }
    140167
    141         $gtag_src = $this->get_gtag_src();
    142 
    143         // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion
    144         wp_enqueue_script( self::HANDLE, $gtag_src, false, null, false );
     168        $gtag_src  = $this->get_gtag_src();
     169        $gtag_deps = $this->get_gtag_deps();
     170
     171        wp_register_script( self::HANDLE, $gtag_src, $gtag_deps, null, false ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion
    145172        wp_script_add_data( self::HANDLE, 'script_execution', 'async' );
     173        wp_enqueue_script( self::HANDLE );
    146174
    147175        // Note that `gtag()` may already be defined via the `Consent_Mode` output, but this is safe to call multiple times.
     
    155183        wp_add_inline_script( self::HANDLE, 'gtag("set", "developer_id.dZTNiMT", true);' ); // Site Kit developer ID.
    156184
     185        if ( $this->is_google_tag_gateway_active() ) {
     186            wp_add_inline_script( self::HANDLE, 'gtag("set", "developer_id.dZmZmYj", true);' );
     187        }
     188
    157189        foreach ( $this->tags as $tag ) {
    158190            wp_add_inline_script( self::HANDLE, $this->get_gtag_call_for_tag( $tag ) );
    159191        }
    160192
    161         $filter_google_gtagjs = function ( $tag, $handle ) {
    162             if ( self::HANDLE !== $handle ) {
     193        $first_handle         = $gtag_deps[0] ?? self::HANDLE;
     194        $filter_google_gtagjs = function ( $tag, $handle ) use ( $first_handle ) {
     195            if ( $first_handle !== $handle ) {
    163196                return $tag;
    164197            }
    165198
    166199            $snippet_comment_begin = sprintf( "\n<!-- %s -->\n", esc_html__( 'Google tag (gtag.js) snippet added by Site Kit', 'google-site-kit' ) );
    167             $snippet_comment_end   = sprintf( "\n<!-- %s -->\n", esc_html__( 'End Google tag (gtag.js) snippet added by Site Kit', 'google-site-kit' ) );
    168 
    169             return $snippet_comment_begin . $tag . $snippet_comment_end;
     200
     201            return $snippet_comment_begin . $tag;
    170202        };
    171203
     
    224256        }
    225257
     258        // If Google tag gateway is active, each tag will get its own script as a dependency.
     259        if ( $this->is_google_tag_gateway_active() ) {
     260            return false;
     261        }
     262
    226263        // Load the GTag scripts using the first tag ID - it doesn't matter which is used,
    227264        // all registered tags will be set up with a config command regardless
     
    229266        $tag_id = rawurlencode( $this->tags[0]['tag_id'] );
    230267
    231         // If Google tag gateway is active, use the proxy URL to load the GTag script.
    232         if ( Feature_Flags::enabled( 'googleTagGateway' ) && $this->is_google_tag_gateway_active() ) {
    233             return add_query_arg(
    234                 array(
    235                     'id' => $tag_id,
    236                     's'  => '/gtag/js',
    237                 ),
    238                 plugins_url( 'gtg/measurement.php', GOOGLESITEKIT_PLUGIN_MAIN_FILE )
     268        return 'https://www.googletagmanager.com/gtag/js?id=' . $tag_id;
     269    }
     270
     271    /**
     272     * Gets the list of tag script handles that GTag should load first.
     273     *
     274     * @return array
     275     */
     276    private function get_gtag_deps() {
     277        if ( ! $this->is_google_tag_gateway_active() ) {
     278            return array();
     279        }
     280
     281        $deps    = array();
     282        $tag_ids = wp_list_pluck( $this->tags, 'tag_id' );
     283
     284        foreach ( $tag_ids as $tag_id ) {
     285            $handle = $this->get_handle_for_tag( $tag_id );
     286            $deps[] = $handle;
     287
     288            wp_register_script(
     289                $handle,
     290                esc_url( $this->get_gtg_src( $tag_id ) ),
     291                array(),
     292                null, // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion
     293                false
    239294            );
    240         }
    241 
    242         return 'https://www.googletagmanager.com/gtag/js?id=' . $tag_id;
     295
     296            wp_script_add_data( $handle, 'script_execution', 'async' );
     297        }
     298
     299        return $deps;
     300    }
     301
     302    /**
     303     * Gets the script tag src for a given tag using GTG.
     304     *
     305     * @param string $tag_id Tag ID.
     306     * @return string
     307     */
     308    protected function get_gtg_src( $tag_id ) {
     309        return add_query_arg(
     310            array(
     311                'id' => $tag_id,
     312                's'  => '/gtag/js',
     313            ),
     314            plugins_url( 'gtg/measurement.php', GOOGLESITEKIT_PLUGIN_MAIN_FILE )
     315        );
    243316    }
    244317
     
    251324     */
    252325    protected function is_google_tag_gateway_active() {
     326        if ( ! Feature_Flags::enabled( 'googleTagGateway' ) ) {
     327            return false;
     328        }
     329
    253330        $google_tag_gateway_settings = new Google_Tag_Gateway_Settings( $this->options );
    254331
     
    265342        return true;
    266343    }
     344
     345    /**
     346     * Gets the script tag handle for a given tag ID.
     347     *
     348     * @since 1.158.0
     349     *
     350     * @param string $tag_id Tag ID.
     351     * @return string
     352     */
     353    public static function get_handle_for_tag( $tag_id ): string {
     354        return self::HANDLE . "-$tag_id";
     355    }
    267356}
  • google-site-kit/tags/1.158.0/includes/Modules/Ads.php

    r3327728 r3335509  
    4949use Google\Site_Kit\Modules\Ads\AMP_Tag;
    5050use Google\Site_Kit\Core\Conversion_Tracking\Conversion_Tracking;
     51use Google\Site_Kit\Core\Modules\Module_With_Inline_Data;
     52use Google\Site_Kit\Core\Modules\Module_With_Inline_Data_Trait;
    5153
    5254/**
     
    5759 * @ignore
    5860 */
    59 final class Ads extends Module implements Module_With_Assets, Module_With_Debug_Fields, Module_With_Scopes, Module_With_Settings, Module_With_Tag, Module_With_Deactivation, Module_With_Persistent_Registration {
     61final class Ads extends Module implements Module_With_Inline_Data, Module_With_Assets, Module_With_Debug_Fields, Module_With_Scopes, Module_With_Settings, Module_With_Tag, Module_With_Deactivation, Module_With_Persistent_Registration {
    6062    use Module_With_Assets_Trait;
    6163    use Module_With_Scopes_Trait;
     
    6365    use Module_With_Tag_Trait;
    6466    use Method_Proxy_Trait;
     67    use Module_With_Inline_Data_Trait;
    6568
    6669    /**
     
    104107    public function register() {
    105108        $this->register_scopes_hook();
     109        $this->register_inline_data();
    106110        // Ads tag placement logic.
    107111        add_action( 'template_redirect', array( $this, 'register_tag' ) );
    108         add_filter( 'googlesitekit_inline_modules_data', $this->get_method_proxy( 'inline_modules_data' ) );
    109112        add_filter(
    110113            'googlesitekit_ads_measurement_connection_checks',
     
    257260    }
    258261
    259     /**
    260      * Populates module data to pass to JS via _googlesitekitModulesData.
    261      *
    262      * @since 1.126.0
    263      *
    264      * @param array $modules_data Inline modules data.
    265      * @return array Inline modules data.
    266      */
    267     private function inline_modules_data( $modules_data ) {
    268         if ( ! Feature_Flags::enabled( 'adsPax' ) ) {
    269             return $modules_data;
    270         }
    271 
    272         if ( empty( $modules_data['ads'] ) ) {
    273             $modules_data['ads'] = array();
    274         }
    275 
    276         $modules_data['ads']['supportedConversionEvents'] = $this->get_supported_conversion_events();
    277 
    278         return $modules_data;
    279     }
    280262
    281263    /**
     
    463445        return array_unique( $events );
    464446    }
     447
     448    /**
     449     * Gets required inline data for the module.
     450     *
     451     * @since 1.158.0
     452     *
     453     * @return array An array of the module's inline data.
     454     */
     455    public function get_inline_data() {
     456        if ( ! Feature_Flags::enabled( 'adsPax' ) ) {
     457            return array();
     458        }
     459
     460        return array(
     461            self::MODULE_SLUG => array(
     462                'supportedConversionEvents' => $this->get_supported_conversion_events(),
     463            ),
     464        );
     465    }
    465466}
  • google-site-kit/tags/1.158.0/includes/Modules/Ads/Web_Tag.php

    r3221899 r3335509  
    4141            20
    4242        );
     43        add_filter( 'script_loader_tag', $this->get_method_proxy( 'filter_tag_output' ), 10, 2 );
    4344
    4445        $this->do_init_tag_action();
     
    6364    protected function setup_gtag( $gtag ) {
    6465        $gtag->add_tag( $this->tag_id );
     66    }
    6567
    66         $filter_google_gtagjs = function ( $tag, $handle ) {
    67             if ( GTag::HANDLE !== $handle ) {
    68                 return $tag;
    69             }
    7068
    71             // Retain this comment for detection of Site Kit placed tag.
    72             $snippet_comment = sprintf( "\n<!-- %s -->\n", esc_html__( 'Google Ads snippet added by Site Kit', 'google-site-kit' ) );
     69    /**
     70     * Filters output of tag HTML.
     71     *
     72     * @param string $tag Tag HTML.
     73     * @param string $handle WP script handle of given tag.
     74     * @return string
     75     */
     76    protected function filter_tag_output( $tag, $handle ) {
     77        // The tag will either have its own handle or use the common GTag handle, not both.
     78        if ( GTag::get_handle_for_tag( $this->tag_id ) !== $handle && GTag::HANDLE !== $handle ) {
     79            return $tag;
     80        }
    7381
    74             return $snippet_comment . $tag;
    75         };
     82        // Retain this comment for detection of Site Kit placed tag.
     83        $snippet_comment = sprintf( "<!-- %s -->\n", esc_html__( 'Google Ads snippet added by Site Kit', 'google-site-kit' ) );
    7684
    77         add_filter( 'script_loader_tag', $filter_google_gtagjs, 10, 2 );
     85        return $snippet_comment . $tag;
    7886    }
    7987}
  • google-site-kit/tags/1.158.0/includes/Modules/Analytics_4.php

    r3327728 r3335509  
    3131use Google\Site_Kit\Core\Modules\Module_With_Data_Available_State;
    3232use Google\Site_Kit\Core\Modules\Module_With_Data_Available_State_Trait;
     33use Google\Site_Kit\Core\Modules\Module_With_Inline_Data;
     34use Google\Site_Kit\Core\Modules\Module_With_Inline_Data_Trait;
    3335use Google\Site_Kit\Core\Modules\Module_With_Scopes;
    3436use Google\Site_Kit\Core\Modules\Module_With_Scopes_Trait;
     
    110112 * @ignore
    111113 */
    112 final class Analytics_4 extends Module implements Module_With_Scopes, Module_With_Settings, Module_With_Debug_Fields, Module_With_Owner, Module_With_Assets, Module_With_Service_Entity, Module_With_Activation, Module_With_Deactivation, Module_With_Data_Available_State, Module_With_Tag {
     114final class Analytics_4 extends Module implements Module_With_Inline_Data, Module_With_Scopes, Module_With_Settings, Module_With_Debug_Fields, Module_With_Owner, Module_With_Assets, Module_With_Service_Entity, Module_With_Activation, Module_With_Deactivation, Module_With_Data_Available_State, Module_With_Tag {
    113115
    114116    use Method_Proxy_Trait;
     
    119121    use Module_With_Data_Available_State_Trait;
    120122    use Module_With_Tag_Trait;
     123    use Module_With_Inline_Data_Trait;
    121124
    122125    const PROVISION_ACCOUNT_TICKET_ID = 'googlesitekit_analytics_provision_account_ticket_id';
     
    218221        $this->register_scopes_hook();
    219222
     223        $this->register_inline_data();
     224
    220225        $synchronize_property = new Synchronize_Property(
    221226            $this,
     
    360365            2
    361366        );
    362 
    363         add_filter( 'googlesitekit_inline_modules_data', $this->get_method_proxy( 'inline_custom_dimensions_data' ), 10 );
    364 
    365         add_filter( 'googlesitekit_inline_modules_data', $this->get_method_proxy( 'inline_tag_id_mismatch' ), 15 );
    366 
    367         add_filter( 'googlesitekit_inline_modules_data', $this->get_method_proxy( 'inline_resource_availability_dates_data' ) );
    368 
    369         add_filter( 'googlesitekit_inline_modules_data', $this->get_method_proxy( 'inline_conversion_reporting_events_detection' ), 15 );
    370367
    371368        add_filter(
     
    24152412     *
    24162413     * @since 1.113.0
    2417      *
    2418      * @param array $modules_data Inline modules data.
     2414     * @since 1.158.0 Renamed method to `get_inline_custom_dimensions_data()`, and modified it to return a new array rather than populating a passed filter value.
     2415     *
    24192416     * @return array Inline modules data.
    24202417     */
    2421     private function inline_custom_dimensions_data( $modules_data ) {
     2418    private function get_inline_custom_dimensions_data() {
    24222419        if ( $this->is_connected() ) {
    2423             // Add the data under the `analytics-4` key to make it clear it's scoped to this module.
    2424             $modules_data['analytics-4'] = array(
     2420            return array(
    24252421                'customDimensionsDataAvailable' => $this->custom_dimensions_data_available->get_data_availability(),
    24262422            );
    24272423        }
    24282424
    2429         return $modules_data;
     2425        return array();
    24302426    }
    24312427
     
    24342430     *
    24352431     * @since 1.130.0
    2436      *
    2437      * @param array $modules_data Inline modules data.
     2432     * @since 1.158.0 Renamed method to `get_inline_tag_id_mismatch()`, and modified it to return a new array rather than populating a passed filter value.
     2433     *
    24382434     * @return array Inline modules data.
    24392435     */
    2440     protected function inline_tag_id_mismatch( $modules_data ) {
     2436    private function get_inline_tag_id_mismatch() {
    24412437        if ( $this->is_connected() ) {
    24422438            $tag_id_mismatch = $this->transients->get( 'googlesitekit_inline_tag_id_mismatch' );
    24432439
    2444             // Add the data under the `analytics-4` key to make it clear it's scoped to this module.
    2445             // No need to check if `analytics-4` key is present, as this hook is added with higher
    2446             // priority than inline_custom_dimensions_data where this key is set.
    2447             $modules_data['analytics-4']['tagIDMismatch'] = $tag_id_mismatch;
    2448         }
    2449 
    2450         return $modules_data;
     2440            return array(
     2441                'tagIDMismatch' => $tag_id_mismatch,
     2442            );
     2443        }
     2444
     2445        return array();
    24512446    }
    24522447
     
    24552450     *
    24562451     * @since 1.127.0
    2457      *
    2458      * @param array $modules_data Inline modules data.
     2452     * @since 1.158.0 Renamed method to `get_inline_resource_availability_dates_data()`, and modified it to return a new array rather than populating a passed filter value.
     2453     *
    24592454     * @return array Inline modules data.
    24602455     */
    2461     private function inline_resource_availability_dates_data( $modules_data ) {
     2456    private function get_inline_resource_availability_dates_data() {
    24622457        if ( $this->is_connected() ) {
    2463             // Add the data under the `analytics-4` key to make it clear it's scoped to this module.
    2464             // If `analytics-4` key already exists, merge the data.
    2465             $modules_data['analytics-4'] = array_merge(
    2466                 $modules_data['analytics-4'] ?? array(),
    2467                 array(
    2468                     'resourceAvailabilityDates' => $this->resource_data_availability_date->get_all_resource_dates(),
    2469                 )
     2458            return array(
     2459                'resourceAvailabilityDates' => $this->resource_data_availability_date->get_all_resource_dates(),
    24702460            );
    24712461        }
    24722462
    2473         return $modules_data;
     2463        return array();
    24742464    }
    24752465
     
    26952685     *
    26962686     * @since 1.139.0
    2697      *
    2698      * @param array $modules_data Inline modules data.
     2687     * @since 1.158.0 Renamed method to `get_inline_conversion_reporting_events_detection()`, and modified it to return a new array rather than populating a passed filter value.
     2688     *
    26992689     * @return array Inline modules data.
    27002690     */
    2701     public function inline_conversion_reporting_events_detection( $modules_data ) {
     2691    private function get_inline_conversion_reporting_events_detection() {
    27022692        if ( ! $this->is_connected() ) {
    2703             return $modules_data;
     2693            return array();
    27042694        }
    27052695
     
    27082698        $new_events_badge = $this->transients->get( Conversion_Reporting_New_Badge_Events_Sync::NEW_EVENTS_BADGE_TRANSIENT );
    27092699
    2710         $modules_data['analytics-4']['newEvents']      = is_array( $detected_events ) ? $detected_events : array();
    2711         $modules_data['analytics-4']['lostEvents']     = is_array( $lost_events ) ? $lost_events : array();
    2712         $modules_data['analytics-4']['newBadgeEvents'] = is_array( $new_events_badge ) ? $new_events_badge['events'] : array();
    2713 
    2714         return $modules_data;
     2700        return array(
     2701            'newEvents'      => is_array( $detected_events ) ? $detected_events : array(),
     2702            'lostEvents'     => is_array( $lost_events ) ? $lost_events : array(),
     2703            'newBadgeEvents' => is_array( $new_events_badge ) ? $new_events_badge['events'] : array(),
     2704        );
     2705    }
     2706
     2707    /**
     2708     * Gets required inline data for the module.
     2709     *
     2710     * @since 1.158.0
     2711     *
     2712     * @return array An array of the module's inline data.
     2713     */
     2714    public function get_inline_data() {
     2715        $inline_data = array_merge(
     2716            $this->get_inline_custom_dimensions_data(),
     2717            $this->get_inline_resource_availability_dates_data(),
     2718            $this->get_inline_tag_id_mismatch(),
     2719            $this->get_inline_conversion_reporting_events_detection()
     2720        );
     2721
     2722        if ( empty( $inline_data ) ) {
     2723            return array();
     2724        }
     2725
     2726        return array(
     2727            self::MODULE_SLUG => $inline_data,
     2728        );
    27152729    }
    27162730}
  • google-site-kit/tags/1.158.0/includes/Modules/Analytics_4/Web_Tag.php

    r3118692 r3335509  
    1313use Google\Site_Kit\Core\Modules\Tags\Module_Web_Tag;
    1414use Google\Site_Kit\Core\Tags\GTag;
    15 use Google\Site_Kit\Core\Tags\Tag_With_DNS_Prefetch_Trait;
    1615use Google\Site_Kit\Core\Tags\Tag_With_Linker_Trait;
    1716use Google\Site_Kit\Core\Util\Method_Proxy_Trait;
     
    2827
    2928    use Method_Proxy_Trait;
    30     use Tag_With_DNS_Prefetch_Trait;
    3129    use Tag_With_Linker_Trait;
    3230
     
    102100    public function register() {
    103101        add_action( 'googlesitekit_setup_gtag', $this->get_method_proxy( 'setup_gtag' ) );
     102        add_filter( 'script_loader_tag', $this->get_method_proxy( 'filter_tag_output' ), 10, 2 );
    104103
    105104        $this->do_init_tag_action();
     
    151150            $gtag->add_tag( $this->ads_conversion_id );
    152151        }
    153 
    154         $filter_google_gtagjs = function ( $tag, $handle ) use ( $gtag ) {
    155             if ( GTag::HANDLE !== $handle ) {
    156                 return $tag;
    157             }
    158 
    159             // Retain this comment for detection of Site Kit placed tag.
    160             $snippet_comment = sprintf( "\n<!-- %s -->\n", esc_html__( 'Google Analytics snippet added by Site Kit', 'google-site-kit' ) );
    161 
    162             $block_on_consent_attrs = $this->get_tag_blocked_on_consent_attribute();
    163 
    164             if ( $block_on_consent_attrs ) {
    165                 $gtag_src = $gtag->get_gtag_src();
    166 
    167                 $tag = $this->add_legacy_block_on_consent_attributes( $tag, $gtag_src, $block_on_consent_attrs );
    168             }
    169 
    170             return $snippet_comment . $tag;
    171         };
    172 
    173         add_filter( 'script_loader_tag', $filter_google_gtagjs, 10, 2 );
     152    }
     153
     154    /**
     155     * Filters output of tag HTML.
     156     *
     157     * @param string $tag Tag HTML.
     158     * @param string $handle WP script handle of given tag.
     159     * @return string
     160     */
     161    protected function filter_tag_output( $tag, $handle ) {
     162        // The tag will either have its own handle or use the common GTag handle, not both.
     163        if ( GTag::get_handle_for_tag( $this->tag_id ) !== $handle && GTag::HANDLE !== $handle ) {
     164            return $tag;
     165        }
     166
     167        // Retain this comment for detection of Site Kit placed tag.
     168        $snippet_comment = sprintf( "<!-- %s -->\n", esc_html__( 'Google Analytics snippet added by Site Kit', 'google-site-kit' ) );
     169
     170        $block_on_consent_attrs = $this->get_tag_blocked_on_consent_attribute();
     171
     172        if ( $block_on_consent_attrs ) {
     173            $tag = $this->add_legacy_block_on_consent_attributes( $tag, $block_on_consent_attrs );
     174        }
     175
     176        return $snippet_comment . $tag;
    174177    }
    175178
     
    197200     *
    198201     * @since 1.122.0
    199      *
    200      * @param string $tag     The script tag.
    201      * @param string $gtag_src The gtag script source URL.
     202     * @since 1.158.0 Remove src from signature & replacement.
     203     *
     204     * @param string $tag                    The script tag.
    202205     * @param string $block_on_consent_attrs The attributes to add to the script tag to block it until user consent is granted.
     206     *
    203207     * @return string The script tag with the added attributes.
    204208     */
    205     protected function add_legacy_block_on_consent_attributes( $tag, $gtag_src, $block_on_consent_attrs ) {
     209    protected function add_legacy_block_on_consent_attributes( $tag, $block_on_consent_attrs ) {
    206210        return str_replace(
    207211            array(
    208                 "<script src='$gtag_src'", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
    209                     "<script src=\"$gtag_src\"", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
    210                     "<script type='text/javascript' src='$gtag_src'", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
    211                     "<script type=\"text/javascript\" src=\"$gtag_src\"", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
     212                '<script src=', // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
     213                    "<script type='text/javascript' src=", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
     214                    '<script type="text/javascript" src=', // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
    212215            ),
    213             array( // `type` attribute intentionally excluded in replacements.
    214                 "<script{$block_on_consent_attrs} src='$gtag_src'", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
    215                     "<script{$block_on_consent_attrs} src=\"$gtag_src\"", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
    216                     "<script{$block_on_consent_attrs} src='$gtag_src'", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
    217                     "<script{$block_on_consent_attrs} src=\"$gtag_src\"", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
    218             ),
     216            // `type` attribute intentionally excluded in replacements.
     217            "<script{$block_on_consent_attrs} src=", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
    219218            $tag
    220219        );
  • google-site-kit/tags/1.158.0/includes/Modules/Reader_Revenue_Manager.php

    r3313285 r3335509  
    538538                'blocks-reader-revenue-manager-block-editor-plugin',
    539539                array(
    540                     'src'           => $base_url . 'js/blocks/reader-revenue-manager/block-editor-plugin/index.js',
     540                    'src'           => $base_url . 'blocks/reader-revenue-manager/block-editor-plugin/index.js',
    541541                    'dependencies'  => array(
    542542                        'googlesitekit-components',
     
    554554                'blocks-reader-revenue-manager-block-editor-plugin-styles',
    555555                array(
    556                     'src'           => $base_url . 'js/blocks/reader-revenue-manager/block-editor-plugin/editor-styles.css',
     556                    'src'           => $base_url . 'blocks/reader-revenue-manager/block-editor-plugin/editor-styles.css',
    557557                    'dependencies'  => array(),
    558558                    'load_contexts' => array( Asset::CONTEXT_ADMIN_POST_EDITOR ),
     
    563563                'blocks-contribute-with-google',
    564564                array(
    565                     'src'           => $base_url . 'js/blocks/reader-revenue-manager/contribute-with-google/index.js',
     565                    'src'           => $base_url . 'blocks/reader-revenue-manager/contribute-with-google/index.js',
    566566                    'dependencies'  => array(
    567567                        'googlesitekit-components',
     
    579579                'blocks-subscribe-with-google',
    580580                array(
    581                     'src'           => $base_url . 'js/blocks/reader-revenue-manager/subscribe-with-google/index.js',
     581                    'src'           => $base_url . 'blocks/reader-revenue-manager/subscribe-with-google/index.js',
    582582                    'dependencies'  => array(
    583583                        'googlesitekit-components',
     
    596596                    'blocks-contribute-with-google-non-sitekit-user',
    597597                    array(
    598                         'src'           => $base_url . 'js/blocks/reader-revenue-manager/contribute-with-google/non-site-kit-user.js',
     598                        'src'           => $base_url . 'blocks/reader-revenue-manager/contribute-with-google/non-site-kit-user.js',
    599599                        'dependencies'  => array(
    600600                            'googlesitekit-i18n',
     
    608608                    'blocks-subscribe-with-google-non-sitekit-user',
    609609                    array(
    610                         'src'           => $base_url . 'js/blocks/reader-revenue-manager/subscribe-with-google/non-site-kit-user.js',
     610                        'src'           => $base_url . 'blocks/reader-revenue-manager/subscribe-with-google/non-site-kit-user.js',
    611611                        'dependencies'  => array( 'googlesitekit-i18n' ),
    612612                        'load_contexts' => array( Asset::CONTEXT_ADMIN_POST_EDITOR ),
     
    619619                'blocks-reader-revenue-manager-common-editor-styles',
    620620                array(
    621                     'src'           => $base_url . 'js/blocks/reader-revenue-manager/common/editor-styles.css',
     621                    'src'           => $base_url . 'blocks/reader-revenue-manager/common/editor-styles.css',
    622622                    'dependencies'  => array(),
    623623                    'load_contexts' => array( Asset::CONTEXT_ADMIN_BLOCK_EDITOR ),
  • google-site-kit/tags/1.158.0/includes/Modules/Reader_Revenue_Manager/Contribute_With_Google_Block.php

    r3253534 r3335509  
    7575            function () {
    7676                register_block_type(
    77                     dirname( GOOGLESITEKIT_PLUGIN_MAIN_FILE ) . '/dist/assets/js/blocks/reader-revenue-manager/contribute-with-google/block.json',
     77                    dirname( GOOGLESITEKIT_PLUGIN_MAIN_FILE ) . '/dist/assets/blocks/reader-revenue-manager/contribute-with-google/block.json',
    7878                    array(
    7979                        'render_callback' => array( $this, 'render_callback' ),
  • google-site-kit/tags/1.158.0/includes/Modules/Reader_Revenue_Manager/Subscribe_With_Google_Block.php

    r3253534 r3335509  
    7575            function () {
    7676                register_block_type(
    77                     dirname( GOOGLESITEKIT_PLUGIN_MAIN_FILE ) . '/dist/assets/js/blocks/reader-revenue-manager/subscribe-with-google/block.json',
     77                    dirname( GOOGLESITEKIT_PLUGIN_MAIN_FILE ) . '/dist/assets/blocks/reader-revenue-manager/subscribe-with-google/block.json',
    7878                    array(
    7979                        'render_callback' => array( $this, 'render_callback' ),
  • google-site-kit/tags/1.158.0/includes/Modules/Sign_In_With_Google.php

    r3305239 r3335509  
    2222use Google\Site_Kit\Core\Modules\Module_With_Deactivation;
    2323use Google\Site_Kit\Core\Modules\Module_With_Debug_Fields;
     24use Google\Site_Kit\Core\Modules\Module_With_Inline_Data;
     25use Google\Site_Kit\Core\Modules\Module_With_Inline_Data_Trait;
    2426use Google\Site_Kit\Core\Modules\Module_With_Settings;
    2527use Google\Site_Kit\Core\Modules\Module_With_Settings_Trait;
     
    5355 * @ignore
    5456 */
    55 final class Sign_In_With_Google extends Module implements Module_With_Assets, Module_With_Settings, Module_With_Deactivation, Module_With_Debug_Fields, Module_With_Tag {
     57final class Sign_In_With_Google extends Module implements Module_With_Inline_Data, Module_With_Assets, Module_With_Settings, Module_With_Deactivation, Module_With_Debug_Fields, Module_With_Tag {
    5658
    5759    use Method_Proxy_Trait;
     
    5961    use Module_With_Settings_Trait;
    6062    use Module_With_Tag_Trait;
     63    use Module_With_Inline_Data_Trait;
    6164
    6265    /**
     
    131134     */
    132135    public function register() {
     136        $this->register_inline_data();
     137
    133138        add_filter( 'wp_login_errors', array( $this, 'handle_login_errors' ) );
    134 
    135         add_filter( 'googlesitekit_inline_modules_data', $this->get_method_proxy( 'inline_module_data' ), 10 );
    136139
    137140        add_action(
     
    314317                'blocks-sign-in-with-google',
    315318                array(
    316                     'src'           => $this->context->url( 'dist/assets/js/blocks/sign-in-with-google/index.js' ),
     319                    'src'           => $this->context->url( 'dist/assets/blocks/sign-in-with-google/index.js' ),
    317320                    'dependencies'  => array(),
    318321                    'load_contexts' => array( Asset::CONTEXT_ADMIN_POST_EDITOR ),
     
    322325                'blocks-sign-in-with-google-editor-styles',
    323326                array(
    324                     'src'           => $this->context->url( 'dist/assets/js/blocks/sign-in-with-google/editor-styles.css' ),
     327                    'src'           => $this->context->url( 'dist/assets/blocks/sign-in-with-google/editor-styles.css' ),
    325328                    'dependencies'  => array(),
    326329                    'load_contexts' => array( Asset::CONTEXT_ADMIN_POST_EDITOR ),
     
    801804
    802805    /**
    803      * Exposes inline module data to JS via _googlesitekitModulesData.
     806     * Gets required inline data for the module.
    804807     *
    805808     * @since 1.142.0
    806809     * @since 1.146.0 Added isWooCommerceActive and isWooCommerceRegistrationEnabled to the inline data.
    807      *
    808      * @param array $modules_data Inline modules data.
    809      * @return array Inline modules data.
    810      */
    811     protected function inline_module_data( $modules_data ) {
     810     * @since 1.158.0 Renamed method to `get_inline_data()`, and modified it to return a new array rather than populating a passed filter value.
     811     *
     812     * @return array An array of the module's inline data.
     813     */
     814    public function get_inline_data() {
    812815        $inline_data = array();
    813816
    814817        $existing_client_id = $this->existing_client_id->get();
     818
    815819        if ( $existing_client_id ) {
    816820            $inline_data['existingClientID'] = $existing_client_id;
     
    823827        $inline_data['isWooCommerceRegistrationEnabled'] = $is_woocommerce_active && 'yes' === $woocommerce_registration_enabled;
    824828
    825         // Add the data under the `sign-in-with-google` key to make it clear it's scoped to this module.
    826         $modules_data['sign-in-with-google'] = $inline_data;
    827 
    828         return $modules_data;
     829        return array(
     830            self::MODULE_SLUG => $inline_data,
     831        );
    829832    }
    830833
  • google-site-kit/tags/1.158.0/includes/Modules/Sign_In_With_Google/Sign_In_With_Google_Block.php

    r3253534 r3335509  
    6464            function () {
    6565                register_block_type(
    66                     dirname( GOOGLESITEKIT_PLUGIN_MAIN_FILE ) . '/dist/assets/js/blocks/sign-in-with-google/block.json',
     66                    dirname( GOOGLESITEKIT_PLUGIN_MAIN_FILE ) . '/dist/assets/blocks/sign-in-with-google/block.json',
    6767                    array(
    6868                        'render_callback' => array( $this, 'render_callback' ),
  • google-site-kit/tags/1.158.0/includes/Plugin.php

    r3327728 r3335509  
    220220                ( new Core\Util\Migration_1_8_1( $this->context, $options, $user_options, $authentication ) )->register();
    221221                ( new Core\Util\Migration_1_123_0( $this->context, $options ) )->register();
     222                ( new Core\Util\Migration_1_129_0( $this->context, $options ) )->register();
    222223                ( new Core\Util\Migration_1_150_0( $this->context, $options ) )->register();
    223                 ( new Core\Dashboard_Sharing\Dashboard_Sharing( $this->context, $user_options ) )->register();
     224                ( new Core\Dashboard_Sharing\Dashboard_Sharing() )->register();
    224225                ( new Core\Key_Metrics\Key_Metrics( $this->context, $user_options, $options ) )->register();
    225226                ( new Core\Prompts\Prompts( $this->context, $user_options ) )->register();
  • google-site-kit/tags/1.158.0/includes/vendor/composer/autoload_classmap.php

    r3327728 r3335509  
    7979    'Google\\Site_Kit\\Core\\Conversion_Tracking\\Conversion_Tracking_Settings' => $baseDir . '/Core/Conversion_Tracking/Conversion_Tracking_Settings.php',
    8080    'Google\\Site_Kit\\Core\\Conversion_Tracking\\REST_Conversion_Tracking_Controller' => $baseDir . '/Core/Conversion_Tracking/REST_Conversion_Tracking_Controller.php',
    81     'Google\\Site_Kit\\Core\\Dashboard_Sharing\\Activity_Metrics\\Active_Consumers' => $baseDir . '/Core/Dashboard_Sharing/Activity_Metrics/Active_Consumers.php',
    82     'Google\\Site_Kit\\Core\\Dashboard_Sharing\\Activity_Metrics\\Activity_Metrics' => $baseDir . '/Core/Dashboard_Sharing/Activity_Metrics/Activity_Metrics.php',
    8381    'Google\\Site_Kit\\Core\\Dashboard_Sharing\\Dashboard_Sharing' => $baseDir . '/Core/Dashboard_Sharing/Dashboard_Sharing.php',
    8482    'Google\\Site_Kit\\Core\\Dashboard_Sharing\\View_Only_Pointer' => $baseDir . '/Core/Dashboard_Sharing/View_Only_Pointer.php',
     
    112110    'Google\\Site_Kit\\Core\\Modules\\Module_With_Deactivation' => $baseDir . '/Core/Modules/Module_With_Deactivation.php',
    113111    'Google\\Site_Kit\\Core\\Modules\\Module_With_Debug_Fields' => $baseDir . '/Core/Modules/Module_With_Debug_Fields.php',
     112    'Google\\Site_Kit\\Core\\Modules\\Module_With_Inline_Data' => $baseDir . '/Core/Modules/Module_With_Inline_Data.php',
     113    'Google\\Site_Kit\\Core\\Modules\\Module_With_Inline_Data_Trait' => $baseDir . '/Core/Modules/Module_With_Inline_Data_Trait.php',
    114114    'Google\\Site_Kit\\Core\\Modules\\Module_With_Owner' => $baseDir . '/Core/Modules/Module_With_Owner.php',
    115115    'Google\\Site_Kit\\Core\\Modules\\Module_With_Owner_Trait' => $baseDir . '/Core/Modules/Module_With_Owner_Trait.php',
     
    230230    'Google\\Site_Kit\\Core\\Util\\Migrate_Legacy_Keys' => $baseDir . '/Core/Util/Migrate_Legacy_Keys.php',
    231231    'Google\\Site_Kit\\Core\\Util\\Migration_1_123_0' => $baseDir . '/Core/Util/Migration_1_123_0.php',
     232    'Google\\Site_Kit\\Core\\Util\\Migration_1_129_0' => $baseDir . '/Core/Util/Migration_1_129_0.php',
    232233    'Google\\Site_Kit\\Core\\Util\\Migration_1_150_0' => $baseDir . '/Core/Util/Migration_1_150_0.php',
    233234    'Google\\Site_Kit\\Core\\Util\\Migration_1_3_0' => $baseDir . '/Core/Util/Migration_1_3_0.php',
  • google-site-kit/tags/1.158.0/readme.txt

    r3327728 r3335509  
    55Tested up to:      6.8
    66Requires PHP:      7.4
    7 Stable tag:        1.157.0
     7Stable tag:        1.158.0
    88License:           Apache License 2.0
    99License URI:       https://www.apache.org/licenses/LICENSE-2.0
     
    110110== Changelog ==
    111111
    112 = 1.157.0 =
     112= 1.158.0 =
     113
     114**Added**
     115
     116* Add unique descriptor to report requests. See [#7348](https://github.com/google/site-kit-wp/issues/7348).
    113117
    114118**Enhanced**
    115119
    116 * Show an in-progress spinner in the Google Tag Gateway Setup Banner's CTA button when it's clicked and setup is underway. See [#11027](https://github.com/google/site-kit-wp/issues/11027).
    117 * Update "First-party mode" references to "Google tag gateway for advertisers". See [#10951](https://github.com/google/site-kit-wp/issues/10951).
    118 * Add support for named date ranges when requesting Google Analytics reports. Props leonidasmi. See [#10738](https://github.com/google/site-kit-wp/issues/10738).
    119 * Apply the “Warning Banner” layout to redesign the `WebDataStreamNotAvailableNotification` banner. See [#10424](https://github.com/google/site-kit-wp/issues/10424).
    120 * Update the design of the Google Tag ID mismatch notification. See [#10423](https://github.com/google/site-kit-wp/issues/10423).
    121 * Apply the “Error Banner” layout to redesign the `AuthError` banner. See [#10422](https://github.com/google/site-kit-wp/issues/10422).
    122 * Update the error banner styling. See [#10421](https://github.com/google/site-kit-wp/issues/10421).
    123 * Apply the “Error Banner” layout to redesign the `UnsatisfiedScopesAlert` banner. See [#10420](https://github.com/google/site-kit-wp/issues/10420).
    124 * Update the module Recovery Alert banner design. See [#10384](https://github.com/google/site-kit-wp/issues/10384).
    125 * Update the "Confirm changes" module settings button to retain its label while saving. See [#10282](https://github.com/google/site-kit-wp/issues/10282).
    126 * Refactor `CoreSiteBannerNotifications` to use the new Notifications datastore. See [#9294](https://github.com/google/site-kit-wp/issues/9294).
    127 * Introduce consistent `Typography` component. See [#8581](https://github.com/google/site-kit-wp/issues/8581).
    128 * Update the Ad Blocking Recovery setup screen to better match the Figma design. Props mxbclang. See [#7300](https://github.com/google/site-kit-wp/issues/7300).
    129 * Add internal URL utility selectors. See [#7112](https://github.com/google/site-kit-wp/issues/7112).
     120* Update Google tag gateway for advertisers to work as expected in various tagging scenarios. See [#11122](https://github.com/google/site-kit-wp/issues/11122).
     121* Fix bug that could cause some WooCommerce events to have inaccurate prices. See [#10974](https://github.com/google/site-kit-wp/issues/10974).
     122* Update heading styles. See [#10905](https://github.com/google/site-kit-wp/issues/10905).
     123* Update the style for generic notification banners received from Site Kit service. See [#10425](https://github.com/google/site-kit-wp/issues/10425).
     124* Update the "successful setup" banner notification styles. See [#10388](https://github.com/google/site-kit-wp/issues/10388).
     125* Remove active consumers and activity metrics tracking functionality. See [#10189](https://github.com/google/site-kit-wp/issues/10189).
     126* Set a max-width for Site Kit content. See [#9599](https://github.com/google/site-kit-wp/issues/9599).
     127* Update button font weight to be consistent with the design system. See [#8856](https://github.com/google/site-kit-wp/issues/8856).
     128* Update AdSense settings view layout to move “Account Status” below “Publisher ID” and “Site Status” for better alignment with other modules. See [#7958](https://github.com/google/site-kit-wp/issues/7958).
    130129
    131130**Fixed**
    132131
    133 * Fix site health information for Google Tag Gateway enabled status. See [#11039](https://github.com/google/site-kit-wp/issues/11039).
    134 * Fix the console error that appeared when setting up visitor groups from Admin settngs. See [#10965](https://github.com/google/site-kit-wp/issues/10965).
    135 * Ensure spinner appears on Enhanced Measurement CTA button. See [#10960](https://github.com/google/site-kit-wp/issues/10960).
    136 * Update the design of the "Enable auto-updates" notification banner. See [#10956](https://github.com/google/site-kit-wp/issues/10956).
     132* Update Sign in with Google setup banner CTA to show spinner when in progress. See [#10962](https://github.com/google/site-kit-wp/issues/10962).
     133* Prevent flicker when Setup CTA is clicked and notification should not re-appear when you cancel setup. See [#10961](https://github.com/google/site-kit-wp/issues/10961).
     134* Fix issue when a React component has been updated after unmount. See [#10845](https://github.com/google/site-kit-wp/issues/10845).
     135* Fix error resolution behaviour in search funnel widget. See [#8434](https://github.com/google/site-kit-wp/issues/8434).
    137136
    138137[See changelog for all versions](https://raw.githubusercontent.com/google/site-kit-wp/main/changelog.txt).
  • google-site-kit/trunk/dist/config.php

    r3327728 r3335509  
    88
    99return array(
    10     'features' => array( 'adsPax','ecEuID','googleTagGateway','privacySandboxModule' ),
     10    'features' => array( 'adsPax','gtagUserData','googleTagGateway','privacySandboxModule' ),
    1111);
  • google-site-kit/trunk/dist/manifest.php

    r3327728 r3335509  
    1515    'googlesitekit-events-provider-optin-monster'                     => array( "googlesitekit-events-provider-optin-monster-820bf8319bf22417c912.js", null ),
    1616    'googlesitekit-events-provider-popup-maker'                       => array( "googlesitekit-events-provider-popup-maker-38c8b97d166ddb055277.js", null ),
    17     'googlesitekit-events-provider-woocommerce'                       => array( "googlesitekit-events-provider-woocommerce-4c846ed50de2fbdd0624.js", null ),
     17    'googlesitekit-events-provider-woocommerce'                       => array( "googlesitekit-events-provider-woocommerce-af479f5dec39653944f3.js", null ),
    1818    'googlesitekit-events-provider-wpforms'                           => array( "googlesitekit-events-provider-wpforms-3b23b71ea60c39fa1552.js", null ),
    1919    'analytics-advanced-tracking'                                     => array( "analytics-advanced-tracking-b1e2a9b411d0c0942c55.js", null ),
     
    2828    'sign-in-with-google/editor-styles'                               => array( "sign-in-with-google/editor-styles.js", null ),
    2929    'sign-in-with-google/index'                                       => array( "sign-in-with-google/index.js", null ),
    30     'googlesitekit-admin-css'                                         => array( "googlesitekit-admin-css-2272f8f368438dca6b5c.min.css", null ),
    31     'googlesitekit-adminbar-css'                                      => array( "googlesitekit-adminbar-css-e9bad4695e968f579f39.min.css", null ),
     30    'googlesitekit-admin-css'                                         => array( "googlesitekit-admin-css-5ba14eeed9dd5a211767.min.css", null ),
     31    'googlesitekit-adminbar-css'                                      => array( "googlesitekit-adminbar-css-09a51a307c5c0cf52174.min.css", null ),
    3232    'googlesitekit-authorize-application-css'                         => array( "googlesitekit-authorize-application-css-ce25e97404abc5a02921.min.css", null ),
    33     'googlesitekit-wp-dashboard-css'                                  => array( "googlesitekit-wp-dashboard-css-6d6c1fc11d7b56b589f9.min.css", null ),
    34     'googlesitekit-vendor'                                            => array( "googlesitekit-vendor-70729eab17f8db649c1b.js", null ),
     33    'googlesitekit-wp-dashboard-css'                                  => array( "googlesitekit-wp-dashboard-css-1ef21b3eb782445a6d52.min.css", null ),
     34    'googlesitekit-vendor'                                            => array( "googlesitekit-vendor-103670c413b29de4a6ca.js", null ),
    3535    'googlesitekit-runtime'                                           => array( "runtime-09b709733bacd5275e3c.js", null ),
    36     'googlesitekit-activation'                                        => array( "googlesitekit-activation-53842cf7768b2ed03989.js", null ),
    37     'googlesitekit-ad-blocking-recovery'                              => array( "googlesitekit-ad-blocking-recovery-4deb8c3ab72a618f67bf.js", null ),
    38     'googlesitekit-adminbar'                                          => array( "googlesitekit-adminbar-0a1f5323d9b3f5ce9b45.js", null ),
    39     'googlesitekit-api'                                               => array( "googlesitekit-api-92bf92ed00193e6b4a90.js", null ),
    40     'googlesitekit-components'                                        => array( "googlesitekit-components-d40f6814efd3b0106a9b.js", null ),
    41     'googlesitekit-data'                                              => array( "googlesitekit-data-97bc64da2a434bebd120.js", null ),
    42     'googlesitekit-datastore-forms'                                   => array( "googlesitekit-datastore-forms-bd246d82cae9f2f4ea5d.js", null ),
    43     'googlesitekit-datastore-location'                                => array( "googlesitekit-datastore-location-ffd7ded2110817eee969.js", null ),
    44     'googlesitekit-datastore-site'                                    => array( "googlesitekit-datastore-site-1f3dbc0c381be6096c8b.js", null ),
    45     'googlesitekit-datastore-ui'                                      => array( "googlesitekit-datastore-ui-3f0eac02cb0cec9473c1.js", null ),
    46     'googlesitekit-datastore-user'                                    => array( "googlesitekit-datastore-user-bf2bcd783d1545e330c3.js", null ),
    47     'googlesitekit-entity-dashboard'                                  => array( "googlesitekit-entity-dashboard-e05a3ae6f7ff10f70235.js", null ),
    48     'googlesitekit-main-dashboard'                                    => array( "googlesitekit-main-dashboard-7949d6a93c1996c46251.js", null ),
    49     'googlesitekit-metric-selection'                                  => array( "googlesitekit-metric-selection-d670cc66a68d7dfab58c.js", null ),
    50     'googlesitekit-modules'                                           => array( "googlesitekit-modules-42397debe377e019fa15.js", null ),
    51     'googlesitekit-modules-ads'                                       => array( "googlesitekit-modules-ads-6dfc70b5141bf4e9f9e2.js", null ),
    52     'googlesitekit-modules-adsense'                                   => array( "googlesitekit-modules-adsense-6198231c32545d0f5d1d.js", null ),
    53     'googlesitekit-modules-analytics-4'                               => array( "googlesitekit-modules-analytics-4-a49e7aa860fc3e5f586c.js", null ),
    54     'googlesitekit-modules-pagespeed-insights'                        => array( "googlesitekit-modules-pagespeed-insights-f51b9070a6c20c6c9e22.js", null ),
    55     'googlesitekit-modules-reader-revenue-manager'                    => array( "googlesitekit-modules-reader-revenue-manager-cedfce01c125ec659aca.js", null ),
    56     'googlesitekit-modules-search-console'                            => array( "googlesitekit-modules-search-console-49b1f41e04ad1418b7cb.js", null ),
    57     'googlesitekit-modules-sign-in-with-google'                       => array( "googlesitekit-modules-sign-in-with-google-73dd928c06fd73fed09d.js", null ),
    58     'googlesitekit-modules-tagmanager'                                => array( "googlesitekit-modules-tagmanager-35db19c6d36bab469a2b.js", null ),
    59     'googlesitekit-notifications'                                     => array( "googlesitekit-notifications-cc58dae44b405ee08538.js", null ),
     36    'googlesitekit-activation'                                        => array( "googlesitekit-activation-fb23218ee42894aade1a.js", null ),
     37    'googlesitekit-ad-blocking-recovery'                              => array( "googlesitekit-ad-blocking-recovery-16a88737554e8a9df698.js", null ),
     38    'googlesitekit-adminbar'                                          => array( "googlesitekit-adminbar-5fedb9466fbdbfc53402.js", null ),
     39    'googlesitekit-api'                                               => array( "googlesitekit-api-5c760348d491f1a2cb8d.js", null ),
     40    'googlesitekit-components'                                        => array( "googlesitekit-components-ee34c13b1d4ec46078f8.js", null ),
     41    'googlesitekit-data'                                              => array( "googlesitekit-data-60772d34bc6b72ca9b56.js", null ),
     42    'googlesitekit-datastore-forms'                                   => array( "googlesitekit-datastore-forms-3d7b950a67758c5ffdd3.js", null ),
     43    'googlesitekit-datastore-location'                                => array( "googlesitekit-datastore-location-fd230b5596c06760e62c.js", null ),
     44    'googlesitekit-datastore-site'                                    => array( "googlesitekit-datastore-site-a1c63e14c127e1809db4.js", null ),
     45    'googlesitekit-datastore-ui'                                      => array( "googlesitekit-datastore-ui-d27352e6d00f36d9e090.js", null ),
     46    'googlesitekit-datastore-user'                                    => array( "googlesitekit-datastore-user-347965424ad9fa0d4ce6.js", null ),
     47    'googlesitekit-entity-dashboard'                                  => array( "googlesitekit-entity-dashboard-7d5f6df732c4f75360a5.js", null ),
     48    'googlesitekit-main-dashboard'                                    => array( "googlesitekit-main-dashboard-776ea6393adec9c961bd.js", null ),
     49    'googlesitekit-metric-selection'                                  => array( "googlesitekit-metric-selection-61e71d5994b20ce34f67.js", null ),
     50    'googlesitekit-modules'                                           => array( "googlesitekit-modules-af1870f3059cb60eca67.js", null ),
     51    'googlesitekit-modules-ads'                                       => array( "googlesitekit-modules-ads-9f969f0ab0bd901c6901.js", null ),
     52    'googlesitekit-modules-adsense'                                   => array( "googlesitekit-modules-adsense-376af6a0a36693e308cd.js", null ),
     53    'googlesitekit-modules-analytics-4'                               => array( "googlesitekit-modules-analytics-4-6fafb356b46edcd112b9.js", null ),
     54    'googlesitekit-modules-pagespeed-insights'                        => array( "googlesitekit-modules-pagespeed-insights-2f4961a3aee77aea283b.js", null ),
     55    'googlesitekit-modules-reader-revenue-manager'                    => array( "googlesitekit-modules-reader-revenue-manager-ba49855d50ca89fc94b0.js", null ),
     56    'googlesitekit-modules-search-console'                            => array( "googlesitekit-modules-search-console-a4c68a77854ac3c5cc90.js", null ),
     57    'googlesitekit-modules-sign-in-with-google'                       => array( "googlesitekit-modules-sign-in-with-google-9f0b585a4eedc65fd195.js", null ),
     58    'googlesitekit-modules-tagmanager'                                => array( "googlesitekit-modules-tagmanager-7ab6384176e3e41f7bbf.js", null ),
     59    'googlesitekit-notifications'                                     => array( "googlesitekit-notifications-965a4dee05b070cf4b79.js", null ),
    6060    'googlesitekit-polyfills'                                         => array( "googlesitekit-polyfills-147c5aa43487b444ac6c.js", null ),
    61     'googlesitekit-settings'                                          => array( "googlesitekit-settings-82a069053610de3fd360.js", null ),
    62     'googlesitekit-splash'                                            => array( "googlesitekit-splash-e27cc3dc368bc5d035ac.js", null ),
    63     'googlesitekit-user-input'                                        => array( "googlesitekit-user-input-24b783e55d2a889ba924.js", null ),
    64     'googlesitekit-widgets'                                           => array( "googlesitekit-widgets-b04e348bfb69205aee30.js", null ),
    65     'googlesitekit-wp-dashboard'                                      => array( "googlesitekit-wp-dashboard-0ed4244208f40a8879a4.js", null ),
     61    'googlesitekit-settings'                                          => array( "googlesitekit-settings-3e5ba76730e6f56b2fab.js", null ),
     62    'googlesitekit-splash'                                            => array( "googlesitekit-splash-b458e422274b887fad88.js", null ),
     63    'googlesitekit-user-input'                                        => array( "googlesitekit-user-input-8a84cc50ad2ee9af88af.js", null ),
     64    'googlesitekit-widgets'                                           => array( "googlesitekit-widgets-00d9085ff2312d995f80.js", null ),
     65    'googlesitekit-wp-dashboard'                                      => array( "googlesitekit-wp-dashboard-29238e989c8865c2dabc.js", null ),
    6666);
  • google-site-kit/trunk/google-site-kit.php

    r3327728 r3335509  
    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.157.0
     14 * Version:           1.158.0
    1515 * Requires at least: 5.2
    1616 * Requires PHP:      7.4
     
    2727
    2828// Define most essential constants.
    29 define( 'GOOGLESITEKIT_VERSION', '1.157.0' );
     29define( 'GOOGLESITEKIT_VERSION', '1.158.0' );
    3030define( 'GOOGLESITEKIT_PLUGIN_MAIN_FILE', __FILE__ );
    3131define( 'GOOGLESITEKIT_PHP_MINIMUM', '7.4.0' );
  • google-site-kit/trunk/includes/Core/Assets/Assets.php

    r3288001 r3335509  
    10151015        }
    10161016
    1017         // Abort adding async/defer for scripts that have this script as a dependency.
     1017        // Abort adding async/defer for scripts that have this script as a dependency, unless it is an alias.
    10181018        foreach ( wp_scripts()->registered as $script ) {
    1019             if ( in_array( $handle, $script->deps, true ) ) {
     1019            if ( $script->src && in_array( $handle, $script->deps, true ) ) {
    10201020                return $tag;
    10211021            }
  • google-site-kit/trunk/includes/Core/Authentication/Clients/OAuth_Client.php

    r3268141 r3335509  
    1919use Google\Site_Kit\Core\Authentication\Profile;
    2020use Google\Site_Kit\Core\Authentication\Token;
    21 use Google\Site_Kit\Core\Dashboard_Sharing\Activity_Metrics\Activity_Metrics;
    22 use Google\Site_Kit\Core\Dashboard_Sharing\Activity_Metrics\Active_Consumers;
    2321use Google\Site_Kit\Core\Permissions\Permissions;
    2422use Google\Site_Kit\Core\Storage\Options;
     
    5250     */
    5351    private $owner_id;
    54 
    55     /**
    56      * Activity_Metrics instance.
    57      *
    58      * @since 1.87.0
    59      * @var Activity_Metrics
    60      */
    61     private $activity_metrics;
    62 
    63     /**
    64      * Active_Consumers instance.
    65      *
    66      * @since 1.87.0
    67      * @var Active_Consumers
    68      */
    69     private $active_consumers;
    7052
    7153    /**
     
    11193        );
    11294
    113         $this->owner_id         = new Owner_ID( $this->options );
    114         $this->activity_metrics = new Activity_Metrics( $this->context, $this->user_options );
    115         $this->active_consumers = new Active_Consumers( $this->user_options );
    116         $this->transients       = $transients ?: new Transients( $this->context );
     95        $this->owner_id   = new Owner_ID( $this->options );
     96        $this->transients = $transients ?: new Transients( $this->context );
    11797    }
    11898
     
    134114        }
    135115
    136         $active_consumers = $this->activity_metrics->get_for_refresh_token();
    137 
    138116        try {
    139             $token_response = $this->get_client()->fetchAccessTokenWithRefreshToken( $token['refresh_token'], $active_consumers );
     117            $token_response = $this->get_client()->fetchAccessTokenWithRefreshToken( $token['refresh_token'] );
    140118        } catch ( \Exception $e ) {
    141119            $this->handle_fetch_token_exception( $e );
     
    148126        }
    149127
    150         $this->active_consumers->delete();
    151128        $this->set_token( $token_response );
    152129    }
     
    689666            : $this->context->admin_url( 'splash' );
    690667    }
    691 
    692     /**
    693      * Adds a user to the active consumers list.
    694      *
    695      * @since 1.87.0
    696      *
    697      * @param WP_User $user User object.
    698      */
    699     public function add_active_consumer( WP_User $user ) {
    700         $this->active_consumers->add( $user->ID, $user->roles );
    701     }
    702668}
  • google-site-kit/trunk/includes/Core/Dashboard_Sharing/Dashboard_Sharing.php

    r3118692 r3335509  
    1111namespace Google\Site_Kit\Core\Dashboard_Sharing;
    1212
    13 use Google\Site_Kit\Context;
    14 use Google\Site_Kit\Core\Storage\User_Options;
    15 use Google\Site_Kit\Core\Dashboard_Sharing\Activity_Metrics\Activity_Metrics;
    16 
    1713/**
    1814 * Class for handling Dashboard Sharing.
     
    2319 */
    2420class Dashboard_Sharing {
    25 
    26     /**
    27      * Plugin context.
    28      *
    29      * @since 1.82.0
    30      * @var Context
    31      */
    32     private $context;
    33 
    34     /**
    35      * User_Options object.
    36      *
    37      * @since 1.82.0
    38      *
    39      * @var User_Options
    40      */
    41     private $user_options = null;
    42 
    43     /**
    44      * Activity_Metrics instance.
    45      *
    46      * @since 1.82.0
    47      * @var Activity_Metrics
    48      */
    49     protected $activity_metrics;
    50 
    5121    /**
    5222     * View_Only_Pointer instance.
     
    6131     *
    6232     * @since 1.82.0
    63      *
    64      * @param Context      $context      Plugin context.
    65      * @param User_Options $user_options Optional. User Option API instance. Default is a new instance.
     33     * @since 1.158.0 Remove $user_options and $context params.
    6634     */
    67     public function __construct( Context $context, User_Options $user_options = null ) {
    68         $this->context           = $context;
    69         $this->user_options      = $user_options ?: new User_Options( $this->context );
    70         $this->activity_metrics  = new Activity_Metrics( $this->context, $this->user_options );
     35    public function __construct() {
    7136        $this->view_only_pointer = new View_Only_Pointer();
    7237    }
     
    7843     */
    7944    public function register() {
    80         $this->activity_metrics->register();
    8145        $this->view_only_pointer->register();
    8246    }
  • google-site-kit/trunk/includes/Core/Modules/Module.php

    r3118692 r3335509  
    358358
    359359                $current_user = wp_get_current_user();
    360                 // Adds the current user to the active consumers list.
    361                 $oauth_client->add_active_consumer( $current_user );
    362360            }
    363361
  • google-site-kit/trunk/includes/Core/Tags/GTag.php

    r3327728 r3335509  
    1313use Google\Site_Kit\Core\Storage\Options;
    1414use Google\Site_Kit\Core\Tags\Google_Tag_Gateway\Google_Tag_Gateway_Settings;
     15use Google\Site_Kit\Core\Util\BC_Functions;
    1516use Google\Site_Kit\Core\Util\Feature_Flags;
    1617use Google\Site_Kit\Core\Util\Method_Proxy_Trait;
     
    6364     *
    6465     * @since 1.124.0
    65      * @access public
    66      *
    67      * @return void
    6866     */
    6967    public function register() {
    70         add_action( 'wp_enqueue_scripts', $this->get_method_proxy( 'enqueue_gtag_script' ), 20 );
     68        add_action( 'wp_enqueue_scripts', fn() => $this->enqueue_gtag_script(), 20 );
     69        // The wp_enqueue_scripts action is hooked on wp_head @ 1;
     70        // The hat script needs to be hooked in after for tag state to be available.
     71        // This also avoids printing from within the "enqueue" action.
     72        add_action( 'wp_head', fn() => $this->maybe_print_hat_script(), 2 );
    7173
    7274        add_filter(
     
    8587
    8688    /**
     89     * Prints the first party tag hat script if GTG is enabled.
     90     */
     91    private function maybe_print_hat_script() {
     92        if ( ! $this->is_google_tag_gateway_active() ) {
     93            return;
     94        }
     95
     96        $tag_ids = wp_list_pluck( $this->tags, 'tag_id' );
     97
     98        if ( ! $tag_ids ) {
     99            return;
     100        }
     101
     102        $js = <<<'JS'
     103(function(w,i,g){w[g]=w[g]||[];if(typeof w[g].push=='function')w[g].push.apply(w[g],i)})
     104(window,%s,'google_tags_first_party');
     105JS;
     106
     107        printf( "\n<!-- %s -->\n", esc_html__( 'Google tag gateway for advertisers snippet added by Site Kit', 'google-site-kit' ) );
     108        BC_Functions::wp_print_inline_script_tag(
     109            sprintf( $js, wp_json_encode( $tag_ids ) )
     110        );
     111    }
     112
     113    /**
    87114     * Method to add a gtag ID and config for output rendering.
    88115     *
     
    139166        }
    140167
    141         $gtag_src = $this->get_gtag_src();
    142 
    143         // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion
    144         wp_enqueue_script( self::HANDLE, $gtag_src, false, null, false );
     168        $gtag_src  = $this->get_gtag_src();
     169        $gtag_deps = $this->get_gtag_deps();
     170
     171        wp_register_script( self::HANDLE, $gtag_src, $gtag_deps, null, false ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion
    145172        wp_script_add_data( self::HANDLE, 'script_execution', 'async' );
     173        wp_enqueue_script( self::HANDLE );
    146174
    147175        // Note that `gtag()` may already be defined via the `Consent_Mode` output, but this is safe to call multiple times.
     
    155183        wp_add_inline_script( self::HANDLE, 'gtag("set", "developer_id.dZTNiMT", true);' ); // Site Kit developer ID.
    156184
     185        if ( $this->is_google_tag_gateway_active() ) {
     186            wp_add_inline_script( self::HANDLE, 'gtag("set", "developer_id.dZmZmYj", true);' );
     187        }
     188
    157189        foreach ( $this->tags as $tag ) {
    158190            wp_add_inline_script( self::HANDLE, $this->get_gtag_call_for_tag( $tag ) );
    159191        }
    160192
    161         $filter_google_gtagjs = function ( $tag, $handle ) {
    162             if ( self::HANDLE !== $handle ) {
     193        $first_handle         = $gtag_deps[0] ?? self::HANDLE;
     194        $filter_google_gtagjs = function ( $tag, $handle ) use ( $first_handle ) {
     195            if ( $first_handle !== $handle ) {
    163196                return $tag;
    164197            }
    165198
    166199            $snippet_comment_begin = sprintf( "\n<!-- %s -->\n", esc_html__( 'Google tag (gtag.js) snippet added by Site Kit', 'google-site-kit' ) );
    167             $snippet_comment_end   = sprintf( "\n<!-- %s -->\n", esc_html__( 'End Google tag (gtag.js) snippet added by Site Kit', 'google-site-kit' ) );
    168 
    169             return $snippet_comment_begin . $tag . $snippet_comment_end;
     200
     201            return $snippet_comment_begin . $tag;
    170202        };
    171203
     
    224256        }
    225257
     258        // If Google tag gateway is active, each tag will get its own script as a dependency.
     259        if ( $this->is_google_tag_gateway_active() ) {
     260            return false;
     261        }
     262
    226263        // Load the GTag scripts using the first tag ID - it doesn't matter which is used,
    227264        // all registered tags will be set up with a config command regardless
     
    229266        $tag_id = rawurlencode( $this->tags[0]['tag_id'] );
    230267
    231         // If Google tag gateway is active, use the proxy URL to load the GTag script.
    232         if ( Feature_Flags::enabled( 'googleTagGateway' ) && $this->is_google_tag_gateway_active() ) {
    233             return add_query_arg(
    234                 array(
    235                     'id' => $tag_id,
    236                     's'  => '/gtag/js',
    237                 ),
    238                 plugins_url( 'gtg/measurement.php', GOOGLESITEKIT_PLUGIN_MAIN_FILE )
     268        return 'https://www.googletagmanager.com/gtag/js?id=' . $tag_id;
     269    }
     270
     271    /**
     272     * Gets the list of tag script handles that GTag should load first.
     273     *
     274     * @return array
     275     */
     276    private function get_gtag_deps() {
     277        if ( ! $this->is_google_tag_gateway_active() ) {
     278            return array();
     279        }
     280
     281        $deps    = array();
     282        $tag_ids = wp_list_pluck( $this->tags, 'tag_id' );
     283
     284        foreach ( $tag_ids as $tag_id ) {
     285            $handle = $this->get_handle_for_tag( $tag_id );
     286            $deps[] = $handle;
     287
     288            wp_register_script(
     289                $handle,
     290                esc_url( $this->get_gtg_src( $tag_id ) ),
     291                array(),
     292                null, // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion
     293                false
    239294            );
    240         }
    241 
    242         return 'https://www.googletagmanager.com/gtag/js?id=' . $tag_id;
     295
     296            wp_script_add_data( $handle, 'script_execution', 'async' );
     297        }
     298
     299        return $deps;
     300    }
     301
     302    /**
     303     * Gets the script tag src for a given tag using GTG.
     304     *
     305     * @param string $tag_id Tag ID.
     306     * @return string
     307     */
     308    protected function get_gtg_src( $tag_id ) {
     309        return add_query_arg(
     310            array(
     311                'id' => $tag_id,
     312                's'  => '/gtag/js',
     313            ),
     314            plugins_url( 'gtg/measurement.php', GOOGLESITEKIT_PLUGIN_MAIN_FILE )
     315        );
    243316    }
    244317
     
    251324     */
    252325    protected function is_google_tag_gateway_active() {
     326        if ( ! Feature_Flags::enabled( 'googleTagGateway' ) ) {
     327            return false;
     328        }
     329
    253330        $google_tag_gateway_settings = new Google_Tag_Gateway_Settings( $this->options );
    254331
     
    265342        return true;
    266343    }
     344
     345    /**
     346     * Gets the script tag handle for a given tag ID.
     347     *
     348     * @since 1.158.0
     349     *
     350     * @param string $tag_id Tag ID.
     351     * @return string
     352     */
     353    public static function get_handle_for_tag( $tag_id ): string {
     354        return self::HANDLE . "-$tag_id";
     355    }
    267356}
  • google-site-kit/trunk/includes/Modules/Ads.php

    r3327728 r3335509  
    4949use Google\Site_Kit\Modules\Ads\AMP_Tag;
    5050use Google\Site_Kit\Core\Conversion_Tracking\Conversion_Tracking;
     51use Google\Site_Kit\Core\Modules\Module_With_Inline_Data;
     52use Google\Site_Kit\Core\Modules\Module_With_Inline_Data_Trait;
    5153
    5254/**
     
    5759 * @ignore
    5860 */
    59 final class Ads extends Module implements Module_With_Assets, Module_With_Debug_Fields, Module_With_Scopes, Module_With_Settings, Module_With_Tag, Module_With_Deactivation, Module_With_Persistent_Registration {
     61final class Ads extends Module implements Module_With_Inline_Data, Module_With_Assets, Module_With_Debug_Fields, Module_With_Scopes, Module_With_Settings, Module_With_Tag, Module_With_Deactivation, Module_With_Persistent_Registration {
    6062    use Module_With_Assets_Trait;
    6163    use Module_With_Scopes_Trait;
     
    6365    use Module_With_Tag_Trait;
    6466    use Method_Proxy_Trait;
     67    use Module_With_Inline_Data_Trait;
    6568
    6669    /**
     
    104107    public function register() {
    105108        $this->register_scopes_hook();
     109        $this->register_inline_data();
    106110        // Ads tag placement logic.
    107111        add_action( 'template_redirect', array( $this, 'register_tag' ) );
    108         add_filter( 'googlesitekit_inline_modules_data', $this->get_method_proxy( 'inline_modules_data' ) );
    109112        add_filter(
    110113            'googlesitekit_ads_measurement_connection_checks',
     
    257260    }
    258261
    259     /**
    260      * Populates module data to pass to JS via _googlesitekitModulesData.
    261      *
    262      * @since 1.126.0
    263      *
    264      * @param array $modules_data Inline modules data.
    265      * @return array Inline modules data.
    266      */
    267     private function inline_modules_data( $modules_data ) {
    268         if ( ! Feature_Flags::enabled( 'adsPax' ) ) {
    269             return $modules_data;
    270         }
    271 
    272         if ( empty( $modules_data['ads'] ) ) {
    273             $modules_data['ads'] = array();
    274         }
    275 
    276         $modules_data['ads']['supportedConversionEvents'] = $this->get_supported_conversion_events();
    277 
    278         return $modules_data;
    279     }
    280262
    281263    /**
     
    463445        return array_unique( $events );
    464446    }
     447
     448    /**
     449     * Gets required inline data for the module.
     450     *
     451     * @since 1.158.0
     452     *
     453     * @return array An array of the module's inline data.
     454     */
     455    public function get_inline_data() {
     456        if ( ! Feature_Flags::enabled( 'adsPax' ) ) {
     457            return array();
     458        }
     459
     460        return array(
     461            self::MODULE_SLUG => array(
     462                'supportedConversionEvents' => $this->get_supported_conversion_events(),
     463            ),
     464        );
     465    }
    465466}
  • google-site-kit/trunk/includes/Modules/Ads/Web_Tag.php

    r3221899 r3335509  
    4141            20
    4242        );
     43        add_filter( 'script_loader_tag', $this->get_method_proxy( 'filter_tag_output' ), 10, 2 );
    4344
    4445        $this->do_init_tag_action();
     
    6364    protected function setup_gtag( $gtag ) {
    6465        $gtag->add_tag( $this->tag_id );
     66    }
    6567
    66         $filter_google_gtagjs = function ( $tag, $handle ) {
    67             if ( GTag::HANDLE !== $handle ) {
    68                 return $tag;
    69             }
    7068
    71             // Retain this comment for detection of Site Kit placed tag.
    72             $snippet_comment = sprintf( "\n<!-- %s -->\n", esc_html__( 'Google Ads snippet added by Site Kit', 'google-site-kit' ) );
     69    /**
     70     * Filters output of tag HTML.
     71     *
     72     * @param string $tag Tag HTML.
     73     * @param string $handle WP script handle of given tag.
     74     * @return string
     75     */
     76    protected function filter_tag_output( $tag, $handle ) {
     77        // The tag will either have its own handle or use the common GTag handle, not both.
     78        if ( GTag::get_handle_for_tag( $this->tag_id ) !== $handle && GTag::HANDLE !== $handle ) {
     79            return $tag;
     80        }
    7381
    74             return $snippet_comment . $tag;
    75         };
     82        // Retain this comment for detection of Site Kit placed tag.
     83        $snippet_comment = sprintf( "<!-- %s -->\n", esc_html__( 'Google Ads snippet added by Site Kit', 'google-site-kit' ) );
    7684
    77         add_filter( 'script_loader_tag', $filter_google_gtagjs, 10, 2 );
     85        return $snippet_comment . $tag;
    7886    }
    7987}
  • google-site-kit/trunk/includes/Modules/Analytics_4.php

    r3327728 r3335509  
    3131use Google\Site_Kit\Core\Modules\Module_With_Data_Available_State;
    3232use Google\Site_Kit\Core\Modules\Module_With_Data_Available_State_Trait;
     33use Google\Site_Kit\Core\Modules\Module_With_Inline_Data;
     34use Google\Site_Kit\Core\Modules\Module_With_Inline_Data_Trait;
    3335use Google\Site_Kit\Core\Modules\Module_With_Scopes;
    3436use Google\Site_Kit\Core\Modules\Module_With_Scopes_Trait;
     
    110112 * @ignore
    111113 */
    112 final class Analytics_4 extends Module implements Module_With_Scopes, Module_With_Settings, Module_With_Debug_Fields, Module_With_Owner, Module_With_Assets, Module_With_Service_Entity, Module_With_Activation, Module_With_Deactivation, Module_With_Data_Available_State, Module_With_Tag {
     114final class Analytics_4 extends Module implements Module_With_Inline_Data, Module_With_Scopes, Module_With_Settings, Module_With_Debug_Fields, Module_With_Owner, Module_With_Assets, Module_With_Service_Entity, Module_With_Activation, Module_With_Deactivation, Module_With_Data_Available_State, Module_With_Tag {
    113115
    114116    use Method_Proxy_Trait;
     
    119121    use Module_With_Data_Available_State_Trait;
    120122    use Module_With_Tag_Trait;
     123    use Module_With_Inline_Data_Trait;
    121124
    122125    const PROVISION_ACCOUNT_TICKET_ID = 'googlesitekit_analytics_provision_account_ticket_id';
     
    218221        $this->register_scopes_hook();
    219222
     223        $this->register_inline_data();
     224
    220225        $synchronize_property = new Synchronize_Property(
    221226            $this,
     
    360365            2
    361366        );
    362 
    363         add_filter( 'googlesitekit_inline_modules_data', $this->get_method_proxy( 'inline_custom_dimensions_data' ), 10 );
    364 
    365         add_filter( 'googlesitekit_inline_modules_data', $this->get_method_proxy( 'inline_tag_id_mismatch' ), 15 );
    366 
    367         add_filter( 'googlesitekit_inline_modules_data', $this->get_method_proxy( 'inline_resource_availability_dates_data' ) );
    368 
    369         add_filter( 'googlesitekit_inline_modules_data', $this->get_method_proxy( 'inline_conversion_reporting_events_detection' ), 15 );
    370367
    371368        add_filter(
     
    24152412     *
    24162413     * @since 1.113.0
    2417      *
    2418      * @param array $modules_data Inline modules data.
     2414     * @since 1.158.0 Renamed method to `get_inline_custom_dimensions_data()`, and modified it to return a new array rather than populating a passed filter value.
     2415     *
    24192416     * @return array Inline modules data.
    24202417     */
    2421     private function inline_custom_dimensions_data( $modules_data ) {
     2418    private function get_inline_custom_dimensions_data() {
    24222419        if ( $this->is_connected() ) {
    2423             // Add the data under the `analytics-4` key to make it clear it's scoped to this module.
    2424             $modules_data['analytics-4'] = array(
     2420            return array(
    24252421                'customDimensionsDataAvailable' => $this->custom_dimensions_data_available->get_data_availability(),
    24262422            );
    24272423        }
    24282424
    2429         return $modules_data;
     2425        return array();
    24302426    }
    24312427
     
    24342430     *
    24352431     * @since 1.130.0
    2436      *
    2437      * @param array $modules_data Inline modules data.
     2432     * @since 1.158.0 Renamed method to `get_inline_tag_id_mismatch()`, and modified it to return a new array rather than populating a passed filter value.
     2433     *
    24382434     * @return array Inline modules data.
    24392435     */
    2440     protected function inline_tag_id_mismatch( $modules_data ) {
     2436    private function get_inline_tag_id_mismatch() {
    24412437        if ( $this->is_connected() ) {
    24422438            $tag_id_mismatch = $this->transients->get( 'googlesitekit_inline_tag_id_mismatch' );
    24432439
    2444             // Add the data under the `analytics-4` key to make it clear it's scoped to this module.
    2445             // No need to check if `analytics-4` key is present, as this hook is added with higher
    2446             // priority than inline_custom_dimensions_data where this key is set.
    2447             $modules_data['analytics-4']['tagIDMismatch'] = $tag_id_mismatch;
    2448         }
    2449 
    2450         return $modules_data;
     2440            return array(
     2441                'tagIDMismatch' => $tag_id_mismatch,
     2442            );
     2443        }
     2444
     2445        return array();
    24512446    }
    24522447
     
    24552450     *
    24562451     * @since 1.127.0
    2457      *
    2458      * @param array $modules_data Inline modules data.
     2452     * @since 1.158.0 Renamed method to `get_inline_resource_availability_dates_data()`, and modified it to return a new array rather than populating a passed filter value.
     2453     *
    24592454     * @return array Inline modules data.
    24602455     */
    2461     private function inline_resource_availability_dates_data( $modules_data ) {
     2456    private function get_inline_resource_availability_dates_data() {
    24622457        if ( $this->is_connected() ) {
    2463             // Add the data under the `analytics-4` key to make it clear it's scoped to this module.
    2464             // If `analytics-4` key already exists, merge the data.
    2465             $modules_data['analytics-4'] = array_merge(
    2466                 $modules_data['analytics-4'] ?? array(),
    2467                 array(
    2468                     'resourceAvailabilityDates' => $this->resource_data_availability_date->get_all_resource_dates(),
    2469                 )
     2458            return array(
     2459                'resourceAvailabilityDates' => $this->resource_data_availability_date->get_all_resource_dates(),
    24702460            );
    24712461        }
    24722462
    2473         return $modules_data;
     2463        return array();
    24742464    }
    24752465
     
    26952685     *
    26962686     * @since 1.139.0
    2697      *
    2698      * @param array $modules_data Inline modules data.
     2687     * @since 1.158.0 Renamed method to `get_inline_conversion_reporting_events_detection()`, and modified it to return a new array rather than populating a passed filter value.
     2688     *
    26992689     * @return array Inline modules data.
    27002690     */
    2701     public function inline_conversion_reporting_events_detection( $modules_data ) {
     2691    private function get_inline_conversion_reporting_events_detection() {
    27022692        if ( ! $this->is_connected() ) {
    2703             return $modules_data;
     2693            return array();
    27042694        }
    27052695
     
    27082698        $new_events_badge = $this->transients->get( Conversion_Reporting_New_Badge_Events_Sync::NEW_EVENTS_BADGE_TRANSIENT );
    27092699
    2710         $modules_data['analytics-4']['newEvents']      = is_array( $detected_events ) ? $detected_events : array();
    2711         $modules_data['analytics-4']['lostEvents']     = is_array( $lost_events ) ? $lost_events : array();
    2712         $modules_data['analytics-4']['newBadgeEvents'] = is_array( $new_events_badge ) ? $new_events_badge['events'] : array();
    2713 
    2714         return $modules_data;
     2700        return array(
     2701            'newEvents'      => is_array( $detected_events ) ? $detected_events : array(),
     2702            'lostEvents'     => is_array( $lost_events ) ? $lost_events : array(),
     2703            'newBadgeEvents' => is_array( $new_events_badge ) ? $new_events_badge['events'] : array(),
     2704        );
     2705    }
     2706
     2707    /**
     2708     * Gets required inline data for the module.
     2709     *
     2710     * @since 1.158.0
     2711     *
     2712     * @return array An array of the module's inline data.
     2713     */
     2714    public function get_inline_data() {
     2715        $inline_data = array_merge(
     2716            $this->get_inline_custom_dimensions_data(),
     2717            $this->get_inline_resource_availability_dates_data(),
     2718            $this->get_inline_tag_id_mismatch(),
     2719            $this->get_inline_conversion_reporting_events_detection()
     2720        );
     2721
     2722        if ( empty( $inline_data ) ) {
     2723            return array();
     2724        }
     2725
     2726        return array(
     2727            self::MODULE_SLUG => $inline_data,
     2728        );
    27152729    }
    27162730}
  • google-site-kit/trunk/includes/Modules/Analytics_4/Web_Tag.php

    r3118692 r3335509  
    1313use Google\Site_Kit\Core\Modules\Tags\Module_Web_Tag;
    1414use Google\Site_Kit\Core\Tags\GTag;
    15 use Google\Site_Kit\Core\Tags\Tag_With_DNS_Prefetch_Trait;
    1615use Google\Site_Kit\Core\Tags\Tag_With_Linker_Trait;
    1716use Google\Site_Kit\Core\Util\Method_Proxy_Trait;
     
    2827
    2928    use Method_Proxy_Trait;
    30     use Tag_With_DNS_Prefetch_Trait;
    3129    use Tag_With_Linker_Trait;
    3230
     
    102100    public function register() {
    103101        add_action( 'googlesitekit_setup_gtag', $this->get_method_proxy( 'setup_gtag' ) );
     102        add_filter( 'script_loader_tag', $this->get_method_proxy( 'filter_tag_output' ), 10, 2 );
    104103
    105104        $this->do_init_tag_action();
     
    151150            $gtag->add_tag( $this->ads_conversion_id );
    152151        }
    153 
    154         $filter_google_gtagjs = function ( $tag, $handle ) use ( $gtag ) {
    155             if ( GTag::HANDLE !== $handle ) {
    156                 return $tag;
    157             }
    158 
    159             // Retain this comment for detection of Site Kit placed tag.
    160             $snippet_comment = sprintf( "\n<!-- %s -->\n", esc_html__( 'Google Analytics snippet added by Site Kit', 'google-site-kit' ) );
    161 
    162             $block_on_consent_attrs = $this->get_tag_blocked_on_consent_attribute();
    163 
    164             if ( $block_on_consent_attrs ) {
    165                 $gtag_src = $gtag->get_gtag_src();
    166 
    167                 $tag = $this->add_legacy_block_on_consent_attributes( $tag, $gtag_src, $block_on_consent_attrs );
    168             }
    169 
    170             return $snippet_comment . $tag;
    171         };
    172 
    173         add_filter( 'script_loader_tag', $filter_google_gtagjs, 10, 2 );
     152    }
     153
     154    /**
     155     * Filters output of tag HTML.
     156     *
     157     * @param string $tag Tag HTML.
     158     * @param string $handle WP script handle of given tag.
     159     * @return string
     160     */
     161    protected function filter_tag_output( $tag, $handle ) {
     162        // The tag will either have its own handle or use the common GTag handle, not both.
     163        if ( GTag::get_handle_for_tag( $this->tag_id ) !== $handle && GTag::HANDLE !== $handle ) {
     164            return $tag;
     165        }
     166
     167        // Retain this comment for detection of Site Kit placed tag.
     168        $snippet_comment = sprintf( "<!-- %s -->\n", esc_html__( 'Google Analytics snippet added by Site Kit', 'google-site-kit' ) );
     169
     170        $block_on_consent_attrs = $this->get_tag_blocked_on_consent_attribute();
     171
     172        if ( $block_on_consent_attrs ) {
     173            $tag = $this->add_legacy_block_on_consent_attributes( $tag, $block_on_consent_attrs );
     174        }
     175
     176        return $snippet_comment . $tag;
    174177    }
    175178
     
    197200     *
    198201     * @since 1.122.0
    199      *
    200      * @param string $tag     The script tag.
    201      * @param string $gtag_src The gtag script source URL.
     202     * @since 1.158.0 Remove src from signature & replacement.
     203     *
     204     * @param string $tag                    The script tag.
    202205     * @param string $block_on_consent_attrs The attributes to add to the script tag to block it until user consent is granted.
     206     *
    203207     * @return string The script tag with the added attributes.
    204208     */
    205     protected function add_legacy_block_on_consent_attributes( $tag, $gtag_src, $block_on_consent_attrs ) {
     209    protected function add_legacy_block_on_consent_attributes( $tag, $block_on_consent_attrs ) {
    206210        return str_replace(
    207211            array(
    208                 "<script src='$gtag_src'", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
    209                     "<script src=\"$gtag_src\"", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
    210                     "<script type='text/javascript' src='$gtag_src'", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
    211                     "<script type=\"text/javascript\" src=\"$gtag_src\"", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
     212                '<script src=', // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
     213                    "<script type='text/javascript' src=", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
     214                    '<script type="text/javascript" src=', // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
    212215            ),
    213             array( // `type` attribute intentionally excluded in replacements.
    214                 "<script{$block_on_consent_attrs} src='$gtag_src'", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
    215                     "<script{$block_on_consent_attrs} src=\"$gtag_src\"", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
    216                     "<script{$block_on_consent_attrs} src='$gtag_src'", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
    217                     "<script{$block_on_consent_attrs} src=\"$gtag_src\"", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
    218             ),
     216            // `type` attribute intentionally excluded in replacements.
     217            "<script{$block_on_consent_attrs} src=", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
    219218            $tag
    220219        );
  • google-site-kit/trunk/includes/Modules/Reader_Revenue_Manager.php

    r3313285 r3335509  
    538538                'blocks-reader-revenue-manager-block-editor-plugin',
    539539                array(
    540                     'src'           => $base_url . 'js/blocks/reader-revenue-manager/block-editor-plugin/index.js',
     540                    'src'           => $base_url . 'blocks/reader-revenue-manager/block-editor-plugin/index.js',
    541541                    'dependencies'  => array(
    542542                        'googlesitekit-components',
     
    554554                'blocks-reader-revenue-manager-block-editor-plugin-styles',
    555555                array(
    556                     'src'           => $base_url . 'js/blocks/reader-revenue-manager/block-editor-plugin/editor-styles.css',
     556                    'src'           => $base_url . 'blocks/reader-revenue-manager/block-editor-plugin/editor-styles.css',
    557557                    'dependencies'  => array(),
    558558                    'load_contexts' => array( Asset::CONTEXT_ADMIN_POST_EDITOR ),
     
    563563                'blocks-contribute-with-google',
    564564                array(
    565                     'src'           => $base_url . 'js/blocks/reader-revenue-manager/contribute-with-google/index.js',
     565                    'src'           => $base_url . 'blocks/reader-revenue-manager/contribute-with-google/index.js',
    566566                    'dependencies'  => array(
    567567                        'googlesitekit-components',
     
    579579                'blocks-subscribe-with-google',
    580580                array(
    581                     'src'           => $base_url . 'js/blocks/reader-revenue-manager/subscribe-with-google/index.js',
     581                    'src'           => $base_url . 'blocks/reader-revenue-manager/subscribe-with-google/index.js',
    582582                    'dependencies'  => array(
    583583                        'googlesitekit-components',
     
    596596                    'blocks-contribute-with-google-non-sitekit-user',
    597597                    array(
    598                         'src'           => $base_url . 'js/blocks/reader-revenue-manager/contribute-with-google/non-site-kit-user.js',
     598                        'src'           => $base_url . 'blocks/reader-revenue-manager/contribute-with-google/non-site-kit-user.js',
    599599                        'dependencies'  => array(
    600600                            'googlesitekit-i18n',
     
    608608                    'blocks-subscribe-with-google-non-sitekit-user',
    609609                    array(
    610                         'src'           => $base_url . 'js/blocks/reader-revenue-manager/subscribe-with-google/non-site-kit-user.js',
     610                        'src'           => $base_url . 'blocks/reader-revenue-manager/subscribe-with-google/non-site-kit-user.js',
    611611                        'dependencies'  => array( 'googlesitekit-i18n' ),
    612612                        'load_contexts' => array( Asset::CONTEXT_ADMIN_POST_EDITOR ),
     
    619619                'blocks-reader-revenue-manager-common-editor-styles',
    620620                array(
    621                     'src'           => $base_url . 'js/blocks/reader-revenue-manager/common/editor-styles.css',
     621                    'src'           => $base_url . 'blocks/reader-revenue-manager/common/editor-styles.css',
    622622                    'dependencies'  => array(),
    623623                    'load_contexts' => array( Asset::CONTEXT_ADMIN_BLOCK_EDITOR ),
  • google-site-kit/trunk/includes/Modules/Reader_Revenue_Manager/Contribute_With_Google_Block.php

    r3253534 r3335509  
    7575            function () {
    7676                register_block_type(
    77                     dirname( GOOGLESITEKIT_PLUGIN_MAIN_FILE ) . '/dist/assets/js/blocks/reader-revenue-manager/contribute-with-google/block.json',
     77                    dirname( GOOGLESITEKIT_PLUGIN_MAIN_FILE ) . '/dist/assets/blocks/reader-revenue-manager/contribute-with-google/block.json',
    7878                    array(
    7979                        'render_callback' => array( $this, 'render_callback' ),
  • google-site-kit/trunk/includes/Modules/Reader_Revenue_Manager/Subscribe_With_Google_Block.php

    r3253534 r3335509  
    7575            function () {
    7676                register_block_type(
    77                     dirname( GOOGLESITEKIT_PLUGIN_MAIN_FILE ) . '/dist/assets/js/blocks/reader-revenue-manager/subscribe-with-google/block.json',
     77                    dirname( GOOGLESITEKIT_PLUGIN_MAIN_FILE ) . '/dist/assets/blocks/reader-revenue-manager/subscribe-with-google/block.json',
    7878                    array(
    7979                        'render_callback' => array( $this, 'render_callback' ),
  • google-site-kit/trunk/includes/Modules/Sign_In_With_Google.php

    r3305239 r3335509  
    2222use Google\Site_Kit\Core\Modules\Module_With_Deactivation;
    2323use Google\Site_Kit\Core\Modules\Module_With_Debug_Fields;
     24use Google\Site_Kit\Core\Modules\Module_With_Inline_Data;
     25use Google\Site_Kit\Core\Modules\Module_With_Inline_Data_Trait;
    2426use Google\Site_Kit\Core\Modules\Module_With_Settings;
    2527use Google\Site_Kit\Core\Modules\Module_With_Settings_Trait;
     
    5355 * @ignore
    5456 */
    55 final class Sign_In_With_Google extends Module implements Module_With_Assets, Module_With_Settings, Module_With_Deactivation, Module_With_Debug_Fields, Module_With_Tag {
     57final class Sign_In_With_Google extends Module implements Module_With_Inline_Data, Module_With_Assets, Module_With_Settings, Module_With_Deactivation, Module_With_Debug_Fields, Module_With_Tag {
    5658
    5759    use Method_Proxy_Trait;
     
    5961    use Module_With_Settings_Trait;
    6062    use Module_With_Tag_Trait;
     63    use Module_With_Inline_Data_Trait;
    6164
    6265    /**
     
    131134     */
    132135    public function register() {
     136        $this->register_inline_data();
     137
    133138        add_filter( 'wp_login_errors', array( $this, 'handle_login_errors' ) );
    134 
    135         add_filter( 'googlesitekit_inline_modules_data', $this->get_method_proxy( 'inline_module_data' ), 10 );
    136139
    137140        add_action(
     
    314317                'blocks-sign-in-with-google',
    315318                array(
    316                     'src'           => $this->context->url( 'dist/assets/js/blocks/sign-in-with-google/index.js' ),
     319                    'src'           => $this->context->url( 'dist/assets/blocks/sign-in-with-google/index.js' ),
    317320                    'dependencies'  => array(),
    318321                    'load_contexts' => array( Asset::CONTEXT_ADMIN_POST_EDITOR ),
     
    322325                'blocks-sign-in-with-google-editor-styles',
    323326                array(
    324                     'src'           => $this->context->url( 'dist/assets/js/blocks/sign-in-with-google/editor-styles.css' ),
     327                    'src'           => $this->context->url( 'dist/assets/blocks/sign-in-with-google/editor-styles.css' ),
    325328                    'dependencies'  => array(),
    326329                    'load_contexts' => array( Asset::CONTEXT_ADMIN_POST_EDITOR ),
     
    801804
    802805    /**
    803      * Exposes inline module data to JS via _googlesitekitModulesData.
     806     * Gets required inline data for the module.
    804807     *
    805808     * @since 1.142.0
    806809     * @since 1.146.0 Added isWooCommerceActive and isWooCommerceRegistrationEnabled to the inline data.
    807      *
    808      * @param array $modules_data Inline modules data.
    809      * @return array Inline modules data.
    810      */
    811     protected function inline_module_data( $modules_data ) {
     810     * @since 1.158.0 Renamed method to `get_inline_data()`, and modified it to return a new array rather than populating a passed filter value.
     811     *
     812     * @return array An array of the module's inline data.
     813     */
     814    public function get_inline_data() {
    812815        $inline_data = array();
    813816
    814817        $existing_client_id = $this->existing_client_id->get();
     818
    815819        if ( $existing_client_id ) {
    816820            $inline_data['existingClientID'] = $existing_client_id;
     
    823827        $inline_data['isWooCommerceRegistrationEnabled'] = $is_woocommerce_active && 'yes' === $woocommerce_registration_enabled;
    824828
    825         // Add the data under the `sign-in-with-google` key to make it clear it's scoped to this module.
    826         $modules_data['sign-in-with-google'] = $inline_data;
    827 
    828         return $modules_data;
     829        return array(
     830            self::MODULE_SLUG => $inline_data,
     831        );
    829832    }
    830833
  • google-site-kit/trunk/includes/Modules/Sign_In_With_Google/Sign_In_With_Google_Block.php

    r3253534 r3335509  
    6464            function () {
    6565                register_block_type(
    66                     dirname( GOOGLESITEKIT_PLUGIN_MAIN_FILE ) . '/dist/assets/js/blocks/sign-in-with-google/block.json',
     66                    dirname( GOOGLESITEKIT_PLUGIN_MAIN_FILE ) . '/dist/assets/blocks/sign-in-with-google/block.json',
    6767                    array(
    6868                        'render_callback' => array( $this, 'render_callback' ),
  • google-site-kit/trunk/includes/Plugin.php

    r3327728 r3335509  
    220220                ( new Core\Util\Migration_1_8_1( $this->context, $options, $user_options, $authentication ) )->register();
    221221                ( new Core\Util\Migration_1_123_0( $this->context, $options ) )->register();
     222                ( new Core\Util\Migration_1_129_0( $this->context, $options ) )->register();
    222223                ( new Core\Util\Migration_1_150_0( $this->context, $options ) )->register();
    223                 ( new Core\Dashboard_Sharing\Dashboard_Sharing( $this->context, $user_options ) )->register();
     224                ( new Core\Dashboard_Sharing\Dashboard_Sharing() )->register();
    224225                ( new Core\Key_Metrics\Key_Metrics( $this->context, $user_options, $options ) )->register();
    225226                ( new Core\Prompts\Prompts( $this->context, $user_options ) )->register();
  • google-site-kit/trunk/includes/vendor/composer/autoload_classmap.php

    r3327728 r3335509  
    7979    'Google\\Site_Kit\\Core\\Conversion_Tracking\\Conversion_Tracking_Settings' => $baseDir . '/Core/Conversion_Tracking/Conversion_Tracking_Settings.php',
    8080    'Google\\Site_Kit\\Core\\Conversion_Tracking\\REST_Conversion_Tracking_Controller' => $baseDir . '/Core/Conversion_Tracking/REST_Conversion_Tracking_Controller.php',
    81     'Google\\Site_Kit\\Core\\Dashboard_Sharing\\Activity_Metrics\\Active_Consumers' => $baseDir . '/Core/Dashboard_Sharing/Activity_Metrics/Active_Consumers.php',
    82     'Google\\Site_Kit\\Core\\Dashboard_Sharing\\Activity_Metrics\\Activity_Metrics' => $baseDir . '/Core/Dashboard_Sharing/Activity_Metrics/Activity_Metrics.php',
    8381    'Google\\Site_Kit\\Core\\Dashboard_Sharing\\Dashboard_Sharing' => $baseDir . '/Core/Dashboard_Sharing/Dashboard_Sharing.php',
    8482    'Google\\Site_Kit\\Core\\Dashboard_Sharing\\View_Only_Pointer' => $baseDir . '/Core/Dashboard_Sharing/View_Only_Pointer.php',
     
    112110    'Google\\Site_Kit\\Core\\Modules\\Module_With_Deactivation' => $baseDir . '/Core/Modules/Module_With_Deactivation.php',
    113111    'Google\\Site_Kit\\Core\\Modules\\Module_With_Debug_Fields' => $baseDir . '/Core/Modules/Module_With_Debug_Fields.php',
     112    'Google\\Site_Kit\\Core\\Modules\\Module_With_Inline_Data' => $baseDir . '/Core/Modules/Module_With_Inline_Data.php',
     113    'Google\\Site_Kit\\Core\\Modules\\Module_With_Inline_Data_Trait' => $baseDir . '/Core/Modules/Module_With_Inline_Data_Trait.php',
    114114    'Google\\Site_Kit\\Core\\Modules\\Module_With_Owner' => $baseDir . '/Core/Modules/Module_With_Owner.php',
    115115    'Google\\Site_Kit\\Core\\Modules\\Module_With_Owner_Trait' => $baseDir . '/Core/Modules/Module_With_Owner_Trait.php',
     
    230230    'Google\\Site_Kit\\Core\\Util\\Migrate_Legacy_Keys' => $baseDir . '/Core/Util/Migrate_Legacy_Keys.php',
    231231    'Google\\Site_Kit\\Core\\Util\\Migration_1_123_0' => $baseDir . '/Core/Util/Migration_1_123_0.php',
     232    'Google\\Site_Kit\\Core\\Util\\Migration_1_129_0' => $baseDir . '/Core/Util/Migration_1_129_0.php',
    232233    'Google\\Site_Kit\\Core\\Util\\Migration_1_150_0' => $baseDir . '/Core/Util/Migration_1_150_0.php',
    233234    'Google\\Site_Kit\\Core\\Util\\Migration_1_3_0' => $baseDir . '/Core/Util/Migration_1_3_0.php',
  • google-site-kit/trunk/readme.txt

    r3327728 r3335509  
    55Tested up to:      6.8
    66Requires PHP:      7.4
    7 Stable tag:        1.157.0
     7Stable tag:        1.158.0
    88License:           Apache License 2.0
    99License URI:       https://www.apache.org/licenses/LICENSE-2.0
     
    110110== Changelog ==
    111111
    112 = 1.157.0 =
     112= 1.158.0 =
     113
     114**Added**
     115
     116* Add unique descriptor to report requests. See [#7348](https://github.com/google/site-kit-wp/issues/7348).
    113117
    114118**Enhanced**
    115119
    116 * Show an in-progress spinner in the Google Tag Gateway Setup Banner's CTA button when it's clicked and setup is underway. See [#11027](https://github.com/google/site-kit-wp/issues/11027).
    117 * Update "First-party mode" references to "Google tag gateway for advertisers". See [#10951](https://github.com/google/site-kit-wp/issues/10951).
    118 * Add support for named date ranges when requesting Google Analytics reports. Props leonidasmi. See [#10738](https://github.com/google/site-kit-wp/issues/10738).
    119 * Apply the “Warning Banner” layout to redesign the `WebDataStreamNotAvailableNotification` banner. See [#10424](https://github.com/google/site-kit-wp/issues/10424).
    120 * Update the design of the Google Tag ID mismatch notification. See [#10423](https://github.com/google/site-kit-wp/issues/10423).
    121 * Apply the “Error Banner” layout to redesign the `AuthError` banner. See [#10422](https://github.com/google/site-kit-wp/issues/10422).
    122 * Update the error banner styling. See [#10421](https://github.com/google/site-kit-wp/issues/10421).
    123 * Apply the “Error Banner” layout to redesign the `UnsatisfiedScopesAlert` banner. See [#10420](https://github.com/google/site-kit-wp/issues/10420).
    124 * Update the module Recovery Alert banner design. See [#10384](https://github.com/google/site-kit-wp/issues/10384).
    125 * Update the "Confirm changes" module settings button to retain its label while saving. See [#10282](https://github.com/google/site-kit-wp/issues/10282).
    126 * Refactor `CoreSiteBannerNotifications` to use the new Notifications datastore. See [#9294](https://github.com/google/site-kit-wp/issues/9294).
    127 * Introduce consistent `Typography` component. See [#8581](https://github.com/google/site-kit-wp/issues/8581).
    128 * Update the Ad Blocking Recovery setup screen to better match the Figma design. Props mxbclang. See [#7300](https://github.com/google/site-kit-wp/issues/7300).
    129 * Add internal URL utility selectors. See [#7112](https://github.com/google/site-kit-wp/issues/7112).
     120* Update Google tag gateway for advertisers to work as expected in various tagging scenarios. See [#11122](https://github.com/google/site-kit-wp/issues/11122).
     121* Fix bug that could cause some WooCommerce events to have inaccurate prices. See [#10974](https://github.com/google/site-kit-wp/issues/10974).
     122* Update heading styles. See [#10905](https://github.com/google/site-kit-wp/issues/10905).
     123* Update the style for generic notification banners received from Site Kit service. See [#10425](https://github.com/google/site-kit-wp/issues/10425).
     124* Update the "successful setup" banner notification styles. See [#10388](https://github.com/google/site-kit-wp/issues/10388).
     125* Remove active consumers and activity metrics tracking functionality. See [#10189](https://github.com/google/site-kit-wp/issues/10189).
     126* Set a max-width for Site Kit content. See [#9599](https://github.com/google/site-kit-wp/issues/9599).
     127* Update button font weight to be consistent with the design system. See [#8856](https://github.com/google/site-kit-wp/issues/8856).
     128* Update AdSense settings view layout to move “Account Status” below “Publisher ID” and “Site Status” for better alignment with other modules. See [#7958](https://github.com/google/site-kit-wp/issues/7958).
    130129
    131130**Fixed**
    132131
    133 * Fix site health information for Google Tag Gateway enabled status. See [#11039](https://github.com/google/site-kit-wp/issues/11039).
    134 * Fix the console error that appeared when setting up visitor groups from Admin settngs. See [#10965](https://github.com/google/site-kit-wp/issues/10965).
    135 * Ensure spinner appears on Enhanced Measurement CTA button. See [#10960](https://github.com/google/site-kit-wp/issues/10960).
    136 * Update the design of the "Enable auto-updates" notification banner. See [#10956](https://github.com/google/site-kit-wp/issues/10956).
     132* Update Sign in with Google setup banner CTA to show spinner when in progress. See [#10962](https://github.com/google/site-kit-wp/issues/10962).
     133* Prevent flicker when Setup CTA is clicked and notification should not re-appear when you cancel setup. See [#10961](https://github.com/google/site-kit-wp/issues/10961).
     134* Fix issue when a React component has been updated after unmount. See [#10845](https://github.com/google/site-kit-wp/issues/10845).
     135* Fix error resolution behaviour in search funnel widget. See [#8434](https://github.com/google/site-kit-wp/issues/8434).
    137136
    138137[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.