-
-
Notifications
You must be signed in to change notification settings - Fork 3
Refactor to filter-based architecture #15
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
a6c0ccf
Refactor to filter-based architecture
pfefferle 216b1b8
Add per-version integration classes
pfefferle a5cae1a
Centralize JRD discovery in controller
pfefferle fd502cf
Switch to wp-env and update test setup
pfefferle deb64d7
Fix PHPCS issues and add unit tests
pfefferle f24b9f4
Fix PHPUnit workflow database creation
pfefferle d63b498
Fix test failures
pfefferle b4dd90b
Remove unused get_plugin_meta and get_plugin_version functions
pfefferle f3a66b6
Remove translatable strings from schema descriptions
pfefferle e87028e
Add schema to NodeInfo 1.1 and add NodeInfo 2.2 support
pfefferle 4852312
Update NodeInfo schema definitions and protocol handling
pfefferle 71f2846
Bump NodeInfo plugin version to 3.0.0
pfefferle 55ff527
Update requirements and changelog for 3.0.0 release
pfefferle da08d84
Expand README with plugin usage details
pfefferle f696505
Add Site Health checks for NodeInfo endpoints
pfefferle 43aa84d
Prefix WordPress core functions with backslash
pfefferle 86be1c2
Add backwards compatibility and update package.json
pfefferle cd88863
Update .gitattributes with new config files
pfefferle 99d31f2
Update includes/controller/class-nodeinfo2.php
pfefferle fd8d381
Update phpcs.xml
pfefferle f49831f
Fix issues from code review
pfefferle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,34 @@ | ||
| name: PHP_CodeSniffer | ||
| on: push | ||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| paths: | ||
| - '**/*.php' | ||
| - 'composer.json' | ||
| - 'composer.lock' | ||
| - 'phpcs.xml' | ||
| - '.github/workflows/phpcs.yml' | ||
| pull_request: | ||
| paths: | ||
| - '**/*.php' | ||
| - 'composer.json' | ||
| - 'composer.lock' | ||
| - 'phpcs.xml' | ||
| - '.github/workflows/phpcs.yml' | ||
| jobs: | ||
| phpcs: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
| uses: actions/checkout@v4 | ||
| - 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)" | ||
| - name: Setup cache | ||
| uses: pat-s/always-upload-cache@v1.1.4 | ||
| with: | ||
| path: ${{ steps.composer-cache.outputs.dir }} | ||
| # Use the hash of composer.json as the key for your cache if you do not commit composer.lock. | ||
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
| #key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
| restore-keys: ${{ runner.os }}-composer- | ||
| - name: Install dependencies | ||
| run: composer install --prefer-dist --no-progress | ||
| - name: Install Composer dependencies for PHP | ||
| uses: ramsey/composer-install@v3 | ||
| - name: Detect coding standard violations | ||
| run: ./vendor/bin/phpcs -n -q | ||
| run: ./vendor/bin/phpcs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| name: PHPUnit | ||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| paths: | ||
| - '**/*.php' | ||
| - 'composer.json' | ||
| - 'composer.lock' | ||
| - 'phpunit.xml.dist' | ||
| - '.github/workflows/phpunit.yml' | ||
| pull_request: | ||
| paths: | ||
| - '**/*.php' | ||
| - 'composer.json' | ||
| - 'composer.lock' | ||
| - 'phpunit.xml.dist' | ||
| - '.github/workflows/phpunit.yml' | ||
|
|
||
| jobs: | ||
| phpunit: | ||
| runs-on: ubuntu-latest | ||
| services: | ||
| mysql: | ||
| image: mariadb:10.4 | ||
| env: | ||
| MARIADB_ROOT_PASSWORD: root | ||
| MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: true | ||
| ports: | ||
| - 3306:3306 | ||
| options: >- | ||
| --health-cmd="healthcheck.sh --connect --innodb_initialized" | ||
| --health-interval=5s | ||
| --health-timeout=2s | ||
| --health-retries=3 | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| php-version: ['7.2', '8.3'] | ||
| wp-version: ['latest'] | ||
| include: | ||
| - php-version: '7.2' | ||
| wp-version: '6.5' | ||
|
|
||
| name: PHP ${{ matrix.php-version }} / WP ${{ matrix.wp-version }} | ||
| steps: | ||
| - name: Install svn | ||
| run: sudo apt-get update && sudo apt-get install -y subversion | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php-version }} | ||
| extensions: mbstring, intl | ||
| ini-values: post_max_size=256M, max_execution_time=180 | ||
| coverage: none | ||
|
|
||
| - name: Install Composer dependencies | ||
| uses: ramsey/composer-install@v3 | ||
|
|
||
| - name: Setup Test Environment | ||
| run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 ${{ matrix.wp-version }} | ||
|
|
||
| - name: Run PHPUnit | ||
| run: vendor/bin/phpunit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "core": null, | ||
| "plugins": [ "." ], | ||
| "port": 8891, | ||
| "testsPort": 8892, | ||
| "env": { | ||
| "tests": { | ||
| "config": { | ||
| "WP_ENVIRONMENT_TYPE": "production" | ||
| }, | ||
| "mappings": { | ||
| "wp-content/plugins/nodeinfo": "." | ||
| } | ||
| } | ||
| }, | ||
| "lifecycleScripts": { | ||
| "afterStart": "npx wp-env run cli wp rewrite structure /%year%/%monthnum%/%postname%/" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,41 +1,49 @@ | ||
| { | ||
| "name": "pfefferle/wordpress-nodeinfo", | ||
| "description": "NodeInfo and NodeInfo2 for WordPress!", | ||
| "require": { | ||
| "php": ">=5.6.0", | ||
| "composer/installers": "^1.0 || ^2.0" | ||
| }, | ||
| "type": "wordpress-plugin", | ||
| "license": "MIT", | ||
| "authors": [ | ||
| { | ||
| "name": "Matthias Pfefferle", | ||
| "homepage": "https://notiz.blog" | ||
| } | ||
| ], | ||
| "extra": { | ||
| "installer-name": "nodeinfo" | ||
| }, | ||
| "require-dev": { | ||
| "phpunit/phpunit": "^5.7.21 || ^6.5 || ^7.5 || ^8", | ||
| "phpcompatibility/php-compatibility": "*", | ||
| "phpcompatibility/phpcompatibility-wp": "*", | ||
| "squizlabs/php_codesniffer": "3.*", | ||
| "wp-coding-standards/wpcs": "*", | ||
| "yoast/phpunit-polyfills": "^3.0", | ||
| "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0" | ||
| }, | ||
| "config": { | ||
| "allow-plugins": true | ||
| }, | ||
| "allow-plugins": { | ||
| "composer/installers": true | ||
| }, | ||
| "scripts": { | ||
| "test": [ | ||
| "composer install", | ||
| "bin/install-wp-tests.sh wordpress wordpress wordpress", | ||
| "vendor/bin/phpunit" | ||
| ] | ||
| } | ||
| "name": "pfefferle/wordpress-nodeinfo", | ||
| "description": "NodeInfo and NodeInfo2 for WordPress!", | ||
| "type": "wordpress-plugin", | ||
| "license": "MIT", | ||
| "authors": [ | ||
| { | ||
| "name": "Matthias Pfefferle", | ||
| "homepage": "https://notiz.blog" | ||
| } | ||
| ], | ||
| "require": { | ||
| "php": ">=7.2", | ||
| "composer/installers": "^1.0 || ^2.0" | ||
| }, | ||
| "require-dev": { | ||
| "phpunit/phpunit": "^8 || ^9", | ||
| "phpcompatibility/php-compatibility": "*", | ||
| "phpcompatibility/phpcompatibility-wp": "*", | ||
| "squizlabs/php_codesniffer": "3.*", | ||
| "wp-coding-standards/wpcs": "dev-develop", | ||
| "yoast/phpunit-polyfills": "^4.0", | ||
| "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", | ||
| "sirbrillig/phpcs-variable-analysis": "^2.11", | ||
| "phpcsstandards/phpcsextra": "^1.1.0" | ||
| }, | ||
| "extra": { | ||
| "installer-name": "nodeinfo" | ||
| }, | ||
| "config": { | ||
| "allow-plugins": true | ||
| }, | ||
| "scripts": { | ||
| "test": [ | ||
| "composer install", | ||
| "bin/install-wp-tests.sh nodeinfo-test root nodeinfo-test test-db latest true", | ||
| "vendor/bin/phpunit" | ||
| ], | ||
| "test:wp-env": [ | ||
| "wp-env run tests-cli --env-cwd=\"wp-content/plugins/nodeinfo\" vendor/bin/phpunit" | ||
| ], | ||
| "lint": [ | ||
| "vendor/bin/phpcs" | ||
| ], | ||
| "lint:fix": [ | ||
| "vendor/bin/phpcbf" | ||
| ] | ||
| } | ||
| } | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.