diff --git a/.editorconfig b/.editorconfig index 79207a4..29be4ce 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,15 +8,15 @@ root = true [*] charset = utf-8 +indent_style = tab +indent_size = 4 end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true -indent_style = tab -indent_size = 4 -[{.jshintrc,*.json,*.yml}] +[*.md] +trim_trailing_whitespace = false + +[{*.json,*.yml}] indent_style = space indent_size = 2 - -[{*.txt,wp-config-sample.php}] -end_of_line = crlf diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f24d6d9..c8fc6ef 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -13,5 +13,11 @@ updates: - dependency-type: "direct" open-pull-requests-limit: 10 + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 10 + # maybe interesting later # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#composer-repository diff --git a/.github/workflows/build-test-measure.yml b/.github/workflows/build-test-measure.yml new file mode 100644 index 0000000..cd94352 --- /dev/null +++ b/.github/workflows/build-test-measure.yml @@ -0,0 +1,13 @@ +name: Build, test & measure + +on: + workflow_call: + pull_request: + push: + branches: + ['main'] + +jobs: + call-workflow-build-test-measure: + uses: figuren-theater/code-quality/.github/workflows/build-test-measure.yml@main + secrets: inherit diff --git a/.github/workflows/ft-issue-gardening.yml b/.github/workflows/ft-issue-gardening.yml new file mode 100644 index 0000000..96fd72a --- /dev/null +++ b/.github/workflows/ft-issue-gardening.yml @@ -0,0 +1,10 @@ +name: Issue gardening for figuren.theater + +on: + issues: + types: + - opened +jobs: + call-workflow-ft-issue-gardening: + uses: figuren-theater/.github/.github/workflows/issue-gardening.yml@main + secrets: inherit diff --git a/.github/workflows/prerelease-changelog.yml b/.github/workflows/prerelease-changelog.yml new file mode 100644 index 0000000..265e9ab --- /dev/null +++ b/.github/workflows/prerelease-changelog.yml @@ -0,0 +1,12 @@ +name: 'pre-Release Changelog Update' + +on: + workflow_call: + release: + types: [prereleased] + +jobs: + call-workflow-update-changelog: + uses: figuren-theater/.github/.github/workflows/prerelease-changelog-update.yml@main + secrets: inherit + diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..3e5c659 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,19 @@ +name: Draft or update the next release + +on: + push: + # branches to consider in the event; optional, defaults to all + branches: + - main + # pull_request event is required only for autolabeler + pull_request: + # Only following types are handled by the action, but one can default to all as well + types: [opened, reopened, synchronize] + # pull_request_target event is required for autolabeler to support PRs from forks + # pull_request_target: + # types: [opened, reopened, synchronize] + +jobs: + call-workflow-release-drafter: + uses: figuren-theater/.github/.github/workflows/release-drafter.yml@main + secrets: inherit diff --git a/.github/workflows/wp-cron-runner.yml b/.github/workflows/wp-cron-runner.yml index 05f3cef..d9ce5d8 100644 --- a/.github/workflows/wp-cron-runner.yml +++ b/.github/workflows/wp-cron-runner.yml @@ -14,7 +14,7 @@ jobs: steps: - name: cURL request # Hit the webhook endpoint to let WordPress do some routine jobs - # + # # Add a job summary with the wp_die() output, the cron runner creates # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary run: curl "https://figuren.theater/run-cron" >> $GITHUB_STEP_SUMMARY diff --git a/.gitignore b/.gitignore index 448ac03..fbbd667 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ .DS_Store -phpcs.xml -phpunit.xml Thumbs.db wp-cli.local.yml node_modules/ @@ -9,3 +7,8 @@ node_modules/ *.zip /vendor/ + +# is created during composer install, +# when package is tested +# and not running within ft-platform +/wp-content/ diff --git a/.phpcs.xml b/.phpcs.xml new file mode 100644 index 0000000..966eaab --- /dev/null +++ b/.phpcs.xml @@ -0,0 +1,31 @@ + + + Coding standards for ft-maintenance + + . + + + + + */wp-content/* + + + + + + + diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e0ce197 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## [Unreleased](https://github.com/figuren-theater/ft-maintenance/compare/1.0.15...HEAD) + + diff --git a/README.md b/README.md index 46266af..e978cc1 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ This is the long desc * [x] *list closed tracking-issues or `docs` files here* -* [ ] Do you have any [ideas](/issues/new) ? +* [ ] Do you have any [ideas](https://github.com/figuren-theater/ft-maintenance/issues/new) ? ## Background & Motivation @@ -35,29 +35,23 @@ This is the long desc ## Install -1. Add this repository and the *extra* to your `composer.json` -```json -"repositories": [ - { - "type": "git", - "url": "https://github.com/figuren-theater/ft-maintenance" - } -] -"extra": { - "dropin-paths": { - "htdocs/wp-content/": [ - "package:figuren-theater/ft-maintenance:templates/htdocs/wp-content/db-error.php", - "package:figuren-theater/ft-maintenance:templates/htdocs/wp-content/maintenance.php", - "package:figuren-theater/ft-maintenance:templates/htdocs/wp-content/php-error.php" - ] - } -} -``` +1. Add this *extra* to your `composer.json` + ```json + "extra": { + "dropin-paths": { + "htdocs/wp-content/": [ + "package:figuren-theater/ft-maintenance:templates/htdocs/wp-content/db-error.php", + "package:figuren-theater/ft-maintenance:templates/htdocs/wp-content/maintenance.php", + "package:figuren-theater/ft-maintenance:templates/htdocs/wp-content/php-error.php" + ] + } + } + ``` 2. Install via command line -```sh -composer require figuren-theater/ft-maintenance -``` + ```sh + composer require figuren-theater/ft-maintenance + ``` ## Usage @@ -93,6 +87,8 @@ Accompaniying the core functionality of the mentioned plugins, theese **best pra ## Built with & uses - [dependabot](/.github/dependabot.yml) + - [code-quality](https://github.com/figuren-theater/code-quality/) + A set of status checks to ensure high and consitent code-quality for the figuren.theater platform. - .... ## Contributing @@ -112,18 +108,18 @@ Don't forget to give the project a star! Thanks again! ## Versioning We use [Semantic Versioning](http://semver.org/) for versioning. For the versions -available, see the [tags on this repository](/tags). +available, see the [tags on this repository](https://github.com/figuren-theater/ft-maintenance/tags). ## Authors - **Carsten Bach** - *Provided idea & code* - [figuren.theater/crew](https://figuren.theater/crew/) -See also the list of [contributors](/contributors) +See also the list of [contributors](https://github.com/figuren-theater/ft-maintenance/contributors) who participated in this project. ## License -This project is licensed under the [GPL-3.0-or-later](LICENSE.md), see the [LICENSE](LICENSE) file for +This project is licensed under the **GPL-3.0-or-later**, see the [LICENSE](/LICENSE) file for details ## Acknowledgments diff --git a/composer.json b/composer.json index 0fc280c..9171e58 100644 --- a/composer.json +++ b/composer.json @@ -1,84 +1,99 @@ { "name": "figuren-theater/ft-maintenance", "description": "Everything you need to maintain and maybe debug a running WordPress Multisite network like figuren.theater", - "homepage": "https://websites.fuer.figuren.theater", - "type": "wordpress-muplugin", - "keywords": ["wordpress", "maintenance", "debug", "cron", "error_log", "backups"], - "license": "GPL-3.0-or-later", - "authors": [ - { - "name": "figuren.theater", - "email": "info@figuren.theater" - }, - { - "name": "Carsten Bach", - "email": "mail@carsten-bach.de", - "homepage": "https://carsten-bach.de", - "role": "Developer" - } - ], - "support": { - "email": "info@figuren.theater", - "issues": "https://github.com/figuren-theater/ft-maintenance/issues", - "source": "https://github.com/figuren-theater/ft-maintenance" - }, + "license": "GPL-3.0-or-later", + "type": "wordpress-muplugin", + "keywords": [ + "wordpress", + "maintenance", + "debug", + "cron", + "error_log", + "backups" + ], + "authors": [ + { + "name": "figuren.theater", + "email": "info@figuren.theater" + }, + { + "name": "Carsten Bach", + "email": "mail@carsten-bach.de", + "homepage": "https://carsten-bach.de", + "role": "Developer" + } + ], + "homepage": "https://websites.fuer.figuren.theater", + "support": { + "email": "info@figuren.theater", + "issues": "https://github.com/figuren-theater/ft-maintenance/issues", + "source": "https://github.com/figuren-theater/ft-maintenance" + }, + "require": { + "php": ">=7.1", + "devgeniem/wp-cron-runner": "^1.0", + "figuren-theater/ft-options": "^1", + "johnbillion/query-monitor": "^3", + "johnbillion/wp-crontrol": "^1.15", + "koodimonni/composer-dropin-installer": "^1.4", + "pixelstudio/wp-sync-db": "^1.7", + "wpackagist-plugin/multisite-enhancements": "^1.6", + "wpackagist-plugin/wp-db-backup": "^2.5" + }, + "require-dev": { + "figuren-theater/code-quality": "*" + }, + "repositories": [ + { + "type": "git", + "url": "https://github.com/figuren-theater/ft-options" + }, + { + "type": "vcs", + "url": "https://github.com/hrsetyono/wp-sync-db" + }, + { + "type": "composer", + "url": "https://wpackagist.org" + } + ], "autoload": { + "classmap": [ + "inc/" + ], "files": [ "inc/blog-management/namespace.php", - "inc/dashboard-widget/namespace.php", + "inc/dashboard-widget/namespace.php", "inc/mode/namespace.php", - "inc/multisite-enhancements/namespace.php", - "inc/query-monitor/namespace.php", + "inc/multisite-enhancements/namespace.php", + "inc/query-monitor/namespace.php", "inc/wp-crontrol/namespace.php", - "inc/wp-cron-runner/namespace.php", - "inc/wp-db-backup/namespace.php", + "inc/wp-cron-runner/namespace.php", + "inc/wp-db-backup/namespace.php", "inc/wp-sync-db/namespace.php", "inc/namespace.php" - ], - "classmap": [ - "inc/" - ] + ] }, - "repositories": [ - { - "type": "git", - "url": "https://github.com/figuren-theater/ft-options" - }, - { - "type": "vcs", - "url": "https://github.com/hrsetyono/wp-sync-db" - }, - { - "type": "composer", - "url" : "https://wpackagist.org" + "config": { + "allow-plugins": { + "composer/installers": true, + "koodimonni/composer-dropin-installer": true, + "phpstan/extension-installer": true, + "dealerdirect/phpcodesniffer-composer-installer": true, + "ergebnis/composer-normalize": true, + "figuren-theater/ft-core": true } - ], - "require": { - "php": ">=7.1", - "figuren-theater/ft-options": "^1", - "johnbillion/query-monitor": "^3", - "johnbillion/wp-crontrol": "^1.15", - "pixelstudio/wp-sync-db": "^1.7", - "koodimonni/composer-dropin-installer": "^1.4", - "devgeniem/wp-cron-runner": "^1.0", - "wpackagist-plugin/multisite-enhancements": "^1.6", - "wpackagist-plugin/wp-db-backup":"^2.5" }, - "extra": { - "altis": { - "install-overrides": [ - "devgeniem/wp-cron-runner", + "extra": { + "altis": { + "install-overrides": [ + "devgeniem/wp-cron-runner", "johnbillion/query-monitor", "johnbillion/wp-crontrol", "pixelstudio/wp-sync-db", - "wpackagist-plugin/multisite-enhancements", - "wpackagist-plugin/wp-db-backup" - ] - } - }, - "config": { - "allow-plugins": { - "composer/installers": true + "wpackagist-plugin/multisite-enhancements", + "wpackagist-plugin/wp-db-backup" + ] } } } diff --git a/composer.lock b/composer.lock index 75febdf..b7f30fc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6e14e5914870d67ef74fcddb59066858", + "content-hash": "017850679ca86717c3f3f40d5d06d64f", "packages": [ { "name": "composer/installers", @@ -575,7 +575,1512 @@ "homepage": "https://wordpress.org/plugins/wp-db-backup/" } ], - "packages-dev": [], + "packages-dev": [ + { + "name": "automattic/vipwpcs", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/VIP-Coding-Standards.git", + "reference": "fc02f491dc9f51da7c32941ac579f70b9ed300c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/fc02f491dc9f51da7c32941ac579f70b9ed300c5", + "reference": "fc02f491dc9f51da7c32941ac579f70b9ed300c5", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "squizlabs/php_codesniffer": "^3.3.1", + "wp-coding-standards/wpcs": "^2.1" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5", + "phpcompatibility/php-compatibility": "^9", + "phpunit/phpunit": "^5 || ^6 || ^7" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Contributors", + "homepage": "https://github.com/Automattic/VIP-Coding-Standards/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress VIP minimum coding conventions", + "keywords": [ + "phpcs", + "standards", + "wordpress" + ], + "support": { + "issues": "https://github.com/Automattic/VIP-Coding-Standards/issues", + "source": "https://github.com/Automattic/VIP-Coding-Standards", + "wiki": "https://github.com/Automattic/VIP-Coding-Standards/wiki" + }, + "time": "2019-07-12T08:47:36+00:00" + }, + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v0.7.2", + "source": { + "type": "git", + "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + }, + "require-dev": { + "composer/composer": "*", + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcbf", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "support": { + "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", + "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + }, + "time": "2022-02-04T12:51:07+00:00" + }, + { + "name": "ergebnis/composer-normalize", + "version": "2.31.0", + "source": { + "type": "git", + "url": "https://github.com/ergebnis/composer-normalize.git", + "reference": "da1d18bcc2ca02111359c2c76fd938a907ba0a16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ergebnis/composer-normalize/zipball/da1d18bcc2ca02111359c2c76fd938a907ba0a16", + "reference": "da1d18bcc2ca02111359c2c76fd938a907ba0a16", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0.0", + "ergebnis/json": "^1.0.1", + "ergebnis/json-normalizer": "^4.1.0", + "ergebnis/json-printer": "^3.3.0", + "ext-json": "*", + "justinrainbow/json-schema": "^5.2.12", + "localheinz/diff": "^1.1.1", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0" + }, + "require-dev": { + "composer/composer": "^2.5.5", + "ergebnis/license": "^2.1.0", + "ergebnis/php-cs-fixer-config": "^5.5.2", + "fakerphp/faker": "^1.21.0", + "infection/infection": "~0.26.19", + "phpunit/phpunit": "^9.6.7", + "psalm/plugin-phpunit": "~0.18.4", + "rector/rector": "~0.15.25", + "symfony/filesystem": "^6.0.13", + "vimeo/psalm": "^5.9.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Ergebnis\\Composer\\Normalize\\NormalizePlugin", + "composer-normalize": { + "indent-size": 2, + "indent-style": "space" + }, + "plugin-optional": true + }, + "autoload": { + "psr-4": { + "Ergebnis\\Composer\\Normalize\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com" + } + ], + "description": "Provides a composer plugin for normalizing composer.json.", + "homepage": "https://github.com/ergebnis/composer-normalize", + "keywords": [ + "composer", + "normalize", + "normalizer", + "plugin" + ], + "support": { + "issues": "https://github.com/ergebnis/composer-normalize/issues", + "security": "https://github.com/ergebnis/composer-normalize/blob/main/.github/SECURITY.md", + "source": "https://github.com/ergebnis/composer-normalize" + }, + "time": "2023-05-02T14:10:33+00:00" + }, + { + "name": "ergebnis/json", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/ergebnis/json.git", + "reference": "d66ea30060856d0729a4aa319a02752519ca63a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ergebnis/json/zipball/d66ea30060856d0729a4aa319a02752519ca63a0", + "reference": "d66ea30060856d0729a4aa319a02752519ca63a0", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.29.0", + "ergebnis/data-provider": "^1.2.0", + "ergebnis/license": "^2.1.0", + "ergebnis/php-cs-fixer-config": "^5.0.0", + "ergebnis/phpstan-rules": "^1.0.0", + "fakerphp/faker": "^1.20.0", + "infection/infection": "~0.26.16", + "phpunit/phpunit": "^9.5.27", + "psalm/plugin-phpunit": "~0.18.4", + "vimeo/psalm": "^5.1.0" + }, + "type": "library", + "extra": { + "composer-normalize": { + "indent-size": 2, + "indent-style": "space" + } + }, + "autoload": { + "psr-4": { + "Ergebnis\\Json\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com" + } + ], + "description": "Provides a Json value object for representing a valid JSON string.", + "homepage": "https://github.com/ergebnis/json", + "keywords": [ + "json" + ], + "support": { + "issues": "https://github.com/ergebnis/json/issues", + "source": "https://github.com/ergebnis/json" + }, + "time": "2022-12-10T22:38:50+00:00" + }, + { + "name": "ergebnis/json-normalizer", + "version": "4.1.0", + "source": { + "type": "git", + "url": "https://github.com/ergebnis/json-normalizer.git", + "reference": "e38f8b27f908686b200e3bd68e1b7bdfb5d53061" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ergebnis/json-normalizer/zipball/e38f8b27f908686b200e3bd68e1b7bdfb5d53061", + "reference": "e38f8b27f908686b200e3bd68e1b7bdfb5d53061", + "shasum": "" + }, + "require": { + "ergebnis/json": "^1.0.1", + "ergebnis/json-pointer": "^3.2.0", + "ergebnis/json-printer": "^3.3.0", + "ergebnis/json-schema-validator": "^4.0.0", + "ext-json": "*", + "justinrainbow/json-schema": "^5.2.12", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0" + }, + "require-dev": { + "composer/semver": "^3.2.1", + "ergebnis/data-provider": "^1.3.0", + "ergebnis/license": "^2.1.0", + "ergebnis/php-cs-fixer-config": "^5.5.2", + "fakerphp/faker": "^1.21.0", + "infection/infection": "~0.26.19", + "phpunit/phpunit": "^9.6.7", + "psalm/plugin-phpunit": "~0.18.4", + "rector/rector": "~0.15.25", + "symfony/filesystem": "^6.0.19", + "symfony/finder": "^6.0.19", + "vimeo/psalm": "^5.9.0" + }, + "suggest": { + "composer/semver": "If you want to use ComposerJsonNormalizer or VersionConstraintNormalizer" + }, + "type": "library", + "autoload": { + "psr-4": { + "Ergebnis\\Json\\Normalizer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com" + } + ], + "description": "Provides generic and vendor-specific normalizers for normalizing JSON documents.", + "homepage": "https://github.com/ergebnis/json-normalizer", + "keywords": [ + "json", + "normalizer" + ], + "support": { + "issues": "https://github.com/ergebnis/json-normalizer/issues", + "source": "https://github.com/ergebnis/json-normalizer" + }, + "time": "2023-05-02T11:08:03+00:00" + }, + { + "name": "ergebnis/json-pointer", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/ergebnis/json-pointer.git", + "reference": "861516ff5afa1aa8905fdf3361315909523a1bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ergebnis/json-pointer/zipball/861516ff5afa1aa8905fdf3361315909523a1bf8", + "reference": "861516ff5afa1aa8905fdf3361315909523a1bf8", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.28.3", + "ergebnis/data-provider": "^1.2.0", + "ergebnis/license": "^2.1.0", + "ergebnis/php-cs-fixer-config": "^5.0.0", + "fakerphp/faker": "^1.20.0", + "infection/infection": "~0.26.16", + "phpunit/phpunit": "^9.5.26", + "psalm/plugin-phpunit": "~0.18.3", + "vimeo/psalm": "^4.30" + }, + "type": "library", + "extra": { + "composer-normalize": { + "indent-size": 2, + "indent-style": "space" + } + }, + "autoload": { + "psr-4": { + "Ergebnis\\Json\\Pointer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com" + } + ], + "description": "Provides JSON pointer as a value object.", + "homepage": "https://github.com/ergebnis/json-pointer", + "keywords": [ + "RFC6901", + "json", + "pointer" + ], + "support": { + "issues": "https://github.com/ergebnis/json-pointer/issues", + "source": "https://github.com/ergebnis/json-pointer" + }, + "time": "2022-11-28T17:03:31+00:00" + }, + { + "name": "ergebnis/json-printer", + "version": "3.3.0", + "source": { + "type": "git", + "url": "https://github.com/ergebnis/json-printer.git", + "reference": "18920367473b099633f644f0ca6dc8794345148f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ergebnis/json-printer/zipball/18920367473b099633f644f0ca6dc8794345148f", + "reference": "18920367473b099633f644f0ca6dc8794345148f", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "php": "^8.0" + }, + "require-dev": { + "ergebnis/license": "^2.0.0", + "ergebnis/php-cs-fixer-config": "^4.11.0", + "fakerphp/faker": "^1.20.0", + "infection/infection": "~0.26.6", + "phpunit/phpunit": "^9.5.26", + "psalm/plugin-phpunit": "~0.18.3", + "vimeo/psalm": "^4.30.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Ergebnis\\Json\\Printer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com" + } + ], + "description": "Provides a JSON printer, allowing for flexible indentation.", + "homepage": "https://github.com/ergebnis/json-printer", + "keywords": [ + "formatter", + "json", + "printer" + ], + "support": { + "issues": "https://github.com/ergebnis/json-printer/issues", + "source": "https://github.com/ergebnis/json-printer" + }, + "time": "2022-11-28T10:27:43+00:00" + }, + { + "name": "ergebnis/json-schema-validator", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/ergebnis/json-schema-validator.git", + "reference": "a6166272ac5691a9bc791f185841e5f92a6d4723" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ergebnis/json-schema-validator/zipball/a6166272ac5691a9bc791f185841e5f92a6d4723", + "reference": "a6166272ac5691a9bc791f185841e5f92a6d4723", + "shasum": "" + }, + "require": { + "ergebnis/json": "^1.0.0", + "ergebnis/json-pointer": "^3.2.0", + "ext-json": "*", + "justinrainbow/json-schema": "^5.2.12", + "php": "^8.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.21.0", + "ergebnis/data-provider": "^1.2.0", + "ergebnis/license": "^2.1.0", + "ergebnis/php-cs-fixer-config": "~5.0.0", + "fakerphp/faker": "^1.20.0", + "infection/infection": "~0.26.16", + "phpunit/phpunit": "~9.5.27", + "psalm/plugin-phpunit": "~0.18.4", + "vimeo/psalm": "^5.1.0" + }, + "type": "library", + "extra": { + "composer-normalize": { + "indent-size": 2, + "indent-style": "space" + } + }, + "autoload": { + "psr-4": { + "Ergebnis\\Json\\SchemaValidator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com" + } + ], + "description": "Provides a JSON schema validator, building on top of justinrainbow/json-schema.", + "homepage": "https://github.com/ergebnis/json-schema-validator", + "keywords": [ + "json", + "schema", + "validator" + ], + "support": { + "issues": "https://github.com/ergebnis/json-schema-validator/issues", + "source": "https://github.com/ergebnis/json-schema-validator" + }, + "time": "2022-12-10T14:50:15+00:00" + }, + { + "name": "fig-r/psr2r-sniffer", + "version": "0.5.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig-rectified/psr2r-sniffer.git", + "reference": "7eb462bcf19abcae122855a6d79cc8f768c77880" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig-rectified/psr2r-sniffer/zipball/7eb462bcf19abcae122855a6d79cc8f768c77880", + "reference": "7eb462bcf19abcae122855a6d79cc8f768c77880", + "shasum": "" + }, + "require": { + "php": ">=5.4.16", + "squizlabs/php_codesniffer": "^3.0" + }, + "bin": [ + "bin/tokenize", + "bin/sniff" + ], + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "PSR2R\\": "PSR2R" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Scherer", + "homepage": "http://www.dereuromark.de", + "role": "Contributor" + } + ], + "description": "Code-Sniffer, Auto-Fixer and Tokenizer for PSR2-R", + "keywords": [ + "codesniffer", + "cs" + ], + "support": { + "issues": "https://github.com/php-fig-rectified/psr2r-sniffer/issues", + "source": "https://github.com/php-fig-rectified/psr2r-sniffer/tree/0.5.2" + }, + "time": "2019-07-30T11:13:07+00:00" + }, + { + "name": "figuren-theater/code-quality", + "version": "0.6.4", + "source": { + "type": "git", + "url": "https://github.com/figuren-theater/code-quality.git", + "reference": "f140d18e321dddabde68aed0e765470290b93520" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/figuren-theater/code-quality/zipball/f140d18e321dddabde68aed0e765470290b93520", + "reference": "f140d18e321dddabde68aed0e765470290b93520", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "ergebnis/composer-normalize": "^2", + "figuren-theater/coding-standards": "*", + "figuren-theater/phpstan": "*", + "phpstan/extension-installer": "^1.3" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "figuren.theater", + "email": "info@figuren.theater" + }, + { + "name": "Carsten Bach", + "email": "mail@carsten-bach.de", + "homepage": "https://carsten-bach.de", + "role": "Developer" + } + ], + "description": "Development tools to measure and test the code quality of figuren.theater, the WordPress Multisite network for puppeteers.", + "homepage": "https://websites.fuer.figuren.theater", + "keywords": [ + ".editorconfig", + "phpcs.xml", + "phpstan.neon", + "wordpress" + ], + "support": { + "email": "info@figuren.theater", + "issues": "https://github.com/figuren-theater/code-quality/issues", + "source": "https://github.com/figuren-theater/code-quality" + }, + "time": "2023-07-17T11:44:04+00:00" + }, + { + "name": "figuren-theater/coding-standards", + "version": "0.3.0", + "source": { + "type": "git", + "url": "https://github.com/figuren-theater/coding-standards.git", + "reference": "cf929e5b751094b2df24802e05cbf483df147622" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/figuren-theater/coding-standards/zipball/cf929e5b751094b2df24802e05cbf483df147622", + "reference": "cf929e5b751094b2df24802e05cbf483df147622", + "shasum": "" + }, + "require": { + "ergebnis/composer-normalize": "^2.31", + "humanmade/coding-standards": "^1.2" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "figuren.theater", + "email": "info@figuren.theater" + }, + { + "name": "Carsten Bach", + "email": "mail@carsten-bach.de", + "homepage": "https://carsten-bach.de", + "role": "Developer" + } + ], + "description": "Coding standards for PHP, JavaScript and CSS within the figuren.theater WordPress Multisite network.", + "homepage": "https://websites.fuer.figuren.theater", + "keywords": [ + "coding-standards", + "wordpress", + "wpcs" + ], + "support": { + "email": "info@figuren.theater", + "issues": "https://github.com/figuren-theater/coding-standards/issues", + "source": "https://github.com/figuren-theater/coding-standards" + }, + "time": "2023-07-11T12:21:47+00:00" + }, + { + "name": "figuren-theater/phpstan", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/figuren-theater/phpstan.git", + "reference": "3aec3c760c830f185098280bf12fcec78701cb86" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/figuren-theater/phpstan/zipball/3aec3c760c830f185098280bf12fcec78701cb86", + "reference": "3aec3c760c830f185098280bf12fcec78701cb86", + "shasum": "" + }, + "require": { + "php-stubs/wordpress-globals": "^0.2.0", + "szepeviktor/phpstan-wordpress": "^1.3" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "figuren.theater", + "email": "info@figuren.theater" + }, + { + "name": "Carsten Bach", + "email": "mail@carsten-bach.de", + "homepage": "https://carsten-bach.de", + "role": "Developer" + } + ], + "description": "org-wide used phpstan.neon file for the WordPress Multisite network for puppeteers figuren.theater", + "homepage": "https://figuren.theater", + "keywords": [ + "wordpress" + ], + "support": { + "email": "info@figuren.theater", + "issues": "https://github.com/figuren-theater/phpstan/issues", + "source": "https://github.com/figuren-theater/phpstan" + }, + "time": "2023-06-26T21:48:02+00:00" + }, + { + "name": "humanmade/coding-standards", + "version": "v1.2.1", + "source": { + "type": "git", + "url": "https://github.com/humanmade/coding-standards.git", + "reference": "4b5aca25cb350f248f1797beed100edda9f32a0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/humanmade/coding-standards/zipball/4b5aca25cb350f248f1797beed100edda9f32a0d", + "reference": "4b5aca25cb350f248f1797beed100edda9f32a0d", + "shasum": "" + }, + "require": { + "automattic/vipwpcs": "2.0.0", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "fig-r/psr2r-sniffer": "^0.5.0", + "php": ">=7.1", + "phpcompatibility/phpcompatibility-wp": "^2.0.0", + "squizlabs/php_codesniffer": "~3.5", + "wp-coding-standards/wpcs": "2.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^7" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Human Made Coding Standards", + "support": { + "issues": "https://github.com/humanmade/coding-standards/issues", + "source": "https://github.com/humanmade/coding-standards/tree/v1.2.1" + }, + "time": "2022-09-14T09:35:02+00:00" + }, + { + "name": "justinrainbow/json-schema", + "version": "5.2.12", + "source": { + "type": "git", + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", + "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", + "json-schema/json-schema-test-suite": "1.2.0", + "phpunit/phpunit": "^4.8.35" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "support": { + "issues": "https://github.com/justinrainbow/json-schema/issues", + "source": "https://github.com/justinrainbow/json-schema/tree/5.2.12" + }, + "time": "2022-04-13T08:02:27+00:00" + }, + { + "name": "localheinz/diff", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/localheinz/diff.git", + "reference": "851bb20ea8358c86f677f5f111c4ab031b1c764c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/localheinz/diff/zipball/851bb20ea8358c86f677f5f111c4ab031b1c764c", + "reference": "851bb20ea8358c86f677f5f111c4ab031b1c764c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.5 || ^8.0", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Fork of sebastian/diff for use with ergebnis/composer-normalize", + "homepage": "https://github.com/localheinz/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "source": "https://github.com/localheinz/diff/tree/main" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-07-06T04:49:32+00:00" + }, + { + "name": "php-stubs/wordpress-globals", + "version": "v0.2.0", + "source": { + "type": "git", + "url": "https://github.com/php-stubs/wordpress-globals.git", + "reference": "748a1fb2ae8fda94844bd0545935095dbf404b32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-stubs/wordpress-globals/zipball/748a1fb2ae8fda94844bd0545935095dbf404b32", + "reference": "748a1fb2ae8fda94844bd0545935095dbf404b32", + "shasum": "" + }, + "require-dev": { + "php": "~7.1" + }, + "suggest": { + "php-stubs/wordpress-stubs": "Up-to-date WordPress function and class declaration stubs", + "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Global variables and global constants from WordPress core.", + "homepage": "https://github.com/php-stubs/wordpress-globals", + "keywords": [ + "PHPStan", + "constants", + "globals", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/php-stubs/wordpress-globals/issues", + "source": "https://github.com/php-stubs/wordpress-globals/tree/master" + }, + "time": "2020-01-13T06:12:59+00:00" + }, + { + "name": "php-stubs/wordpress-stubs", + "version": "v6.2.1", + "source": { + "type": "git", + "url": "https://github.com/php-stubs/wordpress-stubs.git", + "reference": "0009429e639b748eef1c955200ea0d4e5ad5627d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/0009429e639b748eef1c955200ea0d4e5ad5627d", + "reference": "0009429e639b748eef1c955200ea0d4e5ad5627d", + "shasum": "" + }, + "require-dev": { + "nikic/php-parser": "< 4.12.0", + "php": "~7.3 || ~8.0", + "php-stubs/generator": "^0.8.3", + "phpdocumentor/reflection-docblock": "^5.3", + "phpstan/phpstan": "^1.10.12", + "phpunit/phpunit": "^9.5" + }, + "suggest": { + "paragonie/sodium_compat": "Pure PHP implementation of libsodium", + "symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WordPress function and class declaration stubs for static analysis.", + "homepage": "https://github.com/php-stubs/wordpress-stubs", + "keywords": [ + "PHPStan", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/php-stubs/wordpress-stubs/issues", + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.2.1" + }, + "time": "2023-05-18T04:35:23+00:00" + }, + { + "name": "phpcompatibility/php-compatibility", + "version": "9.3.5", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "homepage": "https://github.com/wimg", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + } + ], + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "keywords": [ + "compatibility", + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, + "time": "2019-12-27T09:44:58+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-paragonie", + "version": "1.3.2", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", + "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", + "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "paragonie/random_compat": "dev-master", + "paragonie/sodium_compat": "dev-master" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" + } + ], + "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "paragonie", + "phpcs", + "polyfill", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + }, + "time": "2022-10-25T01:46:02+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-wp", + "version": "2.1.4", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", + "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", + "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0", + "phpcompatibility/phpcompatibility-paragonie": "^1.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" + } + ], + "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "phpcs", + "standards", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" + }, + "time": "2022-10-24T09:00:36+00:00" + }, + { + "name": "phpstan/extension-installer", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/phpstan/extension-installer.git", + "reference": "f45734bfb9984c6c56c4486b71230355f066a58a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/f45734bfb9984c6c56c4486b71230355f066a58a", + "reference": "f45734bfb9984c6c56c4486b71230355f066a58a", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0", + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^1.9.0" + }, + "require-dev": { + "composer/composer": "^2.0", + "php-parallel-lint/php-parallel-lint": "^1.2.0", + "phpstan/phpstan-strict-rules": "^0.11 || ^0.12 || ^1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PHPStan\\ExtensionInstaller\\Plugin" + }, + "autoload": { + "psr-4": { + "PHPStan\\ExtensionInstaller\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Composer plugin for automatic installation of PHPStan extensions", + "support": { + "issues": "https://github.com/phpstan/extension-installer/issues", + "source": "https://github.com/phpstan/extension-installer/tree/1.3.1" + }, + "time": "2023-05-24T08:59:17+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "1.10.25", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "578f4e70d117f9a90699324c555922800ac38d8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/578f4e70d117f9a90699324c555922800ac38d8c", + "reference": "578f4e70d117f9a90699324c555922800ac38d8c", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "time": "2023-07-06T12:11:37+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.7.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2023-02-22T23:07:41+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "szepeviktor/phpstan-wordpress", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/szepeviktor/phpstan-wordpress.git", + "reference": "5b5cc77ed51fdaf64efe3f00b5aae4b709d2cfa9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/5b5cc77ed51fdaf64efe3f00b5aae4b709d2cfa9", + "reference": "5b5cc77ed51fdaf64efe3f00b5aae4b709d2cfa9", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "php-stubs/wordpress-stubs": "^4.7 || ^5.0 || ^6.0", + "phpstan/phpstan": "^1.10.0", + "symfony/polyfill-php73": "^1.12.0" + }, + "require-dev": { + "composer/composer": "^2.1.14", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpstan/phpstan-strict-rules": "^1.2", + "phpunit/phpunit": "^8.0 || ^9.0", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.8" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "SzepeViktor\\PHPStan\\WordPress\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WordPress extensions for PHPStan", + "keywords": [ + "PHPStan", + "code analyse", + "code analysis", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/szepeviktor/phpstan-wordpress/issues", + "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v1.3.0" + }, + "time": "2023-04-23T06:15:06+00:00" + }, + { + "name": "wp-coding-standards/wpcs", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", + "reference": "7da1894633f168fe244afc6de00d141f27517b62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62", + "reference": "7da1894633f168fe244afc6de00d141f27517b62", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "squizlabs/php_codesniffer": "^3.3.1" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", + "phpcompatibility/php-compatibility": "^9.0", + "phpcsstandards/phpcsdevtools": "^1.0", + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Contributors", + "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", + "keywords": [ + "phpcs", + "standards", + "wordpress" + ], + "support": { + "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", + "source": "https://github.com/WordPress/WordPress-Coding-Standards", + "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" + }, + "time": "2020-05-13T23:57:56+00:00" + } + ], "aliases": [], "minimum-stability": "stable", "stability-flags": [], diff --git a/inc/dashboard-widget/namespace.php b/inc/dashboard-widget/namespace.php index 0112a3f..75d84a3 100644 --- a/inc/dashboard-widget/namespace.php +++ b/inc/dashboard-widget/namespace.php @@ -7,42 +7,43 @@ namespace Figuren_Theater\Maintenance\Dashboard_Widget; -use WP_DEBUG; -use WP_CONTENT_DIR; - use function add_action; -use function admin_url; + use function balanceTags; use function current_user_can; use function wp_add_dashboard_widget; +use WP_CONTENT_DIR; +use WP_DEBUG_LOG; -const VIEW = ( WP_DEBUG ) ? 'debug' : 'error'; -const FILE = '/logs/php.' . VIEW . '.log'; +// // const VIEW = ( defined( 'WP_DEBUG' ) ) ? 'debug' : 'error'; +// const VIEW = 'debugORerror'; +// const FILE = '/logs/php.' . VIEW . '.log'; -const LOG = WP_CONTENT_DIR . FILE; +// const LOG = \WP_CONTENT_DIR . FILE; +// // const LOG = \WP_DEBUG_LOG; /** * Bootstrap module, when enabled. */ function bootstrap() { - // add_action( 'wp_dashboard_setup', __NAMESPACE__ . '\\add_widget' ); add_action( 'wp_network_dashboard_setup', __NAMESPACE__ . '\\add_widget' ); } function add_widget() { - if ( ! current_user_can( 'manage_sites' )) + if ( ! current_user_can( 'manage_sites' ) ) { return; + } - wp_add_dashboard_widget( + wp_add_dashboard_widget( 'cbstdsys-php-errorlog', // 'Debug Log (/wp-content/logs/php.debug.log)', sprintf( - # the sourrounding span helps preventing a layout bug with WordPress - # default '.postbox-header .hndle' class - # which sets: "justify-content: space-between;" + // the sourrounding span helps preventing a layout bug with WordPress + // default '.postbox-header .hndle' class + // which sets: "justify-content: space-between;" '%s Log (%s)', ucfirst( VIEW ), '...' . FILE . '' @@ -51,28 +52,27 @@ function add_widget() { ); } - /** * @todo clean this up even more. This is still a mess from 1995. - * + * * server monitoring as dashboard widget * reads php_error.log or debug.log if WP_DEBUG is TRUE - * + * * @since 0.0.1 */ function render_widget() { // The maximum number of errors to display in the widget $displayErrorsLimit = 1000; - + // The maximum number of characters to display for each error $errorLengthLimit = 1000; - + $fileCleared = false; // Clear file? - if ( isset( $_GET["cbstdsys-php-errorlog"] ) && $_GET["cbstdsys-php-errorlog"]=="clear" ) { - $handle = fopen( LOG, "w" ); + if ( isset( $_GET['cbstdsys-php-errorlog'] ) && $_GET['cbstdsys-php-errorlog'] == 'clear' ) { + $handle = fopen( LOG, 'w' ); fclose( $handle ); $fileCleared = true; } @@ -83,38 +83,41 @@ function render_widget() { $errors = file( LOG ); $errors = array_reverse( $errors ); - - if ( $fileCleared ) + + if ( $fileCleared ) { echo '

File cleared.

'; + } - if ( ! $errors ) + if ( ! $errors ) { echo '

No errors currently logged.

'; + } - echo '

'.count( $errors ).' error'; - if ( $errors != 1 ) + echo '

' . count( $errors ) . ' error'; + if ( $errors != 1 ) { echo 's'; + } echo '.'; // echo ' [ CLEAR LOG FILE ]'; echo ' [ CLEAR LOG FILE ]'; echo '

'; - + echo '
'; echo '
    '; - + $i = 0; foreach ( $errors as $error ) { $error = esc_html( $error ); echo '
  1. '; $errorOutput = preg_replace( '/\[([^\]]+)\]/', '[$1]', $error, 1 ); if ( strlen( $errorOutput ) > $errorLengthLimit ) { - $errorOutput = substr( $errorOutput, 0, $errorLengthLimit ).' […]'; + $errorOutput = substr( $errorOutput, 0, $errorLengthLimit ) . ' […]'; } echo balanceTags( $errorOutput, true ); echo '
  2. '; $i++; if ( $i > $displayErrorsLimit ) { - echo '
  3. More than '.$displayErrorsLimit.' errors in log...
  4. '; + echo '
  5. More than ' . $displayErrorsLimit . ' errors in log...
  6. '; break; } } diff --git a/inc/mode/namespace.php b/inc/mode/namespace.php index 54c6629..a52afdc 100644 --- a/inc/mode/namespace.php +++ b/inc/mode/namespace.php @@ -48,7 +48,11 @@ function load() { require TEMPLATE; die(); } - +/** + * Load the plugin itself and its modifications. + * + * @return void + */ function load_plugins() { add_filter( 'plugin_row_meta', __NAMESPACE__ . '\\output_dropin_note', -10, 4 ); @@ -61,7 +65,7 @@ function load_plugins() { * @param string $file Plugin filename (sunrise.php for sunrise) * @param array $data Data from the plugin header * @param string $status Status of the plugin - * + * * @return array Modified meta links */ function output_dropin_note( $meta, $file, $data, $status ) { @@ -71,7 +75,7 @@ function output_dropin_note( $meta, $file, $data, $status ) { if ( ! in_array( $file, [ 'maintenance.php', 'php-error.php', 'db-error.php' ] ) ) return $meta; - $note = '' . wp_kses( + $note = '' . wp_kses( sprintf( __( 'Enhanced by %3$s', 'figurentheater' ), 'https://github.com/figuren-theater/ft-maintenance', diff --git a/inc/multisite-enhancements/namespace.php b/inc/multisite-enhancements/namespace.php index ed9f6fb..e639763 100644 --- a/inc/multisite-enhancements/namespace.php +++ b/inc/multisite-enhancements/namespace.php @@ -2,7 +2,7 @@ /** * Figuren_Theater Maintenance Multisite_Enhancements. * - * @package figuren-theater/maintenance/multisite_enhancements + * @package figuren-theater/ft-maintenance */ namespace Figuren_Theater\Maintenance\Multisite_Enhancements; @@ -16,32 +16,40 @@ use function remove_action; const BASENAME = 'multisite-enhancements/multisite-enhancements.php'; -const PLUGINPATH = FT_VENDOR_DIR . '/wpackagist-plugin/' . BASENAME; +const PLUGINPATH = '/wpackagist-plugin/' . BASENAME; + /** * Bootstrap module, when enabled. */ function bootstrap() { add_action( 'Figuren_Theater\loaded', __NAMESPACE__ . '\\filter_options', 11 ); - + add_action( 'plugins_loaded', __NAMESPACE__ . '\\load_plugin', 0 ); add_action( 'plugins_loaded', __NAMESPACE__ . '\\unload_plugin_ui', 20 ); } +/** + * Conditionally load the plugin itself and its modifications. + * + * @return void + */ function load_plugin() { - require_once PLUGINPATH; + require_once FT_VENDOR_DIR . PLUGINPATH; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingCustomConstant - // \unload_textdomain( 'multisite-enhancements' ); // does nothing ... + /** + * I thought about using unload_textdomain( 'multisite-enhancements' ) + * but this does unfortunately nothing ... + */ add_filter( 'load_textdomain_mofile', __NAMESPACE__ . '\\unload_i18n', 0, 2 ); } function unload_plugin_ui() { - remove_action( 'init', array( 'Multisite_Enhancements_Settings', 'init' ) ); + remove_action( 'init', [ 'Multisite_Enhancements_Settings', 'init' ] ); } - function unload_i18n( string $mofile, string $domain ) : string { if ( 'multisite-enhancements' === $domain ) { return ''; @@ -50,11 +58,14 @@ function unload_i18n( string $mofile, string $domain ) : string { } function filter_options() { - + $_options = [ 'remove-logo' => 1, - // this saves (Websites*2)-DB requests per Admin-Bar-ified page-load - // so: 20 Websites * 2 = 40 DB requests saved + + /* + * This saves (Websites*2)-DB requests per Admin-Bar-ified page-load + * so: 20 Websites * 2 = 40 DB requests saved + */ 'add-favicon' => 0, 'add-blog-id' => 1, 'add-css' => 1, @@ -69,8 +80,10 @@ function filter_options() { 'delete-settings' => 1, ]; - // gets added to the 'OptionsCollection' - // from within itself on creation + /* + * Gets added to the 'OptionsCollection' + * from within itself on creation. + */ new Options\Option( 'wpme_options', $_options, diff --git a/inc/namespace.php b/inc/namespace.php index c11c47f..4afaf26 100644 --- a/inc/namespace.php +++ b/inc/namespace.php @@ -7,13 +7,11 @@ namespace Figuren_Theater\Maintenance; -use WP_DEBUG; -use WP_ENVIRONMENT_TYPE; -use DISABLE_WP_CRON; - use Altis; -use function Altis\register_module; +use DISABLE_WP_CRON; +use WP_DEBUG; +use WP_ENVIRONMENT_TYPE; /** * Register module. @@ -21,7 +19,7 @@ function register() { $default_settings = [ - 'enabled' => true, // needs to be set + 'enabled' => true, // Needs to be set. 'query-monitor' => WP_DEBUG, 'wp-crontrol' => WP_DEBUG, 'wp-cron-runner' => DISABLE_WP_CRON, @@ -47,45 +45,16 @@ function register() { */ function bootstrap() { - // Plugins + // Plugins. Multisite_Enhancements\bootstrap(); Query_Monitor\bootstrap(); WP_Crontrol\bootstrap(); WP_Cron_Runner\bootstrap(); WP_DB_Backup\bootstrap(); WP_Sync_DB\bootstrap(); - - // Best practices + + // Best practices. Blog_Management\bootstrap(); Dashboard_Widget\bootstrap(); Mode\bootstrap(); } - - -////////////////// -// UNUSED IDEAS // -////////////////// - -/* -function get_log_folder() : string { - if ( defined('WP_DEBUG_LOG') ) { - return dirname( WP_DEBUG_LOG ); - } - - return ''; -} - - -function is_log_folder_secured() : bool { - - $log_folder_htaccess = get_log_folder() . '/.htaccess'; - if ( file_exists( $log_folder_htaccess ) ) { - return true; - } - - return false; -} - -function secure_log_folder() : void { - # code... -}*/ diff --git a/inc/query-monitor/namespace.php b/inc/query-monitor/namespace.php index 87e130f..28893db 100644 --- a/inc/query-monitor/namespace.php +++ b/inc/query-monitor/namespace.php @@ -2,24 +2,27 @@ /** * Figuren_Theater Maintenance Query_Monitor. * - * @package figuren-theater/maintenance/query_monitor + * @package figuren-theater/ft-maintenance */ namespace Figuren_Theater\Maintenance\Query_Monitor; -use FT_VENDOR_DIR; - use Figuren_Theater; -use function Figuren_Theater\get_config; +use FT_VENDOR_DIR; use function add_action; const BASENAME = 'query-monitor/query-monitor.php'; -const PLUGINPATH = FT_VENDOR_DIR . '/johnbillion/' . BASENAME; +const PLUGINPATH = '/johnbillion/' . BASENAME; - -// defined( 'QM_SHOW_ALL_HOOKS' ) ?: define( 'QM_SHOW_ALL_HOOKS', true ); -// defined( 'QM_ENABLE_CAPS_PANEL' ) ?: define( 'QM_ENABLE_CAPS_PANEL', true ); +/** + * This could be used for debugging + * + * Or could be used exclusively via maintenance-mode + * + * defined( 'QM_SHOW_ALL_HOOKS' ) ?: define( 'QM_SHOW_ALL_HOOKS', true ); + * defined( 'QM_ENABLE_CAPS_PANEL' ) ?: define( 'QM_ENABLE_CAPS_PANEL', true ); + */ /** * Bootstrap module, when enabled. @@ -29,11 +32,17 @@ function bootstrap() { add_action( 'plugins_loaded', __NAMESPACE__ . '\\load_plugin', 0 ); } +/** + * Conditionally load the plugin itself and its modifications. + * + * @return void + */ function load_plugin() { $config = Figuren_Theater\get_config()['modules']['maintenance']; - if ( ! $config['query-monitor'] ) - return; // early + if ( ! $config['query-monitor'] ) { + return; + } - require_once PLUGINPATH; + require_once FT_VENDOR_DIR . PLUGINPATH; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingCustomConstant } diff --git a/inc/wp-cron-runner/namespace.php b/inc/wp-cron-runner/namespace.php index 8b8399a..ae4a965 100644 --- a/inc/wp-cron-runner/namespace.php +++ b/inc/wp-cron-runner/namespace.php @@ -2,23 +2,21 @@ /** * Figuren_Theater Maintenance WP_Cron_Runner. * - * @package figuren-theater/maintenance/wp_cron_runner + * @package figuren-theater/ft-maintenance */ namespace Figuren_Theater\Maintenance\WP_Cron_Runner; -use FT_VENDOR_DIR; - -use WP_ALLOW_MULTISITE; - use Figuren_Theater; -use function Figuren_Theater\get_config; + +use FT_VENDOR_DIR; use function add_action; + use function remove_submenu_page; const BASENAME = 'wp-cron-runner/plugin.php'; -const PLUGINPATH = FT_VENDOR_DIR . '/devgeniem/' . BASENAME; +const PLUGINPATH = '/devgeniem/' . BASENAME; /** * Bootstrap module, when enabled. @@ -28,22 +26,31 @@ function bootstrap() { add_action( 'muplugins_loaded', __NAMESPACE__ . '\\load_plugin', 0 ); } +/** + * Conditionally load the plugin itself and its modifications. + * + * @return void + */ function load_plugin() { $config = Figuren_Theater\get_config()['modules']['maintenance']; - if ( ! $config['wp-cron-runner'] ) - return; // early + if ( ! $config['wp-cron-runner'] ) { + return; + } - defined( 'WP_ALLOW_MULTISITE' ) || define( 'WP_ALLOW_MULTISITE', true ); // needed by devgeniem/wp-cron-runner + defined( 'WP_ALLOW_MULTISITE' ) || define( 'WP_ALLOW_MULTISITE', true ); // Needed by devgeniem/wp-cron-runner. - require_once PLUGINPATH; + require_once FT_VENDOR_DIR . PLUGINPATH; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingCustomConstant add_action( 'network_admin_menu', __NAMESPACE__ . '\\remove_menu', 11 ); } - +/** + * Remove native WPs "Setup a Network"-Menu + * which is populated by the existence of WP_ALLOW_MULTISITE. + * + * @return void + */ function remove_menu() : void { - // remove native WPs "Setup a Network"-Menu - // which is populated by the existence of WP_ALLOW_MULTISITE remove_submenu_page( 'settings.php', 'setup.php' ); } diff --git a/inc/wp-crontrol/namespace.php b/inc/wp-crontrol/namespace.php index 7eb1f04..e083f10 100644 --- a/inc/wp-crontrol/namespace.php +++ b/inc/wp-crontrol/namespace.php @@ -2,17 +2,16 @@ /** * Figuren_Theater Maintenance WP_Crontrol. * - * @package figuren-theater/maintenance/wp_crontrol + * @package figuren-theater/ft-maintenance */ namespace Figuren_Theater\Maintenance\WP_Crontrol; -use FT_VENDOR_DIR; - use Figuren_Theater; -use function Figuren_Theater\get_config; +use FT_VENDOR_DIR; use function add_action; + use function current_user_can; use function is_admin; use function remove_action; @@ -20,7 +19,7 @@ use function wp_doing_cron; const BASENAME = 'wp-crontrol/wp-crontrol.php'; -const PLUGINPATH = FT_VENDOR_DIR . '/johnbillion/' . BASENAME; +const PLUGINPATH = '/johnbillion/' . BASENAME; /** * Bootstrap module, when enabled. @@ -30,26 +29,36 @@ function bootstrap() { add_action( 'plugins_loaded', __NAMESPACE__ . '\\load_plugin', 0 ); } +/** + * Conditionally load the plugin itself and its modifications. + * + * @return void + */ function load_plugin() { $config = Figuren_Theater\get_config()['modules']['maintenance']; - if ( ! $config['wp-crontrol'] ) - return; // early + if ( ! $config['wp-crontrol'] ) { + return; + } - if ( ! is_admin() || wp_doing_ajax() || wp_doing_cron() ) + if ( ! is_admin() || wp_doing_ajax() || wp_doing_cron() ) { return; + } - require_once PLUGINPATH; + require_once FT_VENDOR_DIR . PLUGINPATH; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingCustomConstant add_action( 'admin_menu', __NAMESPACE__ . '\\remove_admin_menus', 0 ); } - +/** + * Remove 'wp-crontrol' Submenu from 'Settings' and Submenu from 'Tools' + * + * @return void + */ function remove_admin_menus() { - if ( current_user_can( 'manage_sites' )) + if ( current_user_can( 'manage_sites' ) ) { return; + } - // Remove Submenu from 'Settings' and - // Submenu from 'Tools' remove_action( 'admin_menu', 'Crontrol\\action_admin_menu' ); } diff --git a/inc/wp-db-backup/namespace.php b/inc/wp-db-backup/namespace.php index d3365d7..67719d0 100644 --- a/inc/wp-db-backup/namespace.php +++ b/inc/wp-db-backup/namespace.php @@ -7,13 +7,12 @@ namespace Figuren_Theater\Maintenance\WP_DB_Backup; -use FT_VENDOR_DIR; - use Figuren_Theater; -use Figuren_Theater\Options; -use function Figuren_Theater\get_config; +use Figuren_Theater\Options; +use FT_VENDOR_DIR; use function add_action; + use function add_filter; use function apply_filters; use function current_user_can; @@ -26,7 +25,7 @@ use function wp_schedule_event; const BASENAME = 'wp-db-backup/wp-db-backup.php'; -const PLUGINPATH = FT_VENDOR_DIR . '/wpackagist-plugin/' . BASENAME; +const PLUGINPATH = '/wpackagist-plugin/' . BASENAME; /** * Bootstrap module, when enabled. @@ -38,72 +37,81 @@ function bootstrap() { add_action( 'plugins_loaded', __NAMESPACE__ . '\\load_plugin', 9 ); } +/** + * Conditionally load the plugin itself and its modifications. + * + * @return void + */ function load_plugin() { $config = Figuren_Theater\get_config()['modules']['maintenance']; - if ( ! $config['wp-db-backup'] ) - return; // early + if ( ! $config['wp-db-backup'] ) { + return; + } - require_once PLUGINPATH; + require_once FT_VENDOR_DIR . PLUGINPATH; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingCustomConstant add_action( 'admin_menu', __NAMESPACE__ . '\\remove_menu', 0 ); add_filter( 'pre_option_wp_cron_backup_tables', __NAMESPACE__ . '\\get_prefixed_table_names', 20 ); - // run only when visiting the "Impressum" Settings page + // Run only when visiting the "Impressum" Settings page. add_action( 'admin_head-settings_page_impressum', __NAMESPACE__ . '\\save_backup_time' ); } - -function filter_options() { +/** + * Handle options + * + * @return void + */ +function filter_options() :void { global $wpdb; $_options = [ 'wp_db_backup_excs' => [ 'revisions' => [ $wpdb->prefix . 'posts' ], 'spam' => [ $wpdb->prefix . 'comments' ], - ], - // only needed for on-demand backup - // recipient email + ], + // only needed for on-demand backup recipient email. 'wpdb_backup_recip' => getenv( 'FT_MAINTAINANCE_WPDBBACKUP_EMAIL' ), 'wp_cron_backup_schedule' => ( is_main_site() ) ? 'daily' : 'weekly', // Disabled for PRIVACY concerns - // - // By default, the Plugins sends + // + // By default, the Plugins sends // all relevant tables of each site // including the '_users'- and '_usermeta'-tables // WHICH IS A PROBLEM FOR PRIVACY // so we can only accept this ourselves. - // - // 'wp_cron_backup_recipient' => ( is_main_site() ) ? self::RECIPIENT_EMAIL : \get_bloginfo( 'admin_email' ), + // + // 'wp_cron_backup_recipient' => ( is_main_site() ) ? self::RECIPIENT_EMAIL : \get_bloginfo( 'admin_email' ), ! 'wp_cron_backup_recipient' => getenv( 'FT_MAINTAINANCE_WPDBBACKUP_EMAIL' ), - 'wp_cron_backup_tables' => [], // will be set during admin-load + 'wp_cron_backup_tables' => [], // Will be set during admin-load, @see get_prefixed_table_names(). ]; - // gets added to the 'OptionsCollection' - // from within itself on creation - new Options\Factory( - $_options, - 'Figuren_Theater\Options\Option', - BASENAME, + /* + * Gets added to the 'OptionsCollection' + * from within itself on creation. + */ + new Options\Factory( + $_options, + 'Figuren_Theater\Options\Option', + BASENAME, ); } - function remove_menu() { - if ( current_user_can( 'manage_sites' )) + if ( current_user_can( 'manage_sites' ) ) { return; + } global $mywpdbbackup; - - // Remove Submenu from 'Settings' and + + // Remove Submenu from 'Settings' and // Submenu from 'Tools' remove_action( 'admin_menu', [ $mywpdbbackup, 'admin_menu' ] ); } - - function get_prefixed_table_names() : array { if ( is_main_site() ) { @@ -112,8 +120,8 @@ function get_prefixed_table_names() : array { $tables_to_save = $mywpdbbackup->get_tables(); } - $tablenames = apply_filters( - __NAMESPACE__ . '\\tablenames_to_backup', + $tablenames = apply_filters( + __NAMESPACE__ . '\\tablenames_to_backup', [ 'eo_events', 'eo_venuemeta', @@ -142,14 +150,13 @@ function( string $tablename ) : string { return (array) apply_filters( __NAMESPACE__ . '\\tables_to_backup', $tables_to_save ); } - /** * Shedule WP_Cron for DB backups * - * Because none of the normal Admins is + * Because none of the normal Admins is * (per design of the plugin) * allowed to do backups manually. - * So nobody will be able to reach + * So nobody will be able to reach * the settings screen at Tools->Backups. * * We need to start thoose automatically. @@ -157,7 +164,6 @@ function( string $tablename ) : string { * Mainly cloned from the inside of * wpdbBackup->save_backup_time() * located at ...plugins\wp-db-backup\wp-db-backup.php - * */ function save_backup_time() { // unschedule previous @@ -165,17 +171,17 @@ function save_backup_time() { $tomorrow_date = date( 'Y-m-d', strtotime( 'tomorrow' ) ); $registered_datetime = get_blog_details( null, false )->registered; - + list( $registered_date, $registered_time ) = explode( ' ', $registered_datetime ); - + $timestamp = strtotime( $tomorrow_date . $registered_time ); $recurrence = get_option( 'wp_cron_backup_schedule' ); try { return wp_schedule_event( $timestamp, $recurrence, 'wp_db_backup_cron' ); - } catch ( Exception $WP_Error ) { - do_action( 'qm/error', $WP_Error ); // https://querymonitor.com/docs/logging-variables/ + } catch ( Exception $WP_Error ) { + do_action( 'qm/error', $WP_Error ); // https://querymonitor.com/docs/logging-variables/ } } diff --git a/inc/wp-sync-db/namespace.php b/inc/wp-sync-db/namespace.php index 31b7660..369520a 100644 --- a/inc/wp-sync-db/namespace.php +++ b/inc/wp-sync-db/namespace.php @@ -7,50 +7,62 @@ namespace Figuren_Theater\Maintenance\WP_Sync_DB; -use FT_VENDOR_DIR; - -use WP_ENVIRONMENT_TYPE; - use Figuren_Theater; + use Figuren_Theater\Options; -use function Figuren_Theater\get_config; +use FT_VENDOR_DIR; use function add_action; use function add_filter; + use function get_sites; use function wp_list_pluck; +use WP_ENVIRONMENT_TYPE; const BASENAME = 'wp-sync-db/wp-sync-db.php'; -const PLUGINPATH = FT_VENDOR_DIR . '/pixelstudio/' . BASENAME; +const PLUGINPATH = '/pixelstudio/' . BASENAME; /** * Bootstrap module, when enabled. */ -function bootstrap() { +function bootstrap() :void { add_action( 'Figuren_Theater\loaded', __NAMESPACE__ . '\\filter_options', 11 ); - + add_action( 'plugins_loaded', __NAMESPACE__ . '\\load_plugin', 9 ); } -function load_plugin() { +/** + * Conditionally load the plugin itself and its modifications. + * + * @TODO #29 Make path replacements dynamic. + * + * @return void + */ +function load_plugin() :void { $config = Figuren_Theater\get_config()['modules']['maintenance']; - if ( ! $config['wp-sync-db'] ) - return; // early + if ( ! $config['wp-sync-db'] ) { + return; + } - require_once PLUGINPATH; + require_once FT_VENDOR_DIR . PLUGINPATH; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingCustomConstant add_filter( 'wpsdb_domain_replaces', __NAMESPACE__ . '\\replace_tlds_on_migrate' ); - // Remove plugins menu + // Remove plugins menu. add_action( 'network_admin_menu', __NAMESPACE__ . '\\remove_menu', 11 ); } -function filter_options() : void { +/** + * Handle options + * + * @return void + */ +function filter_options() :void { $_temp_key = ( 'local' === WP_ENVIRONMENT_TYPE ) ? 'fbCla6zyX/m9YK9/rBAG40npm71Y9bOc' : 'g3CqYqPZ5OSghQT1Fv7QAXqhy4BsXnf1'; - + $_options = [ 'max_request' => 1048576, 'key' => $_temp_key, @@ -67,27 +79,27 @@ function filter_options() : void { 'exclude_post_types' => '0', 'action' => 'pull', 'connection_info' => 'https://figuren.theater -g3CqYqPZ5OSghQT1Fv7QAXqhy4BsXnf1', // keep this CRAZY LINEBREAK +g3CqYqPZ5OSghQT1Fv7QAXqhy4BsXnf1', // keep this CRAZY LINEBREAK ! - // replacements + // replacements // that will be done on many different tables - // + // // but will not work for the 'blogs' table // as here are listed all domains without protocoll // e.g 'figuren.theater', which we can't replace by default - // to not destroy emailadresses. - // - // So especially for the 'blogs'-table + // to not destroy emailadresses. + // + // So especially for the 'blogs'-table // we have our 'replace_tlds_on_migrate' filter - // - // @TODO make this somehow dynamic + // + // @TODO #29 Make path replacements dynamic. 'replace_old' => [ 1 => '/srv/www/htdocs/c.bach/www.puppen.theater', 2 => '//figuren.theater', 3 => '.figuren.theater', 4 => '//puppen.theater', 5 => '.puppen.theater', - + 6 => '//katharina-muschiol.de', ], 'replace_new' => [ @@ -96,7 +108,7 @@ function filter_options() : void { 3 => '.figuren.test', 4 => '//puppen.test', 5 => '.puppen.test', - + 6 => '//katharina-muschiol.test', ], 'table_migrate_option' => 'migrate_only_with_prefix', @@ -111,68 +123,81 @@ function filter_options() : void { 'verify_ssl' => true, 'enable_cdn' => false, 'blacklist_plugins' => [], - 'plugin_compatibility' => false # not a real option, but used with in the UI + 'plugin_compatibility' => false, // Not a real option, but used with in the UI. ]; new Options\Option( 'wpsdb_settings', $_options, - BASENAME, + BASENAME ); } - +/** + * Show the admin-menu, only: + * - to super-administrators + * + * @return void + */ function remove_menu() : void { - // Show the menu, only: - // - to super-administrators - // - if (! current_user_can( 'manage_sites' ) ) + if ( ! current_user_can( 'manage_sites' ) ) { remove_submenu_page( 'settings.php', 'wp-sync-db' ); + } } - +/** + * Find only the TLDs and replace them + * with our (typical) local TLD of '.test' + * + * @param string[] $domain_replaces List of domain names and their replacements. + * + * @return string[] + */ function replace_tlds_on_migrate( array $domain_replaces ) : array { - // find only the TLDs - // and replace them with our - // (typical) local TLD of '.test' - foreach ( __get_sites() as $site_url ) { - $domain_replaces[sprintf( "/%s/", $site_url )] = __replace_tld( $site_url ); + foreach ( _get_sites() as $site_url ) { + $domain_replaces[ sprintf( '/%s/', $site_url ) ] = _replace_tld( $site_url ); } -/* -error_log(var_export([ - \current_filter(), - 'replace_tlds_on_migrate()', - $domain_replaces, $local_sites -],true));*/ - - - return $domain_replaces; } -function __replace_tld( string $url, string $new_tld = 'test' ) : string -{ - // cut url into array +/** + * Replace the production TLD for development puposes. + * + * @param string $url Full URL of website. + * @param string $new_tld New TLD which will replace the production TLD for development puposes. + * + * @access private + * + * @return string + */ +function _replace_tld( string $url, string $new_tld = 'test' ) : string { + // Cut url into array pieces. $url_parts = explode( '.', $url ); - - // remove current tld + + // remove current tld. array_pop( $url_parts ); - // re-glue url with new top level domain - return implode('.', array_merge( $url_parts, [ $new_tld ] ) ); + // re-glue url with new top level domain. + return implode( '.', array_merge( $url_parts, [ $new_tld ] ) ); } -function __get_sites() : array -{ +/** + * Get list of domains from WP_Site objects. + * + * @access private + * + * @return string[] + */ +function _get_sites() : array { - // List of WP_Site objects, - // or a list of site IDs when 'fields' is set to 'ids', + // List of WP_Site objects, + // or a list of site IDs when 'fields' is set to 'ids', // or the number of sites when 'count' is passed as a query var. $site_query_vars = []; - - return wp_list_pluck( + + return wp_list_pluck( get_sites( $site_query_vars ), 'domain' ); diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..0144e03 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,20 @@ +#$ vendor/bin/phpstan analyze + +parameters: + level: max + inferPrivatePropertyTypeFromConstructor: true + paths: + - inc/ + - templates/ + - plugin.php + excludePaths: + analyse: + - vendor/ + # "/wp-content/" is created during composer install, + # when package is tested + # and not running within ft-platform + - wp-content/ + - tests/ + ignoreErrors: + # Find a nicer way instead of ignoring this Error on every ft-module + - '#Function Altis\\register_module not found\.#'