950 | | if ( in_array( $plugin_path, $auto_updates, true ) ) { |
951 | | $auto_updates_string = __( 'Auto-updates enabled' ); |
952 | | $enabled = 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 | } |
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 ); |
| 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; |
| 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 | |
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 | } |
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; |
1148 | | if ( in_array( $parent_theme->stylesheet, $auto_updates, true ) ) { |
| 1189 | if ( isset( $transient->response[ $parent_theme->stylesheet ] ) ) { |
| 1190 | $item = $transient->response[ $parent_theme->stylesheet ]; |
| 1191 | } elseif ( isset( $transient->no_update[ $parent_theme->stylesheet ] ) ) { |
| 1192 | $item = $transient->no_update[ $parent_theme->stylesheet ]; |
| 1193 | } else { |
| 1194 | $item = (object) array( |
| 1195 | 'theme' => $parent_theme->stylesheet, |
| 1196 | 'new_version' => $parent_theme->version, |
| 1197 | 'url' => '', |
| 1198 | 'package' => '', |
| 1199 | 'requires' => '', |
| 1200 | 'requires_php' => '', |
| 1201 | ); |
| 1202 | } |
| 1203 | |
| 1204 | /** This action is documented in wp-admin/includes/class-wp-automatic-updater.php */ |
| 1205 | $auto_update_forced = apply_filters( 'auto_update_theme', null, $item ); |
| 1206 | |
| 1207 | if ( ! is_null( $auto_update_forced ) ) { |
| 1208 | $enabled = $auto_update_forced; |
| 1209 | } else { |
| 1210 | $enabled = in_array( $parent_theme->stylesheet, $auto_updates, true ); |
| 1211 | } |
| 1212 | |
| 1213 | if ( $enabled ) { |
1210 | | if ( in_array( $theme_slug, $auto_updates, true ) ) { |
1211 | | $auto_updates_string = __( 'Auto-updates enabled' ); |
1212 | | $enabled = true; |
| 1278 | if ( isset( $transient->response[ $theme_slug ] ) ) { |
| 1279 | $item = $transient->response[ $theme_slug ]; |
| 1280 | } elseif ( isset( $transient->no_update[ $theme_slug ] ) ) { |
| 1281 | $item = $transient->no_update[ $theme_slug ]; |
| 1282 | } else { |
| 1283 | $item = (object) array( |
| 1284 | 'theme' => $theme_slug, |
| 1285 | 'new_version' => $theme->version, |
| 1286 | 'url' => '', |
| 1287 | 'package' => '', |
| 1288 | 'requires' => '', |
| 1289 | 'requires_php' => '', |
| 1290 | ); |
| 1291 | } |
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 ); |
| 1293 | /** This action is documented in wp-admin/includes/class-wp-automatic-updater.php */ |
| 1294 | $auto_update_forced = apply_filters( 'auto_update_theme', null, $item ); |
| 1295 | |
| 1296 | if ( ! is_null( $auto_update_forced ) ) { |
| 1297 | $enabled = $auto_update_forced; |