diff --git a/.github/workflows/plugin-check.yml b/.github/workflows/plugin-check.yml index 432bfc9..0fc71de 100644 --- a/.github/workflows/plugin-check.yml +++ b/.github/workflows/plugin-check.yml @@ -9,21 +9,47 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Build clean plugin directory + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Build plugin directory + run: | + mkdir -p plugin-build/warder-cookie-consent + rsync -a --exclude='.git' --exclude-from='.distignore' . plugin-build/warder-cookie-consent/ + + - name: Install wp-env + run: npm install -g @wordpress/env + + - name: Create wp-env config run: | - mkdir -p ${{ github.workspace }}/plugin-build/warder-cookie-consent - rsync -a --exclude='.git' --exclude-from='.distignore' . ${{ github.workspace }}/plugin-build/warder-cookie-consent/ + echo '{ + "core": null, + "plugins": [ + "https://downloads.wordpress.org/plugin/plugin-check.zip", + "./plugin-build/warder-cookie-consent" + ] + }' > .wp-env.json + + - name: Start wp-env + run: wp-env start + timeout-minutes: 5 - name: Run Plugin Check - uses: WordPress/plugin-check-action@v1 - with: - build-dir: '${{ github.workspace }}/plugin-build/warder-cookie-consent' - checks: '' - exclude-checks: 'EnqueuedScriptsScope' + run: | + wp-env run cli wp plugin check warder-cookie-consent \ + --exclude-checks=EnqueuedScriptsScope \ + --format=table \ + | tee plugin-check-results.txt - - name: Upload Plugin Check Results - uses: actions/upload-artifact@v4 + - name: Upload Plugin Check results if: always() + uses: actions/upload-artifact@v4 with: name: plugin-check-results - path: ${{ github.workspace }}/plugin-build/warder-cookie-consent/plugin-check-results.txt + path: plugin-check-results.txt + + - name: Stop wp-env + if: always() + run: wp-env stop diff --git a/.github/workflows/wpcs.yml b/.github/workflows/wpcs.yml index 5b0a472..0a89c0f 100644 --- a/.github/workflows/wpcs.yml +++ b/.github/workflows/wpcs.yml @@ -1,14 +1,21 @@ -name: WPCS check +name: WPCS Check on: pull_request jobs: phpcs: - name: WPCS + name: WPCS Check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: WPCS check - uses: 10up/wpcs-action@stable + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: - standard: 'WordPress' + php-version: '8.2' + + - name: Install dependencies + run: composer install --no-progress --prefer-dist + + - name: Run PHP_CodeSniffer + run: vendor/bin/phpcs --standard=phpcs.xml --warning-severity=0 diff --git a/CHANGELOG.md b/CHANGELOG.md index e8341c7..cb49fea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to Warder Cookie Consent are documented here. +## [1.4.1] - 2026-05-27 + +### Changed +- Replaced the `10up/wpcs-action`-based WPCS workflow with a local PHPCS workflow that runs against `phpcs.xml` — enforces `WordPress.WP.I18n` with the `warder-cookie-consent` text domain and `WordPress.Security.EscapeOutput`, catching i18n and escaping issues the old workflow missed + ## [1.4.0] - 2026-05-27 ### Added diff --git a/readme.txt b/readme.txt index dc53aba..3d5b7f1 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://imagewize.com Tags: cookie, consent, gdpr, privacy, compliance Requires at least: 5.0 Tested up to: 7.0 -Stable tag: 1.4.0 +Stable tag: 1.4.1 Requires PHP: 8.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -72,6 +72,11 @@ Yes. Settings are versioned via a timestamp that is appended to the script URL, == Changelog == += 1.4.1 = +*2026-05-27* + +* Changed: Replaced the 10up/wpcs-action workflow with a local PHPCS workflow using phpcs.xml, adding enforcement of WordPress.WP.I18n (text domain: warder-cookie-consent) and WordPress.Security.EscapeOutput on pull requests + = 1.4.0 = *2026-05-27* @@ -142,6 +147,9 @@ Yes. Settings are versioned via a timestamp that is appended to the script URL, == Upgrade Notice == += 1.4.1 = +Replaces the 10up/wpcs-action CI workflow with local PHPCS, adding strict i18n (text domain) and output escaping checks on pull requests. + = 1.4.0 = Restores the category/cookie management buttons (add/remove category and cookie) that were not working, with nonce-protected handlers. Adds minimum WordPress/PHP version headers. diff --git a/warder-cookie-consent.php b/warder-cookie-consent.php index 73208eb..58fbc74 100644 --- a/warder-cookie-consent.php +++ b/warder-cookie-consent.php @@ -2,7 +2,7 @@ /** * Plugin Name: Warder Cookie Consent * Description: GDPR-compliant cookie consent banner with category management and floating preferences toggle. - * Version: 1.4.0 + * Version: 1.4.1 * Author: Jasper Frumau * Author URI: https://imagewize.com * Requires at least: 5.0