Skip to content

Commit 399259a

Browse files
committed
Revert "Bump to PHP 7.4, arrow fn, plugin/theme skipping"
This reverts commit c005111.
1 parent c005111 commit 399259a

File tree

6 files changed

+280
-1131
lines changed

6 files changed

+280
-1131
lines changed

bin/cache

Lines changed: 25 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -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', [] )
288290
foreach ( $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 ) ) {

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"@cache",
3939
"@build-ci"
4040
],
41-
"cleanup": "rm -f ./cache/*.json",
41+
"cleanup": "rm ./cache/*.json",
4242
"cache": [
4343
"Composer\\Config::disableProcessTimeout",
4444
"@php ./bin/cache"
@@ -50,8 +50,8 @@
5050
"bin/cache"
5151
],
5252
"require": {
53-
"php": "^7.4||^8.0||^8.1",
54-
"composer/satis": "dev-main as 1.0.0",
53+
"php": ">=7.3||>=8",
54+
"composer/satis": "^1.0",
5555
"rmccue/requests": "^1.8",
5656
"illuminate/collections": "^8.55",
5757
"ext-json": "*"

0 commit comments

Comments
 (0)