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 <giannaropoulou.foteini@gmail.com>

---------

Co-authored-by: Foteini Giannaropoulou <giannaropoulou.foteini@gmail.com>

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

Upstream-Ref: Automattic/jetpack@70eae9f
  • Loading branch information
darssen authored and matticbot committed Oct 8, 2024
1 parent 934ed92 commit adb7dc7
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 @@ -74,7 +74,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": "282074dd429c54d996423112315cd8d468435950"
"reference": "426ddb346ac5704e33861328d9c51a595000dbbb"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -60,7 +60,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-admin-ui",
"reference": "ba62dbf6fbd6fd759cafcb8ffdb46fa54f6346fe"
"reference": "2bc14da5e7c7cbb69e956a706c4ceaa2d7af63e7"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -125,7 +125,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-assets",
"reference": "e50e2912820aab6af7b6412065643a64e4a9ae71"
"reference": "597612ad0d075791ad11f95f440a3a1ebea45181"
},
"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": "a0a723dd83266bba39b56cf20c4ad28d712a4bf1"
"reference": "714a1c4d4074249f3e46ac071547af070e71acf9"
},
"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-boost-core",
"reference": "d41e3812e6252ee4af5d84f9594421f2c3b4ab80"
"reference": "5bd4d35a0228b65a706fe855593343c2f6fb2fab"
},
"require": {
"automattic/jetpack-connection": "^5.1.2-alpha",
Expand Down Expand Up @@ -329,7 +329,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-boost-speed-score",
"reference": "c35a5251ecef9dd7c596774562f4ecd5985dcb4e"
"reference": "02224e5058a047bc8fb408e05495c528b7fca8fd"
},
"require": {
"automattic/jetpack-boost-core": "^0.2.12",
Expand Down Expand Up @@ -405,7 +405,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-composer-plugin",
"reference": "c0f77b35781ccc60fe2e0a2f4ebb85f6585a059d"
"reference": "db0b6649b8527ffcbe08970ebf7d9f179a6eeadd"
},
"require": {
"composer-plugin-api": "^2.1.0",
Expand Down Expand Up @@ -465,7 +465,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-config",
"reference": "d3dcc8f70bf9ebbf69e6b70f8b20a7f1a69dddca"
"reference": "a93926f9e07b80fd62012207beb7bf0d05f39bc3"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -540,7 +540,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-connection",
"reference": "a60e60bcc5e35baf403e2ec75ffa9be71475fde3"
"reference": "05f9bbc7a093dcdbcbb81bb714a87e1b8ebf9b2d"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^2.0.3",
Expand Down Expand Up @@ -630,7 +630,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-constants",
"reference": "d20ed0826436dd5507956e4eddbc8fd1b9e808ba"
"reference": "45061d6225a860815f75670fe83d20b95c63a7b5"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -684,7 +684,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-device-detection",
"reference": "35126972d7eb181cf791b0ddfa917fc39cbe6ddf"
"reference": "3f1ed4fc2d1e92aaf0d9c30432fc8d60eca164e0"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -737,7 +737,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-explat",
"reference": "7df74b1776b75528b8ff615619b6d065d805bb3c"
"reference": "f3705b5f032addf8be60486feb21d431e953c399"
},
"require": {
"automattic/jetpack-connection": "^5.1.2-alpha",
Expand Down Expand Up @@ -812,7 +812,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-ip",
"reference": "b24268d4a0888df99181bf301807089805a39a67"
"reference": "379282b7f833e0d58a091d033c0a345a2f6fddee"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -870,7 +870,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-jitm",
"reference": "1f3c306f50d3b18d8865292db207ca3f8bd61d7f"
"reference": "e2fda937ba49c01ad7291bef6205a69d53762535"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^2.0.3",
Expand Down Expand Up @@ -945,7 +945,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-licensing",
"reference": "876daf0cbacf787d579f5b8d30f7289db0524884"
"reference": "b61d72fff32bb5c32ce80586287efb62c81397d1"
},
"require": {
"automattic/jetpack-connection": "^5.1.2-alpha",
Expand Down Expand Up @@ -1007,7 +1007,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-logo",
"reference": "63b98cf4b60034f2fc2005f3ca711140553caff4"
"reference": "7a8756b33624b04a5e8c720c205356bbd45e41ac"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -1060,7 +1060,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-my-jetpack",
"reference": "14060aea4a74cddfb50b6ebae2a5d8d4c53dc95d"
"reference": "f2a1f52a4157774e0d7abb688f439b19c0a0cc44"
},
"require": {
"automattic/jetpack-admin-ui": "^0.4.5",
Expand Down Expand Up @@ -1162,7 +1162,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-password-checker",
"reference": "3a2d7f8a68c5633204f654bdcd71c66c043e0a0f"
"reference": "3aa0936a25685610345895c980ddbaa028b9ed9a"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -1223,7 +1223,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-plans",
"reference": "3e699e70379b51baa5770d4e654336db855d98be"
"reference": "f51804b5af4381715d48a4171253ade4cf5a2935"
},
"require": {
"automattic/jetpack-connection": "^5.1.2-alpha",
Expand Down Expand Up @@ -1291,7 +1291,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-plugins-installer",
"reference": "61f56a3480c79537b339c62049751066cc999314"
"reference": "1cdc573f848266e3e602dc5f68acc6e566b20e1b"
},
"require": {
"automattic/jetpack-a8c-mc-stats": "^2.0.3",
Expand Down Expand Up @@ -1347,7 +1347,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-protect-models",
"reference": "5001b7fa937085c8a1e6ef66361b740324a43187"
"reference": "be90300b4da1d4e8034d5e92db3fc4888b910019"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -1417,7 +1417,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-protect-status",
"reference": "89dbcb419fe34e7f77a7604ceea6bebc837730eb"
"reference": "8794b87a1b873855d37824f2c16fa2c513a7fde6"
},
"require": {
"automattic/jetpack-connection": "^5.1.2-alpha",
Expand Down Expand Up @@ -1492,7 +1492,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-redirect",
"reference": "4900518b139f3390957da386a8df2434d414a987"
"reference": "319e87079a1697e3740f1f670a7ae1cd1980873a"
},
"require": {
"automattic/jetpack-status": "^4.0.2",
Expand Down Expand Up @@ -1547,7 +1547,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-roles",
"reference": "7529968a88cd80481b45197aa26809e6f284f731"
"reference": "3ecc4e97858b91d59d9a3d6f19f6d6ad199f7b4e"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -1601,7 +1601,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-search",
"reference": "2caba68d537c7452bd82d211f1bf4d224e2aebc0"
"reference": "0a6bed1441b86391a3f81668d46c904123f4a5c1"
},
"require": {
"automattic/jetpack-assets": "^2.3.9-alpha",
Expand Down Expand Up @@ -1689,7 +1689,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-stats",
"reference": "6ce102e1a6151cdf63e79279c0b1f14efeec2795"
"reference": "204a68205150f117a801bbf7eacfd30e7015f750"
},
"require": {
"automattic/jetpack-connection": "^5.1.2-alpha",
Expand Down Expand Up @@ -1756,7 +1756,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-status",
"reference": "82c5989d031c45bd61b4a025a5ca21483f0220e9"
"reference": "a184e0faf090822e1685f85637e178a998dc6590"
},
"require": {
"automattic/jetpack-constants": "^2.0.4",
Expand Down Expand Up @@ -1815,12 +1815,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": "bef0358315ef42babea3a555f3e67b1a67554c2a"
"reference": "27a3f09dea15173334a8254e13dd305e282f8d9a"
},
"require": {
"automattic/jetpack-connection": "^5.1.2-alpha",
Expand Down
Loading

0 comments on commit adb7dc7

Please sign in to comment.