Plugin Directory

Changeset 3181737


Ignore:
Timestamp:
11/04/2024 06:44:13 PM (13 months ago)
Author:
google
Message:

Update to version 1.139.0 from GitHub

Location:
google-site-kit
Files:
88 added
86 deleted
22 edited
1 copied

Legend:

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

    r3173125 r3181737  
    1919    'analytics-advanced-tracking'                          => array( "analytics-advanced-tracking-ea84b2c367b69f5c094b.js", null ),
    2020    'googlesitekit-i18n'                                   => array( "googlesitekit-i18n-33cdd2dee5d1d1f4fb34.js", null ),
    21     'googlesitekit-admin-css'                              => array( "googlesitekit-admin-css-0cf0cf71d3ac64918b65.min.css", null ),
     21    'googlesitekit-admin-css'                              => array( "googlesitekit-admin-css-9fc9d94050fa65d174be.min.css", null ),
    2222    'googlesitekit-adminbar-css'                           => array( "googlesitekit-adminbar-css-6db776544b37175be17f.min.css", null ),
    2323    'googlesitekit-authorize-application-css'              => array( "googlesitekit-authorize-application-css-ce25e97404abc5a02921.min.css", null ),
    2424    'googlesitekit-wp-dashboard-css'                       => array( "googlesitekit-wp-dashboard-css-c5417a27cb905717f9fc.min.css", null ),
    25     'googlesitekit-vendor'                                 => array( "googlesitekit-vendor-cca22bcdeb2e1252b20a.js", null ),
    26     'googlesitekit-runtime'                                => array( "runtime-62d30aa4dfe99a234168.js", null ),
    27     'googlesitekit-activation'                             => array( "googlesitekit-activation-92b68a64f8c49de241af.js", null ),
    28     'googlesitekit-ad-blocking-recovery'                   => array( "googlesitekit-ad-blocking-recovery-07aa92478cfda86230a1.js", null ),
    29     'googlesitekit-adminbar'                               => array( "googlesitekit-adminbar-fcca725e4c9a48e538d5.js", null ),
    30     'googlesitekit-api'                                    => array( "googlesitekit-api-550ec631080ecbe7ce31.js", null ),
    31     'googlesitekit-components'                             => array( array( "googlesitekit-components-gm2-a91f1bfdcda7a0646201.js", null ), array( "googlesitekit-components-gm3-92f85ea47675d14ac5a9.js", null ) ),
    32     'googlesitekit-data'                                   => array( "googlesitekit-data-3b542d543c8681a7a9e3.js", null ),
    33     'googlesitekit-datastore-forms'                        => array( "googlesitekit-datastore-forms-d15515ec8ecd21094314.js", null ),
    34     'googlesitekit-datastore-location'                     => array( "googlesitekit-datastore-location-0ee8a906c521ba57df31.js", null ),
    35     'googlesitekit-datastore-site'                         => array( "googlesitekit-datastore-site-a25b86aff61d95d576a3.js", null ),
    36     'googlesitekit-datastore-ui'                           => array( "googlesitekit-datastore-ui-9a25027ace7928ab86b9.js", null ),
    37     'googlesitekit-datastore-user'                         => array( "googlesitekit-datastore-user-b38448e1fcd4332aa61c.js", null ),
    38     'googlesitekit-entity-dashboard'                       => array( "googlesitekit-entity-dashboard-67d78978f4d8c2fad7c0.js", null ),
    39     'googlesitekit-main-dashboard'                         => array( "googlesitekit-main-dashboard-bbebf70a79bf05241779.js", null ),
    40     'googlesitekit-modules'                                => array( "googlesitekit-modules-e54ee0e6062c26eda49b.js", null ),
    41     'googlesitekit-modules-ads'                            => array( "googlesitekit-modules-ads-75ac41046f9adbce2571.js", null ),
    42     'googlesitekit-modules-adsense'                        => array( "googlesitekit-modules-adsense-0fd44e647615023ac8a3.js", null ),
    43     'googlesitekit-modules-analytics-4'                    => array( "googlesitekit-modules-analytics-4-c82d34b549c6c79ba517.js", null ),
    44     'googlesitekit-modules-pagespeed-insights'             => array( "googlesitekit-modules-pagespeed-insights-fce99a8e14c7bd34f67d.js", null ),
    45     'googlesitekit-modules-reader-revenue-manager'         => array( "googlesitekit-modules-reader-revenue-manager-02102cd465618974bb9a.js", null ),
    46     'googlesitekit-modules-search-console'                 => array( "googlesitekit-modules-search-console-4deafb9b987583dafc26.js", null ),
    47     'googlesitekit-modules-sign-in-with-google'            => array( "googlesitekit-modules-sign-in-with-google-61eee54b7d2d4b48180c.js", null ),
    48     'googlesitekit-modules-tagmanager'                     => array( "googlesitekit-modules-tagmanager-6341f3bb0c704bcf9dea.js", null ),
    49     'googlesitekit-notifications'                          => array( "googlesitekit-notifications-1908f486d9b5a90e3d79.js", null ),
    50     'googlesitekit-polyfills'                              => array( "googlesitekit-polyfills-538dfc56ccc5d6d72b6b.js", null ),
    51     'googlesitekit-settings'                               => array( "googlesitekit-settings-e3abad624d460d009b28.js", null ),
    52     'googlesitekit-splash'                                 => array( "googlesitekit-splash-c4a2084b4a7105a3a920.js", null ),
    53     'googlesitekit-user-input'                             => array( "googlesitekit-user-input-d122cd12eb3e12bfad95.js", null ),
    54     'googlesitekit-widgets'                                => array( "googlesitekit-widgets-7e5164737bb2a867290a.js", null ),
    55     'googlesitekit-wp-dashboard'                           => array( "googlesitekit-wp-dashboard-07f79d1ebe9f6aaea97b.js", null ),
     25    'googlesitekit-vendor'                                 => array( "googlesitekit-vendor-4d044ab3174d0ebe0182.js", null ),
     26    'googlesitekit-runtime'                                => array( "runtime-bb96f829f907209ffda1.js", null ),
     27    'googlesitekit-activation'                             => array( "googlesitekit-activation-ed0be8e05c8445117d68.js", null ),
     28    'googlesitekit-ad-blocking-recovery'                   => array( "googlesitekit-ad-blocking-recovery-bac12d5a33b1738be7e5.js", null ),
     29    'googlesitekit-adminbar'                               => array( "googlesitekit-adminbar-f63502a9e16eba2d3a24.js", null ),
     30    'googlesitekit-api'                                    => array( "googlesitekit-api-9e2fcff7f55d4e9bc071.js", null ),
     31    'googlesitekit-components'                             => array( array( "googlesitekit-components-gm2-02204568db0ea0d3e4d9.js", null ), array( "googlesitekit-components-gm3-0ac62e8c257835cf28be.js", null ) ),
     32    'googlesitekit-data'                                   => array( "googlesitekit-data-e29581d36f03119464dc.js", null ),
     33    'googlesitekit-datastore-forms'                        => array( "googlesitekit-datastore-forms-1d9bab25fba50f7bbe46.js", null ),
     34    'googlesitekit-datastore-location'                     => array( "googlesitekit-datastore-location-035aa2e981ced3a1908d.js", null ),
     35    'googlesitekit-datastore-site'                         => array( "googlesitekit-datastore-site-d596bb3b0518878762fd.js", null ),
     36    'googlesitekit-datastore-ui'                           => array( "googlesitekit-datastore-ui-b106f0c75f948026edd8.js", null ),
     37    'googlesitekit-datastore-user'                         => array( "googlesitekit-datastore-user-ac6b98e703a23e319e20.js", null ),
     38    'googlesitekit-entity-dashboard'                       => array( "googlesitekit-entity-dashboard-d2ff6aa4d5c95f0deb72.js", null ),
     39    'googlesitekit-main-dashboard'                         => array( "googlesitekit-main-dashboard-0b636fcff538becb7916.js", null ),
     40    'googlesitekit-modules'                                => array( "googlesitekit-modules-4267bcb41e38c4d5e5a1.js", null ),
     41    'googlesitekit-modules-ads'                            => array( "googlesitekit-modules-ads-2263881324b99ceb1f28.js", null ),
     42    'googlesitekit-modules-adsense'                        => array( "googlesitekit-modules-adsense-f86f7200ac1bc50cf810.js", null ),
     43    'googlesitekit-modules-analytics-4'                    => array( "googlesitekit-modules-analytics-4-4009bb8cb132293a5bb9.js", null ),
     44    'googlesitekit-modules-pagespeed-insights'             => array( "googlesitekit-modules-pagespeed-insights-219b81701f6b7fee7053.js", null ),
     45    'googlesitekit-modules-reader-revenue-manager'         => array( "googlesitekit-modules-reader-revenue-manager-d908e84a9a6586252f5b.js", null ),
     46    'googlesitekit-modules-search-console'                 => array( "googlesitekit-modules-search-console-b4cac6fc4343ccade9ae.js", null ),
     47    'googlesitekit-modules-sign-in-with-google'            => array( "googlesitekit-modules-sign-in-with-google-6082786dae41021169e1.js", null ),
     48    'googlesitekit-modules-tagmanager'                     => array( "googlesitekit-modules-tagmanager-3dc6f2423126a83b5a85.js", null ),
     49    'googlesitekit-notifications'                          => array( "googlesitekit-notifications-6781e88cb55cb5ebf14e.js", null ),
     50    'googlesitekit-polyfills'                              => array( "googlesitekit-polyfills-c7782d0314a0ffd50e4a.js", null ),
     51    'googlesitekit-settings'                               => array( "googlesitekit-settings-8ac962bf1feaf5d4489c.js", null ),
     52    'googlesitekit-splash'                                 => array( "googlesitekit-splash-3144820cea660ae97c34.js", null ),
     53    'googlesitekit-user-input'                             => array( "googlesitekit-user-input-e531bbf54dac394ce48a.js", null ),
     54    'googlesitekit-widgets'                                => array( "googlesitekit-widgets-fa5003427f3a78b0b50c.js", null ),
     55    'googlesitekit-wp-dashboard'                           => array( "googlesitekit-wp-dashboard-b8c192cbc37779589697.js", null ),
    5656);
  • google-site-kit/tags/1.139.0/google-site-kit.php

    r3173125 r3181737  
    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.138.0
     14 * Version:           1.139.0
    1515 * Requires at least: 5.2
    1616 * Requires PHP:      7.4
     
    2727
    2828// Define most essential constants.
    29 define( 'GOOGLESITEKIT_VERSION', '1.138.0' );
     29define( 'GOOGLESITEKIT_VERSION', '1.139.0' );
    3030define( 'GOOGLESITEKIT_PLUGIN_MAIN_FILE', __FILE__ );
    3131define( 'GOOGLESITEKIT_PHP_MINIMUM', '7.4.0' );
  • google-site-kit/tags/1.139.0/includes/Core/Conversion_Tracking/Conversion_Event_Providers/WooCommerce.php

    r3127664 r3181737  
    9595
    9696                // Don't output the script tag if the order key is invalid.
    97                 if ( ! $order->key_is_valid( $order_key ) ) {
     97                if ( ! $order->key_is_valid( (string) $order_key ) ) {
    9898                    return;
    9999                }
  • google-site-kit/tags/1.139.0/includes/Modules/Analytics_4.php

    r3173125 r3181737  
    224224        if ( Feature_Flags::enabled( 'conversionReporting' ) ) {
    225225            $conversion_reporting_provider = new Conversion_Reporting_Provider(
     226                $this->context,
    226227                $this->settings,
    227228                $this->user_options,
     
    342343        if ( Feature_Flags::enabled( 'audienceSegmentation' ) ) {
    343344            add_filter( 'googlesitekit_inline_modules_data', $this->get_method_proxy( 'inline_resource_availability_dates_data' ) );
     345        }
     346
     347        if ( Feature_Flags::enabled( 'conversionReporting' ) ) {
     348            add_filter( 'googlesitekit_inline_modules_data', $this->get_method_proxy( 'inline_conversion_reporting_events_detection' ), 15 );
    344349        }
    345350
     
    16721677            case 'POST:clear-conversion-reporting-new-events':
    16731678                return function () {
    1674                     return $this->transients->delete( 'googlesitekit_conversion_reporting_detected_events' );
     1679                    return $this->transients->delete( Conversion_Reporting_Events_Sync::DETECTED_EVENTS_TRANSIENT );
    16751680                };
    16761681            case 'POST:clear-conversion-reporting-lost-events':
    16771682                return function () {
    1678                     return $this->transients->delete( 'googlesitekit_conversion_reporting_lost_events' );
     1683                    return $this->transients->delete( Conversion_Reporting_Events_Sync::LOST_EVENTS_TRANSIENT );
    16791684                };
    16801685        }
     
    25852590        return wp_list_pluck( $site_kit_audiences, 'displayName' );
    25862591    }
     2592
     2593    /**
     2594     * Populates conversion reporting event data to pass to JS via _googlesitekitModulesData.
     2595     *
     2596     * @since 1.139.0
     2597     *
     2598     * @param array $modules_data Inline modules data.
     2599     * @return array Inline modules data.
     2600     */
     2601    public function inline_conversion_reporting_events_detection( $modules_data ) {
     2602        if ( ! $this->is_connected() ) {
     2603            return $modules_data;
     2604        }
     2605
     2606        $detected_events                           = $this->transients->get( Conversion_Reporting_Events_Sync::DETECTED_EVENTS_TRANSIENT );
     2607        $lost_events                               = $this->transients->get( Conversion_Reporting_Events_Sync::LOST_EVENTS_TRANSIENT );
     2608        $modules_data['analytics-4']['newEvents']  = is_array( $detected_events ) ? $detected_events : array();
     2609        $modules_data['analytics-4']['lostEvents'] = is_array( $lost_events ) ? $lost_events : array();
     2610
     2611        return $modules_data;
     2612    }
    25872613}
  • google-site-kit/tags/1.139.0/includes/Modules/Analytics_4/Conversion_Reporting/Conversion_Reporting_Events_Sync.php

    r3148853 r3181737  
    1313use Google\Site_Kit\Modules\Analytics_4;
    1414use Google\Site_Kit\Modules\Analytics_4\Settings;
     15use Google\Site_Kit\Core\Storage\Transients;
     16use Google\Site_Kit\Context;
    1517
    1618/**
     
    2224 */
    2325class Conversion_Reporting_Events_Sync {
     26
     27    /**
     28     * The detected events transient name.
     29     */
     30    public const DETECTED_EVENTS_TRANSIENT = 'googlesitekit_conversion_reporting_detected_events';
     31
     32    /**
     33     * The lost events transient name.
     34     */
     35    public const LOST_EVENTS_TRANSIENT = 'googlesitekit_conversion_reporting_lost_events';
    2436
    2537    const EVENT_NAMES = array(
     
    4658
    4759    /**
     60     * Transients instance.
     61     *
     62     * @since 1.139.0
     63     * @var Transients
     64     */
     65    protected $transients;
     66
     67    /**
    4868     * Constructor.
    4969     *
    5070     * @since 1.135.0
     71     * @since 1.139.0 Added $context param to constructor.
    5172     *
     73     * @param Context     $context   Plugin context.
    5274     * @param Settings    $settings  Settings module settings instance.
    5375     * @param Analytics_4 $analytics Analytics 4 module instance.
    5476     */
    5577    public function __construct(
     78        Context $context,
    5679        Settings $settings,
    5780        Analytics_4 $analytics
    5881    ) {
    59         $this->settings  = $settings;
    60         $this->analytics = $analytics;
     82        $this->settings   = $settings;
     83        $this->analytics  = $analytics;
     84        $this->transients = new Transients( $context );
    6185    }
    6286
     
    7498        }
    7599
     100        // Get current stored detected events.
     101        $settings              = $this->settings->get();
     102        $saved_detected_events = isset( $settings['detectedEvents'] ) ? $settings['detectedEvents'] : array();
     103
    76104        // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
    77105        if ( empty( $report->rowCount ) ) {
    78106            $this->settings->merge( array( 'detectedEvents' => array() ) );
     107
     108            $this->transients->delete( self::DETECTED_EVENTS_TRANSIENT );
     109
     110            if ( ! empty( $saved_detected_events ) ) {
     111                $this->transients->set( self::LOST_EVENTS_TRANSIENT, $saved_detected_events );
     112            }
    79113
    80114            return;
     
    83117        foreach ( $report->rows as $row ) {
    84118            $detected_events[] = $row['dimensionValues'][0]['value'];
     119        }
     120
     121        $new_events  = array_diff( $detected_events, $saved_detected_events );
     122        $lost_events = array_diff( $saved_detected_events, $detected_events );
     123
     124        if ( ! empty( $new_events ) ) {
     125            $this->transients->set( self::DETECTED_EVENTS_TRANSIENT, array_values( $new_events ) );
     126        }
     127
     128        if ( ! empty( $lost_events ) ) {
     129            $this->transients->set( self::LOST_EVENTS_TRANSIENT, array_values( $lost_events ) );
     130        }
     131
     132        if ( empty( $saved_detected_events ) ) {
     133            $this->transients->set( self::DETECTED_EVENTS_TRANSIENT, $detected_events );
    85134        }
    86135
  • google-site-kit/tags/1.139.0/includes/Modules/Analytics_4/Conversion_Reporting/Conversion_Reporting_Provider.php

    r3148853 r3181737  
    1111namespace Google\Site_Kit\Modules\Analytics_4\Conversion_Reporting;
    1212
     13use Google\Site_Kit\Context;
    1314use Google\Site_Kit\Core\Storage\User_Options;
    1415use Google\Site_Kit\Modules\Analytics_4;
     
    5657     *
    5758     * @since 1.135.0
     59     * @since 1.139.0 Added Context to constructor.
    5860     *
     61     * @param Context      $context      Plugin context.
    5962     * @param Settings     $settings     Settings instance.
    6063     * @param User_Options $user_options User_Options instance.
     
    6265     */
    6366    public function __construct(
     67        Context $context,
    6468        Settings $settings,
    6569        User_Options $user_options,
     
    6973        $this->analytics    = $analytics;
    7074
    71         $this->events_sync = new Conversion_Reporting_Events_Sync( $settings, $this->analytics );
     75        $this->events_sync = new Conversion_Reporting_Events_Sync( $context, $settings, $this->analytics );
    7276        $this->cron        = new Conversion_Reporting_Cron( fn() => $this->cron_callback() );
    7377    }
  • google-site-kit/tags/1.139.0/includes/Modules/Analytics_4/Report/RequestHelpers.php

    r3156474 r3181737  
    204204            array(
    205205                'activeUsers',
     206                'addToCarts',
    206207                'averageSessionDuration',
    207208                'bounceRate',
    208209                'conversions',
     210                'ecommercePurchases',
    209211                'engagedSessions',
    210212                'engagementRate',
     213                'eventCount',
    211214                'screenPageViews',
    212215                'screenPageViewsPerSession',
     
    275278                'date',
    276279                'deviceCategory',
     280                'eventName',
    277281                'newVsReturning',
    278282                'pagePath',
  • google-site-kit/tags/1.139.0/includes/Modules/Analytics_4/Settings.php

    r3164469 r3181737  
    7474            'availableAudiences',
    7575            'audienceSegmentationSetupCompletedBy',
     76            'detectedEvents',
    7677        );
    7778    }
  • google-site-kit/tags/1.139.0/includes/Modules/Sign_In_With_Google.php

    r3164469 r3181737  
    1818use Google\Site_Kit\Core\Modules\Module_With_Settings;
    1919use Google\Site_Kit\Core\Modules\Module_With_Settings_Trait;
     20use Google\Site_Kit\Core\Util\Method_Proxy_Trait;
    2021use Google\Site_Kit\Modules\Sign_In_With_Google\Settings;
    2122
     
    2930final class Sign_In_With_Google extends Module implements Module_With_Assets, Module_With_Settings, Module_With_Deactivation {
    3031
     32    use Method_Proxy_Trait;
    3133    use Module_With_Assets_Trait;
    3234    use Module_With_Settings_Trait;
     
    4345     */
    4446    public function register() {
     47        add_action( 'login_form', $this->get_method_proxy( 'render_signin_button' ) );
    4548    }
    4649
     
    108111        return new Settings( $this->options );
    109112    }
     113
     114    /**
     115     * Checks whether the module is connected.
     116     *
     117     * A module being connected means that all steps required as part of its activation are completed.
     118     *
     119     * @since 1.139.0
     120     *
     121     * @return bool True if module is connected, false otherwise.
     122     */
     123    public function is_connected() {
     124        $options = $this->get_settings()->get();
     125
     126        if ( empty( $options['clientID'] ) ) {
     127            return false;
     128        }
     129
     130        return parent::is_connected();
     131    }
     132
     133    /**
     134     * Renders the sign in button.
     135     *
     136     * @since 1.139.0
     137     */
     138    private function render_signin_button() {
     139        $settings = $this->get_settings()->get();
     140        if ( ! $settings['clientID'] ) {
     141            return;
     142        }
     143
     144        $redirect_url = site_url( '/auth/google' );
     145        if ( substr( $redirect_url, 0, 5 ) !== 'https' ) {
     146            return;
     147        }
     148
     149        // Render the Sign in with Google button and related inline styles.
     150        ?>
     151<!-- <?php echo esc_html__( 'Sign in with Google button added by Site Kit', 'google-site-kit' ); ?> -->
     152<?php /* phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript */ ?>
     153<script src="https://accounts.google.com/gsi/client"></script>
     154<script>
     155( () => {
     156    google.accounts.id.initialize({
     157        client_id: '<?php echo esc_js( $settings['clientID'] ); ?>',
     158        login_uri: '<?php echo esc_js( $redirect_url ); ?>',
     159    });
     160    const parent = document.createElement( 'div' );
     161    document.getElementById( 'login').insertBefore( parent, document.getElementById( 'loginform' ) );
     162    google.accounts.id.renderButton(parent, {
     163        theme: '<?php echo esc_js( $settings['theme'] ); ?>',
     164        text: '<?php echo esc_js( $settings['text'] ); ?>',
     165        shape: '<?php echo esc_js( $settings['shape'] ); ?>'
     166    });
     167} )();
     168</script>
     169<!-- <?php echo esc_html__( 'End Sign in with Google button added by Site Kit', 'google-site-kit' ); ?> -->
     170        <?php
     171    }
    110172}
  • google-site-kit/tags/1.139.0/includes/Modules/Sign_In_With_Google/Settings.php

    r3173125 r3181737  
    2424    const OPTION = 'googlesitekit_sign-in-with-google_settings';
    2525
    26     const TEXT_CONTINUE_WITH_GOOGLE = 'Continue with Google';
    27     const TEXT_SIGN_IN              = 'Sign in';
    28     const TEXT_SIGN_IN_WITH_GOOGLE  = 'Sign in with Google';
    29     const TEXT_SIGN_UP_WITH_GOOGLE  = 'Sign up with Google';
     26    const TEXT_CONTINUE_WITH_GOOGLE = 'continue_with';
     27    const TEXT_SIGN_IN              = 'signin';
     28    const TEXT_SIGN_IN_WITH_GOOGLE  = 'signin_with';
     29    const TEXT_SIGN_UP_WITH_GOOGLE  = 'signup_with';
    3030
    31     const THEME_LIGHT   = 'light';
    32     const THEME_NEUTRAL = 'neutral';
    33     const THEME_DARK    = 'dark';
     31    const THEME_LIGHT   = 'outline';
     32    const THEME_NEUTRAL = 'filled_blue';
     33    const THEME_DARK    = 'filled_black';
    3434
    3535    const SHAPE_RECTANGULAR = 'rectangular';
     
    4545    protected function get_default() {
    4646        return array(
    47             'clientID' => '',
    48             'text'     => self::TEXT_SIGN_IN_WITH_GOOGLE,
    49             'theme'    => self::THEME_LIGHT,
    50             'shape'    => self::SHAPE_RECTANGULAR,
     47            'clientID'      => '',
     48            'text'          => self::TEXT_SIGN_IN_WITH_GOOGLE,
     49            'theme'         => self::THEME_LIGHT,
     50            'shape'         => self::SHAPE_RECTANGULAR,
     51            'oneTapEnabled' => false,
    5152        );
    5253    }
     
    105106            }
    106107
     108            if ( isset( $option['oneTapEnabled'] ) ) {
     109                $option['oneTapEnabled'] = (bool) $option['oneTapEnabled'];
     110            }
     111
    107112            return $option;
    108113        };
  • google-site-kit/tags/1.139.0/readme.txt

    r3173125 r3181737  
    33Contributors:      google
    44Requires at least: 5.2
    5 Tested up to:      6.6
     5Tested up to:      6.7
    66Requires PHP:      7.4
    7 Stable tag:        1.138.0
     7Stable tag:        1.139.0
    88License:           Apache License 2.0
    99License URI:       https://www.apache.org/licenses/LICENSE-2.0
     
    110110== Changelog ==
    111111
    112 = 1.138.0 =
     112= 1.139.0 =
    113113
    114114**Added**
    115115
    116 * Add datastore infrastructure for Sign in With Google settings. See [#9480](https://github.com/google/site-kit-wp/issues/9480).
    117 * Add Sign in with Google module settings. See [#9333](https://github.com/google/site-kit-wp/issues/9333).
     116* Add the Google sign-in button to the login screen. See [#9337](https://github.com/google/site-kit-wp/issues/9337).
     117* Add Top Device Driving Purchases Key Metric Widget. See [#9162](https://github.com/google/site-kit-wp/issues/9162).
    118118
    119119**Enhanced**
    120120
    121 * Update the RRM setup CTA copy to explicitly mention that subscriptions aren't available yet as part of the integration. See [#9524](https://github.com/google/site-kit-wp/issues/9524).
    122 * Update the Audience Segmentation support documentation "learn more" link in the tooltip for an Audience Tile. See [#9455](https://github.com/google/site-kit-wp/issues/9455).
    123 * Update tailored metrics to also include new ACR metrics. See [#9437](https://github.com/google/site-kit-wp/issues/9437).
    124 * Disallow manual Ads Conversion ID entry when using the Partner Ads Experience. See [#9426](https://github.com/google/site-kit-wp/issues/9426).
    125 * Update copy text in Google Ads module when Partner Ads Experience is enabled. See [#9425](https://github.com/google/site-kit-wp/issues/9425).
    126 * Fix OAuth error handling when attempting to create a custom dimension from the "Top content" metric area in an Audience Tile. See [#9350](https://github.com/google/site-kit-wp/issues/9350).
    127 * Update Analytics setup to support any number of accounts. See [#9348](https://github.com/google/site-kit-wp/issues/9348).
    128 * Implement the ability to dismiss detected and lost events information in the Analytics module. See [#9343](https://github.com/google/site-kit-wp/issues/9343).
    129 * Refactor the setup success subtle notification for Audience Segmentation. See [#9281](https://github.com/google/site-kit-wp/issues/9281).
    130 * Increase maximum Key Metric Widget selection count to 8. See [#9135](https://github.com/google/site-kit-wp/issues/9135).
    131 * Update the Reader Revenue Manager setup success notification to use the new notifications datastore. See [#8981](https://github.com/google/site-kit-wp/issues/8981).
    132 * Update the design of the Key Metrics setup CTA banner. See [#8895](https://github.com/google/site-kit-wp/issues/8895).
    133 * Improve UI/UX on AdSense alerts. See [#7642](https://github.com/google/site-kit-wp/issues/7642).
     121* Add GA event tracking for user interactions with the No Audiences Banner and Info Notice. See [#9496](https://github.com/google/site-kit-wp/issues/9496).
     122* Add opt-in event tracking for an audience tile's "Top content" metric area. See [#9495](https://github.com/google/site-kit-wp/issues/9495).
     123* Add Dashboard Sharing support to Analytics Conversion Reporting tiles. See [#9377](https://github.com/google/site-kit-wp/issues/9377).
     124* Improved the design of the User Input Questionnaire. See [#9374](https://github.com/google/site-kit-wp/issues/9374).
     125* Update requirement checks for notifications to have all selectors resolved correctly and efficiently. See [#9351](https://github.com/google/site-kit-wp/issues/9351).
     126* Update conversion reporting events synchronization to save detected and lost events. See [#9342](https://github.com/google/site-kit-wp/issues/9342).
     127* Add the setup form for the Sign in With Google module. See [#9336](https://github.com/google/site-kit-wp/issues/9336).
     128* Implement the ability to edit Sign in With Google settings. See [#9334](https://github.com/google/site-kit-wp/issues/9334).
    134129
    135130**Fixed**
    136131
    137 * Prevent audience settings from being deleted when changing or disconnecting the Analytics property. Reset `configuredAudiences` and `didSetAudiences` to default values while keeping `isAudienceSegmentationWidgetHidden` unchanged. See [#9432](https://github.com/google/site-kit-wp/issues/9432).
    138 * Improve the availability of the audience widget for secondary administrators. See [#9411](https://github.com/google/site-kit-wp/issues/9411).
    139 * Fix VRT test failures in CI when launching Chromium, ensuring tests run to completion without errors. See [#9406](https://github.com/google/site-kit-wp/issues/9406).
    140 * Ensure the error style for the Settings edit screen is cleared when settings are saved successfully. See [#8481](https://github.com/google/site-kit-wp/issues/8481).
     132* Fix an issue that caused the visitor groups overlay notification to appear unexpectedly. See [#9481](https://github.com/google/site-kit-wp/issues/9481).
     133* Ensure the "Purchasers" default audience can be added to the audience selection when initially setting up the Audience Segmentation feature under the right conditions. See [#9478](https://github.com/google/site-kit-wp/issues/9478).
     134* Prevent rendering of the Audience Selection Panel before the feature is set up, ensuring it only renders after setup is complete. See [#9475](https://github.com/google/site-kit-wp/issues/9475).
     135* Ensure partial data badges display correctly when the connected Analytics property is in the partial data state. See [#9474](https://github.com/google/site-kit-wp/issues/9474).
     136* Fix an issue that caused the visitor groups visibility toggle to appear when the feature wasn't yet set up. See [#9473](https://github.com/google/site-kit-wp/issues/9473).
     137* Handle insufficient permission errors correctly when attempting to create audiences via the Audience Segmentation Setup CTA Banner. See [#9471](https://github.com/google/site-kit-wp/issues/9471).
     138* Prevent console errors appearing when visiting the dashboard as a secondary admin or view-only user after the Audience Segmentation feature has been set up. See [#9445](https://github.com/google/site-kit-wp/issues/9445).
    141139
    142140[See changelog for all versions](https://raw.githubusercontent.com/google/site-kit-wp/main/changelog.txt).
  • google-site-kit/trunk/dist/manifest.php

    r3173125 r3181737  
    1919    'analytics-advanced-tracking'                          => array( "analytics-advanced-tracking-ea84b2c367b69f5c094b.js", null ),
    2020    'googlesitekit-i18n'                                   => array( "googlesitekit-i18n-33cdd2dee5d1d1f4fb34.js", null ),
    21     'googlesitekit-admin-css'                              => array( "googlesitekit-admin-css-0cf0cf71d3ac64918b65.min.css", null ),
     21    'googlesitekit-admin-css'                              => array( "googlesitekit-admin-css-9fc9d94050fa65d174be.min.css", null ),
    2222    'googlesitekit-adminbar-css'                           => array( "googlesitekit-adminbar-css-6db776544b37175be17f.min.css", null ),
    2323    'googlesitekit-authorize-application-css'              => array( "googlesitekit-authorize-application-css-ce25e97404abc5a02921.min.css", null ),
    2424    'googlesitekit-wp-dashboard-css'                       => array( "googlesitekit-wp-dashboard-css-c5417a27cb905717f9fc.min.css", null ),
    25     'googlesitekit-vendor'                                 => array( "googlesitekit-vendor-cca22bcdeb2e1252b20a.js", null ),
    26     'googlesitekit-runtime'                                => array( "runtime-62d30aa4dfe99a234168.js", null ),
    27     'googlesitekit-activation'                             => array( "googlesitekit-activation-92b68a64f8c49de241af.js", null ),
    28     'googlesitekit-ad-blocking-recovery'                   => array( "googlesitekit-ad-blocking-recovery-07aa92478cfda86230a1.js", null ),
    29     'googlesitekit-adminbar'                               => array( "googlesitekit-adminbar-fcca725e4c9a48e538d5.js", null ),
    30     'googlesitekit-api'                                    => array( "googlesitekit-api-550ec631080ecbe7ce31.js", null ),
    31     'googlesitekit-components'                             => array( array( "googlesitekit-components-gm2-a91f1bfdcda7a0646201.js", null ), array( "googlesitekit-components-gm3-92f85ea47675d14ac5a9.js", null ) ),
    32     'googlesitekit-data'                                   => array( "googlesitekit-data-3b542d543c8681a7a9e3.js", null ),
    33     'googlesitekit-datastore-forms'                        => array( "googlesitekit-datastore-forms-d15515ec8ecd21094314.js", null ),
    34     'googlesitekit-datastore-location'                     => array( "googlesitekit-datastore-location-0ee8a906c521ba57df31.js", null ),
    35     'googlesitekit-datastore-site'                         => array( "googlesitekit-datastore-site-a25b86aff61d95d576a3.js", null ),
    36     'googlesitekit-datastore-ui'                           => array( "googlesitekit-datastore-ui-9a25027ace7928ab86b9.js", null ),
    37     'googlesitekit-datastore-user'                         => array( "googlesitekit-datastore-user-b38448e1fcd4332aa61c.js", null ),
    38     'googlesitekit-entity-dashboard'                       => array( "googlesitekit-entity-dashboard-67d78978f4d8c2fad7c0.js", null ),
    39     'googlesitekit-main-dashboard'                         => array( "googlesitekit-main-dashboard-bbebf70a79bf05241779.js", null ),
    40     'googlesitekit-modules'                                => array( "googlesitekit-modules-e54ee0e6062c26eda49b.js", null ),
    41     'googlesitekit-modules-ads'                            => array( "googlesitekit-modules-ads-75ac41046f9adbce2571.js", null ),
    42     'googlesitekit-modules-adsense'                        => array( "googlesitekit-modules-adsense-0fd44e647615023ac8a3.js", null ),
    43     'googlesitekit-modules-analytics-4'                    => array( "googlesitekit-modules-analytics-4-c82d34b549c6c79ba517.js", null ),
    44     'googlesitekit-modules-pagespeed-insights'             => array( "googlesitekit-modules-pagespeed-insights-fce99a8e14c7bd34f67d.js", null ),
    45     'googlesitekit-modules-reader-revenue-manager'         => array( "googlesitekit-modules-reader-revenue-manager-02102cd465618974bb9a.js", null ),
    46     'googlesitekit-modules-search-console'                 => array( "googlesitekit-modules-search-console-4deafb9b987583dafc26.js", null ),
    47     'googlesitekit-modules-sign-in-with-google'            => array( "googlesitekit-modules-sign-in-with-google-61eee54b7d2d4b48180c.js", null ),
    48     'googlesitekit-modules-tagmanager'                     => array( "googlesitekit-modules-tagmanager-6341f3bb0c704bcf9dea.js", null ),
    49     'googlesitekit-notifications'                          => array( "googlesitekit-notifications-1908f486d9b5a90e3d79.js", null ),
    50     'googlesitekit-polyfills'                              => array( "googlesitekit-polyfills-538dfc56ccc5d6d72b6b.js", null ),
    51     'googlesitekit-settings'                               => array( "googlesitekit-settings-e3abad624d460d009b28.js", null ),
    52     'googlesitekit-splash'                                 => array( "googlesitekit-splash-c4a2084b4a7105a3a920.js", null ),
    53     'googlesitekit-user-input'                             => array( "googlesitekit-user-input-d122cd12eb3e12bfad95.js", null ),
    54     'googlesitekit-widgets'                                => array( "googlesitekit-widgets-7e5164737bb2a867290a.js", null ),
    55     'googlesitekit-wp-dashboard'                           => array( "googlesitekit-wp-dashboard-07f79d1ebe9f6aaea97b.js", null ),
     25    'googlesitekit-vendor'                                 => array( "googlesitekit-vendor-4d044ab3174d0ebe0182.js", null ),
     26    'googlesitekit-runtime'                                => array( "runtime-bb96f829f907209ffda1.js", null ),
     27    'googlesitekit-activation'                             => array( "googlesitekit-activation-ed0be8e05c8445117d68.js", null ),
     28    'googlesitekit-ad-blocking-recovery'                   => array( "googlesitekit-ad-blocking-recovery-bac12d5a33b1738be7e5.js", null ),
     29    'googlesitekit-adminbar'                               => array( "googlesitekit-adminbar-f63502a9e16eba2d3a24.js", null ),
     30    'googlesitekit-api'                                    => array( "googlesitekit-api-9e2fcff7f55d4e9bc071.js", null ),
     31    'googlesitekit-components'                             => array( array( "googlesitekit-components-gm2-02204568db0ea0d3e4d9.js", null ), array( "googlesitekit-components-gm3-0ac62e8c257835cf28be.js", null ) ),
     32    'googlesitekit-data'                                   => array( "googlesitekit-data-e29581d36f03119464dc.js", null ),
     33    'googlesitekit-datastore-forms'                        => array( "googlesitekit-datastore-forms-1d9bab25fba50f7bbe46.js", null ),
     34    'googlesitekit-datastore-location'                     => array( "googlesitekit-datastore-location-035aa2e981ced3a1908d.js", null ),
     35    'googlesitekit-datastore-site'                         => array( "googlesitekit-datastore-site-d596bb3b0518878762fd.js", null ),
     36    'googlesitekit-datastore-ui'                           => array( "googlesitekit-datastore-ui-b106f0c75f948026edd8.js", null ),
     37    'googlesitekit-datastore-user'                         => array( "googlesitekit-datastore-user-ac6b98e703a23e319e20.js", null ),
     38    'googlesitekit-entity-dashboard'                       => array( "googlesitekit-entity-dashboard-d2ff6aa4d5c95f0deb72.js", null ),
     39    'googlesitekit-main-dashboard'                         => array( "googlesitekit-main-dashboard-0b636fcff538becb7916.js", null ),
     40    'googlesitekit-modules'                                => array( "googlesitekit-modules-4267bcb41e38c4d5e5a1.js", null ),
     41    'googlesitekit-modules-ads'                            => array( "googlesitekit-modules-ads-2263881324b99ceb1f28.js", null ),
     42    'googlesitekit-modules-adsense'                        => array( "googlesitekit-modules-adsense-f86f7200ac1bc50cf810.js", null ),
     43    'googlesitekit-modules-analytics-4'                    => array( "googlesitekit-modules-analytics-4-4009bb8cb132293a5bb9.js", null ),
     44    'googlesitekit-modules-pagespeed-insights'             => array( "googlesitekit-modules-pagespeed-insights-219b81701f6b7fee7053.js", null ),
     45    'googlesitekit-modules-reader-revenue-manager'         => array( "googlesitekit-modules-reader-revenue-manager-d908e84a9a6586252f5b.js", null ),
     46    'googlesitekit-modules-search-console'                 => array( "googlesitekit-modules-search-console-b4cac6fc4343ccade9ae.js", null ),
     47    'googlesitekit-modules-sign-in-with-google'            => array( "googlesitekit-modules-sign-in-with-google-6082786dae41021169e1.js", null ),
     48    'googlesitekit-modules-tagmanager'                     => array( "googlesitekit-modules-tagmanager-3dc6f2423126a83b5a85.js", null ),
     49    'googlesitekit-notifications'                          => array( "googlesitekit-notifications-6781e88cb55cb5ebf14e.js", null ),
     50    'googlesitekit-polyfills'                              => array( "googlesitekit-polyfills-c7782d0314a0ffd50e4a.js", null ),
     51    'googlesitekit-settings'                               => array( "googlesitekit-settings-8ac962bf1feaf5d4489c.js", null ),
     52    'googlesitekit-splash'                                 => array( "googlesitekit-splash-3144820cea660ae97c34.js", null ),
     53    'googlesitekit-user-input'                             => array( "googlesitekit-user-input-e531bbf54dac394ce48a.js", null ),
     54    'googlesitekit-widgets'                                => array( "googlesitekit-widgets-fa5003427f3a78b0b50c.js", null ),
     55    'googlesitekit-wp-dashboard'                           => array( "googlesitekit-wp-dashboard-b8c192cbc37779589697.js", null ),
    5656);
  • google-site-kit/trunk/google-site-kit.php

    r3173125 r3181737  
    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.138.0
     14 * Version:           1.139.0
    1515 * Requires at least: 5.2
    1616 * Requires PHP:      7.4
     
    2727
    2828// Define most essential constants.
    29 define( 'GOOGLESITEKIT_VERSION', '1.138.0' );
     29define( 'GOOGLESITEKIT_VERSION', '1.139.0' );
    3030define( 'GOOGLESITEKIT_PLUGIN_MAIN_FILE', __FILE__ );
    3131define( 'GOOGLESITEKIT_PHP_MINIMUM', '7.4.0' );
  • google-site-kit/trunk/includes/Core/Conversion_Tracking/Conversion_Event_Providers/WooCommerce.php

    r3127664 r3181737  
    9595
    9696                // Don't output the script tag if the order key is invalid.
    97                 if ( ! $order->key_is_valid( $order_key ) ) {
     97                if ( ! $order->key_is_valid( (string) $order_key ) ) {
    9898                    return;
    9999                }
  • google-site-kit/trunk/includes/Modules/Analytics_4.php

    r3173125 r3181737  
    224224        if ( Feature_Flags::enabled( 'conversionReporting' ) ) {
    225225            $conversion_reporting_provider = new Conversion_Reporting_Provider(
     226                $this->context,
    226227                $this->settings,
    227228                $this->user_options,
     
    342343        if ( Feature_Flags::enabled( 'audienceSegmentation' ) ) {
    343344            add_filter( 'googlesitekit_inline_modules_data', $this->get_method_proxy( 'inline_resource_availability_dates_data' ) );
     345        }
     346
     347        if ( Feature_Flags::enabled( 'conversionReporting' ) ) {
     348            add_filter( 'googlesitekit_inline_modules_data', $this->get_method_proxy( 'inline_conversion_reporting_events_detection' ), 15 );
    344349        }
    345350
     
    16721677            case 'POST:clear-conversion-reporting-new-events':
    16731678                return function () {
    1674                     return $this->transients->delete( 'googlesitekit_conversion_reporting_detected_events' );
     1679                    return $this->transients->delete( Conversion_Reporting_Events_Sync::DETECTED_EVENTS_TRANSIENT );
    16751680                };
    16761681            case 'POST:clear-conversion-reporting-lost-events':
    16771682                return function () {
    1678                     return $this->transients->delete( 'googlesitekit_conversion_reporting_lost_events' );
     1683                    return $this->transients->delete( Conversion_Reporting_Events_Sync::LOST_EVENTS_TRANSIENT );
    16791684                };
    16801685        }
     
    25852590        return wp_list_pluck( $site_kit_audiences, 'displayName' );
    25862591    }
     2592
     2593    /**
     2594     * Populates conversion reporting event data to pass to JS via _googlesitekitModulesData.
     2595     *
     2596     * @since 1.139.0
     2597     *
     2598     * @param array $modules_data Inline modules data.
     2599     * @return array Inline modules data.
     2600     */
     2601    public function inline_conversion_reporting_events_detection( $modules_data ) {
     2602        if ( ! $this->is_connected() ) {
     2603            return $modules_data;
     2604        }
     2605
     2606        $detected_events                           = $this->transients->get( Conversion_Reporting_Events_Sync::DETECTED_EVENTS_TRANSIENT );
     2607        $lost_events                               = $this->transients->get( Conversion_Reporting_Events_Sync::LOST_EVENTS_TRANSIENT );
     2608        $modules_data['analytics-4']['newEvents']  = is_array( $detected_events ) ? $detected_events : array();
     2609        $modules_data['analytics-4']['lostEvents'] = is_array( $lost_events ) ? $lost_events : array();
     2610
     2611        return $modules_data;
     2612    }
    25872613}
  • google-site-kit/trunk/includes/Modules/Analytics_4/Conversion_Reporting/Conversion_Reporting_Events_Sync.php

    r3148853 r3181737  
    1313use Google\Site_Kit\Modules\Analytics_4;
    1414use Google\Site_Kit\Modules\Analytics_4\Settings;
     15use Google\Site_Kit\Core\Storage\Transients;
     16use Google\Site_Kit\Context;
    1517
    1618/**
     
    2224 */
    2325class Conversion_Reporting_Events_Sync {
     26
     27    /**
     28     * The detected events transient name.
     29     */
     30    public const DETECTED_EVENTS_TRANSIENT = 'googlesitekit_conversion_reporting_detected_events';
     31
     32    /**
     33     * The lost events transient name.
     34     */
     35    public const LOST_EVENTS_TRANSIENT = 'googlesitekit_conversion_reporting_lost_events';
    2436
    2537    const EVENT_NAMES = array(
     
    4658
    4759    /**
     60     * Transients instance.
     61     *
     62     * @since 1.139.0
     63     * @var Transients
     64     */
     65    protected $transients;
     66
     67    /**
    4868     * Constructor.
    4969     *
    5070     * @since 1.135.0
     71     * @since 1.139.0 Added $context param to constructor.
    5172     *
     73     * @param Context     $context   Plugin context.
    5274     * @param Settings    $settings  Settings module settings instance.
    5375     * @param Analytics_4 $analytics Analytics 4 module instance.
    5476     */
    5577    public function __construct(
     78        Context $context,
    5679        Settings $settings,
    5780        Analytics_4 $analytics
    5881    ) {
    59         $this->settings  = $settings;
    60         $this->analytics = $analytics;
     82        $this->settings   = $settings;
     83        $this->analytics  = $analytics;
     84        $this->transients = new Transients( $context );
    6185    }
    6286
     
    7498        }
    7599
     100        // Get current stored detected events.
     101        $settings              = $this->settings->get();
     102        $saved_detected_events = isset( $settings['detectedEvents'] ) ? $settings['detectedEvents'] : array();
     103
    76104        // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
    77105        if ( empty( $report->rowCount ) ) {
    78106            $this->settings->merge( array( 'detectedEvents' => array() ) );
     107
     108            $this->transients->delete( self::DETECTED_EVENTS_TRANSIENT );
     109
     110            if ( ! empty( $saved_detected_events ) ) {
     111                $this->transients->set( self::LOST_EVENTS_TRANSIENT, $saved_detected_events );
     112            }
    79113
    80114            return;
     
    83117        foreach ( $report->rows as $row ) {
    84118            $detected_events[] = $row['dimensionValues'][0]['value'];
     119        }
     120
     121        $new_events  = array_diff( $detected_events, $saved_detected_events );
     122        $lost_events = array_diff( $saved_detected_events, $detected_events );
     123
     124        if ( ! empty( $new_events ) ) {
     125            $this->transients->set( self::DETECTED_EVENTS_TRANSIENT, array_values( $new_events ) );
     126        }
     127
     128        if ( ! empty( $lost_events ) ) {
     129            $this->transients->set( self::LOST_EVENTS_TRANSIENT, array_values( $lost_events ) );
     130        }
     131
     132        if ( empty( $saved_detected_events ) ) {
     133            $this->transients->set( self::DETECTED_EVENTS_TRANSIENT, $detected_events );
    85134        }
    86135
  • google-site-kit/trunk/includes/Modules/Analytics_4/Conversion_Reporting/Conversion_Reporting_Provider.php

    r3148853 r3181737  
    1111namespace Google\Site_Kit\Modules\Analytics_4\Conversion_Reporting;
    1212
     13use Google\Site_Kit\Context;
    1314use Google\Site_Kit\Core\Storage\User_Options;
    1415use Google\Site_Kit\Modules\Analytics_4;
     
    5657     *
    5758     * @since 1.135.0
     59     * @since 1.139.0 Added Context to constructor.
    5860     *
     61     * @param Context      $context      Plugin context.
    5962     * @param Settings     $settings     Settings instance.
    6063     * @param User_Options $user_options User_Options instance.
     
    6265     */
    6366    public function __construct(
     67        Context $context,
    6468        Settings $settings,
    6569        User_Options $user_options,
     
    6973        $this->analytics    = $analytics;
    7074
    71         $this->events_sync = new Conversion_Reporting_Events_Sync( $settings, $this->analytics );
     75        $this->events_sync = new Conversion_Reporting_Events_Sync( $context, $settings, $this->analytics );
    7276        $this->cron        = new Conversion_Reporting_Cron( fn() => $this->cron_callback() );
    7377    }
  • google-site-kit/trunk/includes/Modules/Analytics_4/Report/RequestHelpers.php

    r3156474 r3181737  
    204204            array(
    205205                'activeUsers',
     206                'addToCarts',
    206207                'averageSessionDuration',
    207208                'bounceRate',
    208209                'conversions',
     210                'ecommercePurchases',
    209211                'engagedSessions',
    210212                'engagementRate',
     213                'eventCount',
    211214                'screenPageViews',
    212215                'screenPageViewsPerSession',
     
    275278                'date',
    276279                'deviceCategory',
     280                'eventName',
    277281                'newVsReturning',
    278282                'pagePath',
  • google-site-kit/trunk/includes/Modules/Analytics_4/Settings.php

    r3164469 r3181737  
    7474            'availableAudiences',
    7575            'audienceSegmentationSetupCompletedBy',
     76            'detectedEvents',
    7677        );
    7778    }
  • google-site-kit/trunk/includes/Modules/Sign_In_With_Google.php

    r3164469 r3181737  
    1818use Google\Site_Kit\Core\Modules\Module_With_Settings;
    1919use Google\Site_Kit\Core\Modules\Module_With_Settings_Trait;
     20use Google\Site_Kit\Core\Util\Method_Proxy_Trait;
    2021use Google\Site_Kit\Modules\Sign_In_With_Google\Settings;
    2122
     
    2930final class Sign_In_With_Google extends Module implements Module_With_Assets, Module_With_Settings, Module_With_Deactivation {
    3031
     32    use Method_Proxy_Trait;
    3133    use Module_With_Assets_Trait;
    3234    use Module_With_Settings_Trait;
     
    4345     */
    4446    public function register() {
     47        add_action( 'login_form', $this->get_method_proxy( 'render_signin_button' ) );
    4548    }
    4649
     
    108111        return new Settings( $this->options );
    109112    }
     113
     114    /**
     115     * Checks whether the module is connected.
     116     *
     117     * A module being connected means that all steps required as part of its activation are completed.
     118     *
     119     * @since 1.139.0
     120     *
     121     * @return bool True if module is connected, false otherwise.
     122     */
     123    public function is_connected() {
     124        $options = $this->get_settings()->get();
     125
     126        if ( empty( $options['clientID'] ) ) {
     127            return false;
     128        }
     129
     130        return parent::is_connected();
     131    }
     132
     133    /**
     134     * Renders the sign in button.
     135     *
     136     * @since 1.139.0
     137     */
     138    private function render_signin_button() {
     139        $settings = $this->get_settings()->get();
     140        if ( ! $settings['clientID'] ) {
     141            return;
     142        }
     143
     144        $redirect_url = site_url( '/auth/google' );
     145        if ( substr( $redirect_url, 0, 5 ) !== 'https' ) {
     146            return;
     147        }
     148
     149        // Render the Sign in with Google button and related inline styles.
     150        ?>
     151<!-- <?php echo esc_html__( 'Sign in with Google button added by Site Kit', 'google-site-kit' ); ?> -->
     152<?php /* phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript */ ?>
     153<script src="https://accounts.google.com/gsi/client"></script>
     154<script>
     155( () => {
     156    google.accounts.id.initialize({
     157        client_id: '<?php echo esc_js( $settings['clientID'] ); ?>',
     158        login_uri: '<?php echo esc_js( $redirect_url ); ?>',
     159    });
     160    const parent = document.createElement( 'div' );
     161    document.getElementById( 'login').insertBefore( parent, document.getElementById( 'loginform' ) );
     162    google.accounts.id.renderButton(parent, {
     163        theme: '<?php echo esc_js( $settings['theme'] ); ?>',
     164        text: '<?php echo esc_js( $settings['text'] ); ?>',
     165        shape: '<?php echo esc_js( $settings['shape'] ); ?>'
     166    });
     167} )();
     168</script>
     169<!-- <?php echo esc_html__( 'End Sign in with Google button added by Site Kit', 'google-site-kit' ); ?> -->
     170        <?php
     171    }
    110172}
  • google-site-kit/trunk/includes/Modules/Sign_In_With_Google/Settings.php

    r3173125 r3181737  
    2424    const OPTION = 'googlesitekit_sign-in-with-google_settings';
    2525
    26     const TEXT_CONTINUE_WITH_GOOGLE = 'Continue with Google';
    27     const TEXT_SIGN_IN              = 'Sign in';
    28     const TEXT_SIGN_IN_WITH_GOOGLE  = 'Sign in with Google';
    29     const TEXT_SIGN_UP_WITH_GOOGLE  = 'Sign up with Google';
     26    const TEXT_CONTINUE_WITH_GOOGLE = 'continue_with';
     27    const TEXT_SIGN_IN              = 'signin';
     28    const TEXT_SIGN_IN_WITH_GOOGLE  = 'signin_with';
     29    const TEXT_SIGN_UP_WITH_GOOGLE  = 'signup_with';
    3030
    31     const THEME_LIGHT   = 'light';
    32     const THEME_NEUTRAL = 'neutral';
    33     const THEME_DARK    = 'dark';
     31    const THEME_LIGHT   = 'outline';
     32    const THEME_NEUTRAL = 'filled_blue';
     33    const THEME_DARK    = 'filled_black';
    3434
    3535    const SHAPE_RECTANGULAR = 'rectangular';
     
    4545    protected function get_default() {
    4646        return array(
    47             'clientID' => '',
    48             'text'     => self::TEXT_SIGN_IN_WITH_GOOGLE,
    49             'theme'    => self::THEME_LIGHT,
    50             'shape'    => self::SHAPE_RECTANGULAR,
     47            'clientID'      => '',
     48            'text'          => self::TEXT_SIGN_IN_WITH_GOOGLE,
     49            'theme'         => self::THEME_LIGHT,
     50            'shape'         => self::SHAPE_RECTANGULAR,
     51            'oneTapEnabled' => false,
    5152        );
    5253    }
     
    105106            }
    106107
     108            if ( isset( $option['oneTapEnabled'] ) ) {
     109                $option['oneTapEnabled'] = (bool) $option['oneTapEnabled'];
     110            }
     111
    107112            return $option;
    108113        };
  • google-site-kit/trunk/readme.txt

    r3173125 r3181737  
    33Contributors:      google
    44Requires at least: 5.2
    5 Tested up to:      6.6
     5Tested up to:      6.7
    66Requires PHP:      7.4
    7 Stable tag:        1.138.0
     7Stable tag:        1.139.0
    88License:           Apache License 2.0
    99License URI:       https://www.apache.org/licenses/LICENSE-2.0
     
    110110== Changelog ==
    111111
    112 = 1.138.0 =
     112= 1.139.0 =
    113113
    114114**Added**
    115115
    116 * Add datastore infrastructure for Sign in With Google settings. See [#9480](https://github.com/google/site-kit-wp/issues/9480).
    117 * Add Sign in with Google module settings. See [#9333](https://github.com/google/site-kit-wp/issues/9333).
     116* Add the Google sign-in button to the login screen. See [#9337](https://github.com/google/site-kit-wp/issues/9337).
     117* Add Top Device Driving Purchases Key Metric Widget. See [#9162](https://github.com/google/site-kit-wp/issues/9162).
    118118
    119119**Enhanced**
    120120
    121 * Update the RRM setup CTA copy to explicitly mention that subscriptions aren't available yet as part of the integration. See [#9524](https://github.com/google/site-kit-wp/issues/9524).
    122 * Update the Audience Segmentation support documentation "learn more" link in the tooltip for an Audience Tile. See [#9455](https://github.com/google/site-kit-wp/issues/9455).
    123 * Update tailored metrics to also include new ACR metrics. See [#9437](https://github.com/google/site-kit-wp/issues/9437).
    124 * Disallow manual Ads Conversion ID entry when using the Partner Ads Experience. See [#9426](https://github.com/google/site-kit-wp/issues/9426).
    125 * Update copy text in Google Ads module when Partner Ads Experience is enabled. See [#9425](https://github.com/google/site-kit-wp/issues/9425).
    126 * Fix OAuth error handling when attempting to create a custom dimension from the "Top content" metric area in an Audience Tile. See [#9350](https://github.com/google/site-kit-wp/issues/9350).
    127 * Update Analytics setup to support any number of accounts. See [#9348](https://github.com/google/site-kit-wp/issues/9348).
    128 * Implement the ability to dismiss detected and lost events information in the Analytics module. See [#9343](https://github.com/google/site-kit-wp/issues/9343).
    129 * Refactor the setup success subtle notification for Audience Segmentation. See [#9281](https://github.com/google/site-kit-wp/issues/9281).
    130 * Increase maximum Key Metric Widget selection count to 8. See [#9135](https://github.com/google/site-kit-wp/issues/9135).
    131 * Update the Reader Revenue Manager setup success notification to use the new notifications datastore. See [#8981](https://github.com/google/site-kit-wp/issues/8981).
    132 * Update the design of the Key Metrics setup CTA banner. See [#8895](https://github.com/google/site-kit-wp/issues/8895).
    133 * Improve UI/UX on AdSense alerts. See [#7642](https://github.com/google/site-kit-wp/issues/7642).
     121* Add GA event tracking for user interactions with the No Audiences Banner and Info Notice. See [#9496](https://github.com/google/site-kit-wp/issues/9496).
     122* Add opt-in event tracking for an audience tile's "Top content" metric area. See [#9495](https://github.com/google/site-kit-wp/issues/9495).
     123* Add Dashboard Sharing support to Analytics Conversion Reporting tiles. See [#9377](https://github.com/google/site-kit-wp/issues/9377).
     124* Improved the design of the User Input Questionnaire. See [#9374](https://github.com/google/site-kit-wp/issues/9374).
     125* Update requirement checks for notifications to have all selectors resolved correctly and efficiently. See [#9351](https://github.com/google/site-kit-wp/issues/9351).
     126* Update conversion reporting events synchronization to save detected and lost events. See [#9342](https://github.com/google/site-kit-wp/issues/9342).
     127* Add the setup form for the Sign in With Google module. See [#9336](https://github.com/google/site-kit-wp/issues/9336).
     128* Implement the ability to edit Sign in With Google settings. See [#9334](https://github.com/google/site-kit-wp/issues/9334).
    134129
    135130**Fixed**
    136131
    137 * Prevent audience settings from being deleted when changing or disconnecting the Analytics property. Reset `configuredAudiences` and `didSetAudiences` to default values while keeping `isAudienceSegmentationWidgetHidden` unchanged. See [#9432](https://github.com/google/site-kit-wp/issues/9432).
    138 * Improve the availability of the audience widget for secondary administrators. See [#9411](https://github.com/google/site-kit-wp/issues/9411).
    139 * Fix VRT test failures in CI when launching Chromium, ensuring tests run to completion without errors. See [#9406](https://github.com/google/site-kit-wp/issues/9406).
    140 * Ensure the error style for the Settings edit screen is cleared when settings are saved successfully. See [#8481](https://github.com/google/site-kit-wp/issues/8481).
     132* Fix an issue that caused the visitor groups overlay notification to appear unexpectedly. See [#9481](https://github.com/google/site-kit-wp/issues/9481).
     133* Ensure the "Purchasers" default audience can be added to the audience selection when initially setting up the Audience Segmentation feature under the right conditions. See [#9478](https://github.com/google/site-kit-wp/issues/9478).
     134* Prevent rendering of the Audience Selection Panel before the feature is set up, ensuring it only renders after setup is complete. See [#9475](https://github.com/google/site-kit-wp/issues/9475).
     135* Ensure partial data badges display correctly when the connected Analytics property is in the partial data state. See [#9474](https://github.com/google/site-kit-wp/issues/9474).
     136* Fix an issue that caused the visitor groups visibility toggle to appear when the feature wasn't yet set up. See [#9473](https://github.com/google/site-kit-wp/issues/9473).
     137* Handle insufficient permission errors correctly when attempting to create audiences via the Audience Segmentation Setup CTA Banner. See [#9471](https://github.com/google/site-kit-wp/issues/9471).
     138* Prevent console errors appearing when visiting the dashboard as a secondary admin or view-only user after the Audience Segmentation feature has been set up. See [#9445](https://github.com/google/site-kit-wp/issues/9445).
    141139
    142140[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.