Skip to content

Commit

Permalink
v0.3.8 (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadavidnelson authored Dec 16, 2023
1 parent 272c9a4 commit cdde69d
Show file tree
Hide file tree
Showing 34 changed files with 2,510 additions and 676 deletions.
32 changes: 32 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/tests/
.editorconfig
.gitignore
.gitattributes
.distignore
.wordpress-org
composer.json
composer.lock
code-of-conduct.md
contributing.md
phpstan.neon.dist
package.json
package-lock.json
.wp-env.json
*.sql
*.tar.gz
*.zip
.git
.github
.travis.yml
.DS_Store
.wp-env.json
Thumbs.db
bin
node_modules
phpunit.xml
phpunit.xml.dist
phpstan.neon
phpstan.neon.dist
README.md
tests
cypress.config.js
25 changes: 25 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab

[*.yml]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[{*.txt,wp-config-sample.php}]
end_of_line = crlf
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Directories
/.wordpress-org export-ignore
/.github export-ignore
# Files
/.gitattributes export-ignore
/.gitignore export-ignore
45 changes: 45 additions & 0 deletions .github/workflows/cs-fixer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Coding Standards"
on:
workflow_dispatch: null
permissions:
contents: "write"
pull-requests: "write"
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
fix:
name: "Fix"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v4"
- name: "Install PHPCS"
run: |
composer require --no-plugins --dev wp-coding-standards/wpcs
composer config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer run post-install-cmd
- name: "Fix violations"
run: |
# phpcbf exists with 1 on success
vendor/bin/phpcbf --standard=WordPress-Core *.php includes/ || true
# Complex errors need a second run
vendor/bin/phpcbf --standard=WordPress-Core *.php includes/ || true
- name: "Check difference to repository"
id: "list_diff"
run: |
if ! git diff --exit-code; then
echo "exit_status=1" >>"${GITHUB_OUTPUT}"
fi
- name: "Create pull request"
if: "${{ steps.list_diff.outputs.exit_status == '1' }}"
uses: "peter-evans/create-pull-request@v4"
with:
add-paths: |
*.php
branch: "cs-fixer"
commit-message: "Fix CS"
title: "Fix Coding Standards violations"
body: |
Automated changes by running `phpcbf`.
delete-branch: true
18 changes: 18 additions & 0 deletions .github/workflows/deploy-readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Plugin asset/readme update
on:
push:
branches:
- stable
jobs:
trunk:
name: Push to trunk
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: WordPress.org plugin asset/readme update
uses: 10up/action-wordpress-plugin-asset-update@stable
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
IGNORE_OTHER_FILES: true
SLUG: archived-post-status
18 changes: 18 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Deploy to WordPress.org"
on:
push:
tags:
- "*"
jobs:
tag:
name: "New tag"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@master
- name: "WordPress Plugin Deploy"
uses: 10up/action-wordpress-plugin-deploy@stable
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SLUG: archived-post-status
58 changes: 58 additions & 0 deletions .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: "Integrate"

on:
pull_request: null
push:
branches:
- stable
- develop

jobs:
syntax-check:
name: "Syntax check on all PHP versions"
runs-on: "ubuntu-latest"
strategy:
matrix:
php: ['7.4', '8.0', '8.1', '8.2.' ]
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: ${{ matrix.php }}
- name: "PHP lint"
run: "find *.php includes/ -type f -name '*.php' -print0 | xargs -0 -L1 -P4 -- php -l"

coding-standard:
name: "Check coding standard"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.1"
- name: "Install PHPCS"
run: |
composer require --no-plugins --dev wp-coding-standards/wpcs
composer config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer run post-install-cmd
- name: "Run PHPCS"
run: "vendor/bin/phpcs --standard=WordPress-Core *.php src/"

static-analysis:
name: "Run static analysis"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.1"
- name: "Install PHPStan"
run: "composer require --dev szepeviktor/phpstan-wordpress"
- name: "Run PHPStan"
run: "vendor/bin/phpstan analyze"
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.DS_Store
Thumbs.db
*.sql
*.tar.gz
*.zip
node_modules
dist
vendor
*.cache
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

49 changes: 49 additions & 0 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards based custom ruleset for your plugin">
<description>Generally-applicable sniffs for WordPress plugins.</description>

<!-- What to scan -->
<file>.</file>
<exclude-pattern>/vendor/</exclude-pattern>
<exclude-pattern>/node_modules/</exclude-pattern>

<!-- How to scan -->
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
<!-- Annotated ruleset: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<arg value="sp"/> <!-- Show sniff and progress -->
<arg name="basepath" value="./"/><!-- Strip the file paths down to the relevant bit -->
<arg name="colors"/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="8"/><!-- Enables parallel processing when available for faster results. -->

<!-- Rules: Check PHP version compatibility -->
<!-- https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
<config name="testVersion" value="5.3-"/>
<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP -->
<rule ref="PHPCompatibilityWP"/>

<!-- Rules: WordPress Coding Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<config name="minimum_supported_wp_version" value="4.6"/>
<rule ref="WordPress">
<exclude name="WordPress.VIP"/>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<!-- Value: replace the function, class, and variable prefixes used. Separate multiple prefixes with a comma. -->
<property name="prefixes" type="array" value="my-plugin"/>
</properties>
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<!-- Value: replace the text domain used. -->
<property name="text_domain" type="array" value="my-plugin"/>
</properties>
</rule>
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
<properties>
<property name="blank_line_check" value="true"/>
</properties>
</rule>
</ruleset>
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
10 changes: 10 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"config": {
"WP_DEBUG": true,
"WP_DEBUG_LOG": true
},
"phpVersion": "8.2",
"plugins": [
"."
]
}
Loading

0 comments on commit cdde69d

Please sign in to comment.