Skip to content

Commit

Permalink
Sync: Don't sync set object terms action for blacklisted taxonomies (…
Browse files Browse the repository at this point in the history
…#39663)

* Filter out set_object_terms actions with blacklisted taxonomies

* Args in this flow does not have the terms retrieved as objects. Instead we rely directly on the taxonomy

* changelog

* Update projects/packages/sync/src/modules/class-terms.php

Co-authored-by: Foteini Giannaropoulou <[email protected]>

---------

Co-authored-by: Foteini Giannaropoulou <[email protected]>

Committed via a GitHub action: https:/Automattic/jetpack/actions/runs/11230895151

Upstream-Ref: Automattic/jetpack@70eae9f
  • Loading branch information
darssen authored and matticbot committed Oct 8, 2024
1 parent 98e6670 commit a0902cd
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 119 deletions.
3 changes: 3 additions & 0 deletions jetpack_vendor/automattic/jetpack-sync/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ This is an alpha version! The changes listed here are not final.
### Added
- Jetpack Sync: Add 'woocommerce_analytics_first_activation' in options' whitelist

### Changed
- Sync: Ensure we don't sync set_object_terms action for terms with blacklisted taxonomies

## [3.13.2] - 2024-09-30
### Fixed
- Jetpack Sync: Fix a bug in syncing HPOS 'woocommerce_delete_order' actions [#39562]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,16 @@ public function filter_blacklisted_taxonomies( $args ) {
}

/**
* Filter out set_object_terms actions where the terms have not changed.
* Filter out set_object_terms actions with blacklisted taxonomies or where the terms have not changed.
*
* @param array $args Hook args.
* @return array|boolean False if no change in terms, the original hook args otherwise.
* @return array|boolean False if blacklisted taxonomy or no change in terms, the original hook args otherwise.
*/
public function filter_set_object_terms_no_update( $args ) {
// Check if the taxonomy is blacklisted. $args[3] is the taxonomy.
if ( isset( $args[3] ) && in_array( $args[3], Settings::get_setting( 'taxonomies_blacklist' ), true ) ) {
return false;
}
// There is potential for other plugins to modify args, therefore lets validate # of and types.
// $args[2] is $tt_ids, $args[5] is $old_tt_ids see wp-includes/taxonomy.php L2740.
if ( 6 === count( $args ) && is_array( $args[2] ) && is_array( $args[5] ) ) {
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/i18n-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
),
'jetpack-sync' => array(
'path' => 'jetpack_vendor/automattic/jetpack-sync',
'ver' => '3.14.0-alpha1728365238',
'ver' => '3.14.0-alpha1728373566',
),
),
);
60 changes: 30 additions & 30 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-a8c-mc-stats",
"reference": "c15744b268ac4e0368700ef3cb3211a941a21a2a"
"reference": "0e1039ea4a242de9f1d5fbcc72b8ab6cf8914d2a"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -60,7 +60,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-admin-ui",
"reference": "a50ee9f66f499e959b72dbbd98d4a94b902037cb"
"reference": "4c439565d3ddf1a696fce4c704709da302da5fa2"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -125,7 +125,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-assets",
"reference": "596b9919d67386d60cc0f6c3498e9002a1566fb0"
"reference": "e4fc97eb181d0362211753e54ef29f35f9f7f75e"
},
"require": {
"automattic/jetpack-constants": "^2.0.4",
Expand Down Expand Up @@ -194,7 +194,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-autoloader",
"reference": "df5ddc80abe0940a5e9cb8f6747346bd1887bdf0"
"reference": "574f51cb89b3335587110553da1781270d2fe01e"
},
"require": {
"composer-plugin-api": "^1.1 || ^2.0",
Expand Down Expand Up @@ -261,7 +261,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-backup",
"reference": "c45b7a73e170bb0b129bb70f17293838786e19cb"
"reference": "25c8c9f60da22321629deb11921ea7d5fae51d76"
},
"require": {
"automattic/jetpack-admin-ui": "^0.4.5",
Expand Down Expand Up @@ -351,7 +351,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-backup-helper-script-manager",
"reference": "19b0a679b5a622e561e8f378cee37567fabb360c"
"reference": "fd7cbeb19c158823edba38e75c93e671fa71e023"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -411,7 +411,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-boost-core",
"reference": "e37097fdc61af3f1b3ef95f816a9d27600519005"
"reference": "c4e06f796b7e1e6b98ddc1ad8503e74c0d5c7293"
},
"require": {
"automattic/jetpack-connection": "^5.1.2-alpha",
Expand Down Expand Up @@ -479,7 +479,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-boost-speed-score",
"reference": "6a7ac267004a95b048830c17d9d4b66cec3a026e"
"reference": "24f0234eea05c3cad1f2303c54082b4e4952a558"
},
"require": {
"automattic/jetpack-boost-core": "^0.2.12",
Expand Down Expand Up @@ -555,7 +555,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-composer-plugin",
"reference": "0cab57443557352388a1c0c0ed98f40731d74a89"
"reference": "2181f6d552deaf4ca3afb6a6acad7aa7c2c926cf"
},
"require": {
"composer-plugin-api": "^2.1.0",
Expand Down Expand Up @@ -615,7 +615,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-config",
"reference": "7f0a66e130993b198b52a5d48f1258ed8ee13737"
"reference": "67f3399c388a60d553934f0ec891260f7e19e97a"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -690,7 +690,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-connection",
"reference": "44e54375672731ef33ec60403a12e57c5f7136b6"
"reference": "e6a9b03248c06238d1b887bbc07f63ce33f9a8de"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^2.0.3",
Expand Down Expand Up @@ -780,7 +780,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-constants",
"reference": "36acbb87b180cd63dd190a5cfb8b28629a2dd4a6"
"reference": "a20c6f2c0641fa2ba1249b0ef9775f1bb54c8bcb"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -834,7 +834,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-device-detection",
"reference": "1304abd5fb748c3651379476fa2a23c3cd532db7"
"reference": "d924be82e21ab3dfedb95bb1043582148934a6d2"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -887,7 +887,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-explat",
"reference": "2b688e299e6f2a07d2b65dba22112ec11ab698d9"
"reference": "7d4f7c7e5d72f08a67d1bb4a7bbaccdc56960214"
},
"require": {
"automattic/jetpack-connection": "^5.1.2-alpha",
Expand Down Expand Up @@ -962,7 +962,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-ip",
"reference": "46be57fad2357bd05fa1bab2b6bf4883ed7f8dd7"
"reference": "9725a122078bcaba0eabe9273b16c6b865c2a3f0"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -1020,7 +1020,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-jitm",
"reference": "01862972d7cb270f5c70df22841df5c031251923"
"reference": "7ad3b3e7fd73bc89c38edf4a46dcda79b5fe2d1d"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^2.0.3",
Expand Down Expand Up @@ -1095,7 +1095,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-licensing",
"reference": "3c30778827a0040dea83fdbebebef1fd1918a580"
"reference": "99faafc7f179e208f07f0794429a7df6ff93e95a"
},
"require": {
"automattic/jetpack-connection": "^5.1.2-alpha",
Expand Down Expand Up @@ -1157,7 +1157,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-logo",
"reference": "2c190274d42b1669ed31ca1732b99fe655386568"
"reference": "f76ecda3c05948ac4c012964b7d10de98bf51eab"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -1210,7 +1210,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-my-jetpack",
"reference": "297552b6f063b705041f13f16fa1d247d0012b4c"
"reference": "9caab65e9726a0af3c53f4528959382fc6f30efc"
},
"require": {
"automattic/jetpack-admin-ui": "^0.4.5",
Expand Down Expand Up @@ -1312,7 +1312,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-password-checker",
"reference": "08ca0a6d25fef672b8ea76b1be20cbe41d0dfad6"
"reference": "5748ce26468a8043d6d0a72261c123d438ab041b"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -1373,7 +1373,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-plans",
"reference": "09f8a06cb126d0e3f90b2e64b7a6be8bf6e3a211"
"reference": "22ed068281ae1591b66121a626dec0bee38e19ec"
},
"require": {
"automattic/jetpack-connection": "^5.1.2-alpha",
Expand Down Expand Up @@ -1441,7 +1441,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-plugins-installer",
"reference": "8feb9f70f4f88fe1827dfdf6698ec57939e7ee21"
"reference": "f07912b0fe34d8748442e81e8a38bf71becda1de"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^2.0.3",
Expand Down Expand Up @@ -1497,7 +1497,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-protect-models",
"reference": "9f2dd53b118da4f3c9df61b973c303d1f1641138"
"reference": "d07e26d6c5557104dc51466ad5c27360bcc64dc5"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -1567,7 +1567,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-protect-status",
"reference": "1be19f277022914f21c3860a1a2f973793d1173d"
"reference": "8355826c55846bdc5e1b199226936045f25b7dac"
},
"require": {
"automattic/jetpack-connection": "^5.1.2-alpha",
Expand Down Expand Up @@ -1642,7 +1642,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-redirect",
"reference": "e24220c99ec80fcb21516846464a06c3c091011c"
"reference": "d5f0558c98be638da7683063ef247739cb875e1a"
},
"require": {
"automattic/jetpack-status": "^4.0.2",
Expand Down Expand Up @@ -1697,7 +1697,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-roles",
"reference": "ca4e45d86d52c5eeb117ec49c24df3873128b6bd"
"reference": "59ae1d7682b05cd3b5a624c4c65053d97e7ff421"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -1751,7 +1751,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-status",
"reference": "26510eeb75535a64cf0c0d3f3ecd8a256aea581d"
"reference": "89546bf6ff6aeaaed7ae3681ae3f7c6053e784cc"
},
"require": {
"automattic/jetpack-constants": "^2.0.4",
Expand Down Expand Up @@ -1810,12 +1810,12 @@
},
{
"name": "automattic/jetpack-sync",
"version": "3.14.0-alpha.1728365238",
"version_normalized": "3.14.0.0-alpha1728365238",
"version": "3.14.0-alpha.1728373566",
"version_normalized": "3.14.0.0-alpha1728373566",
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-sync",
"reference": "d1bc4c2ebb820c09ae7ba7d95063284ed73f5a65"
"reference": "da7e1bb284ae9dc1c3a37d39b557602b2ead2203"
},
"require": {
"automattic/jetpack-connection": "^5.1.2-alpha",
Expand Down
Loading

0 comments on commit a0902cd

Please sign in to comment.