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
24 changes: 24 additions & 0 deletions .build-rsync-exclude
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.git
.gitignore
.github/
.cursor/
.DS_Store
.phpunit.result*
.build-rsync-exclude
.jshintrc
.idea/
node_modules/
vendor/
bin/
tests/
coverage/
ruleset.xml
phpunit.xml
composer.json
composer.lock
package.json
package-lock.json
Gruntfile.js
README.md
aryo-activity-log/
aryo-activity-log.*.zip
15 changes: 15 additions & 0 deletions .cursor/rules/run-tests-before-finish.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
description: Always run PHPUnit before considering a coding task finished
alwaysApply: true
---

# Run tests before finishing

Before declaring any coding task complete (including refactors, bug fixes, and new features):

1. Ensure the WordPress test suite is available (`WP_TESTS_DIR` / `bin/install-wp-tests.sh` if missing).
2. Run `composer test` (or `./vendor/bin/phpunit`) from the plugin root.
3. If tests fail, fix the failures (or the harness) before finishing — do not stop at "implementation done".
4. In the final response, briefly report that tests were run and the result (pass/fail + relevant filter if used).

Skip only if the change cannot affect PHP/runtime behavior (e.g. docs-only or pure `.mdc`/README wording with no code/config impact) — say so explicitly.
23 changes: 23 additions & 0 deletions .github/checkstyle-problem-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"problemMatcher": [
{
"owner": "phpcs",
"severity": "error",
"pattern": [
{
"regexp": "^<file name=\"(?:\\/github\\/workspace\\/)?(.*)\">$",
"file": 1
},
{
"regexp": "<error line=\"(\\d*)\" column=\"(\\d*)\" severity=\"(error|warning)\" message=\"(.*)\" source=\"(.*)(\"\\/>+)$",
"line": 1,
"column": 2,
"severity": 3,
"message": 4,
"code": 5,
"loop": true
}
]
}
]
}
51 changes: 51 additions & 0 deletions .github/workflows/php-coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: PHP Lint

on:
push:
pull_request:
workflow_dispatch:

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: read

jobs:
PHP-Code-Standards:
name: Lint PHP files
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip PHPCS]') || !contains(github.event.head_commit.message, '[skip CI]')"
steps:
- name: Check out source code
uses: actions/checkout@v4

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
tools: composer, cs2pr, phpcs
env:
fail-fast: 'true'

- name: Log debug information
run: |
export PATH=$HOME/.composer/vendor/bin:$PATH
php --version
phpcs -i
composer --version

- name: Install dependencies
uses: ramsey/composer-install@v3

- name: Add error matcher
run: echo "::add-matcher::$(pwd)/.github/checkstyle-problem-matcher.json"

- name: Run style check (errors block, warnings annotate)
run: |
export PATH=$HOME/.composer/vendor/bin:$PATH
composer run lint -- --report=checkstyle
# Also show warnings as PR annotations (non-blocking)
vendor/bin/phpcs --standard=./ruleset.xml --extensions=php --error-severity=0 . --report=checkstyle || true
92 changes: 92 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: PHPUnit Tests

on:
push:
pull_request:

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: read

jobs:
phpunit:
name: PHPUnit Tests (PHP ${{ matrix.php-version }}, WP ${{ matrix.wp-version }})
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3']
wp-version: ['6.8', '6.9', '7.0', 'latest']

services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: wordpress_test
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

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

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, mysql
env:
fail-fast: true

- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: locked

- name: Install SVN
run: |
sudo apt-get update -y
sudo apt-get install -y subversion
which svn
svn --version

- name: Set up WordPress test environment
env:
WP_TESTS_DIR: /tmp/wordpress-tests-lib
WP_CORE_DIR: /tmp/wordpress
run: |
bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 ${{ matrix.wp-version }} || {
git clone --depth=1 --branch=trunk https://github.com/WordPress/wordpress-develop.git /tmp/wordpress-develop
mkdir -p /tmp/wordpress-tests-lib
cp -r /tmp/wordpress-develop/tests/phpunit/* /tmp/wordpress-tests-lib/

if [ "${{ matrix.wp-version }}" = "latest" ]; then
wget -O /tmp/wordpress.tar.gz https://wordpress.org/latest.tar.gz
else
wget -O /tmp/wordpress.tar.gz https://wordpress.org/wordpress-${{ matrix.wp-version }}.tar.gz
fi
tar -xzf /tmp/wordpress.tar.gz -C /tmp/
}

# Fix PHPMailer compatibility issue for WordPress 6.7+
if [ -f "/tmp/wordpress/wp-includes/class-phpmailer.php" ] && [ ! -f "/tmp/wordpress/wp-includes/class-wp-phpmailer.php" ]; then
cd /tmp/wordpress/wp-includes
ln -s "class-phpmailer.php" "class-wp-phpmailer.php"
echo "Created symlink for PHPMailer compatibility"
fi

- name: Run PHPUnit tests
run: composer test
env:
WP_TESTS_DIR: /tmp/wordpress-tests-lib
WP_CORE_DIR: /tmp/wordpress
DB_NAME: wordpress_test
DB_USER: root
DB_PASSWORD: root
DB_HOST: 127.0.0.1
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
.idea/
node_modules/
vendor/
build/
log/
npm-debug.log
.DS_Store
coverage.xml
coverage.xml
.phpunit.result.cache
aryo-activity-log/
aryo-activity-log.*.zip
16 changes: 0 additions & 16 deletions .jshintrc

This file was deleted.

50 changes: 0 additions & 50 deletions .travis.yml

This file was deleted.

Loading
Loading