Ticket #49151: 49151.2.diff
File 49151.2.diff, 4.4 KB (added by , 3 years ago) |
---|
-
src/wp-admin/includes/class-wp-debug-data.php
35 35 static function debug_data() { 36 36 global $wpdb; 37 37 38 include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; // For plugins_api(). 39 include_once ABSPATH . 'wp-admin/includes/theme.php'; // For themes_api(). 40 38 41 // Save few function calls. 39 42 $upload_dir = wp_upload_dir(); 40 43 $permalink_structure = get_option( 'permalink_structure' ); … … 880 883 $plugin_version = $plugin['Version']; 881 884 $plugin_author = $plugin['Author']; 882 885 886 $plugin_slug = explode( '/', $plugin_path ); 887 $plugin_info = plugins_api( 888 'plugin_information', 889 array( 890 'slug' => $plugin_slug[0], 891 'fields' => array( 892 'last_updated', 893 ), 894 ) 895 ); 896 883 897 $plugin_version_string = __( 'No version or author information is available.' ); 884 898 $plugin_version_string_debug = 'author: (undefined), version: (undefined)'; 885 899 … … 1009 1023 $plugin_version_string_debug .= ', ' . $auto_updates_string; 1010 1024 } 1011 1025 1026 if ( isset( $plugin_info->last_updated ) ) { 1027 $plugin_version_string .= sprintf( 1028 /* translators: %s: Plugin last released time. */ 1029 __( ' | Last Plugin release: %s ago' ), 1030 human_time_diff( strtotime( $plugin_info->last_updated ),current_time( 'timestamp' ) ) 1031 ); 1032 1033 $plugin_version_string_debug .= sprintf( 1034 /* translators: %s: Plugin last released time. */ 1035 __( ', last plugin release: %s ago' ), 1036 human_time_diff( strtotime( $plugin_info->last_updated ), current_time( 'timestamp' ) ) 1037 ); 1038 } 1039 1012 1040 $info[ $plugin_part ]['fields'][ sanitize_text_field( $plugin['Name'] ) ] = array( 1013 1041 'label' => $plugin['Name'], 1014 1042 'value' => $plugin_version_string, … … 1039 1067 $auto_updates = (array) get_site_option( 'auto_update_themes', array() ); 1040 1068 } 1041 1069 1070 $active_theme_info = themes_api( 1071 'theme_information', 1072 array( 1073 'slug' => $active_theme->template, 1074 'fields' => 'last_updated', 1075 ) 1076 ); 1077 1042 1078 if ( array_key_exists( $active_theme->stylesheet, $theme_updates ) ) { 1043 1079 $theme_update_new_version = $theme_updates[ $active_theme->stylesheet ]->update['new_version']; 1044 1080 … … 1147 1183 ); 1148 1184 } 1149 1185 1186 if ( isset( $active_theme->last_updated ) ) { 1187 $info['wp-active-theme']['fields']['last_release'] = array( 1188 'label' => __( 'Last Theme Release' ), 1189 'value' => sprintf( 1190 /* translators: %s: Theme last released time. */ 1191 __( '%s ago' ), 1192 human_time_diff( strtotime( $active_theme_info->last_updated ), current_time( 'timestamp' ) ) 1193 ), 1194 'debug' => sprintf( 1195 /* translators: %s: Theme last released time. */ 1196 __( '%s ago' ), 1197 human_time_diff( strtotime( $active_theme_info->last_updated ), current_time( 'timestamp' ) ) 1198 ), 1199 ); 1200 } 1201 1150 1202 $parent_theme = $active_theme->parent(); 1151 1203 1152 1204 if ( $parent_theme ) { … … 1259 1311 $theme_version_string = __( 'No version or author information is available.' ); 1260 1312 $theme_version_string_debug = 'undefined'; 1261 1313 1314 $theme_info = themes_api( 1315 'theme_information', 1316 array( 1317 'slug' => $theme_slug, 1318 'fields' => 'last_updated', 1319 ) 1320 ); 1321 1262 1322 if ( ! empty( $theme_version ) && ! empty( $theme_author ) ) { 1263 1323 /* translators: 1: Theme version number. 2: Theme author name. */ 1264 1324 $theme_version_string = sprintf( __( 'Version %1$s by %2$s' ), $theme_version, $theme_author ); … … 1330 1390 $theme_version_string_debug .= ',' . $auto_updates_string; 1331 1391 } 1332 1392 1393 if ( isset( $theme_info->last_updated ) ) { 1394 $theme_version_string .= sprintf( 1395 /* translators: %s: Theme last released time. */ 1396 __( ' | Last Theme release: %s ago' ), 1397 human_time_diff( strtotime( $theme_info->last_updated ), current_time( 'timestamp' ) ) 1398 ); 1399 1400 $theme_version_string_debug .= sprintf( 1401 /* translators: %s: Theme last released time. */ 1402 __( ', last theme release: %s ago' ), 1403 human_time_diff( strtotime( $theme_info->last_updated ), current_time( 'timestamp' ) ) 1404 ); 1405 } 1406 1333 1407 $info['wp-themes-inactive']['fields'][ sanitize_text_field( $theme->name ) ] = array( 1334 1408 'label' => sprintf( 1335 1409 /* translators: 1: Theme name. 2: Theme slug. */