| | 802 | // If WP_Error send data to WordPress.org. |
| | 803 | if ( is_wp_error( $result ) ) { |
| | 804 | global $wp_version, $wp_filesystem; |
| | 805 | $stats = array( |
| | 806 | 'update_type' => null, |
| | 807 | 'name' => null, |
| | 808 | 'update_version' => null, |
| | 809 | 'success' => false, |
| | 810 | 'fs_method' => $wp_filesystem->method, |
| | 811 | 'fs_method_forced' => defined( 'FS_METHOD' ) || has_filter( 'filesystem_method' ), |
| | 812 | 'fs_method_direct' => ! empty( $GLOBALS['_wp_filesystem_direct_method'] ) ? $GLOB['_wp_filesystem_direct_method'] : '', |
| | 813 | 'time_taken' => time() - $start_time, |
| | 814 | 'wp_version' => $wp_version, |
| | 815 | 'wp_error' => $result, |
| | 816 | ); |
| | 817 | if ( $this instanceof Plugin_Upgrader ) { |
| | 818 | $stats['update_type'] = 'plugin'; |
| | 819 | $stats['name'] = $this->skin->plugin_info['Name']; |
| | 820 | $stats['update_version'] = $this->skin->plugin_info['Version']; |
| | 821 | } |
| | 822 | if ( $this instanceof Theme_Upgrader ) { |
| | 823 | $stats['update_type'] = 'theme'; |
| | 824 | $stats['name'] = $this->skin->theme_info->get('Name'); |
| | 825 | $stats['update_version'] = $this->skin->theme_info->get('Version'); |
| | 826 | } |
| | 827 | wp_version_check( $stats ); |
| | 828 | } |
| | 829 | |