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
1 change: 1 addition & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tests/
phpunit.xml.dist
wp-tests-config-sample.php
phpcs.xml.dist
phpstan.dist.neon
composer.json
composer.lock
package.json
Expand Down
42 changes: 12 additions & 30 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches:
- main
pull_request:

workflow_dispatch:

# Cancels all previous workflow runs for pull requests that have not completed.
Expand All @@ -20,44 +19,27 @@ concurrency:
permissions: {}

jobs:
# Runs the PHP coding standards checks.
#
# Violations are reported inline with annotations.
#
# Performs the following steps:
# - Checks out the repository.
# - Sets up PHP.
# - Installs Composer dependencies.
# - Make Composer packages available globally.
# - Runs PHPCS on the full codebase (warnings excluded).
# - Ensures version-controlled files are not modified or deleted.
phpcs:
lint:
name: Run coding standards checks
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 20

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v6

- name: Setup cache
uses: actions/cache@v5
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
key: ${{ runner.os }}-${{ hashFiles('composer.json') }} # Note that lock file will change between runs.
path: .cache

- name: Set up PHP
uses: shivammathur/setup-php@cf4cade2721270509d5b1c766ab3549210a39a2a # v2.33.0
with:
coverage: none

- name: Install Composer dependencies
uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3.1.1

- name: Make Composer packages available globally
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH

- name: Run PHPCS on all files
id: phpcs-files
run: phpcs . -n --report-full
- name: Install dependencies
run: composer install

- name: Ensure version-controlled files are not modified during the checks
run: git diff --exit-code
- name: Lint PHP
run: composer run lint
97 changes: 3 additions & 94 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
wp-version: [ '5.4', '5.5', '5.6', '5.7', '5.8', '5.9', '6.0', '6.1', '6.2', '6.3', '6.4', '6.5', '6.6', '6.7', '6.8', '6.9' ]
php-version: [ '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
wp-version: [ '6.2', '6.3', '6.4', '6.5', '6.6', '6.7', '6.8', '6.9' ]
exclude:
# PHP 8.5 exclusions
- wp-version: '6.8'
Expand All @@ -53,22 +53,6 @@ jobs:
php-version: '8.5'
- wp-version: '6.2'
php-version: '8.5'
- wp-version: '6.1'
php-version: '8.5'
- wp-version: '6.0'
php-version: '8.5'
- wp-version: '5.9'
php-version: '8.5'
- wp-version: '5.8'
php-version: '8.5'
- wp-version: '5.7'
php-version: '8.5'
- wp-version: '5.6'
php-version: '8.5'
- wp-version: '5.5'
php-version: '8.5'
- wp-version: '5.4'
php-version: '8.5'

# PHP 8.4 exclusions
- wp-version: '6.6'
Expand All @@ -81,84 +65,12 @@ jobs:
php-version: '8.4'
- wp-version: '6.2'
php-version: '8.4'
- wp-version: '6.1'
php-version: '8.4'
- wp-version: '6.0'
php-version: '8.4'
- wp-version: '5.9'
php-version: '8.4'
- wp-version: '5.8'
php-version: '8.4'
- wp-version: '5.7'
php-version: '8.4'
- wp-version: '5.6'
php-version: '8.4'
- wp-version: '5.5'
php-version: '8.4'
- wp-version: '5.4'
php-version: '8.4'

# PHP 8.3 exclusions
- wp-version: '6.3'
php-version: '8.3'
- wp-version: '6.2'
php-version: '8.3'
- wp-version: '6.1'
php-version: '8.3'
- wp-version: '6.0'
php-version: '8.3'
- wp-version: '5.9'
php-version: '8.3'
- wp-version: '5.8'
php-version: '8.3'
- wp-version: '5.7'
php-version: '8.3'
- wp-version: '5.6'
php-version: '8.3'
- wp-version: '5.5'
php-version: '8.3'
- wp-version: '5.4'
php-version: '8.3'

# PHP 8.2 exclusions
- wp-version: '6.0'
php-version: '8.2'
- wp-version: '5.9'
php-version: '8.2'
- wp-version: '5.8'
php-version: '8.2'
- wp-version: '5.7'
php-version: '8.2'
- wp-version: '5.6'
php-version: '8.2'
- wp-version: '5.5'
php-version: '8.2'
- wp-version: '5.4'
php-version: '8.2'

# PHP 8.1 exclusions
- wp-version: '5.8'
php-version: '8.1'
- wp-version: '5.7'
php-version: '8.1'
- wp-version: '5.6'
php-version: '8.1'
- wp-version: '5.5'
php-version: '8.1'
- wp-version: '5.4'
php-version: '8.1'

# PHP 8 exclusions
- wp-version: '5.8' # Should work, currently doesn't.
php-version: '8.0'
- wp-version: '5.7' # Should work, currently doesn't.
php-version: '8.0'
- wp-version: '5.6' # Introduced PHP 8 beta support. Should work, currently doesn't.
php-version: '8.0'
- wp-version: '5.5'
php-version: '8.0'
- wp-version: '5.4'
php-version: '8.0'

steps:
- name: Checkout
Expand All @@ -184,7 +96,7 @@ jobs:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install Composer dependencies
run: composer install --optimize-autoloader --prefer-dist
run: composer update --optimize-autoloader --prefer-dist

- name: Install SVN
run: sudo apt-get update && sudo apt-get install -y subversion
Expand All @@ -201,6 +113,3 @@ jobs:
run: |
echo "define('WP_TESTS_PHPUNIT_POLYFILLS_PATH', '$HOME/.composer/vendor/yoast/phpunit-polyfills');" >> ${{ runner.temp }}/wordpress-tests-lib/wp-tests-config.php
phpunit

- name: Ensure version-controlled files are not modified or deleted
run: git diff --exit-code
45 changes: 45 additions & 0 deletions .github/workflows/publish-fair.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish FAIR Metadata

on:
workflow_run:
workflows: ["Upload Release Asset"]
types: [completed]
workflow_dispatch:
inputs:
version:
description: Version tag (for example v1.2.3)
required: false
type: string

permissions:
contents: write

jobs:
publish:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get tag
id: tag
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" && -n "${{ inputs.version }}" ]]; then
echo "tag=${{ inputs.version }}" >> $GITHUB_OUTPUT
else
echo "tag=${{ github.event.workflow_run.head_branch }}" >> $GITHUB_OUTPUT
fi

- name: Publish to FAIR
uses: fairpm/fair-pulse@v1
with:
version: ${{ steps.tag.outputs.tag }}
artifact-name: ${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.zip
upload-metadata: 'true'
env:
FAIR_VERIFICATION_KEY_PRIVATE: ${{ secrets.FAIR_VERIFICATION_KEY_PRIVATE }}
FAIR_VERIFICATION_KEY_PUBLIC: ${{ secrets.FAIR_VERIFICATION_KEY_PUBLIC }}
FAIR_DID: ${{ vars.FAIR_DID }}
16 changes: 15 additions & 1 deletion .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,26 @@ jobs:
- name: Checkout code
uses: actions/checkout@master

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer

- name: Install Composer dependencies
run: composer install --no-dev --optimize-autoloader --no-interaction

- name: Get tag
id: tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Build project
run: git archive -o /tmp/${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.zip --prefix=${{ github.event.repository.name }}/ ${{ steps.tag.outputs.tag }}
run: |
git archive -o /tmp/${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.zip --prefix=${{ github.event.repository.name }}/ ${{ steps.tag.outputs.tag }}
mkdir -p /tmp/vendor-stage/${{ github.event.repository.name }}
cp -r vendor /tmp/vendor-stage/${{ github.event.repository.name }}/vendor
cd /tmp/vendor-stage
zip -r /tmp/${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.zip ${{ github.event.repository.name }}/vendor/

- name: Create WP distribution files
run: bin/bundle.sh
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
*.bak
/.vscode
/vendor/
.wp-env.override.json
.phpunit.result.cache
phpunit.xml
phpcs.xml
phpstan.neon
/tests/phpunit/cache
/tests/phpunit/coverage
wp-tests-config.php
*.swp

# Track placeholders so that empty directories stay in the repo.
!.gitkeep
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
[unreleased]

#### 1.4.0 / 2026-5-14

* [bump-version] Bump version to 1.3.0-RC1 by @github-actions[bot] in https://github.com/fairpm/fair-plugin/pull/432
* release: merge release_1.3.0 into development for RC testing by @cdils in https://github.com/fairpm/fair-plugin/pull/433
* Pass at validation of hash by @afragen in https://github.com/fairpm/fair-plugin/pull/436
* Validate bundle hash by @afragen in https://github.com/fairpm/fair-plugin/pull/437
* Rearchitect `Updater` into a registry by @johnbillion in https://github.com/fairpm/fair-plugin/pull/428
* set update-browserslist.yaml to manual dispatch only by @chuckadams in https://github.com/fairpm/fair-plugin/pull/447
* release: merge release/1.3.0-RC4 into development for RC testing by @cdils in https://github.com/fairpm/fair-plugin/pull/449
* Update RELEASE.MD by @Ipstenu in https://github.com/fairpm/fair-plugin/pull/458
* hotfix, originally in PR4428 by @afragen in https://github.com/fairpm/fair-plugin/pull/463
* Update ca POT translation (02-26-25) by @marcarmengou in https://github.com/fairpm/fair-plugin/pull/459
* Update stable tag version to 1.4.0 by @marcarmengou in https://github.com/fairpm/fair-plugin/pull/461
* Did manager integration by @namithj in https://github.com/fairpm/fair-plugin/pull/465
* Add PHPStan checks by @kasparsd in https://github.com/fairpm/fair-plugin/pull/382
* [bump-version] Bump version to 1.4.0-BETA by @github-actions[bot] in https://github.com/fairpm/fair-plugin/pull/468
* Release: merge 1.4.0 into development for BETA testing by @cdils in https://github.com/fairpm/fair-plugin/pull/469
* Remove < PHP 8.0 & WP 6.2 from test matrix by @jazzsequence in https://github.com/fairpm/fair-plugin/pull/485
* release: merge Release 1.4.0 into main for production release by @cdils in https://github.com/fairpm/fair-plugin/pull/484

##### New Contributors
* @namithj made their first contribution in https://github.com/fairpm/fair-plugin/pull/465
* @kasparsd made their first contribution in https://github.com/fairpm/fair-plugin/pull/382

#### 1.3.0 / 2026-2-25

* Improved automated release process
Expand Down
33 changes: 22 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,29 @@ $ git commit -s -m 'My commit message.'

This plugin is ready to use with wp-env for local development, with a default configuration included in the repository. `npm run env` is an alias for `wp-env`:

```sh
# Install wp-env and other dependencies.
$ npm install
- `npm install` to install wp-env and other dependencies.
- `npm run env start` to start the development server. Run `npm run env start -- --xdebug=coverage` to enable Xdebug with test coverage reporting.
- `npm run env logs` to get the logs.
- `npm run env stop` to stop the development server.
- `npm run cli` to run any CLI commands inside the environment, such as `npm run cli -- wp plugin list`.

# Start the development server
$ npm run env start
By default wp-env is configured with PHP 7.4 (our minimum supported version), as well as Airplane Mode to avoid inadvertent requests.

# Get the logs
$ npm run env logs
For linting and static analysis:

# Stop the development server
$ npm run env stop
```
- `npm run lint:php:phpcs` to run PHPCS (configured in [`phpcs.xml.dist`](phpcs.xml.dist)).
- `npm run lint:php:phpstan` to run PHPStan (configured in [`phpstan.dist.neon`](phpstan.dist.neon)).
- `npm run format:php:phpcs` to automatically fix PHPCS issues.
- `npm run format:php:phpstan` to automatically fix PHPStan issues.
- `npm run cli -- composer phpstan-baseline` to update the PHPStan baseline [`tests/phpstan-baseline.neon`](tests/phpstan-baseline.neon) as you fix the reported issues.

### Configuring PHP and WP Versions

By default, wp-env is configured with PHP 7.4 (our minimum supported version), as well as Airplane Mode to avoid inadvertent requests.
To run a specific version of PHP or WP with your local development environment, create a `.wp-env.override.json` file in the root of the repository with the following contents:

```json
{
"phpVersion": "8.5",
"core": "https://wordpress.org/wordpress-6.9.zip"
}
```
Loading
Loading