diff --git a/wp-admin/includes/class-plugin-upgrader.php b/wp-admin/includes/class-plugin-upgrader.php
index b171f9228b..0e1c185daa 100644
--- a/wp-admin/includes/class-plugin-upgrader.php
+++ b/wp-admin/includes/class-plugin-upgrader.php
@@ -116,6 +116,7 @@ class Plugin_Upgrader extends WP_Upgrader {
 	 * @return bool|WP_Error True if the installation was successful, false or a WP_Error otherwise.
 	 */
 	public function install( $package, $args = array() ) {
+		$start_time  = time();
 		$defaults    = array(
 			'clear_update_cache' => true,
 			'overwrite_package'  => false, // Do not overwrite files.
@@ -132,7 +133,7 @@ class Plugin_Upgrader extends WP_Upgrader {
 			add_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0 );
 		}
 
-		$this->run(
+		$result = $this->run(
 			array(
 				'package'           => $package,
 				'destination'       => WP_PLUGIN_DIR,
@@ -148,6 +149,10 @@ class Plugin_Upgrader extends WP_Upgrader {
 		remove_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9 );
 		remove_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
 
+		if ( is_wp_error( $result ) ) {
+			$this->send_error_data( $result, $start_time, 'plugin_install' );
+		}
+
 		if ( ! $this->result || is_wp_error( $this->result ) ) {
 			return $this->result;
 		}
@@ -188,6 +193,7 @@ class Plugin_Upgrader extends WP_Upgrader {
 	 * @return bool|WP_Error True if the upgrade was successful, false or a WP_Error object otherwise.
 	 */
 	public function upgrade( $plugin, $args = array() ) {
+		$start_time  = time();
 		$defaults    = array(
 			'clear_update_cache' => true,
 		);
@@ -219,7 +225,7 @@ class Plugin_Upgrader extends WP_Upgrader {
 			add_action( 'upgrader_process_complete', 'wp_clean_plugins_cache', 9, 0 );
 		}
 
-		$this->run(
+		$result = $this->run(
 			array(
 				'package'           => $r->package,
 				'destination'       => WP_PLUGIN_DIR,
@@ -240,6 +246,10 @@ class Plugin_Upgrader extends WP_Upgrader {
 		remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ) );
 		remove_filter( 'upgrader_post_install', array( $this, 'active_after' ) );
 
+		if ( is_wp_error( $result ) ) {
+			$this->send_error_data( $result, $start_time, 'plugin_upgrade' );
+		}
+
 		if ( ! $this->result || is_wp_error( $this->result ) ) {
 			return $this->result;
 		}
@@ -274,6 +284,7 @@ class Plugin_Upgrader extends WP_Upgrader {
 	 * @return array|false An array of results indexed by plugin file, or false if unable to connect to the filesystem.
 	 */
 	public function bulk_upgrade( $plugins, $args = array() ) {
+		$start_time  = time();
 		$defaults    = array(
 			'clear_update_cache' => true,
 		);
@@ -349,6 +360,10 @@ class Plugin_Upgrader extends WP_Upgrader {
 
 			$results[ $plugin ] = $this->result;
 
+			if ( is_wp_error( $result ) ) {
+				$this->send_error_data( $result, $start_time, 'plugin_bulk_upgrade' );
+			}
+
 			// Prevent credentials auth screen from displaying multiple times.
 			if ( false === $result ) {
 				break;
diff --git a/wp-admin/includes/class-theme-upgrader.php b/wp-admin/includes/class-theme-upgrader.php
index 229a8115bd..f1ff035f06 100644
--- a/wp-admin/includes/class-theme-upgrader.php
+++ b/wp-admin/includes/class-theme-upgrader.php
@@ -122,6 +122,8 @@ class Theme_Upgrader extends WP_Upgrader {
 	 * @return bool
 	 */
 	public function check_parent_theme_filter( $install_result, $hook_extra, $child_result ) {
+		$start_time = time();
+
 		// Check to see if we need to install a parent theme.
 		$theme_info = $this->theme_info();
 
@@ -180,6 +182,7 @@ class Theme_Upgrader extends WP_Upgrader {
 		);
 
 		if ( is_wp_error( $parent_result ) ) {
+			$this->send_error_data( $parent_result, $start_time, 'parent_theme' );
 			add_filter( 'install_theme_complete_actions', array( $this, 'hide_activate_preview_actions' ) );
 		}
 
@@ -228,6 +231,7 @@ class Theme_Upgrader extends WP_Upgrader {
 	 * @return bool|WP_Error True if the installation was successful, false or a WP_Error object otherwise.
 	 */
 	public function install( $package, $args = array() ) {
+		$start_time  = time();
 		$defaults    = array(
 			'clear_update_cache' => true,
 			'overwrite_package'  => false, // Do not overwrite files.
@@ -245,7 +249,7 @@ class Theme_Upgrader extends WP_Upgrader {
 			add_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 );
 		}
 
-		$this->run(
+		$result = $this->run(
 			array(
 				'package'           => $package,
 				'destination'       => get_theme_root(),
@@ -262,6 +266,10 @@ class Theme_Upgrader extends WP_Upgrader {
 		remove_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
 		remove_filter( 'upgrader_post_install', array( $this, 'check_parent_theme_filter' ) );
 
+		if ( is_wp_error( $result ) ) {
+			$this->send_error_data( $result, $start_time, 'theme_install' );
+		}
+
 		if ( ! $this->result || is_wp_error( $this->result ) ) {
 			return $this->result;
 		}
@@ -302,6 +310,7 @@ class Theme_Upgrader extends WP_Upgrader {
 	 * @return bool|WP_Error True if the upgrade was successful, false or a WP_Error object otherwise.
 	 */
 	public function upgrade( $theme, $args = array() ) {
+		$start_time  = time();
 		$defaults    = array(
 			'clear_update_cache' => true,
 		);
@@ -330,7 +339,7 @@ class Theme_Upgrader extends WP_Upgrader {
 			add_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9, 0 );
 		}
 
-		$this->run(
+		$result = $this->run(
 			array(
 				'package'           => $r['package'],
 				'destination'       => get_theme_root( $theme ),
@@ -349,6 +358,10 @@ class Theme_Upgrader extends WP_Upgrader {
 		remove_filter( 'upgrader_post_install', array( $this, 'current_after' ) );
 		remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ) );
 
+		if ( is_wp_error( $result ) ) {
+			$this->send_error_data( $result, $start_time, 'theme_upgrade' );
+		}
+
 		if ( ! $this->result || is_wp_error( $this->result ) ) {
 			return $this->result;
 		}
@@ -383,6 +396,7 @@ class Theme_Upgrader extends WP_Upgrader {
 	 * @return array[]|false An array of results, or false if unable to connect to the filesystem.
 	 */
 	public function bulk_upgrade( $themes, $args = array() ) {
+		$start_time  = time();
 		$defaults    = array(
 			'clear_update_cache' => true,
 		);
@@ -459,6 +473,10 @@ class Theme_Upgrader extends WP_Upgrader {
 
 			$results[ $theme ] = $this->result;
 
+			if ( is_wp_error( $result ) ) {
+				$this->send_error_data( $result, $start_time, 'theme_bulk_upgrade' );
+			}
+
 			// Prevent credentials auth screen from displaying multiple times.
 			if ( false === $result ) {
 				break;
diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php
index 5faac56213..5e85f18006 100644
--- a/wp-admin/includes/class-wp-upgrader.php
+++ b/wp-admin/includes/class-wp-upgrader.php
@@ -666,6 +666,7 @@ class WP_Upgrader {
 	 *                              or false if unable to connect to the filesystem.
 	 */
 	public function run( $options ) {
+		$start_time = time();
 
 		$defaults = array(
 			'package'                     => '', // Please always pass this.
@@ -728,6 +729,7 @@ class WP_Upgrader {
 		$this->skin->before();
 
 		if ( is_wp_error( $res ) ) {
+			$this->send_error_data( $res, $start_time, 'fs_connect' );
 			$this->skin->error( $res );
 			$this->skin->after();
 			if ( ! $options['is_multi'] ) {
@@ -765,6 +767,7 @@ class WP_Upgrader {
 		}
 
 		if ( is_wp_error( $download ) ) {
+			$this->send_error_data( $download, $start_time, 'download_package' );
 			$this->skin->error( $download );
 			$this->skin->after();
 			if ( ! $options['is_multi'] ) {
@@ -778,6 +781,7 @@ class WP_Upgrader {
 		// Unzips the file into a temporary directory.
 		$working_dir = $this->unpack_package( $download, $delete_package );
 		if ( is_wp_error( $working_dir ) ) {
+			$this->send_error_data( $working_dir, $start_time, 'unpack_package' );
 			$this->skin->error( $working_dir );
 			$this->skin->after();
 			if ( ! $options['is_multi'] ) {
@@ -800,6 +804,7 @@ class WP_Upgrader {
 
 		$this->skin->set_result( $result );
 		if ( is_wp_error( $result ) ) {
+			$this->send_error_data( $result, $start_time, 'install_package' );
 			$this->skin->error( $result );
 
 			if ( ! method_exists( $this->skin, 'hide_process_failed' ) || ! $this->skin->hide_process_failed( $result ) ) {
@@ -937,6 +942,61 @@ class WP_Upgrader {
 		return delete_option( $lock_name . '.lock' );
 	}
 
+	/**
+	 * Send upgrade WP_Error data to WordPress.org.
+	 *
+	 * @since 5.7.0
+	 *
+	 * @global string             $wp_version    The WordPress version string.
+	 * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
+	 * @param  WP_Error           $result        WP_Error data from failed upgrade process.
+	 * @param  int                $start_time    Time that run() started.
+	 * @param  string             $method        Name of method sending data.
+	 *
+	 * @return void
+	 */
+	public function send_error_data( $result, $start_time, $method = null ) {
+		global $wp_version, $wp_filesystem;
+
+		if ( ! is_wp_error( $result ) ) {
+			return;
+		}
+		$stats = array(
+			'process'          => $method,
+			'update_type'      => null,
+			'name'             => null,
+			'update_version'   => null,
+			'success'          => false,
+			'fs_method'        => $wp_filesystem->method,
+			'fs_method_forced' => defined( 'FS_METHOD' ) || has_filter( 'filesystem_method' ),
+			'fs_method_direct' => ! empty( $GLOBALS['_wp_filesystem_direct_method'] ) ? $GLOBALS['_wp_filesystem_direct_method'] : '',
+			'time_taken'       => time() - $start_time,
+			'wp_version'       => $wp_version,
+			'error_code'       => $result->get_error_code(),
+			'error_message'    => $result->get_error_message(),
+			'error_data'       => $result->get_error_data(),
+		);
+		if ( $this instanceof Plugin_Upgrader ) {
+			if ( isset( $this->skin->plugin_info ) ) {
+				$stats['update_type']    = 'manual_plugin_update';
+				$stats['name']           = $this->skin->plugin_info['Name'];
+				$stats['update_version'] = $this->skin->plugin_info['Version'];
+			} else {
+				$stats['update_type'] = 'automatic_plugin_update';
+			}
+			wp_update_plugins( $stats );
+		}
+		if ( $this instanceof Theme_Upgrader ) {
+			if ( isset( $this->skin->theme_info )) {
+				$stats['update_type']    = 'manual_theme_update';
+				$stats['name']           = $this->skin->theme_info->get('Name');
+				$stats['update_version'] = $this->skin->theme_info->get('Version');
+			} else {
+				$stats['update_type'] = 'automatic_theme_update';
+			}
+			wp_update_themes( $stats );
+		}
+	}
 }
 
 /** Plugin_Upgrader class */
