Skip to content

Commit 64a7e24

Browse files
darssenmatticbot
authored andcommitted
Full sync: Get only whitelisted comment types (#42777)
* Added filtering whitelisted comment types to full sync query * changelog Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/14172161412 Upstream-Ref: Automattic/jetpack@25a062f
1 parent b5dc6b0 commit 64a7e24

File tree

4 files changed

+80
-66
lines changed

4 files changed

+80
-66
lines changed

jetpack_vendor/automattic/jetpack-sync/src/modules/class-comments.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,18 @@ public function get_whitelisted_comment_types() {
218218
);
219219
}
220220

221+
/**
222+
* Returns escaped SQL for whitelisted comment types.
223+
* Can be injected directly into a WHERE clause.
224+
*
225+
* @access public
226+
*
227+
* @return string SQL WHERE clause.
228+
*/
229+
public function get_whitelisted_comment_types_sql() {
230+
return 'comment_type IN (\'' . implode( '\', \'', array_map( 'esc_sql', $this->get_whitelisted_comment_types() ) ) . '\')';
231+
}
232+
221233
/**
222234
* Prevents any comment types that are not in the whitelist from being enqueued and sent to WordPress.com.
223235
*
@@ -378,11 +390,13 @@ public function estimate_full_sync_actions( $config ) {
378390
* @return string WHERE SQL clause, or `null` if no comments are specified in the module config.
379391
*/
380392
public function get_where_sql( $config ) {
393+
$where_sql = $this->get_whitelisted_comment_types_sql();
394+
381395
if ( is_array( $config ) && ! empty( $config ) ) {
382396
return 'comment_ID IN (' . implode( ',', array_map( 'intval', $config ) ) . ')';
383397
}
384398

385-
return '1=1';
399+
return $where_sql;
386400
}
387401

388402
/**

jetpack_vendor/i18n-map.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
),
8383
'jetpack-sync' => array(
8484
'path' => 'jetpack_vendor/automattic/jetpack-sync',
85-
'ver' => '4.10.0-alpha1743414874',
85+
'ver' => '4.10.0-alpha1743426038',
8686
),
8787
),
8888
);

vendor/composer/installed.json

+32-32
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"dist": {
8282
"type": "path",
8383
"url": "/tmp/jetpack-build/Automattic/jetpack-a8c-mc-stats",
84-
"reference": "17c04cb65dd0ebb823a15530ff8f2061774d59c4"
84+
"reference": "39a30a8b7f01ef69bc997273e42d1f766b80f4ec"
8585
},
8686
"require": {
8787
"php": ">=7.2"
@@ -138,7 +138,7 @@
138138
"dist": {
139139
"type": "path",
140140
"url": "/tmp/jetpack-build/Automattic/jetpack-admin-ui",
141-
"reference": "66647247203fb1fe954946a52649b023784ac2de"
141+
"reference": "a28e05d6f81db265a3d908a16b0df9cb2b6a51ea"
142142
},
143143
"require": {
144144
"php": ">=7.2"
@@ -201,7 +201,7 @@
201201
"dist": {
202202
"type": "path",
203203
"url": "/tmp/jetpack-build/Automattic/jetpack-assets",
204-
"reference": "7a900584b4ef765dcfe134a36a789014809dce30"
204+
"reference": "a169490b99ed5a166888beaad50ce5a24739de3d"
205205
},
206206
"require": {
207207
"automattic/jetpack-constants": "^3.0.6-alpha",
@@ -274,7 +274,7 @@
274274
"dist": {
275275
"type": "path",
276276
"url": "/tmp/jetpack-build/Automattic/jetpack-blaze",
277-
"reference": "7a9a4e9a27eaa34f871380beab4d299ee2fc9db9"
277+
"reference": "54947cc70234c85e324c3b37e1f8714a21f70809"
278278
},
279279
"require": {
280280
"automattic/jetpack-assets": "^4.0.15-alpha",
@@ -353,7 +353,7 @@
353353
"dist": {
354354
"type": "path",
355355
"url": "/tmp/jetpack-build/Automattic/jetpack-blocks",
356-
"reference": "85ecec032ee3285199ccfee0862f42fb855c005e"
356+
"reference": "f55324b135507ee527f05c52d6f5a3d4464c6323"
357357
},
358358
"require": {
359359
"automattic/jetpack-constants": "^3.0.6-alpha",
@@ -413,7 +413,7 @@
413413
"dist": {
414414
"type": "path",
415415
"url": "/tmp/jetpack-build/Automattic/jetpack-calypsoify",
416-
"reference": "b288f99ac3bf21ade2e1f76aaf27269b0a65a6b4"
416+
"reference": "6a391bed6e541495b7f03315bcb1dcd4dc2aeee9"
417417
},
418418
"require": {
419419
"automattic/jetpack-assets": "^4.0.15-alpha",
@@ -482,7 +482,7 @@
482482
"dist": {
483483
"type": "path",
484484
"url": "/tmp/jetpack-build/Automattic/jetpack-classic-theme-helper",
485-
"reference": "9fef9257556648028a013a93f2d412e4123d1aff"
485+
"reference": "cfe4ee798b4670cea1fe5bc3a323bdf347c127b0"
486486
},
487487
"require": {
488488
"automattic/jetpack-assets": "^4.0.15-alpha",
@@ -550,7 +550,7 @@
550550
"dist": {
551551
"type": "path",
552552
"url": "/tmp/jetpack-build/Automattic/jetpack-compat",
553-
"reference": "e8961033984b35325a2eb08dec4c3992b11742d0"
553+
"reference": "9926268aaea33c4f28f1db07c8938f745aa334e2"
554554
},
555555
"require": {
556556
"php": ">=7.2"
@@ -590,7 +590,7 @@
590590
"dist": {
591591
"type": "path",
592592
"url": "/tmp/jetpack-build/Automattic/jetpack-composer-plugin",
593-
"reference": "c9b0fd378359128cd57a05918d1059948dda05e3"
593+
"reference": "4a58f2a62dc1851a1372f4908fc934793d6fac43"
594594
},
595595
"require": {
596596
"composer-plugin-api": "^2.2",
@@ -654,7 +654,7 @@
654654
"dist": {
655655
"type": "path",
656656
"url": "/tmp/jetpack-build/Automattic/jetpack-config",
657-
"reference": "3be370d90c48ed56c483252b96136ed51475b561"
657+
"reference": "d7b193eb38e46248b409d8895fa0d6fb64b18583"
658658
},
659659
"require": {
660660
"php": ">=7.2"
@@ -731,7 +731,7 @@
731731
"dist": {
732732
"type": "path",
733733
"url": "/tmp/jetpack-build/Automattic/jetpack-connection",
734-
"reference": "5fd6854bae1a0c067adf65a8b192478cf0f722e3"
734+
"reference": "bba9cf36557f85f9c95fa28a83097a3992a6bdfc"
735735
},
736736
"require": {
737737
"automattic/jetpack-a8c-mc-stats": "^3.0.4",
@@ -819,7 +819,7 @@
819819
"dist": {
820820
"type": "path",
821821
"url": "/tmp/jetpack-build/Automattic/jetpack-constants",
822-
"reference": "1900a1c122f530abf87c2be317a59d1c6b2b009a"
822+
"reference": "383d2255ec4ba54d7a43b2458deb4045d62afa0c"
823823
},
824824
"require": {
825825
"php": ">=7.2"
@@ -877,7 +877,7 @@
877877
"dist": {
878878
"type": "path",
879879
"url": "/tmp/jetpack-build/Automattic/jetpack-device-detection",
880-
"reference": "dffa463f0733d8000f3d11f97a7cc267da640811"
880+
"reference": "40b8a7379c5523645d35b69c9181e7d6df7be440"
881881
},
882882
"require": {
883883
"php": ">=7.2"
@@ -934,7 +934,7 @@
934934
"dist": {
935935
"type": "path",
936936
"url": "/tmp/jetpack-build/Automattic/jetpack-google-analytics",
937-
"reference": "fe98c3a86d4cfd1da50e158c94a0b1f51f85f731"
937+
"reference": "08c111743c8f83b3773d11ba6f147890aa2b7ab2"
938938
},
939939
"require": {
940940
"automattic/jetpack-status": "^5.1.1-alpha",
@@ -1003,7 +1003,7 @@
10031003
"dist": {
10041004
"type": "path",
10051005
"url": "/tmp/jetpack-build/Automattic/jetpack-ip",
1006-
"reference": "8b75831c6801d77c0d7f436ec4e6159b7fab119b"
1006+
"reference": "bf9c5ff7cec3013045d313744fec70a96a92d5ad"
10071007
},
10081008
"require": {
10091009
"php": ">=7.2"
@@ -1065,7 +1065,7 @@
10651065
"dist": {
10661066
"type": "path",
10671067
"url": "/tmp/jetpack-build/Automattic/jetpack-jitm",
1068-
"reference": "cf22a3b83c1ccca10d7f9372098d9e8e7c003e32"
1068+
"reference": "9a60e715b8b17f6c2bb8813e82f52728202a5764"
10691069
},
10701070
"require": {
10711071
"automattic/jetpack-a8c-mc-stats": "^3.0.4",
@@ -1144,7 +1144,7 @@
11441144
"dist": {
11451145
"type": "path",
11461146
"url": "/tmp/jetpack-build/Automattic/jetpack-logo",
1147-
"reference": "0f38be9e20182b946caefc9e0e9e436fdfd8471f"
1147+
"reference": "8ca5c1aaab9fbe2eb78823edd7e2720b392f446d"
11481148
},
11491149
"require": {
11501150
"php": ">=7.2"
@@ -1201,7 +1201,7 @@
12011201
"dist": {
12021202
"type": "path",
12031203
"url": "/tmp/jetpack-build/Automattic/jetpack-masterbar",
1204-
"reference": "46c7cf153f83492defb7b02ffaf9ffc89660d6a8"
1204+
"reference": "6ada81c675cf6941619196061510c96608323e45"
12051205
},
12061206
"require": {
12071207
"automattic/jetpack-assets": "^4.0.15-alpha",
@@ -1287,7 +1287,7 @@
12871287
"dist": {
12881288
"type": "path",
12891289
"url": "/tmp/jetpack-build/Automattic/jetpack-mu-wpcom",
1290-
"reference": "951fbe09991ec37dd40f704d36b4750f4e68d916"
1290+
"reference": "050250c9dfd2de006698b4114a29d2219ed1cf63"
12911291
},
12921292
"require": {
12931293
"automattic/jetpack-assets": "^4.0.15-alpha",
@@ -1374,7 +1374,7 @@
13741374
"dist": {
13751375
"type": "path",
13761376
"url": "/tmp/jetpack-build/Automattic/jetpack-password-checker",
1377-
"reference": "93460319b88135cb52cf0f621ab0f2ed283a9718"
1377+
"reference": "89596ba59ec3a00b675882e39844618e955b3013"
13781378
},
13791379
"require": {
13801380
"php": ">=7.2"
@@ -1433,7 +1433,7 @@
14331433
"dist": {
14341434
"type": "path",
14351435
"url": "/tmp/jetpack-build/Automattic/jetpack-plans",
1436-
"reference": "020b203d088952fcffb5b4e3b7590f813c24abfb"
1436+
"reference": "5a3100021e8e49bdb4a3b8d777f1ef5b3444302e"
14371437
},
14381438
"require": {
14391439
"automattic/jetpack-connection": "^6.10.0-alpha",
@@ -1499,7 +1499,7 @@
14991499
"dist": {
15001500
"type": "path",
15011501
"url": "/tmp/jetpack-build/Automattic/jetpack-post-list",
1502-
"reference": "0671119e224072bd70f1d2833eca137a36adc94a"
1502+
"reference": "c13ec8b12826475e66fe27f620308a359b5d7189"
15031503
},
15041504
"require": {
15051505
"automattic/jetpack-assets": "^4.0.15-alpha",
@@ -1568,7 +1568,7 @@
15681568
"dist": {
15691569
"type": "path",
15701570
"url": "/tmp/jetpack-build/Automattic/jetpack-redirect",
1571-
"reference": "b6dbe88cdb5c379fc01bb5a245f027b940d5131c"
1571+
"reference": "80cf68ca7b884dabe6ec2481a1bbb237f8b40892"
15721572
},
15731573
"require": {
15741574
"automattic/jetpack-status": "^5.1.1-alpha",
@@ -1627,7 +1627,7 @@
16271627
"dist": {
16281628
"type": "path",
16291629
"url": "/tmp/jetpack-build/Automattic/jetpack-roles",
1630-
"reference": "303e9ea4ffe2d8bc46d2f622c85f9a0a8855df0f"
1630+
"reference": "912dbbdded475162d60ded6b89082582fbfd0d53"
16311631
},
16321632
"require": {
16331633
"php": ">=7.2"
@@ -1685,7 +1685,7 @@
16851685
"dist": {
16861686
"type": "path",
16871687
"url": "/tmp/jetpack-build/Automattic/jetpack-stats",
1688-
"reference": "f14d8513acfae748a123c639033e67e0e5cfadc0"
1688+
"reference": "58cb36c370f8de73ab21b65b04fec2676c13acdc"
16891689
},
16901690
"require": {
16911691
"automattic/jetpack-connection": "^6.10.0-alpha",
@@ -1755,7 +1755,7 @@
17551755
"dist": {
17561756
"type": "path",
17571757
"url": "/tmp/jetpack-build/Automattic/jetpack-stats-admin",
1758-
"reference": "9dd7051a10a753f581244dc86574824f59a50d0a"
1758+
"reference": "80db4e6c39f5b24ccae6c21b1e251ac883d91342"
17591759
},
17601760
"require": {
17611761
"automattic/jetpack-connection": "^6.10.0-alpha",
@@ -1826,7 +1826,7 @@
18261826
"dist": {
18271827
"type": "path",
18281828
"url": "/tmp/jetpack-build/Automattic/jetpack-status",
1829-
"reference": "8185ab079f3725e948ed53ed61ea9983f424af9c"
1829+
"reference": "0da4ea0128f842a251895bcfb3526d263351ecd8"
18301830
},
18311831
"require": {
18321832
"automattic/jetpack-constants": "^3.0.6-alpha",
@@ -1894,7 +1894,7 @@
18941894
"dist": {
18951895
"type": "path",
18961896
"url": "/tmp/jetpack-build/Automattic/jetpack-subscribers-dashboard",
1897-
"reference": "cf74423fc12d336881c35adb752d8cf329058815"
1897+
"reference": "2f695dfb829cce6cec316365d547439bcd8c24a0"
18981898
},
18991899
"require": {
19001900
"automattic/jetpack-connection": "^6.10.0-alpha",
@@ -1971,12 +1971,12 @@
19711971
},
19721972
{
19731973
"name": "automattic/jetpack-sync",
1974-
"version": "4.10.0-alpha.1743414874",
1975-
"version_normalized": "4.10.0.0-alpha1743414874",
1974+
"version": "4.10.0-alpha.1743426038",
1975+
"version_normalized": "4.10.0.0-alpha1743426038",
19761976
"dist": {
19771977
"type": "path",
19781978
"url": "/tmp/jetpack-build/Automattic/jetpack-sync",
1979-
"reference": "fbeb0c8686fd82de00234cce563ebf028b77d4b9"
1979+
"reference": "ec4d84f428a077b4a277c9b35586596c48cfe5f6"
19801980
},
19811981
"require": {
19821982
"automattic/jetpack-connection": "^6.10.0-alpha",
@@ -2052,7 +2052,7 @@
20522052
"dist": {
20532053
"type": "path",
20542054
"url": "/tmp/jetpack-build/Automattic/scheduled-updates",
2055-
"reference": "3041f72053434504064e86526a8491bc3f27f2e4"
2055+
"reference": "6c2200f677935b1a580ee732eeda1b8a1f53c29c"
20562056
},
20572057
"require": {
20582058
"automattic/jetpack-connection": "^6.10.0-alpha",

0 commit comments

Comments
 (0)