Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jdevalk authored Apr 29, 2024
2 parents 6e420f5 + 8e7fd03 commit 7254d7c
Show file tree
Hide file tree
Showing 20 changed files with 1,323 additions and 283 deletions.
3 changes: 2 additions & 1 deletion .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
.distignore
.gitignore
.gitattributes
.phpcs.xml.dist
phpcs.xml.dist
phpstan.neon.dist
phpunit.xml.dist
README.md
composer.json
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/.gitignore export-ignore
/.phpcs.xml export-ignore
/phpcs.xml.dist export-ignore
/phpstan.neon.dist export-ignore
/.cache export-ignore
composer.json export-ignore
composer.lock export-ignore
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: PHPStan

on:
# Run on pushes to select branches and on all pull requests.
push:
branches:
- main
- develop
- 'release/[0-9]+.[0-9]+*'
- 'hotfix/[0-9]+.[0-9]+*'
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
phpstan:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 'latest'
coverage: none
tools: composer, cs2pr

- name: Install PHP dependencies
uses: ramsey/composer-install@v2
with:
composer-options: '--prefer-dist --no-scripts'

- name: PHPStan
run: composer phpstan
Binary file modified .wordpress-org/screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![CS](https://github.com/emilia-capital/aaa-option-optimizer/actions/workflows/cs.yml/badge.svg)](https://github.com/emilia-capital/aaa-option-optimizer/actions/workflows/cs.yml)
[![PHPStan](https://github.com/Emilia-Capital/aaa-option-optimizer/actions/workflows/phpstan.yml/badge.svg)](https://github.com/Emilia-Capital/aaa-option-optimizer/actions/workflows/phpstan.yml)
[![Lint](https://github.com/emilia-capital/aaa-option-optimizer/actions/workflows/lint.yml/badge.svg)](https://github.com/emilia-capital/aaa-option-optimizer/actions/workflows/lint.yml)
[![Security](https://github.com/emilia-capital/aaa-option-optimizer/actions/workflows/security.yml/badge.svg)](https://github.com/emilia-capital/aaa-option-optimizer/actions/workflows/security.yml)

Expand All @@ -21,6 +22,10 @@ starting the name with AAA made sense.

Yes!! Backup your database.

### How can I add recognized plugins?

Please do a pull request via GitHub on [this file](https://github.com/Emilia-Capital/aaa-option-optimizer/blob/develop/known-plugins/known-plugins.json) in the plugin.

### How can I report security bugs?

You can report security bugs through the Patchstack Vulnerability Disclosure Program. The Patchstack team help validate, triage and handle any security vulnerabilities. [Report a security vulnerability.](https://patchstack.com/database/vdp/aaa-option-optimizer)
6 changes: 4 additions & 2 deletions aaa-option-optimizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Plugin Name: AAA Option Optimizer
* Plugin URI: https://joost.blog/plugins/aaa-option-optimizer/
* Description: Tracks autoloaded options usage and allows the user to optimize them.
* Version: 1.1.1
* Version: 1.2.1
* License: GPL-3.0+
* Author: Joost de Valk
* Author URI: https://joost.blog/
Expand All @@ -19,6 +19,9 @@
}

define( 'AAA_OPTION_OPTIMIZER_FILE', __FILE__ );
define( 'AAA_OPTION_OPTIMIZER_DIR', __DIR__ );

require_once __DIR__ . '/src/autoload.php';

register_activation_hook( __FILE__, 'aaa_option_optimizer_activation' );

Expand Down Expand Up @@ -49,7 +52,6 @@ function aaa_option_optimizer_activation() {
* @return void
*/
function aaa_option_optimizer_init() {
require_once plugin_dir_path( __FILE__ ) . 'src/class-plugin.php';
$optimizer = new Emilia\OptionOptimizer\Plugin();
$optimizer->register_hooks();
}
Expand Down
14 changes: 11 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,21 @@
"require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"wp-coding-standards/wpcs": "^3.0"
"wp-coding-standards/wpcs": "^3.0",
"phpstan/phpstan": "^1.10",
"szepeviktor/phpstan-wordpress": "^1.3",
"phpstan/extension-installer": "^1.3",
"phpcompatibility/php-compatibility": "dev-develop as 9.99.99"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true
}
},
"scripts": {
"check-cs": [
"@php ./vendor/bin/phpcs"
"@php ./vendor/bin/phpcs -s --colors"
],
"fix-cs": [
"@php ./vendor/bin/phpcbf"
Expand All @@ -31,6 +36,9 @@
],
"lint-blueprint": [
"@php -r \"exit( intval( is_null( json_decode( file_get_contents( './.wordpress-org/blueprints/blueprint.json' ) ) ) ) );\""
],
"phpstan": [
"@php ./vendor/bin/phpstan analyse --memory-limit=2048M"
]
}
}
Loading

0 comments on commit 7254d7c

Please sign in to comment.