Skip to content

Commit 3fc1a4b

Browse files
dognose24matticbot
authored andcommitted
Stats: Check if Jetpack is integrated with the Complianz plugin to show the notice (#37870)
* Check if Jetpack is integrated with the Complianz plugin * changelog * Check if the plugin is installed by WPCOM API * refactoring * if option not set, then it is integrated * remove dup logic * fix up versions * Check the plugin installation locally * Fix key GDPR_COOKIE_CONSENT_NOTICE_ID * Bump lock files * changelog * Bump versions --------- Co-authored-by: Jasper Kang <[email protected]> Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/9559063016 Upstream-Ref: Automattic/jetpack@b292f59
1 parent 93a89d5 commit 3fc1a4b

File tree

11 files changed

+90
-74
lines changed

11 files changed

+90
-74
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 3.23.0-alpha - unreleased
4+
5+
This is an alpha version! The changes listed here are not final.
6+
7+
### Changed
8+
- Bump lock files.
9+
310
## 3.22.16 - 2024-06-17
411
### Changed
512
- Fixed readme, added accurate links. [#37901]

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
"composer/installers": true,
124124
"roots/wordpress-core-installer": true
125125
},
126-
"autoloader-suffix": "26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_22_16"
126+
"autoloader-suffix": "26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_23_0_alpha"
127127
},
128128
"extra": {
129129
"mirror-repo": "Automattic/wpcom-site-helper",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "@automattic/jetpack-wpcomsh",
44
"description": "A helper for connecting WordPress.com sites to external host infrastructure.",
55
"homepage": "https://jetpack.com",
6-
"version": "3.22.16",
6+
"version": "3.23.0-alpha",
77
"bugs": {
88
"url": "https://github.com/Automattic/jetpack/labels/[Plugin] Wpcomsh"
99
},

vendor/autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222

2323
require_once __DIR__ . '/composer/autoload_real.php';
2424

25-
return ComposerAutoloaderInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_22_16::getLoader();
25+
return ComposerAutoloaderInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_23_0_alpha::getLoader();

vendor/automattic/jetpack-stats-admin/src/class-main.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Main {
2222
/**
2323
* Stats version.
2424
*/
25-
const VERSION = '0.19.3';
25+
const VERSION = '0.20.0-alpha';
2626

2727
/**
2828
* Singleton Main instance.

vendor/automattic/jetpack-stats-admin/src/class-notices.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class Notices {
2020
const OPT_OUT_NEW_STATS_NOTICE_ID = 'opt_out_new_stats';
2121
const NEW_STATS_FEEDBACK_NOTICE_ID = 'new_stats_feedback';
2222
const OPT_IN_NEW_STATS_NOTICE_ID = 'opt_in_new_stats';
23+
const GDPR_COOKIE_CONSENT_NOTICE_ID = 'gdpr_cookie_consent';
2324

2425
const VIEWS_TO_SHOW_FEEDBACK = 3;
2526
const POSTPONE_OPT_IN_NOTICE_DAYS = 30;
@@ -70,23 +71,31 @@ public function get_notices_to_show() {
7071
$stats_views = intval( Stats_Options::get_option( 'views' ) );
7172
$odyssey_stats_changed_at = intval( Stats_Options::get_option( 'odyssey_stats_changed_at' ) );
7273

74+
// Check if Jetpack is integrated with the Complianz plugin, which blocks the Stats.
75+
$complianz_options_integrations = get_option( 'complianz_options_integrations' );
76+
$is_jetpack_blocked_by_complianz = ! isset( $complianz_options_integrations['jetpack'] ) || $complianz_options_integrations['jetpack'];
77+
7378
return array_merge(
7479
$notices_wpcom,
7580
array(
7681
// Show Opt-in notice 30 days after the new stats being disabled.
77-
self::OPT_IN_NEW_STATS_NOTICE_ID => ! $new_stats_enabled
82+
self::OPT_IN_NEW_STATS_NOTICE_ID => ! $new_stats_enabled
7883
&& $odyssey_stats_changed_at < time() - self::POSTPONE_OPT_IN_NOTICE_DAYS * DAY_IN_SECONDS
7984
&& ! $this->is_notice_hidden( self::OPT_IN_NEW_STATS_NOTICE_ID ),
8085

8186
// Show feedback notice after 3 views of the new stats.
82-
self::NEW_STATS_FEEDBACK_NOTICE_ID => $new_stats_enabled
87+
self::NEW_STATS_FEEDBACK_NOTICE_ID => $new_stats_enabled
8388
&& $stats_views >= self::VIEWS_TO_SHOW_FEEDBACK
8489
&& ! $this->is_notice_hidden( self::NEW_STATS_FEEDBACK_NOTICE_ID ),
8590

8691
// Show opt-out notice before 3 views of the new stats, where 3 is included.
87-
self::OPT_OUT_NEW_STATS_NOTICE_ID => $new_stats_enabled
92+
self::OPT_OUT_NEW_STATS_NOTICE_ID => $new_stats_enabled
8893
&& $stats_views < self::VIEWS_TO_SHOW_FEEDBACK
8994
&& ! $this->is_notice_hidden( self::OPT_OUT_NEW_STATS_NOTICE_ID ),
95+
96+
// GDPR cookie consent notice for Complianz users.
97+
self::GDPR_COOKIE_CONSENT_NOTICE_ID => class_exists( 'COMPLIANZ' ) && $is_jetpack_blocked_by_complianz
98+
&& ! $this->is_notice_hidden( self::GDPR_COOKIE_CONSENT_NOTICE_ID ),
9099
)
91100
);
92101
}

vendor/composer/autoload_real.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// autoload_real.php @generated by Composer
44

5-
class ComposerAutoloaderInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_22_16
5+
class ComposerAutoloaderInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_23_0_alpha
66
{
77
private static $loader;
88

@@ -24,17 +24,17 @@ public static function getLoader()
2424

2525
require __DIR__ . '/platform_check.php';
2626

27-
spl_autoload_register(array('ComposerAutoloaderInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_22_16', 'loadClassLoader'), true, true);
27+
spl_autoload_register(array('ComposerAutoloaderInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_23_0_alpha', 'loadClassLoader'), true, true);
2828
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
29-
spl_autoload_unregister(array('ComposerAutoloaderInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_22_16', 'loadClassLoader'));
29+
spl_autoload_unregister(array('ComposerAutoloaderInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_23_0_alpha', 'loadClassLoader'));
3030

3131
require __DIR__ . '/autoload_static.php';
32-
call_user_func(\Composer\Autoload\ComposerStaticInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_22_16::getInitializer($loader));
32+
call_user_func(\Composer\Autoload\ComposerStaticInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_23_0_alpha::getInitializer($loader));
3333

3434
$loader->setClassMapAuthoritative(true);
3535
$loader->register(true);
3636

37-
$filesToLoad = \Composer\Autoload\ComposerStaticInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_22_16::$files;
37+
$filesToLoad = \Composer\Autoload\ComposerStaticInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_23_0_alpha::$files;
3838
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
3939
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
4040
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

vendor/composer/autoload_static.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Composer\Autoload;
66

7-
class ComposerStaticInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_22_16
7+
class ComposerStaticInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_23_0_alpha
88
{
99
public static $files = array (
1010
'3773ef3f09c37da5478d578e32b03a4b' => __DIR__ . '/..' . '/automattic/jetpack-assets/actions.php',
@@ -378,9 +378,9 @@ class ComposerStaticInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_22_16
378378
public static function getInitializer(ClassLoader $loader)
379379
{
380380
return \Closure::bind(function () use ($loader) {
381-
$loader->prefixLengthsPsr4 = ComposerStaticInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_22_16::$prefixLengthsPsr4;
382-
$loader->prefixDirsPsr4 = ComposerStaticInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_22_16::$prefixDirsPsr4;
383-
$loader->classMap = ComposerStaticInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_22_16::$classMap;
381+
$loader->prefixLengthsPsr4 = ComposerStaticInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_23_0_alpha::$prefixLengthsPsr4;
382+
$loader->prefixDirsPsr4 = ComposerStaticInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_23_0_alpha::$prefixDirsPsr4;
383+
$loader->classMap = ComposerStaticInit26841ac2064774301cbe06d174833bfc_wpcomshⓥ3_23_0_alpha::$classMap;
384384

385385
}, null, ClassLoader::class);
386386
}

vendor/composer/installed.json

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"dist": {
7878
"type": "path",
7979
"url": "/tmp/jetpack-build/Automattic/jetpack-a8c-mc-stats",
80-
"reference": "de96bd72f0a10df9263a5acc9e71ea4a18db62c4"
80+
"reference": "fec4cad83b967982348b8a102f8dff69635efa19"
8181
},
8282
"require": {
8383
"php": ">=7.0"
@@ -130,7 +130,7 @@
130130
"dist": {
131131
"type": "path",
132132
"url": "/tmp/jetpack-build/Automattic/jetpack-admin-ui",
133-
"reference": "3abe5fd9d9470215e832e019863a65d73e9afd69"
133+
"reference": "e07980796c3e8abbd55644ae94560a9ce2ec79cb"
134134
},
135135
"require": {
136136
"php": ">=7.0"
@@ -195,7 +195,7 @@
195195
"dist": {
196196
"type": "path",
197197
"url": "/tmp/jetpack-build/Automattic/jetpack-assets",
198-
"reference": "cf064780b32a37ebb0923f97d0e617c016e274a3"
198+
"reference": "2fd81053ceeddee26c1fc166bea818a10f239fe2"
199199
},
200200
"require": {
201201
"automattic/jetpack-constants": "^2.0.3",
@@ -264,7 +264,7 @@
264264
"dist": {
265265
"type": "path",
266266
"url": "/tmp/jetpack-build/Automattic/jetpack-blocks",
267-
"reference": "044aa3dc074901fbf530773ac654cbe49a27aed5"
267+
"reference": "1ee848a48abfc22ee1192cf56191a372f33865eb"
268268
},
269269
"require": {
270270
"automattic/jetpack-constants": "^2.0.3",
@@ -326,7 +326,7 @@
326326
"dist": {
327327
"type": "path",
328328
"url": "/tmp/jetpack-build/Automattic/jetpack-calypsoify",
329-
"reference": "ac9a583159b2081a45539cd3cbb0bee7042622f1"
329+
"reference": "e344200658ac8f53283090ad8ad56450e3f4a0cf"
330330
},
331331
"require": {
332332
"automattic/jetpack-assets": "^2.1.12",
@@ -391,7 +391,7 @@
391391
"dist": {
392392
"type": "path",
393393
"url": "/tmp/jetpack-build/Automattic/jetpack-classic-theme-helper",
394-
"reference": "ea4227f8702dacfb88b7bd5cc05202014480c5b7"
394+
"reference": "cab104bf1b41ae3c389ca48ea3e3228b50e4eab0"
395395
},
396396
"require": {
397397
"automattic/jetpack-assets": "^2.1.12",
@@ -462,7 +462,7 @@
462462
"dist": {
463463
"type": "path",
464464
"url": "/tmp/jetpack-build/Automattic/jetpack-compat",
465-
"reference": "44622f5d83362a61752a11d55398b57d1eb2d2ea"
465+
"reference": "f7d04d5fa747a08fdb4658f267db23c4c11c3884"
466466
},
467467
"require": {
468468
"php": ">=7.0"
@@ -502,7 +502,7 @@
502502
"dist": {
503503
"type": "path",
504504
"url": "/tmp/jetpack-build/Automattic/jetpack-config",
505-
"reference": "9e37a53d307ecbb0af01a079007c64eebcf226e9"
505+
"reference": "ac35ba15c4998db9f7ad2e9d2764cbb58f80830f"
506506
},
507507
"require": {
508508
"php": ">=7.0"
@@ -578,7 +578,7 @@
578578
"dist": {
579579
"type": "path",
580580
"url": "/tmp/jetpack-build/Automattic/jetpack-connection",
581-
"reference": "c54f5c9bfb9e5d44044a56a8136afde126ce6341"
581+
"reference": "0b0950288763dbc30aca3acb8326f314ef4b4f1a"
582582
},
583583
"require": {
584584
"automattic/jetpack-a8c-mc-stats": "^2.0.1",
@@ -665,7 +665,7 @@
665665
"dist": {
666666
"type": "path",
667667
"url": "/tmp/jetpack-build/Automattic/jetpack-constants",
668-
"reference": "b52d8d1514f34cbdad52a49b5286d0c178a004e1"
668+
"reference": "6ae8a91a040ce0ec92d6b4b7e89b0d871ad9638f"
669669
},
670670
"require": {
671671
"php": ">=7.0"
@@ -719,7 +719,7 @@
719719
"dist": {
720720
"type": "path",
721721
"url": "/tmp/jetpack-build/Automattic/jetpack-device-detection",
722-
"reference": "1e12e40e63f8a5b48508d8ff07c55e054e5c769d"
722+
"reference": "3dd1d20e49be904e9ae8afcf447d5858099824d3"
723723
},
724724
"require": {
725725
"php": ">=7.0"
@@ -772,7 +772,7 @@
772772
"dist": {
773773
"type": "path",
774774
"url": "/tmp/jetpack-build/Automattic/jetpack-ip",
775-
"reference": "b8916115b2636c44ec5029a61c1804ced48ab5b1"
775+
"reference": "c5259f774961c936693b087a85db365591977332"
776776
},
777777
"require": {
778778
"php": ">=7.0"
@@ -830,7 +830,7 @@
830830
"dist": {
831831
"type": "path",
832832
"url": "/tmp/jetpack-build/Automattic/jetpack-jitm",
833-
"reference": "03a66d8c7ef711547e88c99a1de8352263b2ccb0"
833+
"reference": "7a7c8f94d1a0fbfae30bd145e8454403f5a0de85"
834834
},
835835
"require": {
836836
"automattic/jetpack-a8c-mc-stats": "^2.0.1",
@@ -905,7 +905,7 @@
905905
"dist": {
906906
"type": "path",
907907
"url": "/tmp/jetpack-build/Automattic/jetpack-logo",
908-
"reference": "60845f00ca2b5cf57eb28198c7d0a4f46fd60280"
908+
"reference": "44248355c4cff96a6b7cf0593c0da210f39ddb46"
909909
},
910910
"require": {
911911
"php": ">=7.0"
@@ -958,7 +958,7 @@
958958
"dist": {
959959
"type": "path",
960960
"url": "/tmp/jetpack-build/Automattic/jetpack-mu-wpcom",
961-
"reference": "e4047a891df3739d35b3f3f06e90f49cdfb3d307"
961+
"reference": "99673862d029105a0e767657d3197d1e4bde4929"
962962
},
963963
"require": {
964964
"automattic/jetpack-assets": "^2.1.12",
@@ -968,7 +968,7 @@
968968
"automattic/jetpack-compat": "^3.0.2",
969969
"automattic/jetpack-connection": "^2.10.1",
970970
"automattic/jetpack-redirect": "^2.0.2",
971-
"automattic/jetpack-stats-admin": "^0.19.3",
971+
"automattic/jetpack-stats-admin": "^0.20.0-alpha",
972972
"automattic/jetpack-status": "^3.3.0",
973973
"automattic/scheduled-updates": "^0.13.0",
974974
"php": ">=7.0"
@@ -1038,7 +1038,7 @@
10381038
"dist": {
10391039
"type": "path",
10401040
"url": "/tmp/jetpack-build/Automattic/jetpack-password-checker",
1041-
"reference": "93b846da4407a95e1b43a3df6dcd94f70c8d150b"
1041+
"reference": "a97bb2572e90b9898529e0f186b2f382df3c5583"
10421042
},
10431043
"require": {
10441044
"php": ">=7.0"
@@ -1099,7 +1099,7 @@
10991099
"dist": {
11001100
"type": "path",
11011101
"url": "/tmp/jetpack-build/Automattic/jetpack-plans",
1102-
"reference": "16fba9033b61af206c05713c3ec0fa7899fcf581"
1102+
"reference": "cba4db21e91a8b5dc7c68a8caa851ad58803a604"
11031103
},
11041104
"require": {
11051105
"automattic/jetpack-connection": "^2.10.1",
@@ -1167,7 +1167,7 @@
11671167
"dist": {
11681168
"type": "path",
11691169
"url": "/tmp/jetpack-build/Automattic/jetpack-post-list",
1170-
"reference": "1eef80ad5c6360c7538f88e4ddd3ad9d50856134"
1170+
"reference": "0d8d65b70fc4798716149ff0bca64956705ad3e3"
11711171
},
11721172
"require": {
11731173
"automattic/jetpack-assets": "^2.1.12",
@@ -1232,7 +1232,7 @@
12321232
"dist": {
12331233
"type": "path",
12341234
"url": "/tmp/jetpack-build/Automattic/jetpack-redirect",
1235-
"reference": "0037638d4bd333f96cc7c1443a5e0d30763c0063"
1235+
"reference": "4db080d917375eae42aff86aebeddda34f605b3b"
12361236
},
12371237
"require": {
12381238
"automattic/jetpack-status": "^3.3.0",
@@ -1287,7 +1287,7 @@
12871287
"dist": {
12881288
"type": "path",
12891289
"url": "/tmp/jetpack-build/Automattic/jetpack-roles",
1290-
"reference": "ca11d05e60e6eb6d478989c37973934a9833137f"
1290+
"reference": "955b1c03a043a308cc99f2e649353142de0e6a2f"
12911291
},
12921292
"require": {
12931293
"php": ">=7.0"
@@ -1341,7 +1341,7 @@
13411341
"dist": {
13421342
"type": "path",
13431343
"url": "/tmp/jetpack-build/Automattic/jetpack-stats",
1344-
"reference": "c8584ae2c63fed62970c9f614e11f18e13a22659"
1344+
"reference": "b28792ae6e1eb2f7d344471548a9ebb341a30e35"
13451345
},
13461346
"require": {
13471347
"automattic/jetpack-connection": "^2.10.1",
@@ -1403,12 +1403,12 @@
14031403
},
14041404
{
14051405
"name": "automattic/jetpack-stats-admin",
1406-
"version": "0.19.3",
1407-
"version_normalized": "0.19.3.0",
1406+
"version": "0.20.0-alpha.1718685425",
1407+
"version_normalized": "0.20.0.0-alpha1718685425",
14081408
"dist": {
14091409
"type": "path",
14101410
"url": "/tmp/jetpack-build/Automattic/jetpack-stats-admin",
1411-
"reference": "5b944245e641647901cd7b00b0744ce322c2b747"
1411+
"reference": "1a9c0ee735bd8985ff0721f1c4d005c6a660df1c"
14121412
},
14131413
"require": {
14141414
"automattic/jetpack-connection": "^2.10.1",
@@ -1432,7 +1432,7 @@
14321432
"autotagger": true,
14331433
"mirror-repo": "Automattic/jetpack-stats-admin",
14341434
"branch-alias": {
1435-
"dev-trunk": "0.19.x-dev"
1435+
"dev-trunk": "0.20.x-dev"
14361436
},
14371437
"textdomain": "jetpack-stats-admin",
14381438
"version-constants": {
@@ -1481,7 +1481,7 @@
14811481
"dist": {
14821482
"type": "path",
14831483
"url": "/tmp/jetpack-build/Automattic/jetpack-status",
1484-
"reference": "e4c71863d212fe0708463b88ee836f2e4e50f1bd"
1484+
"reference": "9ca513a926c04639c10f1af1c2e6166a5c63e9fe"
14851485
},
14861486
"require": {
14871487
"automattic/jetpack-constants": "^2.0.3",
@@ -1546,7 +1546,7 @@
15461546
"dist": {
15471547
"type": "path",
15481548
"url": "/tmp/jetpack-build/Automattic/jetpack-sync",
1549-
"reference": "7f1586927d75861e17e17d8da89faf478f591d27"
1549+
"reference": "ee7a6433b8072c3ab3dedfc04a495476afb7d186"
15501550
},
15511551
"require": {
15521552
"automattic/jetpack-connection": "^2.10.1",
@@ -1624,7 +1624,7 @@
16241624
"dist": {
16251625
"type": "path",
16261626
"url": "/tmp/jetpack-build/Automattic/scheduled-updates",
1627-
"reference": "f2c1a0805937e59531b32aa4c569c1c04cfb2465"
1627+
"reference": "40202cfa9311c1e4e64ba92179191785bf402f8f"
16281628
},
16291629
"require": {
16301630
"automattic/jetpack-connection": "^2.10.1",

0 commit comments

Comments
 (0)