Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new Offloading_Files_Check check #566

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
cebd9f3
first check known urls
davidperezgar Aug 10, 2024
83a9ac7
name changes
davidperezgar Aug 11, 2024
37b6cfe
added extensions
davidperezgar Aug 11, 2024
0fb89db
Merge branch 'trunk' into 486-check-calling-remote-files-js-css-image…
davidperezgar Aug 17, 2024
c48faa0
fixed error in merge
davidperezgar Aug 17, 2024
6eedf4c
start detecting functions offloading
davidperezgar Aug 18, 2024
b97ac8a
offloading
davidperezgar Aug 18, 2024
8d140d7
fix some typos
davidperezgar Aug 18, 2024
de59867
Merge branch 'trunk' into 486-check-calling-remote-files-js-css-image…
swissspidy Aug 22, 2024
26e9e29
Turn into PHPCS based sniff
swissspidy Aug 22, 2024
48574fd
Add some test files
swissspidy Aug 22, 2024
e68b70a
Implement custom sniffs
swissspidy Aug 22, 2024
c09ed3f
Remove unused import
swissspidy Aug 22, 2024
1daa875
Composer update
swissspidy Aug 22, 2024
32c8625
Update phpmd config
swissspidy Aug 22, 2024
a369849
Merge branch 'trunk' into 486-check-calling-remote-files-js-css-image…
davidperezgar Sep 1, 2024
1de3525
Merge branch 'trunk' into 486-check-calling-remote-files-js-css-image…
swissspidy Sep 10, 2024
34aa8a6
No symlink
swissspidy Sep 10, 2024
0655820
Add unit tests for the sniffs themselves
swissspidy Sep 10, 2024
18cc7a9
Run sniff tests on CI
swissspidy Sep 10, 2024
a0b5a48
Downgrade deps
swissspidy Sep 10, 2024
eb2711a
Composer normalize
swissspidy Sep 10, 2024
7958600
added description
davidperezgar Sep 12, 2024
2c607a9
Fix apostrophe issue in error messages
ernilambar Sep 10, 2024
24a2741
Add warning for mismatched plugin name
ernilambar Sep 10, 2024
5adcdc1
Refine units tests for readme
ernilambar Sep 11, 2024
09c4e6e
Add test for mismatched plugin name
ernilambar Sep 11, 2024
8d1cc01
Composer update
swissspidy Sep 13, 2024
db7bf58
Merge branch 'trunk' into 486-check-calling-remote-files-js-css-image…
swissspidy Sep 14, 2024
7a1f62a
Fix distignore comment
swissspidy Sep 14, 2024
9c1434b
fixed distignore not getting folders correctly
davidperezgar Sep 14, 2024
497de88
fixed test-content
davidperezgar Sep 14, 2024
629ba2c
Merge branch 'trunk' into 486-check-calling-remote-files-js-css-image…
ernilambar Sep 22, 2024
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
2 changes: 2 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ build-phpunit
docs
node_modules
patches
# Distributed via vendor/plugin-check/phpcs-sniffs instead
/phpcs-sniffs/
tests

*.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install PHP dependencies
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a
with:
composer-options: '--prefer-dist --no-progress --no-interaction --no-dev'
composer-options: '--prefer-dist --no-dev'

- name: WordPress Plugin Deploy
id: deploy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/php-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Install PHP dependencies
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a
with:
composer-options: '--prefer-dist --no-progress --no-interaction'
composer-options: '--prefer-dist'

- name: PHP Lint
run: composer lint
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/php-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,51 @@ jobs:
file: build/logs/*.xml
flags: unit
token: ${{ secrets.CODECOV_TOKEN }}

phpcs-sniffs:
name: PHP (Sniffs) ${{ matrix.php }} ${{ matrix.coverage && ' (with coverage)' || '' }}
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: true
matrix:
php:
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
wordpress: [ 'latest' ]
include:
- php: '8.3'
coverage: true
steps:
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: Install PHP dependencies
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a
with:
working-directory: "phpcs-sniffs"

- name: Run tests
working-directory: "phpcs-sniffs"
run: |

if [[ ${{ matrix.coverage == true }} == true ]]; then
composer run-tests -- --coverage-clover ../build/logs/phpcs-coverage.xml
else
composer run-tests
fi

- name: Upload code coverage report
if: ${{ matrix.coverage }}
uses: codecov/codecov-action@893cfea3da0870ceb77096be8b5fe014720f3c32
with:
file: build/logs/*.xml
flags: phpcs-sniffs
token: ${{ secrets.CODECOV_TOKEN }}
80 changes: 45 additions & 35 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"name": "wordpress/plugin-check",
"description": "Plugin Check is a WordPress.org tool which provides checks to help plugins meet the directory requirements and follow various best practices.",
"type": "wordpress-plugin",
"license": "GPL-2.0-or-later",
"type": "wordpress-plugin",
"require": {
"php": ">=7.2.24",
"ext-json": "*",
"afragen/wordpress-plugin-readme-parser": "dev-master#67fba498d0b112acf84386b95e4905c539a33f0b",
"automattic/vipwpcs": "^3.0.0",
"composer/installers": "^2.2",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0",
"wp-coding-standards/wpcs": "^3.1.0",
"automattic/vipwpcs": "^3.0.0",
"afragen/wordpress-plugin-readme-parser": "dev-master#67fba498d0b112acf84386b95e4905c539a33f0b",
"ext-json": "*"
"plugin-check/phpcs-sniffs": "@dev",
"wp-coding-standards/wpcs": "^3.1.0"
},
"require-dev": {
"phpcompatibility/php-compatibility": "^9.3",
Expand All @@ -21,49 +22,58 @@
"szepeviktor/phpstan-wordpress": "^1.1",
"wp-cli/extension-command": "^2.1",
"wp-cli/wp-cli": "^2.8",
"wp-cli/wp-cli-tests": "^v4.2.9"
"wp-cli/wp-cli-tests": "^4.2.9"
},
"repositories": [
{
"type": "path",
"url": "./phpcs-sniffs",
"options": {
"symlink": false
}
}
],
"autoload": {
"psr-4": {
"WordPress\\Plugin_Check\\": "includes/"
}
},
"autoload-dev": {
"psr-4": {
"WordPress\\Plugin_Check\\Behat_Utils\\": "tests/behat/includes",
"WordPress\\Plugin_Check\\Test_Data\\": "tests/phpunit/testdata/Checks",
"WordPress\\Plugin_Check\\Test_Utils\\": "tests/phpunit/utils"
}
},
"config": {
"allow-plugins": {
"composer/installers": true,
"cweagans/composer-patches": false,
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true
},
"platform": {
"php": "7.2.24"
}
},
"scripts": {
"behat": "BEHAT_FEATURES_FOLDER=tests/behat/features run-behat-tests",
"behat-rerun": "BEHAT_FEATURES_FOLDER=tests/behat/features rerun-behat-tests",
"prepare-behat-tests": "install-package-tests",
"format": "phpcbf --standard=phpcs.xml.dist",
"lint": "phpcs --standard=phpcs.xml.dist",
"phpmd": "phpmd . text phpmd.xml",
"phpstan": "phpstan analyse --memory-limit=2048M",
"prepare-behat-tests": "install-package-tests",
"test": "phpunit"
},
"scripts-descriptions": {
"lint": "Detect coding standards issues",
"behat": "Run functional tests",
"behat-rerun": "Re-run failed functional tests",
"format": "Detect and automatically fix most coding standards issues",
"test": "Run unit tests",
"lint": "Detect coding standards issues",
"phpmd": "Run PHP mess detector",
"phpstan": "Run static analysis",
"behat": "Run functional tests",
"behat-rerun": "Re-run failed functional tests",
"prepare-behat-tests": "Prepare functional tests"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"composer/installers": true,
"phpstan/extension-installer": true,
"cweagans/composer-patches": false
},
"platform": {
"php": "7.2.24"
}
},
"autoload": {
"psr-4": {
"WordPress\\Plugin_Check\\": "includes/"
}
},
"autoload-dev": {
"psr-4": {
"WordPress\\Plugin_Check\\Test_Data\\": "tests/phpunit/testdata/Checks",
"WordPress\\Plugin_Check\\Test_Utils\\": "tests/phpunit/utils",
"WordPress\\Plugin_Check\\Behat_Utils\\": "tests/behat/includes"
}
"prepare-behat-tests": "Prepare functional tests",
"test": "Run unit tests"
}
}
Loading