Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Files and directories that must not ship in the WordPress.org package.
# build/ and vendor/ are deliberately absent: they are generated during the
# release workflow and are required at runtime.

.git
.github
.gitignore
.distignore
.wordpress-org
.idea
.vscode
.DS_Store

node_modules
tests
bin
assets/admin
assets/blocks

composer.json
composer.lock
package.json
package-lock.json
webpack.config.js
phpcs.xml
phpcs.xml.dist
phpunit.xml
phpunit.xml.dist

README.md
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
push:
branches: [ master, main ]
pull_request:

jobs:
test:
name: Lint, test and build
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.2', '8.3' ]

steps:
- uses: actions/checkout@v4

- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Install PHP dependencies
run: composer install --no-interaction --prefer-dist

- name: Lint PHP
run: |
find src inc tests -name '*.php' -print0 | xargs -0 -n1 -P4 php -l > /dev/null
php -l wp-performance.php
php -l advanced-cache.php
php -l object-cache.php

- name: Test
run: php tests/run.php

build:
name: Build assets
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- run: npm ci
- run: npm run build

- name: Confirm the build produced what the plugin loads
run: |
test -f build/admin/app/index.js
test -f build/admin/app/index.asset.php
test -f build/admin/app.css
test -f build/blocks/cache/index.js
72 changes: 72 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Deploy to WordPress.org

# Pushing a version tag publishes that version. The tag is the single source of
# truth, so a release is exactly what was tagged.
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:

jobs:
deploy:
name: Build and deploy
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Check the tag matches the plugin version
run: |
TAG="${GITHUB_REF_NAME}"
HEADER=$(grep -m1 '^ \* Version:' wp-performance.php | sed 's/.*Version:[[:space:]]*//' | tr -d '[:space:]')
STABLE=$(grep -m1 '^Stable tag:' readme.txt | sed 's/.*Stable tag:[[:space:]]*//' | tr -d '[:space:]')
echo "tag=$TAG header=$HEADER stable=$STABLE"
if [ "$TAG" != "$HEADER" ]; then
echo "::error::Tag $TAG does not match the Version header ($HEADER)."
exit 1
fi
if [ "$STABLE" != "trunk" ] && [ "$TAG" != "$STABLE" ]; then
echo "::error::Tag $TAG does not match readme.txt Stable tag ($STABLE)."
exit 1
fi

- name: Install PHP dependencies
run: composer install --no-dev --optimize-autoloader --prefer-dist --no-interaction

- name: Run tests
run: php tests/run.php

- name: Build assets
run: |
npm ci
npm run build

- name: Confirm the build produced what the plugin loads
run: |
test -f build/admin/app/index.js || { echo "::error::admin bundle missing"; exit 1; }
test -f build/admin/app/index.asset.php || { echo "::error::admin asset manifest missing"; exit 1; }
test -f build/admin/app.css || { echo "::error::admin stylesheet missing"; exit 1; }
test -f build/blocks/cache/index.js || { echo "::error::cache block bundle missing"; exit 1; }
test -f vendor/autoload.php || { echo "::error::autoloader missing"; exit 1; }

- name: Deploy to the plugin directory
uses: 10up/action-wordpress-plugin-deploy@stable
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SLUG: wp-performance
ASSETS_DIR: .wordpress-org
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
includes/data/settings/*.json
/vendor/
/vendor-prefixed/
/node_modules/
/build/
*.backup
log.txt
wpp.js
vendor/
.DS_Store
.idea/
Binary file added .wordpress-org/banner-1544x500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/banner-772x250.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions .wordpress-org/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading