Skip to content

Commit 37e8860

Browse files
Merge pull request #1981 from WordPress/trunk
Merge latest changes to feature branch
2 parents c9e98f3 + d769a47 commit 37e8860

File tree

198 files changed

+4041
-2108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+4041
-2108
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const config = {
2323
'/node_modules',
2424
'/build',
2525
'/dist',
26-
'/*.min.js',
26+
'/**/*.min.js',
2727
],
2828
};
2929

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Bump WordPress Tested up to
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
plugin:
7+
type: string
8+
description: 'Plugin slug (leave empty for all plugins)'
9+
required: false
10+
11+
jobs:
12+
prepare-matrix:
13+
name: Prepare plugins matrix
14+
runs-on: ubuntu-latest
15+
outputs:
16+
matrix: ${{ steps.set-matrix.outputs.plugins }}
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Configure plugin matrix
22+
id: set-matrix
23+
env:
24+
PLUGIN_SLUG: ${{ inputs.plugin }}
25+
run: |
26+
PLUGINS=$(jq -r '.plugins' plugins.json)
27+
if [[ -n "$PLUGIN_SLUG" ]]; then
28+
if echo $PLUGINS | jq -e '.[] | select(. == "'$PLUGIN_SLUG'")' > /dev/null; then
29+
PLUGINS="[ \"$PLUGIN_SLUG\" ]"
30+
else
31+
echo "::error::Plugin '$PLUGIN_SLUG' not found in plugins.json"
32+
exit 1
33+
fi
34+
fi
35+
echo "::notice::Updating plugins: $(echo ${PLUGINS[@]})"
36+
echo "plugins=$(echo $PLUGINS | jq -c .)" >> $GITHUB_OUTPUT
37+
38+
update-compatibility:
39+
name: Update "Tested up to" value for ${{ matrix.plugin }}
40+
needs: prepare-matrix
41+
runs-on: ubuntu-latest
42+
env:
43+
PLUGIN_SLUG: ${{ matrix.plugin }}
44+
strategy:
45+
matrix:
46+
plugin: ${{ fromJSON(needs.prepare-matrix.outputs.matrix) }}
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v4
50+
51+
- name: Download WordPress.org readme
52+
run: |
53+
# Download the current readme.txt from WordPress.org
54+
curl -sSL --retry 3 --retry-delay 5 --retry-all-errors --fail -o /tmp/wp-org-readme.txt "https://plugins.svn.wordpress.org/$PLUGIN_SLUG/trunk/readme.txt"
55+
if [ $? -ne 0 ]; then
56+
echo "::error::Could not fetch readme.txt from WordPress.org for $PLUGIN_SLUG"
57+
exit 1
58+
fi
59+
60+
- name: Extract "Tested up to" version from repository
61+
id: extract-tested-up-to
62+
run: |
63+
LOCAL_TESTED_UP_TO=$(grep -E "^Tested up to:" "./plugins/$PLUGIN_SLUG/readme.txt" | awk -F ': +' '{print $2}')
64+
if [ -z "$LOCAL_TESTED_UP_TO" ]; then
65+
echo "::error::Unable to parse Tested up to version from repository readme.txt"
66+
exit 1
67+
fi
68+
69+
echo "version=$LOCAL_TESTED_UP_TO" >> $GITHUB_OUTPUT
70+
71+
- name: Prepare and update readme.txt
72+
env:
73+
LOCAL_TESTED_UP_TO: ${{ steps.extract-tested-up-to.outputs.version }}
74+
run: |
75+
# Replace local readme.txt with WordPress.org version, updating only the "Tested up to" line.
76+
cp /tmp/wp-org-readme.txt "./plugins/$PLUGIN_SLUG/readme.txt"
77+
sed -i -E 's/^(Tested up to:[[:space:]]*).+/\1'"$LOCAL_TESTED_UP_TO"'/' "./plugins/$PLUGIN_SLUG/readme.txt"
78+
79+
# Show the diff of what's being updated.
80+
echo "Changes made to readme.txt:"
81+
diff -u /tmp/wp-org-readme.txt "./plugins/$PLUGIN_SLUG/readme.txt" || true
82+
83+
- name: Copy readme.txt to workspace root for SVN upload
84+
run: cp "./plugins/$PLUGIN_SLUG/readme.txt" "$GITHUB_WORKSPACE/readme.txt"
85+
86+
- name: Push to WordPress.org
87+
uses: 10up/action-wordpress-plugin-asset-update@stable
88+
env:
89+
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
90+
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
91+
SLUG: ${{ matrix.plugin }}
92+
SKIP_ASSETS: true
93+
IGNORE_OTHER_FILES: true

.github/workflows/pr-validation.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
types:
1010
- labeled
1111
- unlabeled
12+
- milestoned
13+
- demilestoned
1214
- opened
1315
- reopened
1416
- synchronize

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Performance Lab
22
![Performance Lab plugin banner with icon](https://github.com/WordPress/performance/assets/10103365/99d37ba5-27e3-47ea-8ab8-48de75ee69bf)
33

4+
[![codecov](https://codecov.io/gh/WordPress/performance/graph/badge.svg?token=zQv52K2LWz)](https://codecov.io/gh/WordPress/performance)
5+
46
Monorepo for the [WordPress Performance Team](https://make.wordpress.org/performance/), primarily for the Performance Lab plugin, which is a collection of standalone performance features.
57

68
Details about the Performance Lab plugin, including instructions for getting started and contributing, are available in the [Performance Team Handbook here](https://make.wordpress.org/performance/handbook/performance-lab/).

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
},
1818
"suggest": {
1919
"ext-imagick": "Required to use Modern Image Format's Dominant_Color_Image_Editor_Imagick class",
20-
"ext-gd": "Required to use Modern Image Format's Dominant_Color_Image_Editor_GD class"
20+
"ext-gd": "Required to use Modern Image Format's Dominant_Color_Image_Editor_GD class",
21+
"ext-zlib": "Required for compression of URL Metric data submitted to the REST API for storage in Optimization Detective"
2122
},
2223
"require-dev": {
2324
"phpcompatibility/php-compatibility": "^9.3",

composer.lock

Lines changed: 29 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)