@@ -12,10 +12,6 @@ $query_author = 'wordpressdotorg';
1212$ extra_plugins = [ 'akismet ' , 'bbpress ' , 'buddypress ' , 'woocommerce ' , 'wordpress-importer ' ];
1313$ extra_themes = [ 'twentyseventeen ' , 'twentynineteen ' , 'twentytwenty ' , 'twentytwentyone ' ];
1414
15- // Skipped themes and plugins.
16- $ skip_plugins = [ 'performance-lab ' ];
17- $ skip_themes = [];
18-
1915// Config directory and filenames
2016$ config_dir = $ root . '/config ' ;
2117$ config_languages = $ config_dir . '/languages-info.json ' ;
@@ -51,14 +47,16 @@ if ( should_refresh_cache( $cache_file_versions, HOUR_IN_SECONDS * 3 ) ) {
5147 // Get available WordPress versions
5248 try {
5349 $ wp_versions = collect ( req ( $ api_versions ) )
54- ->mapToGroups ( fn ( $ item , $ key ) => [ $ item => $ key ] );
50+ ->mapToGroups ( function ( $ item , $ key ) {
51+ return [ $ item => $ key ];
52+ } );
5553
5654 // Latest version to get the available languages
5755 $ latest = $ wp_versions ->get ( 'latest ' )->first ();
5856 // Versions we still fetch
59- $ outdated = collect ( $ wp_versions ->get ( 'outdated ' ))-> reverse ()-> take ( 25 )->values ();
57+ $ outdated = $ wp_versions ->get ( 'outdated ' )->values ();
6058 // Versions we drop from the repository to save time
61- $ insecure = collect ( $ wp_versions ->get ( 'insecure ' ))-> reverse ()-> take ( 14 )->values ();
59+ $ insecure = $ wp_versions ->get ( 'insecure ' )->values ();
6260
6361 cache ( [
6462 'outdated ' => $ outdated ,
@@ -160,13 +158,15 @@ if ( should_refresh_cache( $cache_file_core_themes, HOUR_IN_SECONDS * 3 ) ) {
160158 }
161159
162160 $ themes = collect ( $ themes )
163- ->mapWithKeys ( fn ( $ theme ) => [
164- $ theme ->slug => [
165- 'name ' => $ theme ->name ,
166- 'slug ' => $ theme ->slug ,
167- 'versions ' => collect ($ theme ->versions )->sortKeysDesc ()->take ( 20 ),
168- ],
169- ] );
161+ ->mapWithKeys ( function ( $ theme ) {
162+ return [
163+ $ theme ->slug => [
164+ 'name ' => $ theme ->name ,
165+ 'slug ' => $ theme ->slug ,
166+ 'versions ' => $ theme ->versions ,
167+ ],
168+ ];
169+ } );
170170
171171 cache ( [ 'themes ' => $ themes ], $ cache_file_core_themes );
172172 }
@@ -212,13 +212,15 @@ if ( should_refresh_cache( $cache_file_core_plugins ) ) {
212212 }
213213
214214 $ plugins = collect ( $ plugins )
215- ->map ( fn ( $ plugin ) => [
216- $ plugin ->slug => [
217- 'name ' => $ plugin ->name ,
218- 'slug ' => $ plugin ->slug ,
219- 'versions ' => collect ($ plugin ->versions )->sortKeysDesc ()->take ( 20 ),
220- ],
221- ] );
215+ ->map ( function ( $ plugin ) {
216+ return [
217+ $ plugin ->slug => [
218+ 'name ' => $ plugin ->name ,
219+ 'slug ' => $ plugin ->slug ,
220+ 'versions ' => $ plugin ->versions ,
221+ ],
222+ ];
223+ } );
222224
223225 cache ( [ 'plugins ' => $ plugins ], $ cache_file_core_plugins );
224226 }
@@ -288,10 +290,6 @@ $plugins = collect( get_cached( $cache_file_core_plugins )->get( 'plugins', [] )
288290foreach ( $ plugins as $ plugin ) {
289291 $ plugin = (object ) collect ( $ plugin )->toArray ();
290292
291- if ( \in_array ( $ plugin ->slug , $ skip_plugins , true ) ) {
292- continue ;
293- }
294-
295293 if ( empty ( $ plugin ->versions ) ) {
296294 continue ;
297295 }
@@ -358,18 +356,11 @@ foreach ( $themes as $theme ) {
358356 $ theme = (object ) $ theme ;
359357 $ slug = $ theme ->slug ?? '' ;
360358
361- if ( \in_array ( $ slug , $ skip_themes , true ) ) {
362- continue ;
363- }
364-
365359 if ( empty ( $ theme ->versions ) ) {
366360 msg ( 'Theme has no versions: ' . $ slug );
367361 continue ;
368362 }
369363
370- // Only keep 10 theme versions.
371- $ theme ->versions = collect ( $ theme ->versions )->sortKeys ()->reverse ()->take ( 10 );
372-
373364 foreach ( $ theme ->versions as $ theme_version => $ theme_version_url ) {
374365 $ theme_cache_file_name = "$ cache_dir/theme- $ slug- $ theme_version.json " ;
375366
@@ -479,7 +470,7 @@ foreach ( $core as $language => $versions ) {
479470
480471 foreach ( $ versions as $ version => $ dist ) {
481472 $ required = [
482- 'koodimonni/composer-dropin-installer ' => '^1 ' ,
473+ 'koodimonni/composer-dropin-installer ' => '>=0.2.3 ' ,
483474 ];
484475
485476 foreach ( $ components as $ component ) {
@@ -496,7 +487,7 @@ foreach ( $core as $language => $versions ) {
496487 }
497488
498489 $ description = sprintf (
499- 'Full WordPress translation (including themes and core plugins) for %s ' ,
490+ 'Full Wordpress translation (including themes and core plugins) for %s ' ,
500491 $ language
501492 );
502493 if ( ! empty ( $ lang_name ) ) {
0 commit comments