Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-mendonca committed Feb 3, 2022
2 parents 279c99c + beb3cdc commit be5b25a
Showing 19 changed files with 10,303 additions and 14,766 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -2,3 +2,4 @@
/assets/lib/
/node_modules/
/vendor/
/*.js
121 changes: 114 additions & 7 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -29,6 +29,51 @@ on:
workflow_dispatch:

jobs:

# Runs PHP compatibility check.
#
# Violations are reported inline with annotations.
#
# Performs the following steps:
# - Checks out the repository.
# - Sets up PHP.
# - Logs debug information about the runner container.
# - Installs Composer dependencies (use cache if possible).
# - Logs PHP_CodeSniffer debug information.
# - Runs the PHP compatibility tests.
php-compatibility:
name: PHP compatibility
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2.4.0

- name: Set up PHP
uses: shivammathur/setup-php@2.16.0
with:
php-version: '7.4' # Results are the same across all versions, check only in the last stable version.
coverage: none
env:
fail-fast: false

- name: Log debug information
run: |
php --version
composer --version
- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Install Composer dependencies
uses: ramsey/composer-install@v1

- name: Log PHPCS debug information
run: composer phpcs-i

- name: Run PHP compatibility tests
run: composer compat:php

# Runs PHP coding standards checks.
#
# Violations are reported inline with annotations.
@@ -41,7 +86,7 @@ jobs:
# - Make Composer packages available globally.
# - Logs PHP_CodeSniffer debug information.
# - Runs PHPCS on the full codebase.
phpcs:
php-cs:
name: PHP coding standards
runs-on: ubuntu-latest

@@ -85,18 +130,18 @@ jobs:
- name: Show PHPCS results in PR
run: cs2pr ./phpcs-report.xml

# Runs the JavaScript, CSS/SCSS and Markdown coding standards checks.
# Runs the JavaScript coding standards checks.
#
# JS and CSS violations are not currently reported inline with annotations.
# JS violations are not currently reported inline with annotations.
#
# Performs the following steps:
# - Checks out the repository.
# - Installs NodeJS 16 with caching for NPM.
# - Logs updated debug information.
# _ Installs NPM dependencies using install-changed to hash the `package.json` file.
# - Run the WordPress ESLint, Stylelint and Markdownlint checks.
js-css-md-cs:
name: JS, CSS/SCSS and MD coding standards
# - Installs NPM dependencies using install-changed to hash the `package.json` file.
# - Run the WordPress ESLint checks.
js-cs:
name: JavaScript coding standards
runs-on: ubuntu-latest

steps:
@@ -120,8 +165,70 @@ jobs:
- name: Run JavaScript Lint
run: npm run lint:js

# Runs the CSS/SCSS coding standards checks.
#
# CSS violations are not currently reported inline with annotations.
#
# Performs the following steps:
# - Checks out the repository.
# - Installs NodeJS 16 with caching for NPM.
# - Logs updated debug information.
# - Installs NPM dependencies using install-changed to hash the `package.json` file.
# - Run the WordPress Stylelint checks.
css-cs:
name: CSS/SCSS coding standards
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2.4.0

- name: Setup Node
uses: actions/setup-node@v2.5.1
with:
node-version: 16
cache: npm

- name: Log debug information
run: |
npm --version
node --version
- name: Install Dependencies
run: npm ci

- name: Run CSS/SCSS Lint
run: npm run lint:css

# Runs the Markdown coding standards checks.
#
# Performs the following steps:
# - Checks out the repository.
# - Installs NodeJS 16 with caching for NPM.
# - Logs updated debug information.
# - Installs NPM dependencies using install-changed to hash the `package.json` file.
# - Run the WordPress Markdownlint checks.
md-cs:
name: Markdown coding standards
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2.4.0

- name: Setup Node
uses: actions/setup-node@v2.5.1
with:
node-version: 16
cache: npm

- name: Log debug information
run: |
npm --version
node --version
- name: Install Dependencies
run: npm ci

- name: Run Markdown Lint
run: npm run lint:md:docs
63 changes: 0 additions & 63 deletions .github/workflows/php-compatibility.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3', '7.4', '8.0'] # 5.6 and 7.0 not supported by PHPStan, 7.1 not supported by a PHPMD dependency.
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1'] # 5.6 and 7.0 not supported by PHPStan, 7.1 not supported by a PHPMD dependency.

steps:
- name: Checkout repository
5 changes: 4 additions & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -11,6 +11,9 @@
],
"font-weight-notation": null,
"no-descending-specificity": null,
"selector-class-pattern": null
"selector-class-pattern": null,
"scss/at-import-no-partial-leading-underscore": null,
"scss/at-import-partial-extension": null,
"scss/operator-no-unspaced": null
}
}
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -88,6 +88,12 @@ Sure! You are welcome to report any issues or add feature suggestions on the [Gi

## Changelog

### Unreleased

* Tested up to WP 5.9
* Fix PHP error on new installs before saving settings
* Fix CSS error

### 1.2.0

* Stats widget color and border improvements
1 change: 1 addition & 0 deletions assets/css/admin.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/admin-settings.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 6 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
@@ -16,9 +16,9 @@
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"wp-coding-standards/wpcs": "^2.3.0",
"phpcompatibility/phpcompatibility-wp": "^2.1.2",
"phpmd/phpmd": "^2.10.2",
"szepeviktor/phpstan-wordpress": "^1.0.0",
"phpcompatibility/phpcompatibility-wp": "^2.1.3",
"phpmd/phpmd": "^2.11.1",
"szepeviktor/phpstan-wordpress": "^1.0.2",
"sirbrillig/phpcs-variable-analysis": "^2.11.2"
},
"config": {
@@ -34,14 +34,6 @@
"@lint:md:docs",
"@lint:pkg-json"
],
"compile": [
"@compile:css",
"@compile:js"
],
"build": [
"@lint",
"@compile"
],
"zip": "composer archive --file=translation-stats --format=zip",
"phpcs-i": "phpcs -i",
"lint:php": "phpcs -v --standard=phpcs.xml",
@@ -53,13 +45,11 @@
"lint:js": "npm run lint:js",
"lint:md:docs": "npm run lint:md:docs",
"lint:pkg-json": "npm run lint:pkg-json",
"compile:css": "npm run compile:css",
"compile:js": "npm run compile:js",
"build": "npm run build",
"scripts-list": "composer run-script --list"
},
"scripts-descriptions": {
"lint": "Runs all available code linting (PHP_CodeSniffer, CSS/SASS, JS and MD lint).",
"compile": "Compile all CSS and JavaScript",
"lint": "Runs all available code linting (PHP_CodeSniffer, PHPStan, CSS, JS and MD lint).",
"phpcs-i": "Log PHPCS debug information.",
"lint:php": "Runs the PHP code sniffer.",
"format:php": "Runs the PHP code sniffer and automatically fix errors.",
@@ -70,10 +60,8 @@
"lint:js": "Run npm JS linter.",
"lint:md:docs": "Run npm MD linter.",
"lint:pkg-json": "Run npm package.json linter.",
"compile:css": "Run npm Node Sass and Stylelint to compile CSS.",
"compile:js": "Run npm UglifyJS to compile minified JS.",
"build": "Compile all CSS and JS with npm run build",
"scripts-list": "List all Composer scripts.",
"build": "Lint, test and compile all PHP, CSS, JS and MD.",
"zip": "Build production zip archive."
},
"funding": [
Loading

0 comments on commit be5b25a

Please sign in to comment.