Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
336720c
Enhance PHP compatibility and structure for WP_REST_Blocks
jonnynews Dec 29, 2025
c5fb392
Expand PHP support to 7.3+ and update array syntax across all classes…
jonnynews Dec 29, 2025
215a17b
Add Subversion installation step to GitHub Actions test workflow
jonnynews Dec 29, 2025
a91481b
Refactor class names and improve testing setup for WordPress environment
jonnynews Dec 29, 2025
3a45125
Refactor wp-env setup in GitHub Actions to streamline WordPress versi…
jonnynews Dec 29, 2025
bf163a1
Update PHP requirements and version in configuration files for compat…
jonnynews Dec 29, 2025
f98798b
Fix PHPCS configuration and improve test formatting for consistency
jonnynews Dec 29, 2025
3527f01
Update PHP matrix in test workflow to include PHP 7.2 and 8.5 for bet…
jonnynews Dec 29, 2025
ba8a807
Update PHP requirements to 7.3 for improved compatibility
jonnynews Dec 29, 2025
c70d4eb
Remove PHP 7.2 from test workflow for streamlined compatibility
jonnynews Dec 29, 2025
de28668
Update PHP requirement to 7.3 and replace `tburry/pquery` with `imang…
jonnynews Dec 29, 2025
8ae86dd
Update WordPress version in test workflow and improve environment var…
jonnynews Dec 29, 2025
82c3176
Enable debug mode for environment startup in test workflow
jonnynews Dec 29, 2025
f999723
Refactor post ID retrieval logic in Posts.php for improved readabilit…
jonnynews Dec 29, 2025
f163a78
Update caching key to use composer.json and add composer normalizatio…
jonnynews Dec 29, 2025
54f1554
Add PHPStan configuration for static analysis with error ignoring
jonnynews Dec 29, 2025
451c6d2
Add PHPStan configuration for static analysis with error ignoring
jonnynews Dec 29, 2025
2b35e88
Update PHP version requirements to 7.4 in configuration files
jonnynews Dec 29, 2025
fb70003
Add PHPMD configuration and update has_blocks method references
jonnynews Dec 29, 2025
0da9c25
Refactor PHPMD rules and suppress NPathComplexity warning in Data.php
jonnynews Dec 29, 2025
b38a3ca
Suppress PHPMD NPathComplexity warning in Data.php
jonnynews Dec 29, 2025
ebfd09f
Remove report file generation from PHPMD command in CI configuration
jonnynews Dec 29, 2025
aae2af1
Fix logic for source attribute check in Data.php
jonnynews Dec 29, 2025
be6a99e
Update PHP version to 7.4 in CI configuration and package.json
jonnynews Dec 29, 2025
1c4283d
Enhance CI configuration by adding support for GitHub Actions and imp…
jonnynews Dec 29, 2025
72bba3e
Fix quoting in GitHub Actions output redirection for Composer cache a…
jonnynews Dec 29, 2025
44e42d8
Remove CodeQL analysis configuration from security.yml
jonnynews Dec 29, 2025
71979f8
Add block data schema method and update schema references in Posts an…
jonnynews Dec 30, 2025
3029e5a
Add item definitions for innerBlocks and innerContent in Data.php
jonnynews Dec 30, 2025
e105276
Refactor block data handling by introducing REST_Blocks abstract clas…
jonnynews Dec 30, 2025
1f8c1f0
Refactor REST API field registration by consolidating type retrieval …
jonnynews Dec 30, 2025
9f649e1
Refactor block processing in Data.php by introducing process_blocks m…
jonnynews Dec 30, 2025
815bc41
Refactor test methods to use get_types instead of get_post_types_with…
jonnynews Dec 30, 2025
4b0f4cf
Refactor REST API schema definitions for block data and has blocks fi…
jonnynews Dec 30, 2025
4b517b4
Refactor PHP linting configuration to streamline commands and improve…
jonnynews Dec 30, 2025
96e813d
Refactor PHP linting command for improved output and clarity; streaml…
jonnynews Dec 30, 2025
60966b9
Refactor PHP linting command to enhance error handling and suppress w…
jonnynews Dec 30, 2025
f4700e2
Update permissions in reusable-php-lint.yml to allow write access for…
jonnynews Dec 30, 2025
e00b572
Update permissions in reusable-php-lint.yml to allow write access for…
jonnynews Dec 30, 2025
36e3523
Enhance debugging output in PHP linting workflow by enabling debug mo…
jonnynews Dec 30, 2025
2b8e5a9
Remove debug mode from PHPCS and PHPStan commands in reusable-php-lin…
jonnynews Dec 30, 2025
5113ec8
Update permissions in CI workflows to allow write access for pull req…
jonnynews Dec 30, 2025
58d4a22
Refactor Data class for improved attribute extraction and modernize c…
jonnynews Dec 30, 2025
7f0b957
Update PHPStan level and improve type hinting in Data and Posts classes
jonnynews Dec 30, 2025
71f8d93
Refactor type declarations and improve code consistency across multip…
jonnynews Dec 30, 2025
7cfc388
Add Slevomat Coding Standard to composer development dependencies
jonnynews Dec 30, 2025
aa5563b
Update PHPCS ruleset for improved coding standards and consistency
jonnynews Dec 30, 2025
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
3 changes: 3 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
.travis.yml
.DS_Store
.wordpress-org
.wp-env.json
.wp-env.override.json
.wp-env-home
composer.json
composer.lock
Thumbs.db
Expand Down
59 changes: 59 additions & 0 deletions .github/actions/setup-php-composer/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: 'Setup PHP with Composer'
description: 'Setup PHP environment with Composer cache and dependencies'

inputs:
php-version:
description: 'PHP version to use'
required: false
default: '7.4'
composer-args:
description: 'Additional arguments for composer install'
required: false
default: '--prefer-dist --no-progress --no-interaction'
tools:
description: 'Tools to install'
required: false
default: 'composer, cs2pr'
coverage:
description: 'Coverage driver'
required: false
default: 'none'
extensions:
description: 'PHP extensions to install'
required: false
default: ''

outputs:
composer-cache-dir:
description: 'Composer cache directory'
value: ${{ steps.composer-cache.outputs.dir }}

runs:
using: 'composite'
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php-version }}
coverage: ${{ inputs.coverage }}
tools: ${{ inputs.tools }}
extensions: ${{ inputs.extensions }}

- name: Get Composer cache directory
id: composer-cache
shell: bash
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"

- name: Setup Composer cache
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
${{ runner.os }}-

- name: Install dependencies
shell: bash
run: composer install ${{ inputs.composer-args }}

64 changes: 44 additions & 20 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,47 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# Dependabot configuration for keeping GitHub Actions up to date
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates

version: 2
updates:
- package-ecosystem: composer
directory: '/'
schedule:
interval: weekly
open-pull-requests-limit: 10
labels:
- Dependencies
- PHP
- package-ecosystem: npm
directory: '/'
schedule:
interval: weekly
open-pull-requests-limit: 15
labels:
- Dependencies
- JavaScript
# Monitor GitHub Actions versions
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
day: 'monday'
open-pull-requests-limit: 10
labels:
- 'dependencies'
- 'github-actions'
commit-message:
prefix: 'chore(deps)'
include: 'scope'

# Monitor Composer dependencies
- package-ecosystem: 'composer'
directory: '/'
schedule:
interval: 'weekly'
day: 'monday'
open-pull-requests-limit: 10
labels:
- 'dependencies'
- 'php'
commit-message:
prefix: 'chore(deps)'
include: 'scope'

# Monitor npm dependencies
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
day: 'monday'
open-pull-requests-limit: 10
labels:
- 'dependencies'
- 'javascript'
commit-message:
prefix: 'chore(deps)'
include: 'scope'

44 changes: 12 additions & 32 deletions .github/workflows/continuous-integration-lint-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,18 @@ on:
- release/*
pull_request:

jobs:
lint-php:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
tools: composer, cs2pr

- name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
# Cancel in-progress runs for the same workflow and branch/PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

- name: Setup Composer cache
uses: pat-s/always-upload-cache@v2.1.3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
${{ runner.os }}-
permissions:
contents: read
pull-requests: write

- name: Validate composer.json
run: composer --no-interaction validate --no-check-all

- name: Install dependencies
run: composer install --prefer-dist --no-suggest --no-progress --no-interaction
jobs:
lint-php:
uses: ./.github/workflows/reusable-php-lint.yml
with:
php-version: '7.4'

- name: Detect coding standard violations (PHPCS)
run: vendor/bin/phpcs -q --report=checkstyle --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 | cs2pr --graceful-warnings
30 changes: 10 additions & 20 deletions .github/workflows/deploytowp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,27 @@ on:
push:
tags:
- '**'

permissions:
contents: read

jobs:
tag:
name: New tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
- name: Setup PHP with Composer
uses: ./.github/actions/setup-php-composer
with:
php-version: '7.0'
coverage: none
tools: composer
php-version: '7.4'
composer-args: '--prefer-dist --no-progress --no-dev --optimize-autoloader --no-interaction'
tools: 'composer'

- name: Validate composer.json and composer.lock
run: composer validate

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache Composer vendor directory
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-

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

- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@stable
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/reusable-php-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Reusable PHP Lint

on:
workflow_call:
inputs:
php-version:
description: 'PHP version to use'
type: string
default: '7.4'
run-phpcs:
description: 'Run PHPCS checks'
type: boolean
default: true
run-phpstan:
description: 'Run PHPStan checks'
type: boolean
default: true
run-phpmd:
description: 'Run PHPMD checks'
type: boolean
default: true
run-composer-normalize:
description: 'Run composer normalize check'
type: boolean
default: true

permissions:
contents: read
pull-requests: write

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP with Composer
uses: ./.github/actions/setup-php-composer
with:
php-version: ${{ inputs.php-version }}

- name: Validate composer.json
run: composer --no-interaction validate --no-check-all

- name: Normalize composer.json
if: ${{ inputs.run-composer-normalize }}
run: composer normalize --no-interaction --dry-run

- name: Detect coding standard violations (PHPCS)
if: ${{ inputs.run-phpcs }}
run: composer lint -- -q --report=checkstyle --severity=1 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 | cs2pr --graceful-warnings

- name: Detect PHPStan issues
if: ${{ inputs.run-phpstan }}
run: composer phpstan -- --error-format=checkstyle | cs2pr --graceful-warnings

- name: Detect PHP Mess Detector issues
if: ${{ inputs.run-phpmd }}
run: composer phpmd

48 changes: 48 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Security Scanning

on:
push:
branches:
- master
pull_request:
schedule:
# Run weekly on Monday at 00:00 UTC
- cron: '0 0 * * 1'
workflow_dispatch:

# Cancel in-progress runs for the same workflow and branch/PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
security-events: write

jobs:
dependency-review:
name: Dependency Review
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Dependency Review
uses: actions/dependency-review-action@v4

composer-audit:
name: Composer Security Audit
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP with Composer
uses: ./.github/actions/setup-php-composer
with:
php-version: '7.4'

- name: Run Composer Audit
run: composer audit --format=plain

Loading
Loading