From afd1e4d63c8db2824d9d8815bead1f001e01dfa5 Mon Sep 17 00:00:00 2001 From: Anthony Grullon Date: Tue, 30 Apr 2024 17:40:23 -0400 Subject: [PATCH 01/20] Log error message from user invite response --- .../jetpack/modules/sso/class.jetpack-sso-user-admin.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php index 689c8cbdc8af9..c3ac154bbb167 100644 --- a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php +++ b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php @@ -252,8 +252,9 @@ public function invite_user_to_wpcom() { ); if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { - $error = 'invalid-invite-api-error'; - $query_params = array( + $error_message = $response->get_error_message(); + $error = 'invalid-invite-api-error'; + $query_params = array( 'jetpack-sso-invite-user' => 'failed', 'jetpack-sso-invite-error' => $error, '_wpnonce' => $nonce, @@ -263,7 +264,7 @@ public function invite_user_to_wpcom() { $event, array( 'success' => 'false', - 'error_message' => $error, + 'error_message' => $error_message, ) ); return self::create_error_notice_and_redirect( $query_params ); From 431fcc56e8b9769ac2f8a13f98e920e38d5e8682 Mon Sep 17 00:00:00 2001 From: Anthony Grullon Date: Tue, 30 Apr 2024 17:41:37 -0400 Subject: [PATCH 02/20] changelog --- .../changelog/update-invite-user-error-response-logging | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 projects/plugins/jetpack/changelog/update-invite-user-error-response-logging diff --git a/projects/plugins/jetpack/changelog/update-invite-user-error-response-logging b/projects/plugins/jetpack/changelog/update-invite-user-error-response-logging new file mode 100644 index 0000000000000..87881bbd97ce0 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-invite-user-error-response-logging @@ -0,0 +1,4 @@ +Significance: minor +Type: other + +Update invite user error response logging From cdc87ba52d1e8df56d33e38014a94a948d485646 Mon Sep 17 00:00:00 2001 From: Anthony Grullon Date: Wed, 1 May 2024 00:59:08 -0400 Subject: [PATCH 03/20] Check for wp_error --- .../jetpack/modules/sso/class.jetpack-sso-user-admin.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php index c3ac154bbb167..8b8db3bf0f802 100644 --- a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php +++ b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php @@ -252,9 +252,8 @@ public function invite_user_to_wpcom() { ); if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { - $error_message = $response->get_error_message(); - $error = 'invalid-invite-api-error'; - $query_params = array( + $error = is_wp_error( $response ) ? $response->get_error_message() : 'invalid-invite-api-error'; + $query_params = array( 'jetpack-sso-invite-user' => 'failed', 'jetpack-sso-invite-error' => $error, '_wpnonce' => $nonce, @@ -264,7 +263,7 @@ public function invite_user_to_wpcom() { $event, array( 'success' => 'false', - 'error_message' => $error_message, + 'error_message' => $error, ) ); return self::create_error_notice_and_redirect( $query_params ); From 9afb46e4a71ac7e9b014416a24d7d19bb6ce2589 Mon Sep 17 00:00:00 2001 From: mindbuc Date: Wed, 1 May 2024 15:39:46 +0200 Subject: [PATCH 04/20] Retrieve error message --- .../modules/sso/class.jetpack-sso-user-admin.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php index 8b8db3bf0f802..5e3332de04798 100644 --- a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php +++ b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php @@ -252,10 +252,11 @@ public function invite_user_to_wpcom() { ); if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { - $error = is_wp_error( $response ) ? $response->get_error_message() : 'invalid-invite-api-error'; - $query_params = array( + $error_code = 'invalid-invite-api-error'; + $error_message = is_wp_error( $response ) ? $response->get_error_message() : wp_remote_retrieve_response_message( $response ); + $query_params = array( 'jetpack-sso-invite-user' => 'failed', - 'jetpack-sso-invite-error' => $error, + 'jetpack-sso-invite-error' => $error_code, '_wpnonce' => $nonce, ); @@ -263,7 +264,8 @@ public function invite_user_to_wpcom() { $event, array( 'success' => 'false', - 'error_message' => $error, + 'error_code' => $error_code, + 'error_message' => $error_message, ) ); return self::create_error_notice_and_redirect( $query_params ); From 272d7adfb20a4b7592598cc8ff0f5cf4405848fc Mon Sep 17 00:00:00 2001 From: Anthony Grullon Date: Wed, 1 May 2024 11:00:14 -0400 Subject: [PATCH 05/20] Copy changes to connection package --- .../packages/connection/src/sso/class-user-admin.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/projects/packages/connection/src/sso/class-user-admin.php b/projects/packages/connection/src/sso/class-user-admin.php index a0b5b2bf9e637..9facca57acde3 100644 --- a/projects/packages/connection/src/sso/class-user-admin.php +++ b/projects/packages/connection/src/sso/class-user-admin.php @@ -261,10 +261,11 @@ public function invite_user_to_wpcom() { ); if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { - $error = 'invalid-invite-api-error'; - $query_params = array( + $error_code = 'invalid-invite-api-error'; + $error_message = is_wp_error( $response ) ? $response->get_error_message() : wp_remote_retrieve_response_message( $response ); + $query_params = array( 'jetpack-sso-invite-user' => 'failed', - 'jetpack-sso-invite-error' => $error, + 'jetpack-sso-invite-error' => $error_code, '_wpnonce' => $nonce, ); @@ -272,7 +273,8 @@ public function invite_user_to_wpcom() { $event, array( 'success' => 'false', - 'error_message' => $error, + 'error_code' => $error_code, + 'error_message' => $error_message, ) ); return self::create_error_notice_and_redirect( $query_params ); From 679a851925926b8551fd83d17315967f94a5b5de Mon Sep 17 00:00:00 2001 From: Anthony Grullon Date: Wed, 1 May 2024 11:01:01 -0400 Subject: [PATCH 06/20] changelog --- .../changelog/update-invite-user-error-response-logging | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 projects/packages/connection/changelog/update-invite-user-error-response-logging diff --git a/projects/packages/connection/changelog/update-invite-user-error-response-logging b/projects/packages/connection/changelog/update-invite-user-error-response-logging new file mode 100644 index 0000000000000..5644052da63e4 --- /dev/null +++ b/projects/packages/connection/changelog/update-invite-user-error-response-logging @@ -0,0 +1,4 @@ +Significance: minor +Type: changed + +SSO: Improve user invite error logging From 3ffcf9b6b57f60f33a3b5ec1672e180e6c852e90 Mon Sep 17 00:00:00 2001 From: Anthony Grullon Date: Wed, 1 May 2024 11:06:44 -0400 Subject: [PATCH 07/20] Connection package version update --- projects/packages/connection/composer.json | 2 +- projects/packages/connection/src/class-package-version.php | 2 +- .../automattic-for-agencies-client.php | 2 +- .../changelog/update-invite-user-error-response-logging | 5 +++++ .../plugins/automattic-for-agencies-client/composer.json | 2 +- .../plugins/automattic-for-agencies-client/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging | 5 +++++ projects/plugins/backup/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging | 5 +++++ projects/plugins/boost/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging | 5 +++++ projects/plugins/inspect/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging#2 | 5 +++++ projects/plugins/jetpack/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging | 5 +++++ projects/plugins/migration/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging | 5 +++++ projects/plugins/mu-wpcom-plugin/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging | 5 +++++ projects/plugins/protect/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging | 5 +++++ projects/plugins/search/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging | 5 +++++ projects/plugins/social/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging | 5 +++++ projects/plugins/starter-plugin/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging | 5 +++++ projects/plugins/videopress/composer.lock | 4 ++-- 28 files changed, 88 insertions(+), 28 deletions(-) create mode 100644 projects/plugins/automattic-for-agencies-client/changelog/update-invite-user-error-response-logging create mode 100644 projects/plugins/backup/changelog/update-invite-user-error-response-logging create mode 100644 projects/plugins/boost/changelog/update-invite-user-error-response-logging create mode 100644 projects/plugins/inspect/changelog/update-invite-user-error-response-logging create mode 100644 projects/plugins/jetpack/changelog/update-invite-user-error-response-logging#2 create mode 100644 projects/plugins/migration/changelog/update-invite-user-error-response-logging create mode 100644 projects/plugins/mu-wpcom-plugin/changelog/update-invite-user-error-response-logging create mode 100644 projects/plugins/protect/changelog/update-invite-user-error-response-logging create mode 100644 projects/plugins/search/changelog/update-invite-user-error-response-logging create mode 100644 projects/plugins/social/changelog/update-invite-user-error-response-logging create mode 100644 projects/plugins/starter-plugin/changelog/update-invite-user-error-response-logging create mode 100644 projects/plugins/videopress/changelog/update-invite-user-error-response-logging diff --git a/projects/packages/connection/composer.json b/projects/packages/connection/composer.json index 711e94ed95e5e..18fb4e53dc508 100644 --- a/projects/packages/connection/composer.json +++ b/projects/packages/connection/composer.json @@ -67,7 +67,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" } }, "config": { diff --git a/projects/packages/connection/src/class-package-version.php b/projects/packages/connection/src/class-package-version.php index 071fcd8b17c6a..702bd661d3734 100644 --- a/projects/packages/connection/src/class-package-version.php +++ b/projects/packages/connection/src/class-package-version.php @@ -12,7 +12,7 @@ */ class Package_Version { - const PACKAGE_VERSION = '2.7.6-alpha'; + const PACKAGE_VERSION = '2.8.0-alpha'; const PACKAGE_SLUG = 'connection'; diff --git a/projects/plugins/automattic-for-agencies-client/automattic-for-agencies-client.php b/projects/plugins/automattic-for-agencies-client/automattic-for-agencies-client.php index d0f5ef7a5e769..3cf525bafd432 100644 --- a/projects/plugins/automattic-for-agencies-client/automattic-for-agencies-client.php +++ b/projects/plugins/automattic-for-agencies-client/automattic-for-agencies-client.php @@ -4,7 +4,7 @@ * Plugin Name: Automattic for Agencies Client * Plugin URI: https://wordpress.org/plugins/automattic-for-agencies-client * Description: Securely connect your clients’ sites to the Automattic for Agencies Sites Dashboard. Manage your sites from one place and see what needs attention. - * Version: 0.1.0-alpha + * Version: 0.1.1-alpha * Author: Automattic * Author URI: https://jetpack.com/ * License: GPLv2 or later diff --git a/projects/plugins/automattic-for-agencies-client/changelog/update-invite-user-error-response-logging b/projects/plugins/automattic-for-agencies-client/changelog/update-invite-user-error-response-logging new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/automattic-for-agencies-client/changelog/update-invite-user-error-response-logging @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/automattic-for-agencies-client/composer.json b/projects/plugins/automattic-for-agencies-client/composer.json index 003f8fc0584f1..fa5ba9f0016ae 100644 --- a/projects/plugins/automattic-for-agencies-client/composer.json +++ b/projects/plugins/automattic-for-agencies-client/composer.json @@ -71,6 +71,6 @@ "automattic/jetpack-autoloader": true, "automattic/jetpack-composer-plugin": true }, - "autoloader-suffix": "c4802e05bbcf59fd3b6350e8d3e5482c_automattic_for_agencies_clientⓥ0_1_0_alpha" + "autoloader-suffix": "c4802e05bbcf59fd3b6350e8d3e5482c_automattic_for_agencies_clientⓥ0_1_1_alpha" } } diff --git a/projects/plugins/automattic-for-agencies-client/composer.lock b/projects/plugins/automattic-for-agencies-client/composer.lock index a2dbe0ad89f35..c5ad37fa52272 100644 --- a/projects/plugins/automattic-for-agencies-client/composer.lock +++ b/projects/plugins/automattic-for-agencies-client/composer.lock @@ -353,7 +353,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "4b7d9b428cd74c5b33129e0712e3dd417b8268bf" + "reference": "342ae462b15212e396137c9210b655227e931fbf" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -386,7 +386,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" } }, "autoload": { diff --git a/projects/plugins/backup/changelog/update-invite-user-error-response-logging b/projects/plugins/backup/changelog/update-invite-user-error-response-logging new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/backup/changelog/update-invite-user-error-response-logging @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/backup/composer.lock b/projects/plugins/backup/composer.lock index c1cc191eca4f0..55feb868bb2d0 100644 --- a/projects/plugins/backup/composer.lock +++ b/projects/plugins/backup/composer.lock @@ -634,7 +634,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "4b7d9b428cd74c5b33129e0712e3dd417b8268bf" + "reference": "342ae462b15212e396137c9210b655227e931fbf" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -667,7 +667,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" } }, "autoload": { diff --git a/projects/plugins/boost/changelog/update-invite-user-error-response-logging b/projects/plugins/boost/changelog/update-invite-user-error-response-logging new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/boost/changelog/update-invite-user-error-response-logging @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/boost/composer.lock b/projects/plugins/boost/composer.lock index fed41eaac43c8..a3f0239630f29 100644 --- a/projects/plugins/boost/composer.lock +++ b/projects/plugins/boost/composer.lock @@ -490,7 +490,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "4b7d9b428cd74c5b33129e0712e3dd417b8268bf" + "reference": "342ae462b15212e396137c9210b655227e931fbf" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -523,7 +523,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" } }, "autoload": { diff --git a/projects/plugins/inspect/changelog/update-invite-user-error-response-logging b/projects/plugins/inspect/changelog/update-invite-user-error-response-logging new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/inspect/changelog/update-invite-user-error-response-logging @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/inspect/composer.lock b/projects/plugins/inspect/composer.lock index 5503b08485b05..48c8e597e8ad6 100644 --- a/projects/plugins/inspect/composer.lock +++ b/projects/plugins/inspect/composer.lock @@ -353,7 +353,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "4b7d9b428cd74c5b33129e0712e3dd417b8268bf" + "reference": "342ae462b15212e396137c9210b655227e931fbf" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -386,7 +386,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" } }, "autoload": { diff --git a/projects/plugins/jetpack/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/jetpack/changelog/update-invite-user-error-response-logging#2 new file mode 100644 index 0000000000000..a1c1831fa1ef7 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-invite-user-error-response-logging#2 @@ -0,0 +1,5 @@ +Significance: patch +Type: other +Comment: Updated composer.lock. + + diff --git a/projects/plugins/jetpack/composer.lock b/projects/plugins/jetpack/composer.lock index 24fb912671cb8..a63dcd8436eeb 100644 --- a/projects/plugins/jetpack/composer.lock +++ b/projects/plugins/jetpack/composer.lock @@ -867,7 +867,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "4b7d9b428cd74c5b33129e0712e3dd417b8268bf" + "reference": "342ae462b15212e396137c9210b655227e931fbf" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -900,7 +900,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" } }, "autoload": { diff --git a/projects/plugins/migration/changelog/update-invite-user-error-response-logging b/projects/plugins/migration/changelog/update-invite-user-error-response-logging new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/migration/changelog/update-invite-user-error-response-logging @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/migration/composer.lock b/projects/plugins/migration/composer.lock index 8c2886fc86e81..cd3b22ed10cf3 100644 --- a/projects/plugins/migration/composer.lock +++ b/projects/plugins/migration/composer.lock @@ -634,7 +634,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "4b7d9b428cd74c5b33129e0712e3dd417b8268bf" + "reference": "342ae462b15212e396137c9210b655227e931fbf" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -667,7 +667,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" } }, "autoload": { diff --git a/projects/plugins/mu-wpcom-plugin/changelog/update-invite-user-error-response-logging b/projects/plugins/mu-wpcom-plugin/changelog/update-invite-user-error-response-logging new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/mu-wpcom-plugin/changelog/update-invite-user-error-response-logging @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/mu-wpcom-plugin/composer.lock b/projects/plugins/mu-wpcom-plugin/composer.lock index 6799e76149221..428a4310b0818 100644 --- a/projects/plugins/mu-wpcom-plugin/composer.lock +++ b/projects/plugins/mu-wpcom-plugin/composer.lock @@ -249,7 +249,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "4b7d9b428cd74c5b33129e0712e3dd417b8268bf" + "reference": "342ae462b15212e396137c9210b655227e931fbf" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -282,7 +282,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" } }, "autoload": { diff --git a/projects/plugins/protect/changelog/update-invite-user-error-response-logging b/projects/plugins/protect/changelog/update-invite-user-error-response-logging new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/protect/changelog/update-invite-user-error-response-logging @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/protect/composer.lock b/projects/plugins/protect/composer.lock index cdb239ea65092..6a09b26b0d00a 100644 --- a/projects/plugins/protect/composer.lock +++ b/projects/plugins/protect/composer.lock @@ -547,7 +547,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "4b7d9b428cd74c5b33129e0712e3dd417b8268bf" + "reference": "342ae462b15212e396137c9210b655227e931fbf" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -580,7 +580,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" } }, "autoload": { diff --git a/projects/plugins/search/changelog/update-invite-user-error-response-logging b/projects/plugins/search/changelog/update-invite-user-error-response-logging new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/search/changelog/update-invite-user-error-response-logging @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/search/composer.lock b/projects/plugins/search/composer.lock index cff1180310f32..d86b0c8e67cdb 100644 --- a/projects/plugins/search/composer.lock +++ b/projects/plugins/search/composer.lock @@ -490,7 +490,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "4b7d9b428cd74c5b33129e0712e3dd417b8268bf" + "reference": "342ae462b15212e396137c9210b655227e931fbf" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -523,7 +523,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" } }, "autoload": { diff --git a/projects/plugins/social/changelog/update-invite-user-error-response-logging b/projects/plugins/social/changelog/update-invite-user-error-response-logging new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/social/changelog/update-invite-user-error-response-logging @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/social/composer.lock b/projects/plugins/social/composer.lock index 5ddc36c2fb1d9..147d22f0d21bf 100644 --- a/projects/plugins/social/composer.lock +++ b/projects/plugins/social/composer.lock @@ -490,7 +490,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "4b7d9b428cd74c5b33129e0712e3dd417b8268bf" + "reference": "342ae462b15212e396137c9210b655227e931fbf" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -523,7 +523,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" } }, "autoload": { diff --git a/projects/plugins/starter-plugin/changelog/update-invite-user-error-response-logging b/projects/plugins/starter-plugin/changelog/update-invite-user-error-response-logging new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/starter-plugin/changelog/update-invite-user-error-response-logging @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/starter-plugin/composer.lock b/projects/plugins/starter-plugin/composer.lock index f549117d64266..4469d6901f8b1 100644 --- a/projects/plugins/starter-plugin/composer.lock +++ b/projects/plugins/starter-plugin/composer.lock @@ -490,7 +490,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "4b7d9b428cd74c5b33129e0712e3dd417b8268bf" + "reference": "342ae462b15212e396137c9210b655227e931fbf" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -523,7 +523,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" } }, "autoload": { diff --git a/projects/plugins/videopress/changelog/update-invite-user-error-response-logging b/projects/plugins/videopress/changelog/update-invite-user-error-response-logging new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/videopress/changelog/update-invite-user-error-response-logging @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/videopress/composer.lock b/projects/plugins/videopress/composer.lock index bd56d929bf71b..cf39c56e7c5f2 100644 --- a/projects/plugins/videopress/composer.lock +++ b/projects/plugins/videopress/composer.lock @@ -490,7 +490,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "4b7d9b428cd74c5b33129e0712e3dd417b8268bf" + "reference": "342ae462b15212e396137c9210b655227e931fbf" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -523,7 +523,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" } }, "autoload": { From f8b3e7d6fe0c68f6e50ebd5f81537861811e39f7 Mon Sep 17 00:00:00 2001 From: Anthony Grullon Date: Wed, 1 May 2024 13:03:11 -0400 Subject: [PATCH 08/20] Display user invite error message --- .../jetpack/modules/sso/class.jetpack-sso-user-admin.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php index 5e3332de04798..0cb7d1d730701 100644 --- a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php +++ b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php @@ -162,6 +162,10 @@ public function handle_invitation_results() { return wp_admin_notice( __( 'User invite revoked successfully.', 'jetpack' ), array( 'type' => 'success' ) ); } + if ( $_GET['jetpack-sso-invite-user'] === 'failed' && isset( $_GET['jetpack-sso-invite-api-error-message'] ) ) { + return wp_admin_notice( wp_kses( wp_unslash( $_GET['jetpack-sso-invite-api-error-message'] ), array() ), array( 'type' => 'error' ) ); + } + if ( $_GET['jetpack-sso-invite-user'] === 'failed' && isset( $_GET['jetpack-sso-invite-error'] ) ) { switch ( $_GET['jetpack-sso-invite-error'] ) { case 'invalid-user': @@ -257,6 +261,7 @@ public function invite_user_to_wpcom() { $query_params = array( 'jetpack-sso-invite-user' => 'failed', 'jetpack-sso-invite-error' => $error_code, + 'jetpack-sso-invite-api-error-messsage' => $error_message, '_wpnonce' => $nonce, ); From eb42dcb2936f206be109c0379f5e686bb98ebef0 Mon Sep 17 00:00:00 2001 From: Anthony Grullon Date: Wed, 1 May 2024 14:24:06 -0400 Subject: [PATCH 09/20] update query param key --- .../jetpack/modules/sso/class.jetpack-sso-user-admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php index 0cb7d1d730701..d34405ad257c4 100644 --- a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php +++ b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php @@ -261,7 +261,7 @@ public function invite_user_to_wpcom() { $query_params = array( 'jetpack-sso-invite-user' => 'failed', 'jetpack-sso-invite-error' => $error_code, - 'jetpack-sso-invite-api-error-messsage' => $error_message, + 'jetpack-sso-invite-api-error-message' => $error_message, '_wpnonce' => $nonce, ); From ea4c2cf7f4670b3ef968b8e0e212e6400bee6b2e Mon Sep 17 00:00:00 2001 From: Anthony Grullon Date: Thu, 2 May 2024 11:30:24 -0400 Subject: [PATCH 10/20] Update logic to display error message on users screen --- .../sso/class.jetpack-sso-user-admin.php | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php index d34405ad257c4..0ec33fe0d67dc 100644 --- a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php +++ b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php @@ -256,22 +256,27 @@ public function invite_user_to_wpcom() { ); if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { - $error_code = 'invalid-invite-api-error'; - $error_message = is_wp_error( $response ) ? $response->get_error_message() : wp_remote_retrieve_response_message( $response ); - $query_params = array( + $error_code = 'invalid-invite-api-error'; + $query_params = array( 'jetpack-sso-invite-user' => 'failed', 'jetpack-sso-invite-error' => $error_code, - 'jetpack-sso-invite-api-error-message' => $error_message, '_wpnonce' => $nonce, ); + $tracking_event_data = array( + 'success' => 'false', + 'error_code' => $error_code, + ); + + $body = json_decode( $response['body'] ); + if ( $body && $body->message ) { + $query_params['jetpack-sso-invite-api-error-message'] = $body->message; + $tracking_event_data['error_message'] = $body->message; + } + self::$tracking->record_user_event( $event, - array( - 'success' => 'false', - 'error_code' => $error_code, - 'error_message' => $error_message, - ) + $tracking_event_data ); return self::create_error_notice_and_redirect( $query_params ); } From f484201132bea2f6a8f007e71c419513b21c33f2 Mon Sep 17 00:00:00 2001 From: Anthony Grullon Date: Mon, 6 May 2024 11:27:49 -0400 Subject: [PATCH 11/20] Sync latest sso user admin changes in Connection package --- .../connection/src/sso/class-user-admin.php | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/projects/packages/connection/src/sso/class-user-admin.php b/projects/packages/connection/src/sso/class-user-admin.php index 9facca57acde3..4099518cdeb95 100644 --- a/projects/packages/connection/src/sso/class-user-admin.php +++ b/projects/packages/connection/src/sso/class-user-admin.php @@ -171,6 +171,10 @@ public function handle_invitation_results() { return wp_admin_notice( __( 'User invite revoked successfully.', 'jetpack-connection' ), array( 'type' => 'success' ) ); } + if ( $_GET['jetpack-sso-invite-user'] === 'failed' && isset( $_GET['jetpack-sso-invite-api-error-message'] ) ) { + return wp_admin_notice( wp_kses( wp_unslash( $_GET['jetpack-sso-invite-api-error-message'] ), array() ), array( 'type' => 'error' ) ); + } + if ( $_GET['jetpack-sso-invite-user'] === 'failed' && isset( $_GET['jetpack-sso-invite-error'] ) ) { switch ( $_GET['jetpack-sso-invite-error'] ) { case 'invalid-user': @@ -261,21 +265,27 @@ public function invite_user_to_wpcom() { ); if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { - $error_code = 'invalid-invite-api-error'; - $error_message = is_wp_error( $response ) ? $response->get_error_message() : wp_remote_retrieve_response_message( $response ); - $query_params = array( + $error_code = 'invalid-invite-api-error'; + $query_params = array( 'jetpack-sso-invite-user' => 'failed', 'jetpack-sso-invite-error' => $error_code, '_wpnonce' => $nonce, ); + $tracking_event_data = array( + 'success' => 'false', + 'error_code' => $error_code, + ); + + $body = json_decode( $response['body'] ); + if ( $body && $body->message ) { + $query_params['jetpack-sso-invite-api-error-message'] = $body->message; + $tracking_event_data['error_message'] = $body->message; + } + self::$tracking->record_user_event( $event, - array( - 'success' => 'false', - 'error_code' => $error_code, - 'error_message' => $error_message, - ) + $tracking_event_data ); return self::create_error_notice_and_redirect( $query_params ); } From fc9586d293c3133317be4dccd5dcb763c94bfddb Mon Sep 17 00:00:00 2001 From: Anthony Grullon Date: Mon, 6 May 2024 11:36:13 -0400 Subject: [PATCH 12/20] Update connection package version --- projects/packages/connection/composer.json | 2 +- .../changelog/update-invite-user-error-response-logging#2 | 5 +++++ .../plugins/automattic-for-agencies-client/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging#2 | 5 +++++ projects/plugins/backup/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging#2 | 5 +++++ projects/plugins/boost/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging#2 | 5 +++++ projects/plugins/inspect/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging#3 | 5 +++++ projects/plugins/jetpack/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging#2 | 5 +++++ projects/plugins/migration/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging#2 | 5 +++++ projects/plugins/mu-wpcom-plugin/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging#2 | 5 +++++ projects/plugins/protect/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging#2 | 5 +++++ projects/plugins/search/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging#2 | 5 +++++ projects/plugins/social/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging#2 | 5 +++++ projects/plugins/starter-plugin/composer.lock | 4 ++-- .../changelog/update-invite-user-error-response-logging#2 | 5 +++++ projects/plugins/videopress/composer.lock | 4 ++-- 25 files changed, 85 insertions(+), 25 deletions(-) create mode 100644 projects/plugins/automattic-for-agencies-client/changelog/update-invite-user-error-response-logging#2 create mode 100644 projects/plugins/backup/changelog/update-invite-user-error-response-logging#2 create mode 100644 projects/plugins/boost/changelog/update-invite-user-error-response-logging#2 create mode 100644 projects/plugins/inspect/changelog/update-invite-user-error-response-logging#2 create mode 100644 projects/plugins/jetpack/changelog/update-invite-user-error-response-logging#3 create mode 100644 projects/plugins/migration/changelog/update-invite-user-error-response-logging#2 create mode 100644 projects/plugins/mu-wpcom-plugin/changelog/update-invite-user-error-response-logging#2 create mode 100644 projects/plugins/protect/changelog/update-invite-user-error-response-logging#2 create mode 100644 projects/plugins/search/changelog/update-invite-user-error-response-logging#2 create mode 100644 projects/plugins/social/changelog/update-invite-user-error-response-logging#2 create mode 100644 projects/plugins/starter-plugin/changelog/update-invite-user-error-response-logging#2 create mode 100644 projects/plugins/videopress/changelog/update-invite-user-error-response-logging#2 diff --git a/projects/packages/connection/composer.json b/projects/packages/connection/composer.json index 759d822b9cc7a..355b6bafd0e82 100644 --- a/projects/packages/connection/composer.json +++ b/projects/packages/connection/composer.json @@ -69,7 +69,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" }, "dependencies": { "test-only": [ diff --git a/projects/plugins/automattic-for-agencies-client/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/automattic-for-agencies-client/changelog/update-invite-user-error-response-logging#2 new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/automattic-for-agencies-client/changelog/update-invite-user-error-response-logging#2 @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/automattic-for-agencies-client/composer.lock b/projects/plugins/automattic-for-agencies-client/composer.lock index b4c5681627cb9..d8c313058b91e 100644 --- a/projects/plugins/automattic-for-agencies-client/composer.lock +++ b/projects/plugins/automattic-for-agencies-client/composer.lock @@ -385,7 +385,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "ef847deea958cb05bab52cbc11f924f5b8eab365" + "reference": "bba49ffca10ebb3868ca3db25ddbf34c5eb72120" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -420,7 +420,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" }, "dependencies": { "test-only": [ diff --git a/projects/plugins/backup/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/backup/changelog/update-invite-user-error-response-logging#2 new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/backup/changelog/update-invite-user-error-response-logging#2 @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/backup/composer.lock b/projects/plugins/backup/composer.lock index ccd81132b1d2b..80b3769fec313 100644 --- a/projects/plugins/backup/composer.lock +++ b/projects/plugins/backup/composer.lock @@ -668,7 +668,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "ef847deea958cb05bab52cbc11f924f5b8eab365" + "reference": "bba49ffca10ebb3868ca3db25ddbf34c5eb72120" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -703,7 +703,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" }, "dependencies": { "test-only": [ diff --git a/projects/plugins/boost/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/boost/changelog/update-invite-user-error-response-logging#2 new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/boost/changelog/update-invite-user-error-response-logging#2 @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/boost/composer.lock b/projects/plugins/boost/composer.lock index d04d69b415ad1..8622668cc844e 100644 --- a/projects/plugins/boost/composer.lock +++ b/projects/plugins/boost/composer.lock @@ -523,7 +523,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "ef847deea958cb05bab52cbc11f924f5b8eab365" + "reference": "bba49ffca10ebb3868ca3db25ddbf34c5eb72120" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -558,7 +558,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" }, "dependencies": { "test-only": [ diff --git a/projects/plugins/inspect/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/inspect/changelog/update-invite-user-error-response-logging#2 new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/inspect/changelog/update-invite-user-error-response-logging#2 @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/inspect/composer.lock b/projects/plugins/inspect/composer.lock index 90dabf6c074f9..fa058a3fc64e2 100644 --- a/projects/plugins/inspect/composer.lock +++ b/projects/plugins/inspect/composer.lock @@ -385,7 +385,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "ef847deea958cb05bab52cbc11f924f5b8eab365" + "reference": "bba49ffca10ebb3868ca3db25ddbf34c5eb72120" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -420,7 +420,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" }, "dependencies": { "test-only": [ diff --git a/projects/plugins/jetpack/changelog/update-invite-user-error-response-logging#3 b/projects/plugins/jetpack/changelog/update-invite-user-error-response-logging#3 new file mode 100644 index 0000000000000..a1c1831fa1ef7 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-invite-user-error-response-logging#3 @@ -0,0 +1,5 @@ +Significance: patch +Type: other +Comment: Updated composer.lock. + + diff --git a/projects/plugins/jetpack/composer.lock b/projects/plugins/jetpack/composer.lock index 6780f6967ab3e..e04fa6e7d9a71 100644 --- a/projects/plugins/jetpack/composer.lock +++ b/projects/plugins/jetpack/composer.lock @@ -901,7 +901,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "ef847deea958cb05bab52cbc11f924f5b8eab365" + "reference": "bba49ffca10ebb3868ca3db25ddbf34c5eb72120" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -936,7 +936,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" }, "dependencies": { "test-only": [ diff --git a/projects/plugins/migration/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/migration/changelog/update-invite-user-error-response-logging#2 new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/migration/changelog/update-invite-user-error-response-logging#2 @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/migration/composer.lock b/projects/plugins/migration/composer.lock index 7935bc6fd45cb..ad6adc5e4d736 100644 --- a/projects/plugins/migration/composer.lock +++ b/projects/plugins/migration/composer.lock @@ -668,7 +668,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "ef847deea958cb05bab52cbc11f924f5b8eab365" + "reference": "bba49ffca10ebb3868ca3db25ddbf34c5eb72120" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -703,7 +703,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" }, "dependencies": { "test-only": [ diff --git a/projects/plugins/mu-wpcom-plugin/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/mu-wpcom-plugin/changelog/update-invite-user-error-response-logging#2 new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/mu-wpcom-plugin/changelog/update-invite-user-error-response-logging#2 @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/mu-wpcom-plugin/composer.lock b/projects/plugins/mu-wpcom-plugin/composer.lock index 1e367067e89df..5cf9557ad4d5c 100644 --- a/projects/plugins/mu-wpcom-plugin/composer.lock +++ b/projects/plugins/mu-wpcom-plugin/composer.lock @@ -249,7 +249,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "ef847deea958cb05bab52cbc11f924f5b8eab365" + "reference": "bba49ffca10ebb3868ca3db25ddbf34c5eb72120" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -284,7 +284,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" }, "dependencies": { "test-only": [ diff --git a/projects/plugins/protect/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/protect/changelog/update-invite-user-error-response-logging#2 new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/protect/changelog/update-invite-user-error-response-logging#2 @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/protect/composer.lock b/projects/plugins/protect/composer.lock index 9ced4ec062b7c..fac13b5794747 100644 --- a/projects/plugins/protect/composer.lock +++ b/projects/plugins/protect/composer.lock @@ -580,7 +580,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "ef847deea958cb05bab52cbc11f924f5b8eab365" + "reference": "bba49ffca10ebb3868ca3db25ddbf34c5eb72120" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -615,7 +615,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" }, "dependencies": { "test-only": [ diff --git a/projects/plugins/search/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/search/changelog/update-invite-user-error-response-logging#2 new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/search/changelog/update-invite-user-error-response-logging#2 @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/search/composer.lock b/projects/plugins/search/composer.lock index 2cbf046a868b3..63008e0037502 100644 --- a/projects/plugins/search/composer.lock +++ b/projects/plugins/search/composer.lock @@ -523,7 +523,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "ef847deea958cb05bab52cbc11f924f5b8eab365" + "reference": "bba49ffca10ebb3868ca3db25ddbf34c5eb72120" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -558,7 +558,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" }, "dependencies": { "test-only": [ diff --git a/projects/plugins/social/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/social/changelog/update-invite-user-error-response-logging#2 new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/social/changelog/update-invite-user-error-response-logging#2 @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/social/composer.lock b/projects/plugins/social/composer.lock index 80f0abd5e3246..0881baa548727 100644 --- a/projects/plugins/social/composer.lock +++ b/projects/plugins/social/composer.lock @@ -523,7 +523,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "ef847deea958cb05bab52cbc11f924f5b8eab365" + "reference": "bba49ffca10ebb3868ca3db25ddbf34c5eb72120" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -558,7 +558,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" }, "dependencies": { "test-only": [ diff --git a/projects/plugins/starter-plugin/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/starter-plugin/changelog/update-invite-user-error-response-logging#2 new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/starter-plugin/changelog/update-invite-user-error-response-logging#2 @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/starter-plugin/composer.lock b/projects/plugins/starter-plugin/composer.lock index 3eedbfb5de947..1df67c7c758fc 100644 --- a/projects/plugins/starter-plugin/composer.lock +++ b/projects/plugins/starter-plugin/composer.lock @@ -523,7 +523,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "ef847deea958cb05bab52cbc11f924f5b8eab365" + "reference": "bba49ffca10ebb3868ca3db25ddbf34c5eb72120" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -558,7 +558,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" }, "dependencies": { "test-only": [ diff --git a/projects/plugins/videopress/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/videopress/changelog/update-invite-user-error-response-logging#2 new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/videopress/changelog/update-invite-user-error-response-logging#2 @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/videopress/composer.lock b/projects/plugins/videopress/composer.lock index 7f0c21fd854af..c2556bf1f9585 100644 --- a/projects/plugins/videopress/composer.lock +++ b/projects/plugins/videopress/composer.lock @@ -523,7 +523,7 @@ "dist": { "type": "path", "url": "../../packages/connection", - "reference": "ef847deea958cb05bab52cbc11f924f5b8eab365" + "reference": "bba49ffca10ebb3868ca3db25ddbf34c5eb72120" }, "require": { "automattic/jetpack-a8c-mc-stats": "@dev", @@ -558,7 +558,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.7.x-dev" + "dev-trunk": "2.8.x-dev" }, "dependencies": { "test-only": [ From b32807280fe6e96337bfc92342b4e8d4d0327f4b Mon Sep 17 00:00:00 2001 From: Anthony Grullon Date: Mon, 6 May 2024 11:50:48 -0400 Subject: [PATCH 13/20] Remove duplicate changelogs --- .../changelog/update-invite-user-error-response-logging#2 | 5 ----- .../changelog/update-invite-user-error-response-logging#2 | 5 ----- .../changelog/update-invite-user-error-response-logging#2 | 5 ----- .../changelog/update-invite-user-error-response-logging#2 | 5 ----- .../changelog/update-invite-user-error-response-logging#2 | 5 ----- .../changelog/update-invite-user-error-response-logging#3 | 5 ----- .../changelog/update-invite-user-error-response-logging#2 | 5 ----- .../changelog/update-invite-user-error-response-logging#2 | 5 ----- .../changelog/update-invite-user-error-response-logging#2 | 5 ----- .../changelog/update-invite-user-error-response-logging#2 | 5 ----- .../changelog/update-invite-user-error-response-logging#2 | 5 ----- .../changelog/update-invite-user-error-response-logging#2 | 5 ----- .../changelog/update-invite-user-error-response-logging#2 | 5 ----- 13 files changed, 65 deletions(-) delete mode 100644 projects/plugins/automattic-for-agencies-client/changelog/update-invite-user-error-response-logging#2 delete mode 100644 projects/plugins/backup/changelog/update-invite-user-error-response-logging#2 delete mode 100644 projects/plugins/boost/changelog/update-invite-user-error-response-logging#2 delete mode 100644 projects/plugins/inspect/changelog/update-invite-user-error-response-logging#2 delete mode 100644 projects/plugins/jetpack/changelog/update-invite-user-error-response-logging#2 delete mode 100644 projects/plugins/jetpack/changelog/update-invite-user-error-response-logging#3 delete mode 100644 projects/plugins/migration/changelog/update-invite-user-error-response-logging#2 delete mode 100644 projects/plugins/mu-wpcom-plugin/changelog/update-invite-user-error-response-logging#2 delete mode 100644 projects/plugins/protect/changelog/update-invite-user-error-response-logging#2 delete mode 100644 projects/plugins/search/changelog/update-invite-user-error-response-logging#2 delete mode 100644 projects/plugins/social/changelog/update-invite-user-error-response-logging#2 delete mode 100644 projects/plugins/starter-plugin/changelog/update-invite-user-error-response-logging#2 delete mode 100644 projects/plugins/videopress/changelog/update-invite-user-error-response-logging#2 diff --git a/projects/plugins/automattic-for-agencies-client/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/automattic-for-agencies-client/changelog/update-invite-user-error-response-logging#2 deleted file mode 100644 index 9aa70e3ec1f75..0000000000000 --- a/projects/plugins/automattic-for-agencies-client/changelog/update-invite-user-error-response-logging#2 +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: changed -Comment: Updated composer.lock. - - diff --git a/projects/plugins/backup/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/backup/changelog/update-invite-user-error-response-logging#2 deleted file mode 100644 index 9aa70e3ec1f75..0000000000000 --- a/projects/plugins/backup/changelog/update-invite-user-error-response-logging#2 +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: changed -Comment: Updated composer.lock. - - diff --git a/projects/plugins/boost/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/boost/changelog/update-invite-user-error-response-logging#2 deleted file mode 100644 index 9aa70e3ec1f75..0000000000000 --- a/projects/plugins/boost/changelog/update-invite-user-error-response-logging#2 +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: changed -Comment: Updated composer.lock. - - diff --git a/projects/plugins/inspect/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/inspect/changelog/update-invite-user-error-response-logging#2 deleted file mode 100644 index 9aa70e3ec1f75..0000000000000 --- a/projects/plugins/inspect/changelog/update-invite-user-error-response-logging#2 +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: changed -Comment: Updated composer.lock. - - diff --git a/projects/plugins/jetpack/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/jetpack/changelog/update-invite-user-error-response-logging#2 deleted file mode 100644 index a1c1831fa1ef7..0000000000000 --- a/projects/plugins/jetpack/changelog/update-invite-user-error-response-logging#2 +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: other -Comment: Updated composer.lock. - - diff --git a/projects/plugins/jetpack/changelog/update-invite-user-error-response-logging#3 b/projects/plugins/jetpack/changelog/update-invite-user-error-response-logging#3 deleted file mode 100644 index a1c1831fa1ef7..0000000000000 --- a/projects/plugins/jetpack/changelog/update-invite-user-error-response-logging#3 +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: other -Comment: Updated composer.lock. - - diff --git a/projects/plugins/migration/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/migration/changelog/update-invite-user-error-response-logging#2 deleted file mode 100644 index 9aa70e3ec1f75..0000000000000 --- a/projects/plugins/migration/changelog/update-invite-user-error-response-logging#2 +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: changed -Comment: Updated composer.lock. - - diff --git a/projects/plugins/mu-wpcom-plugin/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/mu-wpcom-plugin/changelog/update-invite-user-error-response-logging#2 deleted file mode 100644 index 9aa70e3ec1f75..0000000000000 --- a/projects/plugins/mu-wpcom-plugin/changelog/update-invite-user-error-response-logging#2 +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: changed -Comment: Updated composer.lock. - - diff --git a/projects/plugins/protect/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/protect/changelog/update-invite-user-error-response-logging#2 deleted file mode 100644 index 9aa70e3ec1f75..0000000000000 --- a/projects/plugins/protect/changelog/update-invite-user-error-response-logging#2 +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: changed -Comment: Updated composer.lock. - - diff --git a/projects/plugins/search/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/search/changelog/update-invite-user-error-response-logging#2 deleted file mode 100644 index 9aa70e3ec1f75..0000000000000 --- a/projects/plugins/search/changelog/update-invite-user-error-response-logging#2 +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: changed -Comment: Updated composer.lock. - - diff --git a/projects/plugins/social/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/social/changelog/update-invite-user-error-response-logging#2 deleted file mode 100644 index 9aa70e3ec1f75..0000000000000 --- a/projects/plugins/social/changelog/update-invite-user-error-response-logging#2 +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: changed -Comment: Updated composer.lock. - - diff --git a/projects/plugins/starter-plugin/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/starter-plugin/changelog/update-invite-user-error-response-logging#2 deleted file mode 100644 index 9aa70e3ec1f75..0000000000000 --- a/projects/plugins/starter-plugin/changelog/update-invite-user-error-response-logging#2 +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: changed -Comment: Updated composer.lock. - - diff --git a/projects/plugins/videopress/changelog/update-invite-user-error-response-logging#2 b/projects/plugins/videopress/changelog/update-invite-user-error-response-logging#2 deleted file mode 100644 index 9aa70e3ec1f75..0000000000000 --- a/projects/plugins/videopress/changelog/update-invite-user-error-response-logging#2 +++ /dev/null @@ -1,5 +0,0 @@ -Significance: patch -Type: changed -Comment: Updated composer.lock. - - From 35597bf080d5a897799c5e5685569413f34235a0 Mon Sep 17 00:00:00 2001 From: Anthony Grullon Date: Tue, 7 May 2024 16:36:29 -0400 Subject: [PATCH 14/20] Update projects/packages/connection/src/sso/class-user-admin.php Co-authored-by: Jeremy Herve --- projects/packages/connection/src/sso/class-user-admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/packages/connection/src/sso/class-user-admin.php b/projects/packages/connection/src/sso/class-user-admin.php index 4099518cdeb95..7d9149f57edca 100644 --- a/projects/packages/connection/src/sso/class-user-admin.php +++ b/projects/packages/connection/src/sso/class-user-admin.php @@ -277,7 +277,7 @@ public function invite_user_to_wpcom() { 'error_code' => $error_code, ); - $body = json_decode( $response['body'] ); + $body = json_decode( wp_remote_retrieve_body( $response ) ); if ( $body && $body->message ) { $query_params['jetpack-sso-invite-api-error-message'] = $body->message; $tracking_event_data['error_message'] = $body->message; From 26df29b456d08e975fc4ae40e08e26ff8d977494 Mon Sep 17 00:00:00 2001 From: Anthony Grullon Date: Tue, 7 May 2024 16:36:39 -0400 Subject: [PATCH 15/20] Update projects/packages/connection/src/sso/class-user-admin.php Co-authored-by: Jeremy Herve --- projects/packages/connection/src/sso/class-user-admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/packages/connection/src/sso/class-user-admin.php b/projects/packages/connection/src/sso/class-user-admin.php index 7d9149f57edca..01bcf4a445a01 100644 --- a/projects/packages/connection/src/sso/class-user-admin.php +++ b/projects/packages/connection/src/sso/class-user-admin.php @@ -278,7 +278,7 @@ public function invite_user_to_wpcom() { ); $body = json_decode( wp_remote_retrieve_body( $response ) ); - if ( $body && $body->message ) { + if ( ! empty( $body ) && ! empty( $body->message ) ) { $query_params['jetpack-sso-invite-api-error-message'] = $body->message; $tracking_event_data['error_message'] = $body->message; } From aae329aedefbd7a8c98edb613e680832c91c74fb Mon Sep 17 00:00:00 2001 From: Anthony Grullon Date: Tue, 7 May 2024 16:37:00 -0400 Subject: [PATCH 16/20] Update projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php Co-authored-by: Jeremy Herve --- .../jetpack/modules/sso/class.jetpack-sso-user-admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php index 0ec33fe0d67dc..91c36e16e1709 100644 --- a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php +++ b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php @@ -268,7 +268,7 @@ public function invite_user_to_wpcom() { 'error_code' => $error_code, ); - $body = json_decode( $response['body'] ); + $body = json_decode( wp_remote_retrieve_body( $response ) ); if ( $body && $body->message ) { $query_params['jetpack-sso-invite-api-error-message'] = $body->message; $tracking_event_data['error_message'] = $body->message; From 88293648964e2a8e11361a9368d47938102f5e09 Mon Sep 17 00:00:00 2001 From: Anthony Grullon Date: Tue, 7 May 2024 16:39:54 -0400 Subject: [PATCH 17/20] Update projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php Co-authored-by: Jeremy Herve --- .../jetpack/modules/sso/class.jetpack-sso-user-admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php index 91c36e16e1709..a498bd685cc21 100644 --- a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php +++ b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php @@ -269,7 +269,7 @@ public function invite_user_to_wpcom() { ); $body = json_decode( wp_remote_retrieve_body( $response ) ); - if ( $body && $body->message ) { + if ( ! empty( $body ) && ! empty( $body->message ) ) { $query_params['jetpack-sso-invite-api-error-message'] = $body->message; $tracking_event_data['error_message'] = $body->message; } From 6ff596acba92e82aef14fdbfa4bfd6181eb4039d Mon Sep 17 00:00:00 2001 From: Anthony Grullon Date: Thu, 9 May 2024 00:44:18 -0400 Subject: [PATCH 18/20] Display api error response for invite revoke --- .../connection/src/sso/class-user-admin.php | 25 +++++++++++++------ .../sso/class.jetpack-sso-user-admin.php | 25 +++++++++++++------ 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/projects/packages/connection/src/sso/class-user-admin.php b/projects/packages/connection/src/sso/class-user-admin.php index 01bcf4a445a01..23a53f2639b23 100644 --- a/projects/packages/connection/src/sso/class-user-admin.php +++ b/projects/packages/connection/src/sso/class-user-admin.php @@ -171,8 +171,8 @@ public function handle_invitation_results() { return wp_admin_notice( __( 'User invite revoked successfully.', 'jetpack-connection' ), array( 'type' => 'success' ) ); } - if ( $_GET['jetpack-sso-invite-user'] === 'failed' && isset( $_GET['jetpack-sso-invite-api-error-message'] ) ) { - return wp_admin_notice( wp_kses( wp_unslash( $_GET['jetpack-sso-invite-api-error-message'] ), array() ), array( 'type' => 'error' ) ); + if ( $_GET['jetpack-sso-invite-user'] === 'failed' && isset( $_GET['jetpack-sso-api-error-message'] ) ) { + return wp_admin_notice( wp_kses( wp_unslash( $_GET['jetpack-sso-api-error-message'] ), array() ), array( 'type' => 'error' ) ); } if ( $_GET['jetpack-sso-invite-user'] === 'failed' && isset( $_GET['jetpack-sso-invite-error'] ) ) { @@ -279,8 +279,8 @@ public function invite_user_to_wpcom() { $body = json_decode( wp_remote_retrieve_body( $response ) ); if ( ! empty( $body ) && ! empty( $body->message ) ) { - $query_params['jetpack-sso-invite-api-error-message'] = $body->message; - $tracking_event_data['error_message'] = $body->message; + $query_params['jetpack-sso-api-error-message'] = $body->message; + $tracking_event_data['error_message'] = $body->message; } self::$tracking->record_user_event( @@ -422,12 +422,21 @@ public function handle_request_revoke_invite() { 'jetpack-sso-invite-error' => $error, // general error message '_wpnonce' => $nonce, ); + + $tracking_event_data = array( + 'success' => 'false', + 'error_code' => $error, + ); + + $body = json_decode( wp_remote_retrieve_body( $response ) ); + if ( ! empty( $body ) && ! empty( $body->message ) ) { + $query_params['jetpack-sso-api-error-message'] = $body->message; + $tracking_event_data['error_message'] = $body->message; + } + self::$tracking->record_user_event( $event, - array( - 'success' => 'false', - 'error_message' => $error, - ) + $tracking_event_data ); return self::create_error_notice_and_redirect( $query_params ); } diff --git a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php index a498bd685cc21..fc12dd8178644 100644 --- a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php +++ b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php @@ -162,8 +162,8 @@ public function handle_invitation_results() { return wp_admin_notice( __( 'User invite revoked successfully.', 'jetpack' ), array( 'type' => 'success' ) ); } - if ( $_GET['jetpack-sso-invite-user'] === 'failed' && isset( $_GET['jetpack-sso-invite-api-error-message'] ) ) { - return wp_admin_notice( wp_kses( wp_unslash( $_GET['jetpack-sso-invite-api-error-message'] ), array() ), array( 'type' => 'error' ) ); + if ( $_GET['jetpack-sso-invite-user'] === 'failed' && isset( $_GET['jetpack-sso-api-error-message'] ) ) { + return wp_admin_notice( wp_kses( wp_unslash( $_GET['jetpack-sso-api-error-message'] ), array() ), array( 'type' => 'error' ) ); } if ( $_GET['jetpack-sso-invite-user'] === 'failed' && isset( $_GET['jetpack-sso-invite-error'] ) ) { @@ -270,8 +270,8 @@ public function invite_user_to_wpcom() { $body = json_decode( wp_remote_retrieve_body( $response ) ); if ( ! empty( $body ) && ! empty( $body->message ) ) { - $query_params['jetpack-sso-invite-api-error-message'] = $body->message; - $tracking_event_data['error_message'] = $body->message; + $query_params['jetpack-sso-api-error-message'] = $body->message; + $tracking_event_data['error_message'] = $body->message; } self::$tracking->record_user_event( @@ -409,12 +409,21 @@ public function handle_request_revoke_invite() { 'jetpack-sso-invite-error' => $error, // general error message '_wpnonce' => $nonce, ); + + $tracking_event_data = array( + 'success' => 'false', + 'error_code' => $error, + ); + + $body = json_decode( wp_remote_retrieve_body( $response ) ); + if ( ! empty( $body ) && ! empty( $body->message ) ) { + $query_params['jetpack-sso-api-error-message'] = $body->message; + $tracking_event_data['error_message'] = $body->message; + } + self::$tracking->record_user_event( $event, - array( - 'success' => 'false', - 'error_message' => $error, - ) + $tracking_event_data ); return self::create_error_notice_and_redirect( $query_params ); } From 03cb17459252b727707e947198592dac044ee3b0 Mon Sep 17 00:00:00 2001 From: Anthony Grullon Date: Thu, 9 May 2024 00:59:58 -0400 Subject: [PATCH 19/20] Update revoke user invite error tracking --- .../connection/src/sso/class-user-admin.php | 14 ++++++++++---- .../modules/sso/class.jetpack-sso-user-admin.php | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/projects/packages/connection/src/sso/class-user-admin.php b/projects/packages/connection/src/sso/class-user-admin.php index 23a53f2639b23..4e8b1e2ef319a 100644 --- a/projects/packages/connection/src/sso/class-user-admin.php +++ b/projects/packages/connection/src/sso/class-user-admin.php @@ -112,12 +112,18 @@ public function revoke_user_invite( $user_id ) { $event = 'sso_user_invite_revoked'; if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { + $body = json_decode( wp_remote_retrieve_body( $response ) ); + $tracking_event_data = array( + 'success' => 'false', + 'error_code' => 'invalid-revoke-api-error', + ); + + if ( ! empty( $body ) && ! empty( $body->message ) ) { + $tracking_event_data['error_message'] = $body->message; + } self::$tracking->record_user_event( $event, - array( - 'success' => 'false', - 'error_message' => 'invalid-revoke-api-error', - ) + $tracking_event_data ); return $response; } diff --git a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php index fc12dd8178644..73fa1812dac76 100644 --- a/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php +++ b/projects/plugins/jetpack/modules/sso/class.jetpack-sso-user-admin.php @@ -103,12 +103,18 @@ public function revoke_user_invite( $user_id ) { $event = 'sso_user_invite_revoked'; if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { + $body = json_decode( wp_remote_retrieve_body( $response ) ); + $tracking_event_data = array( + 'success' => 'false', + 'error_code' => 'invalid-revoke-api-error', + ); + + if ( ! empty( $body ) && ! empty( $body->message ) ) { + $tracking_event_data['error_message'] = $body->message; + } self::$tracking->record_user_event( $event, - array( - 'success' => 'false', - 'error_message' => 'invalid-revoke-api-error', - ) + $tracking_event_data ); return $response; } From b6a75295165c4087ae754ed7e39a9c69ce1f8863 Mon Sep 17 00:00:00 2001 From: Jeremy Herve Date: Fri, 10 May 2024 11:40:41 +0200 Subject: [PATCH 20/20] Bump version --- projects/plugins/backup/composer.json | 2 +- projects/plugins/backup/jetpack-backup.php | 2 +- projects/plugins/mu-wpcom-plugin/composer.json | 2 +- projects/plugins/mu-wpcom-plugin/mu-wpcom-plugin.php | 2 +- projects/plugins/mu-wpcom-plugin/package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/plugins/backup/composer.json b/projects/plugins/backup/composer.json index 05e80add9414d..92608fd0b08ef 100644 --- a/projects/plugins/backup/composer.json +++ b/projects/plugins/backup/composer.json @@ -34,7 +34,7 @@ "minimum-stability": "dev", "prefer-stable": true, "config": { - "autoloader-suffix": "9559eef123208b7d1b9c15b978567267_backupⓥ2_6", + "autoloader-suffix": "9559eef123208b7d1b9c15b978567267_backupⓥ2_7_alpha", "allow-plugins": { "automattic/jetpack-autoloader": true, "automattic/jetpack-composer-plugin": true diff --git a/projects/plugins/backup/jetpack-backup.php b/projects/plugins/backup/jetpack-backup.php index 0fa9eb7d0a173..580efc5669c08 100644 --- a/projects/plugins/backup/jetpack-backup.php +++ b/projects/plugins/backup/jetpack-backup.php @@ -4,7 +4,7 @@ * Plugin Name: Jetpack VaultPress Backup * Plugin URI: https://jetpack.com/jetpack-backup * Description: Easily restore or download a backup of your site from a specific moment in time. - * Version: 2.6 + * Version: 2.7-alpha * Author: Automattic - Jetpack Backup team * Author URI: https://jetpack.com/ * License: GPLv2 or later diff --git a/projects/plugins/mu-wpcom-plugin/composer.json b/projects/plugins/mu-wpcom-plugin/composer.json index e55d773d5b597..6adcff2372999 100644 --- a/projects/plugins/mu-wpcom-plugin/composer.json +++ b/projects/plugins/mu-wpcom-plugin/composer.json @@ -46,6 +46,6 @@ ] }, "config": { - "autoloader-suffix": "d9d132a783958a00a2c7cccff60ca42d_jetpack_mu_wpcom_pluginⓥ2_1_22" + "autoloader-suffix": "d9d132a783958a00a2c7cccff60ca42d_jetpack_mu_wpcom_pluginⓥ2_1_23_alpha" } } diff --git a/projects/plugins/mu-wpcom-plugin/mu-wpcom-plugin.php b/projects/plugins/mu-wpcom-plugin/mu-wpcom-plugin.php index 9e6d47be78cea..efc46337cd188 100644 --- a/projects/plugins/mu-wpcom-plugin/mu-wpcom-plugin.php +++ b/projects/plugins/mu-wpcom-plugin/mu-wpcom-plugin.php @@ -3,7 +3,7 @@ * * Plugin Name: WordPress.com Features * Description: Test plugin for the jetpack-mu-wpcom package - * Version: 2.1.22 + * Version: 2.1.23-alpha * Author: Automattic * License: GPLv2 or later * Text Domain: jetpack-mu-wpcom-plugin diff --git a/projects/plugins/mu-wpcom-plugin/package.json b/projects/plugins/mu-wpcom-plugin/package.json index f7a0eaadb9c8b..d524ec0868504 100644 --- a/projects/plugins/mu-wpcom-plugin/package.json +++ b/projects/plugins/mu-wpcom-plugin/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-mu-wpcom-plugin", - "version": "2.1.22", + "version": "2.1.23-alpha", "description": "Test plugin for the jetpack-mu-wpcom package", "homepage": "https://jetpack.com", "bugs": {