diff --git a/src/wp-admin/includes/class-wp-debug-data.php b/src/wp-admin/includes/class-wp-debug-data.php
index 24ca2bdfd2..c5eabca9b6 100644
a
|
b
|
class WP_Debug_Data { |
905 | 905 | // List all available plugins. |
906 | 906 | $plugins = get_plugins(); |
907 | 907 | $plugin_updates = get_plugin_updates(); |
| 908 | $transient = get_site_transient( 'update_plugins' ); |
| 909 | |
908 | 910 | $auto_updates = array(); |
909 | 911 | |
910 | 912 | $auto_updates_enabled = wp_is_auto_update_enabled_for_type( 'plugin' ); |
… |
… |
class WP_Debug_Data { |
947 | 949 | } |
948 | 950 | |
949 | 951 | if ( $auto_updates_enabled ) { |
950 | | if ( in_array( $plugin_path, $auto_updates, true ) ) { |
| 952 | if ( isset( $transient->response[ $plugin_path ] ) ) { |
| 953 | $item = $transient->response[ $plugin_path ]; |
| 954 | } elseif ( isset( $transient->no_update[ $plugin_path ] ) ) { |
| 955 | $item = $transient->no_update[ $plugin_path ]; |
| 956 | } else { |
| 957 | $item = array( |
| 958 | 'id' => $plugin_path, |
| 959 | 'slug' => '', |
| 960 | 'plugin' => $plugin_path, |
| 961 | 'new_version' => '', |
| 962 | 'url' => '', |
| 963 | 'package' => '', |
| 964 | 'icons' => array(), |
| 965 | 'banners' => array(), |
| 966 | 'banners_rtl' => array(), |
| 967 | 'tested' => '', |
| 968 | 'requires_php' => '', |
| 969 | 'compatibility' => new stdClass(), |
| 970 | ); |
| 971 | $item = (object) array_merge( $item, array_intersect_key( $plugin, $item ) ); |
| 972 | } |
| 973 | |
| 974 | /** This action is documented in wp-admin/includes/class-wp-automatic-updater.php */ |
| 975 | $auto_update_forced = apply_filters( 'auto_update_plugin', null, $item ); |
| 976 | |
| 977 | if ( ! is_null( $auto_update_forced ) ) { |
| 978 | $enabled = $auto_update_forced; |
| 979 | } else { |
| 980 | $enabled = in_array( $plugin_path, $auto_updates, true ); |
| 981 | } |
| 982 | |
| 983 | if ( $enabled ) { |
951 | 984 | $auto_updates_string = __( 'Auto-updates enabled' ); |
952 | | $enabled = true; |
953 | | |
954 | | /** |
955 | | * Filters the text string of the auto-updates setting for each plugin in the Site Health debug data. |
956 | | * |
957 | | * @since 5.5.0 |
958 | | * |
959 | | * @param string $auto_updates_string The string output for the auto-updates column. |
960 | | * @param string $plugin_path The path to the plugin file. |
961 | | * @param array $plugin An array of plugin data. |
962 | | * @param bool $enabled Whether auto-updates are enabled for this item. |
963 | | */ |
964 | | $auto_updates_string = apply_filters( 'plugin_auto_update_debug_string', $auto_updates_string, $plugin_path, $plugin, $enabled ); |
965 | 985 | } else { |
966 | 986 | $auto_updates_string = __( 'Auto-updates disabled' ); |
967 | | $enabled = false; |
968 | | |
969 | | /** This filter is documented in wp-admin/includes/class-wp-debug-data.php */ |
970 | | $auto_updates_string = apply_filters( 'plugin_auto_update_debug_string', $auto_updates_string, $plugin_path, $plugin, $enabled ); |
971 | 987 | } |
972 | 988 | |
| 989 | /** |
| 990 | * Filters the text string of the auto-updates setting for each plugin in the Site Health debug data. |
| 991 | * |
| 992 | * @since 5.5.0 |
| 993 | * |
| 994 | * @param string $auto_updates_string The string output for the auto-updates column. |
| 995 | * @param string $plugin_path The path to the plugin file. |
| 996 | * @param array $plugin An array of plugin data. |
| 997 | * @param bool $enabled Whether auto-updates are enabled for this item. |
| 998 | */ |
| 999 | $auto_updates_string = apply_filters( 'plugin_auto_update_debug_string', $auto_updates_string, $plugin_path, $plugin, $enabled ); |
| 1000 | |
973 | 1001 | $plugin_version_string .= ' | ' . $auto_updates_string; |
974 | 1002 | $plugin_version_string_debug .= ', ' . $auto_updates_string; |
975 | 1003 | } |
… |
… |
class WP_Debug_Data { |
993 | 1021 | |
994 | 1022 | $active_theme = wp_get_theme(); |
995 | 1023 | $theme_updates = get_theme_updates(); |
| 1024 | $transient = get_site_transient( 'update_themes' ); |
996 | 1025 | |
997 | 1026 | $active_theme_version = $active_theme->version; |
998 | 1027 | $active_theme_version_debug = $active_theme_version; |
… |
… |
class WP_Debug_Data { |
1070 | 1099 | ); |
1071 | 1100 | |
1072 | 1101 | if ( $auto_updates_enabled ) { |
1073 | | if ( in_array( $active_theme->stylesheet, $auto_updates, true ) ) { |
1074 | | $auto_updates_string = __( 'Enabled' ); |
1075 | | $enabled = true; |
| 1102 | if ( isset( $transient->response[ $active_theme->stylesheet ] ) ) { |
| 1103 | $item = $transient->response[ $active_theme->stylesheet ]; |
| 1104 | } elseif ( isset( $transient->no_update[ $active_theme->stylesheet ] ) ) { |
| 1105 | $item = $transient->no_update[ $active_theme->stylesheet ]; |
| 1106 | } else { |
| 1107 | $item = (object) array( |
| 1108 | 'theme' => $active_theme->stylesheet, |
| 1109 | 'new_version' => $active_theme->version, |
| 1110 | 'url' => '', |
| 1111 | 'package' => '', |
| 1112 | 'requires' => '', |
| 1113 | 'requires_php' => '', |
| 1114 | ); |
| 1115 | } |
1076 | 1116 | |
1077 | | /** |
1078 | | * Filters the text string of the auto-updates setting for each theme in the Site Health debug data. |
1079 | | * |
1080 | | * @since 5.5.0 |
1081 | | * |
1082 | | * @param string $auto_updates_string The string output for the auto-updates column. |
1083 | | * @param WP_Theme $theme An object of theme data. |
1084 | | * @param bool $enabled Whether auto-updates are enabled for this item. |
1085 | | */ |
1086 | | $auto_updates_string = apply_filters( 'theme_auto_update_debug_string', $auto_updates_string, $active_theme, $enabled ); |
| 1117 | /** This action is documented in wp-admin/includes/class-wp-automatic-updater.php */ |
| 1118 | $auto_update_forced = apply_filters( 'auto_update_theme', null, $item ); |
| 1119 | |
| 1120 | if ( ! is_null( $auto_update_forced ) ) { |
| 1121 | $enabled = $auto_update_forced; |
1087 | 1122 | } else { |
1088 | | $auto_updates_string = __( 'Disabled' ); |
1089 | | $enabled = false; |
| 1123 | $enabled = in_array( $active_theme->stylesheet, $auto_updates, true ); |
| 1124 | } |
1090 | 1125 | |
1091 | | /** This filter is documented in wp-admin/includes/class-wp-debug-data.php */ |
1092 | | $auto_updates_string = apply_filters( 'theme_auto_update_debug_string', $auto_updates_string, $active_theme, $enabled ); |
| 1126 | if ( $enabled ) { |
| 1127 | $auto_updates_string = __( 'Enabled' ); |
| 1128 | } else { |
| 1129 | $auto_updates_string = __( 'Disabled' ); |
1093 | 1130 | } |
1094 | 1131 | |
| 1132 | /** |
| 1133 | * Filters the text string of the auto-updates setting for each theme in the Site Health debug data. |
| 1134 | * |
| 1135 | * @since 5.5.0 |
| 1136 | * |
| 1137 | * @param string $auto_updates_string The string output for the auto-updates column. |
| 1138 | * @param WP_Theme $theme An object of theme data. |
| 1139 | * @param bool $enabled Whether auto-updates are enabled for this item. |
| 1140 | */ |
| 1141 | $auto_updates_string = apply_filters( 'theme_auto_update_debug_string', $auto_updates_string, $active_theme, $enabled ); |
| 1142 | |
1095 | 1143 | $info['wp-active-theme']['fields']['auto_update'] = array( |
1096 | 1144 | 'label' => __( 'Auto-updates' ), |
1097 | 1145 | 'value' => $auto_updates_string, |
… |
… |
class WP_Debug_Data { |
1144 | 1192 | 'value' => get_template_directory(), |
1145 | 1193 | ), |
1146 | 1194 | ); |
| 1195 | |
1147 | 1196 | if ( $auto_updates_enabled ) { |
1148 | | if ( in_array( $parent_theme->stylesheet, $auto_updates, true ) ) { |
| 1197 | if ( isset( $transient->response[ $parent_theme->stylesheet ] ) ) { |
| 1198 | $item = $transient->response[ $parent_theme->stylesheet ]; |
| 1199 | } elseif ( isset( $transient->no_update[ $parent_theme->stylesheet ] ) ) { |
| 1200 | $item = $transient->no_update[ $parent_theme->stylesheet ]; |
| 1201 | } else { |
| 1202 | $item = (object) array( |
| 1203 | 'theme' => $parent_theme->stylesheet, |
| 1204 | 'new_version' => $parent_theme->version, |
| 1205 | 'url' => '', |
| 1206 | 'package' => '', |
| 1207 | 'requires' => '', |
| 1208 | 'requires_php' => '', |
| 1209 | ); |
| 1210 | } |
| 1211 | |
| 1212 | /** This action is documented in wp-admin/includes/class-wp-automatic-updater.php */ |
| 1213 | $auto_update_forced = apply_filters( 'auto_update_theme', null, $item ); |
| 1214 | |
| 1215 | if ( ! is_null( $auto_update_forced ) ) { |
| 1216 | $enabled = $auto_update_forced; |
| 1217 | } else { |
| 1218 | $enabled = in_array( $parent_theme->stylesheet, $auto_updates, true ); |
| 1219 | } |
| 1220 | |
| 1221 | if ( $enabled ) { |
1149 | 1222 | $parent_theme_auto_update_string = __( 'Enabled' ); |
1150 | 1223 | } else { |
1151 | 1224 | $parent_theme_auto_update_string = __( 'Disabled' ); |
1152 | 1225 | } |
1153 | 1226 | |
| 1227 | /** |
| 1228 | * Filters the text string of the auto-updates setting for each theme in the Site Health debug data. |
| 1229 | * |
| 1230 | * @since 5.5.0 |
| 1231 | * |
| 1232 | * @param string $auto_updates_string The string output for the auto-updates column. |
| 1233 | * @param WP_Theme $theme An object of theme data. |
| 1234 | * @param bool $enabled Whether auto-updates are enabled for this item. |
| 1235 | */ |
| 1236 | $parent_theme_auto_update_string = apply_filters( 'theme_auto_update_debug_string', $auto_updates_string, $parent_theme, $enabled ); |
| 1237 | |
1154 | 1238 | $info['wp-parent-theme']['fields']['auto_update'] = array( |
1155 | 1239 | 'label' => __( 'Auto-update' ), |
1156 | 1240 | 'value' => $parent_theme_auto_update_string, |
… |
… |
class WP_Debug_Data { |
1207 | 1291 | } |
1208 | 1292 | |
1209 | 1293 | if ( $auto_updates_enabled ) { |
1210 | | if ( in_array( $theme_slug, $auto_updates, true ) ) { |
1211 | | $auto_updates_string = __( 'Auto-updates enabled' ); |
1212 | | $enabled = true; |
| 1294 | if ( isset( $transient->response[ $theme_slug ] ) ) { |
| 1295 | $item = $transient->response[ $theme_slug ]; |
| 1296 | } elseif ( isset( $transient->no_update[ $theme_slug ] ) ) { |
| 1297 | $item = $transient->no_update[ $theme_slug ]; |
| 1298 | } else { |
| 1299 | $item = (object) array( |
| 1300 | 'theme' => $theme_slug, |
| 1301 | 'new_version' => $theme->version, |
| 1302 | 'url' => '', |
| 1303 | 'package' => '', |
| 1304 | 'requires' => '', |
| 1305 | 'requires_php' => '', |
| 1306 | ); |
| 1307 | } |
| 1308 | |
| 1309 | /** This action is documented in wp-admin/includes/class-wp-automatic-updater.php */ |
| 1310 | $auto_update_forced = apply_filters( 'auto_update_theme', null, $item ); |
1213 | 1311 | |
1214 | | /** This filter is documented in wp-admin/includes/class-wp-debug-data.php */ |
1215 | | $auto_updates_string = apply_filters( 'theme_auto_update_debug_string', $auto_updates_string, $theme, $enabled ); |
| 1312 | if ( ! is_null( $auto_update_forced ) ) { |
| 1313 | $enabled = $auto_update_forced; |
1216 | 1314 | } else { |
1217 | | $auto_updates_string = __( 'Auto-updates disabled' ); |
1218 | | $enabled = false; |
| 1315 | $enabled = in_array( $theme_slug, $auto_updates, true ); |
| 1316 | } |
1219 | 1317 | |
1220 | | /** This filter is documented in wp-admin/includes/class-wp-debug-data.php */ |
1221 | | $auto_updates_string = apply_filters( 'theme_auto_update_debug_string', $auto_updates_string, $theme, $enabled ); |
| 1318 | if ( $enabled ) { |
| 1319 | $auto_updates_string = __( 'Auto-updates enabled' ); |
| 1320 | } else { |
| 1321 | $auto_updates_string = __( 'Auto-updates disabled' ); |
1222 | 1322 | } |
1223 | 1323 | |
| 1324 | /** |
| 1325 | * Filters the text string of the auto-updates setting for each theme in the Site Health debug data. |
| 1326 | * |
| 1327 | * @since 5.5.0 |
| 1328 | * |
| 1329 | * @param string $auto_updates_string The string output for the auto-updates column. |
| 1330 | * @param WP_Theme $theme An object of theme data. |
| 1331 | * @param bool $enabled Whether auto-updates are enabled for this item. |
| 1332 | */ |
| 1333 | $auto_updates_string = apply_filters( 'theme_auto_update_debug_string', $auto_updates_string, $theme, $enabled ); |
| 1334 | |
1224 | 1335 | $theme_version_string .= ' | ' . $auto_updates_string; |
1225 | 1336 | $theme_version_string_debug .= ',' . $auto_updates_string; |
1226 | 1337 | } |