From b9dbb8eec7c35456dd93a564068fe1ed47213769 Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Sun, 3 Mar 2024 21:49:46 -0500 Subject: [PATCH 01/26] refactored - into a class --- enable-contributor-uploads.php | 109 ++++++++++++++++++++++++++------- 1 file changed, 88 insertions(+), 21 deletions(-) diff --git a/enable-contributor-uploads.php b/enable-contributor-uploads.php index 6b3e836..68c6247 100644 --- a/enable-contributor-uploads.php +++ b/enable-contributor-uploads.php @@ -1,31 +1,98 @@ add_cap('upload_files'); -} -register_activation_hook( __FILE__, 'rwc_allow_contributor_uploads_install' ); +/** + * Class EnableContributorUploads + * + * Main plugin class. + */ +class EnableContributorUploads { + + /** + * Constructor. + */ + public function __construct() { + // Intentionally left blank. + } + + /** + * Initialize the plugin. + * + * Registers activation and deactivation hooks, and adds action to load text domain. + */ + public function init() { + register_activation_hook( __FILE__, [ $this, 'activate' ] ); + register_deactivation_hook( __FILE__, [ $this, 'deactivate' ] ); + add_action( 'init', [ $this, 'load_textdomain' ] ); + } + + /** + * Handles tasks to perform upon plugin activation. + * + * Adds the 'upload_files' capability to the 'contributor' role. + */ + public function activate() { + $contributor = get_role( 'contributor' ); + if ( null !== $contributor ) { + $contributor->add_cap( 'upload_files' ); + } + } + + /** + * Handles tasks to perform upon plugin deactivation. + * + * Removes the 'upload_files' capability from the 'contributor' role. + */ + public function deactivate() { + $contributor = get_role( 'contributor' ); + if ( null !== $contributor ) { + $contributor->remove_cap( 'upload_files' ); + } + } + + /** + * Load the plugin text domain for translation. + */ + public function load_textdomain() { + load_plugin_textdomain( 'enable-contributor-uploads', false, basename( dirname( __FILE__ ) ) . '/languages' ); + } -// Remove upload capabilitys on plugin uninstall -function rwc_allow_contributor_uploads_deactivation() { - $contributor = get_role('contributor'); - $contributor->remove_cap('upload_files'); + /** + * Handles tasks to perform upon plugin uninstallation. + * + * Removes the 'upload_files' capability from the 'contributor' role. + * Note: This method should be called statically and is intended for registration with register_uninstall_hook. + */ + public static function uninstall() { + $contributor = get_role( 'contributor' ); + if ( null !== $contributor ) { + $contributor->remove_cap( 'upload_files' ); + } + } } -register_deactivation_hook(__FILE__, 'rwc_allow_contributor_uploads_deactivation'); -//* That's all! \ No newline at end of file +// Instantiating the class and calling the init method in one line. +( new EnableContributorUploads() )->init(); From fe907453c960736283ac99714319abcf200ac82d Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Sun, 3 Mar 2024 23:00:32 -0500 Subject: [PATCH 02/26] added - npm, composer, linting, and test framework --- .editorconfig | 25 + .github/workflows/cs.yml | 61 + .github/workflows/lint-php.yml | 72 + .github/workflows/phpunit.yml | 90 + .github/workflows/security.yml | 34 + .gitignore | 17 +- .husky/pre-commit | 1 + .phpcs.xml.dist | 47 + .travis.yml | 69 + LICENSE => LICENSE.txt | 11 +- composer.json | 62 + composer.lock | 3073 ++++++++++++++++++++++++++++++++ enable-contributor-uploads.php | 123 +- package.json | 24 + phpcs.xml | 132 ++ phpunit.dev.xml | 15 + phpunit.xml.dist | 15 + readme.txt | 20 +- scripts/dist.sh | 24 + tests/bin/install-wp-tests.sh | 181 ++ tests/bootstrap-dev.php | 12 + tests/bootstrap.php | 37 + tests/e2e/.auth/user.json | 55 + 23 files changed, 4121 insertions(+), 79 deletions(-) create mode 100644 .editorconfig create mode 100644 .github/workflows/cs.yml create mode 100644 .github/workflows/lint-php.yml create mode 100644 .github/workflows/phpunit.yml create mode 100644 .github/workflows/security.yml create mode 100644 .husky/pre-commit create mode 100644 .phpcs.xml.dist create mode 100644 .travis.yml rename LICENSE => LICENSE.txt (98%) create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 package.json create mode 100644 phpcs.xml create mode 100644 phpunit.dev.xml create mode 100644 phpunit.xml.dist create mode 100755 scripts/dist.sh create mode 100755 tests/bin/install-wp-tests.sh create mode 100644 tests/bootstrap-dev.php create mode 100644 tests/bootstrap.php create mode 100644 tests/e2e/.auth/user.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5987f26 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,25 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +# WordPress Coding Standards +# https://make.wordpress.org/core/handbook/coding-standards/ + +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = tab + +[*.{yml,yaml}] +indent_style = space +indent_size = 2 + +[*.{gradle,java,kt}] +indent_style = space + +[packages/react-native-*/**.xml] +indent_style = space + diff --git a/.github/workflows/cs.yml b/.github/workflows/cs.yml new file mode 100644 index 0000000..de14a3f --- /dev/null +++ b/.github/workflows/cs.yml @@ -0,0 +1,61 @@ +name: CS + +on: + # Run on all pushes (except to main) and on all pull requests. + push: + branches: + - '*' + pull_request: + branches: + - '*' + # Allow manually triggering the workflow. + workflow_dispatch: + +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + # The concurrency group contains the workflow name and the branch name. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + checkcs: + name: 'Check code style' + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Run custom composer script + run: ./run-composer.sh + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + coverage: none + tools: cs2pr + + # Validate the composer.json file. + # @link https://getcomposer.org/doc/03-cli.md#validate + - name: Validate Composer installation + run: composer validate --no-check-all + + # Install dependencies and handle caching in one go. + # @link https://github.com/marketplace/actions/install-composer-dependencies + - name: Install Composer dependencies + uses: ramsey/composer-install@v2 + with: + # Bust the cache at least once a month - output format: YYYY-MM-DD. + custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F") + + # Check the codestyle of the files. + # The results of the CS check will be shown inline in the PR via the CS2PR tool. + # @link https://github.com/staabm/annotate-pull-request-from-checkstyle/ + - name: Check PHP code style + id: phpcs + run: composer check-cs -- --report-full --report-checkstyle=./phpcs-report.xml --ignore=vendor + + - name: Show PHPCS results in PR + if: ${{ always() && steps.phpcs.outcome == 'failure' }} + run: cs2pr ./phpcs-report.xml \ No newline at end of file diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml new file mode 100644 index 0000000..ef96ec1 --- /dev/null +++ b/.github/workflows/lint-php.yml @@ -0,0 +1,72 @@ +name: Lint PHP + +on: + # Run on pushes to select branches and on all pull requests. + push: + branches: + - master + - develop + - trunk + - 'feature/**' + - 'release/**' + - 'hotfix/[0-9]+.[0-9]+*' + pull_request: + # Allow manually triggering the workflow. + workflow_dispatch: + +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + # The concurrency group contains the workflow name and the branch name. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + + strategy: + matrix: + # Lint against the highest/lowest supported versions of each PHP major. + # And also do a run against "nightly" (the current dev version of PHP). + php_version: ['7.4', '8.0', '8.1', '8.2'] + + name: "Lint: PHP ${{ matrix.php_version }}" + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install PHP for the composer install + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + coverage: none + + # The lint stage doesn't run the unit tests or use code style, so no need for PHPUnit, WPCS or phpcompatibility. + - name: 'Composer: adjust dependencies - remove PHPUnit' + run: composer remove --no-update --dev phpunit/phpunit --no-scripts --no-interaction + - name: 'Composer: adjust dependencies - remove Yoast test urils' + run: composer remove --no-update --dev yoast/wp-test-utils --no-scripts --no-interaction + - name: 'Composer: adjust dependencies - remove PHPCompatibility' + run: composer remove --no-update --dev phpcompatibility/phpcompatibility-wp --no-scripts --no-interaction + - name: 'Composer: adjust dependencies - remove WPCS' + run: composer remove --no-update --dev wp-coding-standards/wpcs --no-scripts --no-interaction + + # Install dependencies and handle caching in one go. + # @link https://github.com/marketplace/actions/install-composer-dependencies + - name: Install Composer dependencies + uses: ramsey/composer-install@v2 + with: + # Bust the cache at least once a month - output format: YYYY-MM-DD. + custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F") + + - name: Install PHP for the actual test + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php_version }} + ini-values: zend.assertions=1, error_reporting=-1, display_errors=On + coverage: none + tools: cs2pr + + - name: Lint against parse errors + run: composer lint -- --checkstyle | cs2pr diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml new file mode 100644 index 0000000..a29f8f9 --- /dev/null +++ b/.github/workflows/phpunit.yml @@ -0,0 +1,90 @@ +name: Test + +on: + # Run on pushes to select branches and on all pull requests. + push: + pull_request: + # Allow manually triggering the workflow. + workflow_dispatch: + +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + # The concurrency group contains the workflow name and the branch name. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + integration: + runs-on: ubuntu-latest + + strategy: + matrix: + include: + - php_version: '8.1' + wp_version: '6.2' + multisite: false + + - php_version: '8.1' + wp_version: 'latest' + multisite: false + + - php_version: '8.1' + wp_version: 'latest' + multisite: true + + - php_version: '8.2' + wp_version: 'latest' + multisite: true + + name: "Integration Test: PHP ${{ matrix.php_version }} | WP ${{ matrix.wp_version }}${{ matrix.multisite == true && ' (+ ms)' || '' }}" + + # Allow builds to fail on as-of-yet unreleased WordPress versions. + continue-on-error: ${{ matrix.wp_version == 'trunk' }} + + services: + mysql: + image: mysql:8.0 + env: + MYSQL_ALLOW_EMPTY_PASSWORD: false + ports: + - 3306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php_version }} + ini-values: zend.assertions=1, error_reporting=-1, display_errors=On + coverage: none + + # Install dependencies and handle caching in one go. + # @link https://github.com/marketplace/actions/install-composer-dependencies + - name: "Composer: remove the PHP platform requirement" + run: composer config --unset platform.php + + - name: "Install Composer dependencies" + uses: ramsey/composer-install@v2 + with: + # Force a `composer update` run. + dependency-versions: "highest" + # But make it selective. + composer-options: "yoast/wp-test-utils --with-dependencies" + # Bust the cache at least once a month - output format: YYYY-MM-DD. + custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F") + + - name: Install WP + shell: bash + run: tests/bin/install-wp-tests.sh wordpress_tests root '' 127.0.0.1:3306 ${{ matrix.wp_version }} + + - name: Run unit tests - single site + run: composer test + + - name: Run unit tests - multisite + if: ${{ matrix.multisite == true }} + run: composer test + env: + WP_MULTISITE: 1 \ No newline at end of file diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml new file mode 100644 index 0000000..9e6da67 --- /dev/null +++ b/.github/workflows/security.yml @@ -0,0 +1,34 @@ +name: Security + +on: + # Run on all pushes and on all pull requests. + push: + pull_request: + # Also run this workflow every Monday at 6:00. + schedule: + - cron: '0 6 * * 1' + # Allow manually triggering the workflow. + workflow_dispatch: + +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + # The concurrency group contains the workflow name and the branch name. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + security: + name: 'Security check' + runs-on: ubuntu-latest + + # Don't run the cronjob in this workflow on forks. + if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'Yoast') + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + # This action checks the `composer.lock` file against known security vulnerabilities in the dependencies. + # https://github.com/marketplace/actions/the-php-security-checker + - name: Run Security Check + uses: symfonycorp/security-checker-action@v5 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9ab6c6f..6475b4a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,19 @@ # Exclude these files from the git repo - +.sass-cache/ +config.codekit3 +edac_log.txt +#composer.lock +package-lock.json + # Hidden system files *.DS_Store *[Tt]humbs.db -*.Trashes \ No newline at end of file +*.Trashes +vendor +node_modules +build +dist +.env + +# PHPUnit +.phpunit.result.cache diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..3867a0f --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npm run lint diff --git a/.phpcs.xml.dist b/.phpcs.xml.dist new file mode 100644 index 0000000..df58068 --- /dev/null +++ b/.phpcs.xml.dist @@ -0,0 +1,47 @@ + + + Generally-applicable sniffs for WordPress plugins. + + + . + /vendor/ + /node_modules/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..71e3c98 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,69 @@ +sudo: false +dist: trusty + +language: php + +notifications: + email: + on_success: never + on_failure: change + +branches: + only: + - master + +cache: + directories: + - $HOME/.composer/cache + +matrix: + include: + - php: 7.4 + env: WP_VERSION=latest + - php: 7.3 + env: WP_VERSION=latest + - php: 7.2 + env: WP_VERSION=latest + - php: 7.1 + env: WP_VERSION=latest + - php: 7.0 + env: WP_VERSION=latest + - php: 5.6 + env: WP_VERSION=latest + - php: 5.6 + env: WP_VERSION=trunk + - php: 5.6 + env: WP_TRAVISCI=phpcs + +before_script: + - export PATH="$HOME/.composer/vendor/bin:$PATH" + - | + if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then + phpenv config-rm xdebug.ini + else + echo "xdebug.ini does not exist" + fi + - | + if [[ ! -z "$WP_VERSION" ]] ; then + bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION + composer global require "phpunit/phpunit=4.8.*|5.7.*" + fi + - | + if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then + composer global require wp-coding-standards/wpcs + composer global require phpcompatibility/php-compatibility + composer global require phpcompatibility/phpcompatibility-paragonie + composer global require phpcompatibility/phpcompatibility-wp + phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs,$HOME/.composer/vendor/phpcompatibility/php-compatibility,$HOME/.composer/vendor/phpcompatibility/phpcompatibility-paragonie,$HOME/.composer/vendor/phpcompatibility/phpcompatibility-wp + fi + +script: + - | + if [[ ! -z "$WP_VERSION" ]] ; then + phpunit + WP_MULTISITE=1 phpunit + fi + - | + if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then + phpcs + fi diff --git a/LICENSE b/LICENSE.txt similarity index 98% rename from LICENSE rename to LICENSE.txt index 8cdb845..ecbc059 100644 --- a/LICENSE +++ b/LICENSE.txt @@ -1,7 +1,7 @@ GNU GENERAL PUBLIC LICENSE Version 2, June 1991 - Copyright (C) 1989, 1991 Free Software Foundation, Inc., + Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -290,8 +290,8 @@ to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - {description} - Copyright (C) {year} {fullname} + + Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -329,12 +329,11 @@ necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. - {signature of Ty Coon}, 1 April 1989 + , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. - +Public License instead of this License. \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..28e5806 --- /dev/null +++ b/composer.json @@ -0,0 +1,62 @@ +{ + "name": "equalizedigital/enable-contributor-uploads", + "description": "Allows users with the contributor role to upload images.", + "keywords": [ + "wordpress", + "contributor", + "uploads" + ], + "homepage": "https://equalizedigital.com", + "license": "GPL-3.0-or-later", + "authors": [ + { + "name": "Equalize Digital", + "homepage": "https://equalizedigital.com" + } + ], + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true, + "phpstan/extension-installer": true, + "composer/installers": true + } + }, + "minimum-stability": "dev", + "prefer-stable": true, + "require-dev": { + "automattic/vipwpcs": "^3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2", + "phpcompatibility/php-compatibility": "*", + "php-parallel-lint/php-parallel-lint": "^1.3", + "yoast/phpunit-polyfills": "^1.1.0", + "yoast/wp-test-utils": "^1.2", + "phpcompatibility/phpcompatibility-wp": "^2.1", + "wp-coding-standards/wpcs": "^3.0", + "doctrine/instantiator": "^1.3.1", + "wp-phpunit/wp-phpunit": "*" + }, + "require": { + "php": ">=7.4", + "composer/installers": "^1.12.0" + }, + "autoload": { + "classmap": [] + }, + "autoload-dev": { + "classmap": [] + }, + "scripts": { + "lint": [ + "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --show-deprecated --exclude vendor --exclude node_modules --exclude .git" + ], + "check-cs": [ + "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --runtime-set testVersion 7.4-" + ], + "fix-cs": [ + "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf" + ], + "test": [ + "@php ./vendor/phpunit/phpunit/phpunit" + ] + } +} \ No newline at end of file diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..a6375e1 --- /dev/null +++ b/composer.lock @@ -0,0 +1,3073 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "6e5f3a8c0a7386ff36db95eca2534adc", + "packages": [ + { + "name": "composer/installers", + "version": "v1.12.0", + "source": { + "type": "git", + "url": "https://github.com/composer/installers.git", + "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/installers/zipball/d20a64ed3c94748397ff5973488761b22f6d3f19", + "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0" + }, + "replace": { + "roundcube/plugin-installer": "*", + "shama/baton": "*" + }, + "require-dev": { + "composer/composer": "1.6.* || ^2.0", + "composer/semver": "^1 || ^3", + "phpstan/phpstan": "^0.12.55", + "phpstan/phpstan-phpunit": "^0.12.16", + "symfony/phpunit-bridge": "^4.2 || ^5", + "symfony/process": "^2.3" + }, + "type": "composer-plugin", + "extra": { + "class": "Composer\\Installers\\Plugin", + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Installers\\": "src/Composer/Installers" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama" + } + ], + "description": "A multi-framework Composer library installer", + "homepage": "https://composer.github.io/installers/", + "keywords": [ + "Craft", + "Dolibarr", + "Eliasis", + "Hurad", + "ImageCMS", + "Kanboard", + "Lan Management System", + "MODX Evo", + "MantisBT", + "Mautic", + "Maya", + "OXID", + "Plentymarkets", + "Porto", + "RadPHP", + "SMF", + "Starbug", + "Thelia", + "Whmcs", + "WolfCMS", + "agl", + "aimeos", + "annotatecms", + "attogram", + "bitrix", + "cakephp", + "chef", + "cockpit", + "codeigniter", + "concrete5", + "croogo", + "dokuwiki", + "drupal", + "eZ Platform", + "elgg", + "expressionengine", + "fuelphp", + "grav", + "installer", + "itop", + "joomla", + "known", + "kohana", + "laravel", + "lavalite", + "lithium", + "magento", + "majima", + "mako", + "mediawiki", + "miaoxing", + "modulework", + "modx", + "moodle", + "osclass", + "pantheon", + "phpbb", + "piwik", + "ppi", + "processwire", + "puppet", + "pxcms", + "reindex", + "roundcube", + "shopware", + "silverstripe", + "sydes", + "sylius", + "symfony", + "tastyigniter", + "typo3", + "wordpress", + "yawik", + "zend", + "zikula" + ], + "support": { + "issues": "https://github.com/composer/installers/issues", + "source": "https://github.com/composer/installers/tree/v1.12.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-09-13T08:19:44+00:00" + } + ], + "packages-dev": [ + { + "name": "antecedent/patchwork", + "version": "2.1.28", + "source": { + "type": "git", + "url": "https://github.com/antecedent/patchwork.git", + "reference": "6b30aff81ebadf0f2feb9268d3e08385cebcc08d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/antecedent/patchwork/zipball/6b30aff81ebadf0f2feb9268d3e08385cebcc08d", + "reference": "6b30aff81ebadf0f2feb9268d3e08385cebcc08d", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": ">=4" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignas Rudaitis", + "email": "ignas.rudaitis@gmail.com" + } + ], + "description": "Method redefinition (monkey-patching) functionality for PHP.", + "homepage": "https://antecedent.github.io/patchwork/", + "keywords": [ + "aop", + "aspect", + "interception", + "monkeypatching", + "redefinition", + "runkit", + "testing" + ], + "support": { + "issues": "https://github.com/antecedent/patchwork/issues", + "source": "https://github.com/antecedent/patchwork/tree/2.1.28" + }, + "time": "2024-02-06T09:26:11+00:00" + }, + { + "name": "automattic/vipwpcs", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/VIP-Coding-Standards.git", + "reference": "1b8960ebff9ea3eb482258a906ece4d1ee1e25fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/1b8960ebff9ea3eb482258a906ece4d1ee1e25fd", + "reference": "1b8960ebff9ea3eb482258a906ece4d1ee1e25fd", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "phpcsstandards/phpcsextra": "^1.1.0", + "phpcsstandards/phpcsutils": "^1.0.8", + "sirbrillig/phpcs-variable-analysis": "^2.11.17", + "squizlabs/php_codesniffer": "^3.7.2", + "wp-coding-standards/wpcs": "^3.0" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcompatibility/php-compatibility": "^9", + "phpcsstandards/phpcsdevtools": "^1.0", + "phpunit/phpunit": "^4 || ^5 || ^6 || ^7" + }, + "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", + "static analysis", + "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": "2023-09-05T11:01:05+00:00" + }, + { + "name": "brain/monkey", + "version": "2.6.1", + "source": { + "type": "git", + "url": "https://github.com/Brain-WP/BrainMonkey.git", + "reference": "a31c84515bb0d49be9310f52ef1733980ea8ffbb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/a31c84515bb0d49be9310f52ef1733980ea8ffbb", + "reference": "a31c84515bb0d49be9310f52ef1733980ea8ffbb", + "shasum": "" + }, + "require": { + "antecedent/patchwork": "^2.1.17", + "mockery/mockery": "^1.3.5 || ^1.4.4", + "php": ">=5.6.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", + "phpcompatibility/php-compatibility": "^9.3.0", + "phpunit/phpunit": "^5.7.26 || ^6.0 || ^7.0 || >=8.0 <8.5.12 || ^8.5.14 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-version/1": "1.x-dev", + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "files": [ + "inc/api.php" + ], + "psr-4": { + "Brain\\Monkey\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Giuseppe Mazzapica", + "email": "giuseppe.mazzapica@gmail.com", + "homepage": "https://gmazzap.me", + "role": "Developer" + } + ], + "description": "Mocking utility for PHP functions and WordPress plugin API", + "keywords": [ + "Monkey Patching", + "interception", + "mock", + "mock functions", + "mockery", + "patchwork", + "redefinition", + "runkit", + "test", + "testing" + ], + "support": { + "issues": "https://github.com/Brain-WP/BrainMonkey/issues", + "source": "https://github.com/Brain-WP/BrainMonkey" + }, + "time": "2021-11-11T15:53:55+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": "doctrine/instantiator", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^11", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.30 || ^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2022-12-30T00:15:36+00:00" + }, + { + "name": "hamcrest/hamcrest-php", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "shasum": "" + }, + "require": { + "php": "^5.3|^7.0|^8.0" + }, + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" + }, + "require-dev": { + "phpunit/php-file-iterator": "^1.4 || ^2.0", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "classmap": [ + "hamcrest" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "This is the PHP port of Hamcrest Matchers", + "keywords": [ + "test" + ], + "support": { + "issues": "https://github.com/hamcrest/hamcrest-php/issues", + "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1" + }, + "time": "2020-07-09T08:09:16+00:00" + }, + { + "name": "mockery/mockery", + "version": "1.6.7", + "source": { + "type": "git", + "url": "https://github.com/mockery/mockery.git", + "reference": "0cc058854b3195ba21dc6b1f7b1f60f4ef3a9c06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mockery/mockery/zipball/0cc058854b3195ba21dc6b1f7b1f60f4ef3a9c06", + "reference": "0cc058854b3195ba21dc6b1f7b1f60f4ef3a9c06", + "shasum": "" + }, + "require": { + "hamcrest/hamcrest-php": "^2.0.1", + "lib-pcre": ">=7.0", + "php": ">=7.3" + }, + "conflict": { + "phpunit/phpunit": "<8.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.5 || ^9.6.10", + "symplify/easy-coding-standard": "^12.0.8" + }, + "type": "library", + "autoload": { + "files": [ + "library/helpers.php", + "library/Mockery.php" + ], + "psr-4": { + "Mockery\\": "library/Mockery" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "https://github.com/padraic", + "role": "Author" + }, + { + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "https://davedevelopment.co.uk", + "role": "Developer" + }, + { + "name": "Nathanael Esayeas", + "email": "nathanael.esayeas@protonmail.com", + "homepage": "https://github.com/ghostwriter", + "role": "Lead Developer" + } + ], + "description": "Mockery is a simple yet flexible PHP mock object framework", + "homepage": "https://github.com/mockery/mockery", + "keywords": [ + "BDD", + "TDD", + "library", + "mock", + "mock objects", + "mockery", + "stub", + "test", + "test double", + "testing" + ], + "support": { + "docs": "https://docs.mockery.io/", + "issues": "https://github.com/mockery/mockery/issues", + "rss": "https://github.com/mockery/mockery/releases.atom", + "security": "https://github.com/mockery/mockery/security/advisories", + "source": "https://github.com/mockery/mockery" + }, + "time": "2023-12-10T02:24:34+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.11.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2023-03-08T13:26:56+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.0.1", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "2218c2252c874a4624ab2f613d86ac32d227bc69" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/2218c2252c874a4624ab2f613d86ac32d227bc69", + "reference": "2218c2252c874a4624ab2f613d86ac32d227bc69", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.1" + }, + "time": "2024-02-21T19:24:10+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "php-parallel-lint/php-parallel-lint", + "version": "v1.3.2", + "source": { + "type": "git", + "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", + "reference": "6483c9832e71973ed29cf71bd6b3f4fde438a9de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6483c9832e71973ed29cf71bd6b3f4fde438a9de", + "reference": "6483c9832e71973ed29cf71bd6b3f4fde438a9de", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.3.0" + }, + "replace": { + "grogy/php-parallel-lint": "*", + "jakub-onderka/php-parallel-lint": "*" + }, + "require-dev": { + "nette/tester": "^1.3 || ^2.0", + "php-parallel-lint/php-console-highlighter": "0.* || ^1.0", + "squizlabs/php_codesniffer": "^3.6" + }, + "suggest": { + "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" + }, + "bin": [ + "parallel-lint" + ], + "type": "library", + "autoload": { + "classmap": [ + "./src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "ahoj@jakubonderka.cz" + } + ], + "description": "This tool check syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", + "support": { + "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", + "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.3.2" + }, + "time": "2022-02-21T12:50:22+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": "phpcsstandards/phpcsextra", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", + "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", + "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "phpcsstandards/phpcsutils": "^1.0.9", + "squizlabs/php_codesniffer": "^3.8.0" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcsstandards/phpcsdevcs": "^1.1.6", + "phpcsstandards/phpcsdevtools": "^1.2.1", + "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-stable": "1.x-dev", + "dev-develop": "1.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors" + } + ], + "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.", + "keywords": [ + "PHP_CodeSniffer", + "phpcbf", + "phpcodesniffer-standard", + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", + "security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy", + "source": "https://github.com/PHPCSStandards/PHPCSExtra" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2023-12-08T16:49:07+00:00" + }, + { + "name": "phpcsstandards/phpcsutils", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", + "reference": "908247bc65010c7b7541a9551e002db12e9dae70" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/908247bc65010c7b7541a9551e002db12e9dae70", + "reference": "908247bc65010c7b7541a9551e002db12e9dae70", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", + "php": ">=5.4", + "squizlabs/php_codesniffer": "^3.8.0 || 4.0.x-dev@dev" + }, + "require-dev": { + "ext-filter": "*", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcsstandards/phpcsdevcs": "^1.1.6", + "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-stable": "1.x-dev", + "dev-develop": "1.x-dev" + } + }, + "autoload": { + "classmap": [ + "PHPCSUtils/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" + } + ], + "description": "A suite of utility functions for use with PHP_CodeSniffer", + "homepage": "https://phpcsutils.com/", + "keywords": [ + "PHP_CodeSniffer", + "phpcbf", + "phpcodesniffer-standard", + "phpcs", + "phpcs3", + "standards", + "static analysis", + "tokens", + "utility" + ], + "support": { + "docs": "https://phpcsutils.com/", + "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", + "security": "https://github.com/PHPCSStandards/PHPCSUtils/security/policy", + "source": "https://github.com/PHPCSStandards/PHPCSUtils" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2023-12-08T14:50:00+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.31", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:37:42+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.6.17", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "1a156980d78a6666721b7e8e8502fe210b587fcd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1a156980d78a6666721b7e8e8502fe210b587fcd", + "reference": "1a156980d78a6666721b7e8e8502fe210b587fcd", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1 || ^2", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpunit/php-code-coverage": "^9.2.28", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.8", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.5", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^3.2", + "sebastian/version": "^3.0.2" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.6-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.17" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2024-02-23T13:14:51+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:27:43+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T12:41:17+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:19:30+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "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": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:30:58+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:03:51+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:33:00+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.7", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:35:11+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:20:34+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:07:39+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:13:03+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" + }, + { + "name": "sirbrillig/phpcs-variable-analysis", + "version": "v2.11.17", + "source": { + "type": "git", + "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", + "reference": "3b71162a6bf0cde2bff1752e40a1788d8273d049" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/3b71162a6bf0cde2bff1752e40a1788d8273d049", + "reference": "3b71162a6bf0cde2bff1752e40a1788d8273d049", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "squizlabs/php_codesniffer": "^3.5.6" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0", + "phpcsstandards/phpcsdevcs": "^1.1", + "phpstan/phpstan": "^1.7", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0", + "sirbrillig/phpcs-import-detection": "^1.1", + "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0@beta" + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "VariableAnalysis\\": "VariableAnalysis/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Sam Graham", + "email": "php-codesniffer-variableanalysis@illusori.co.uk" + }, + { + "name": "Payton Swick", + "email": "payton@foolord.com" + } + ], + "description": "A PHPCS sniff to detect problems with variables.", + "keywords": [ + "phpcs", + "static analysis" + ], + "support": { + "issues": "https://github.com/sirbrillig/phpcs-variable-analysis/issues", + "source": "https://github.com/sirbrillig/phpcs-variable-analysis", + "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" + }, + "time": "2023-08-05T23:46:11+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.9.0", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/d63cee4890a8afaf86a22e51ad4d97c91dd4579b", + "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + }, + "bin": [ + "bin/phpcbf", + "bin/phpcs" + ], + "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": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-02-16T15:06:51+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:36:25+00:00" + }, + { + "name": "wp-coding-standards/wpcs", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", + "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/b4caf9689f1a0e4a4c632679a44e638c1c67aff1", + "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "ext-libxml": "*", + "ext-tokenizer": "*", + "ext-xmlreader": "*", + "php": ">=5.4", + "phpcsstandards/phpcsextra": "^1.1.0", + "phpcsstandards/phpcsutils": "^1.0.8", + "squizlabs/php_codesniffer": "^3.7.2" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcompatibility/php-compatibility": "^9.0", + "phpcsstandards/phpcsdevtools": "^1.2.0", + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "suggest": { + "ext-iconv": "For improved results", + "ext-mbstring": "For improved results" + }, + "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", + "static analysis", + "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" + }, + "funding": [ + { + "url": "https://opencollective.com/thewpcc/contribute/wp-php-63406", + "type": "custom" + } + ], + "time": "2023-09-14T07:06:09+00:00" + }, + { + "name": "wp-phpunit/wp-phpunit", + "version": "6.4.2", + "source": { + "type": "git", + "url": "https://github.com/wp-phpunit/wp-phpunit.git", + "reference": "aa3c8f5d1b7efc295fd2b37c7264d2356a8c1099" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-phpunit/wp-phpunit/zipball/aa3c8f5d1b7efc295fd2b37c7264d2356a8c1099", + "reference": "aa3c8f5d1b7efc295fd2b37c7264d2356a8c1099", + "shasum": "" + }, + "type": "library", + "autoload": { + "files": [ + "__loaded.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Evan Mattson", + "email": "me@aaemnnost.tv" + }, + { + "name": "WordPress Community", + "homepage": "https://wordpress.org/about/" + } + ], + "description": "WordPress core PHPUnit library", + "homepage": "https://github.com/wp-phpunit", + "keywords": [ + "phpunit", + "test", + "wordpress" + ], + "support": { + "docs": "https://github.com/wp-phpunit/docs", + "issues": "https://github.com/wp-phpunit/issues", + "source": "https://github.com/wp-phpunit/wp-phpunit" + }, + "time": "2023-12-07T00:50:08+00:00" + }, + { + "name": "yoast/phpunit-polyfills", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", + "reference": "224e4a1329c03d8bad520e3fc4ec980034a4b212" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/224e4a1329c03d8bad520e3fc4ec980034a4b212", + "reference": "224e4a1329c03d8bad520e3fc4ec980034a4b212", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + }, + "require-dev": { + "yoast/yoastcs": "^2.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + }, + "autoload": { + "files": [ + "phpunitpolyfills-autoload.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Team Yoast", + "email": "support@yoast.com", + "homepage": "https://yoast.com" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Yoast/PHPUnit-Polyfills/graphs/contributors" + } + ], + "description": "Set of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests", + "homepage": "https://github.com/Yoast/PHPUnit-Polyfills", + "keywords": [ + "phpunit", + "polyfill", + "testing" + ], + "support": { + "issues": "https://github.com/Yoast/PHPUnit-Polyfills/issues", + "source": "https://github.com/Yoast/PHPUnit-Polyfills" + }, + "time": "2023-08-19T14:25:08+00:00" + }, + { + "name": "yoast/wp-test-utils", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/Yoast/wp-test-utils.git", + "reference": "2e0f62e0281e4859707c5f13b7da1422aa1c8f7b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Yoast/wp-test-utils/zipball/2e0f62e0281e4859707c5f13b7da1422aa1c8f7b", + "reference": "2e0f62e0281e4859707c5f13b7da1422aa1c8f7b", + "shasum": "" + }, + "require": { + "brain/monkey": "^2.6.1", + "php": ">=5.6", + "yoast/phpunit-polyfills": "^1.1.0" + }, + "require-dev": { + "yoast/yoastcs": "^2.3.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "1.x-dev", + "dev-main": "1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ], + "exclude-from-classmap": [ + "/src/WPIntegration/TestCase.php", + "/src/WPIntegration/TestCaseNoPolyfills.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Team Yoast", + "email": "support@yoast.com", + "homepage": "https://yoast.com" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Yoast/wp-test-utils/graphs/contributors" + } + ], + "description": "PHPUnit cross-version compatibility layer for testing plugins and themes build for WordPress", + "homepage": "https://github.com/Yoast/wp-test-utils/", + "keywords": [ + "brainmonkey", + "integration-testing", + "phpunit", + "testing", + "unit-testing", + "wordpress" + ], + "support": { + "issues": "https://github.com/Yoast/wp-test-utils/issues", + "source": "https://github.com/Yoast/wp-test-utils" + }, + "time": "2023-09-27T10:25:08+00:00" + } + ], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": [], + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": ">=7.4" + }, + "platform-dev": [], + "plugin-api-version": "2.3.0" +} diff --git a/enable-contributor-uploads.php b/enable-contributor-uploads.php index 68c6247..f9f7c63 100644 --- a/enable-contributor-uploads.php +++ b/enable-contributor-uploads.php @@ -1,16 +1,16 @@ -add_cap( 'upload_files' ); - } - } + /** + * Handles tasks to perform upon plugin activation. + * + * Adds the 'upload_files' capability to the 'contributor' role. + */ + public function activate() { + $contributor = get_role( 'contributor' ); + if ( null !== $contributor ) { + $contributor->add_cap( 'upload_files' ); + } + } - /** - * Handles tasks to perform upon plugin deactivation. - * - * Removes the 'upload_files' capability from the 'contributor' role. - */ - public function deactivate() { - $contributor = get_role( 'contributor' ); - if ( null !== $contributor ) { - $contributor->remove_cap( 'upload_files' ); - } - } + /** + * Handles tasks to perform upon plugin deactivation. + * + * Removes the 'upload_files' capability from the 'contributor' role. + */ + public function deactivate() { + $contributor = get_role( 'contributor' ); + if ( null !== $contributor ) { + $contributor->remove_cap( 'upload_files' ); + } + } - /** - * Load the plugin text domain for translation. - */ - public function load_textdomain() { - load_plugin_textdomain( 'enable-contributor-uploads', false, basename( dirname( __FILE__ ) ) . '/languages' ); - } + /** + * Load the plugin text domain for translation. + */ + public function load_textdomain() { + load_plugin_textdomain( 'enable-contributor-uploads', false, basename( __DIR__ ) . '/languages' ); + } - /** - * Handles tasks to perform upon plugin uninstallation. - * - * Removes the 'upload_files' capability from the 'contributor' role. - * Note: This method should be called statically and is intended for registration with register_uninstall_hook. - */ - public static function uninstall() { - $contributor = get_role( 'contributor' ); - if ( null !== $contributor ) { - $contributor->remove_cap( 'upload_files' ); - } - } + /** + * Handles tasks to perform upon plugin uninstallation. + * + * Removes the 'upload_files' capability from the 'contributor' role. + * Note: This method should be called statically and is intended for registration with register_uninstall_hook. + */ + public static function uninstall() { + $contributor = get_role( 'contributor' ); + if ( null !== $contributor ) { + $contributor->remove_cap( 'upload_files' ); + } + } } // Instantiating the class and calling the init method in one line. diff --git a/package.json b/package.json new file mode 100644 index 0000000..073dcce --- /dev/null +++ b/package.json @@ -0,0 +1,24 @@ +{ + "name": "enable-contributor-uploads", + "version": "1.0.0", + "description": "Allows users with the contributor role to upload images.", + "author": "Equalize Digital", + "license": "GPL-2.0+", + "main": "index.js", + "scripts": { + "dist": "composer install --no-dev && composer dump-autoload --no-dev -o && ./scripts/dist.sh && composer install", + "lint": "./vendor/bin/phpcs", + "lint:fix": "./vendor/bin/phpcbf", + "prepare": "husky" + }, + "files": [ + "LICENSE.txt", + "readme.txt", + "enable-contributor-uploads.php" + ], + "devDependencies": { + "@wordpress/scripts": "^26.5.0", + "husky": "^9.0.6", + "patch-package": "^8.0.0" + } +} diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..79fdbf2 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,132 @@ + + + Accessibility Checker Wordpress Coding Standards + + + . + + + ./dist/ + ./vendor/ + ./node_modules/ + ./.wp-env/ + ./simple_html_dom.php + ./update-composer-config.php + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + 6 + + + 6 + + + 6 + + + 6 + + + 6 + + + 6 + + + 6 + + + + 6 + + + 6 + + + 5 + + + + 6 + + + 6 + + + 4 + + + 4 + + + + + + + + + + + + + + + + + + + diff --git a/phpunit.dev.xml b/phpunit.dev.xml new file mode 100644 index 0000000..8708070 --- /dev/null +++ b/phpunit.dev.xml @@ -0,0 +1,15 @@ + + + + + ./tests/ + + + diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..e8e8560 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,15 @@ + + + + + ./tests/ + + + diff --git a/readme.txt b/readme.txt index ce208ad..866c917 100644 --- a/readme.txt +++ b/readme.txt @@ -1,10 +1,9 @@ === Enable Contributor Uploads === -Contributors: roadwarriorwp, alh0319, stevejonesdev -Donate link: http://roadwarriorcreative.com/donate +Contributors: equalizedigital, alh0319, stevejonesdev Tags: user roles, capabilities, contributor, upload media, enable uploads -Requires at least: 3.0.1 -Tested up to: 5.4 -Stable tag: 1.1 +Requires at least: 6.2 +Tested up to: 6.4.3 +Stable tag: 1.2.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -43,8 +42,11 @@ We recommend you check out other plugins in the WordPress repository. At this t == Changelog == -= 1.0 = -* This is version 1 - everything is new and shiny! += 1.2.0 = -= 1.1 = -* Update upload capability to be added and removed from contributors only on plugin activation and deactivation. \ No newline at end of file + += 1.1.0 = +* Update upload capability to be added and removed from contributors only on plugin activation and deactivation. + += 1.0.0 = +* This is version 1 - everything is new and shiny! \ No newline at end of file diff --git a/scripts/dist.sh b/scripts/dist.sh new file mode 100755 index 0000000..5bd2480 --- /dev/null +++ b/scripts/dist.sh @@ -0,0 +1,24 @@ +#Remove the contents of the dist folder +rm -frd ./dist +mkdir ./dist + +#Run the wp script that produces the zip +npx wp-scripts plugin-zip + +# unzip the zip into its own folder so we can zip that +unzip enable-contributor-uploads.zip -d ./dist/enable-contributor-uploads + +# plugin-zip includes package.json which is not needed for the plugin, so remove. +rm ./dist/enable-contributor-uploads/package.json +rm ./dist/enable-contributor-uploads/README.md + +#remove the original zip +rm enable-contributor-uploads.zip + +#move into the dist folder and zip the plugin's folder +cd ./dist +zip -r enable-contributor-uploads.zip ./enable-contributor-uploads + +#cleanup and drop back into the original dir +rm -r ./enable-contributor-uploads +cd .. diff --git a/tests/bin/install-wp-tests.sh b/tests/bin/install-wp-tests.sh new file mode 100755 index 0000000..c941f8e --- /dev/null +++ b/tests/bin/install-wp-tests.sh @@ -0,0 +1,181 @@ +#!/usr/bin/env bash + +if [ $# -lt 3 ]; then + echo "usage: $0 [db-host] [wp-version] [skip-database-creation]" + exit 1 +fi + +DB_NAME=$1 +DB_USER=$2 +DB_PASS=$3 +DB_HOST=${4-localhost} +WP_VERSION=${5-latest} +SKIP_DB_CREATE=${6-false} + +TMPDIR=${TMPDIR-/tmp} +TMPDIR=$(echo $TMPDIR | sed -e "s/\/$//") +WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib} +WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress} + +download() { + if [ `which curl` ]; then + curl -s "$1" > "$2"; + elif [ `which wget` ]; then + wget -nv -O "$2" "$1" + fi +} + +if [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+\-(beta|RC)[0-9]+$ ]]; then + WP_BRANCH=${WP_VERSION%\-*} + WP_TESTS_TAG="branches/$WP_BRANCH" + +elif [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+$ ]]; then + WP_TESTS_TAG="branches/$WP_VERSION" +elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then + if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then + # version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x + WP_TESTS_TAG="tags/${WP_VERSION%??}" + else + WP_TESTS_TAG="tags/$WP_VERSION" + fi +elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then + WP_TESTS_TAG="trunk" +else + # http serves a single offer, whereas https serves multiple. we only want one + download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json + grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json + LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//') + if [[ -z "$LATEST_VERSION" ]]; then + echo "Latest WordPress version could not be found" + exit 1 + fi + WP_TESTS_TAG="tags/$LATEST_VERSION" +fi +set -ex + +install_wp() { + + if [ -d $WP_CORE_DIR ]; then + return; + fi + + mkdir -p $WP_CORE_DIR + + if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then + mkdir -p $TMPDIR/wordpress-trunk + rm -rf $TMPDIR/wordpress-trunk/* + svn export https://core.svn.wordpress.org/trunk $TMPDIR/wordpress-trunk/wordpress + mv $TMPDIR/wordpress-trunk/wordpress/* $WP_CORE_DIR + else + if [ $WP_VERSION == 'latest' ]; then + local ARCHIVE_NAME='latest' + elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+ ]]; then + # https serves multiple offers, whereas http serves single. + download https://api.wordpress.org/core/version-check/1.7/ $TMPDIR/wp-latest.json + if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then + # version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x + LATEST_VERSION=${WP_VERSION%??} + else + # otherwise, scan the releases and get the most up to date minor version of the major release + local VERSION_ESCAPED=`echo $WP_VERSION | sed 's/\./\\\\./g'` + LATEST_VERSION=$(grep -o '"version":"'$VERSION_ESCAPED'[^"]*' $TMPDIR/wp-latest.json | sed 's/"version":"//' | head -1) + fi + if [[ -z "$LATEST_VERSION" ]]; then + local ARCHIVE_NAME="wordpress-$WP_VERSION" + else + local ARCHIVE_NAME="wordpress-$LATEST_VERSION" + fi + else + local ARCHIVE_NAME="wordpress-$WP_VERSION" + fi + download https://wordpress.org/${ARCHIVE_NAME}.tar.gz $TMPDIR/wordpress.tar.gz + tar --strip-components=1 -zxmf $TMPDIR/wordpress.tar.gz -C $WP_CORE_DIR + fi + + download https://raw.githubusercontent.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php +} + +install_test_suite() { + # portable in-place argument for both GNU sed and Mac OSX sed + if [[ $(uname -s) == 'Darwin' ]]; then + local ioption='-i.bak' + else + local ioption='-i' + fi + + # set up testing suite if it doesn't yet exist + if [ ! -d $WP_TESTS_DIR ]; then + # set up testing suite + mkdir -p $WP_TESTS_DIR + rm -rf $WP_TESTS_DIR/{includes,data} + svn export --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes + svn export --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data + fi + + if [ ! -f wp-tests-config.php ]; then + download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php + # remove all forward slashes in the end + WP_CORE_DIR=$(echo $WP_CORE_DIR | sed "s:/\+$::") + sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s:__DIR__ . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php + fi + +} + +recreate_db() { + shopt -s nocasematch + if [[ $1 =~ ^(y|yes)$ ]] + then + mysqladmin drop $DB_NAME -f --user="$DB_USER" --password="$DB_PASS"$EXTRA + create_db + echo "Recreated the database ($DB_NAME)." + else + echo "Leaving the existing database ($DB_NAME) in place." + fi + shopt -u nocasematch +} + +create_db() { + mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA +} + +install_db() { + + if [ ${SKIP_DB_CREATE} = "true" ]; then + return 0 + fi + + # parse DB_HOST for port or socket references + local PARTS=(${DB_HOST//\:/ }) + local DB_HOSTNAME=${PARTS[0]}; + local DB_SOCK_OR_PORT=${PARTS[1]}; + local EXTRA="" + + if ! [ -z $DB_HOSTNAME ] ; then + if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then + EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp" + elif ! [ -z $DB_SOCK_OR_PORT ] ; then + EXTRA=" --socket=$DB_SOCK_OR_PORT" + elif ! [ -z $DB_HOSTNAME ] ; then + EXTRA=" --host=$DB_HOSTNAME --protocol=tcp" + fi + fi + + # create database + if [ $(mysql --user="$DB_USER" --password="$DB_PASS"$EXTRA --execute='show databases;' | grep ^$DB_NAME$) ] + then + echo "Reinstalling will delete the existing test database ($DB_NAME)" + read -p 'Are you sure you want to proceed? [y/N]: ' DELETE_EXISTING_DB + recreate_db $DELETE_EXISTING_DB + else + create_db + fi +} + +install_wp +install_test_suite +install_db diff --git a/tests/bootstrap-dev.php b/tests/bootstrap-dev.php new file mode 100644 index 0000000..7050b0f --- /dev/null +++ b/tests/bootstrap-dev.php @@ -0,0 +1,12 @@ + Date: Sun, 3 Mar 2024 23:03:48 -0500 Subject: [PATCH 03/26] removed - cs step --- .github/workflows/cs.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/cs.yml b/.github/workflows/cs.yml index de14a3f..7290ebe 100644 --- a/.github/workflows/cs.yml +++ b/.github/workflows/cs.yml @@ -26,9 +26,6 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Run custom composer script - run: ./run-composer.sh - - name: Install PHP uses: shivammathur/setup-php@v2 with: From 61dc6cac4720383f030c7fb0eebed2256e8671f4 Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Sun, 3 Mar 2024 23:06:43 -0500 Subject: [PATCH 04/26] updated - bootstrap path --- tests/bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 9b080e7..c75ec27 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -28,7 +28,7 @@ * Manually load the plugin being tested. */ function _manually_load_plugin() { - require dirname( __DIR__ ) . '/accessibility-checker.php'; + require dirname( __DIR__ ) . '/enable-contributor-uploads.php'; } tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' ); From f52d149beee6f1e72ee7177e718b6f1396791516 Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Sun, 3 Mar 2024 23:24:26 -0500 Subject: [PATCH 05/26] added - README.md --- README.md | 46 +++++++++++++++++++++++++++++++++++++++++ phpcs.xml | 6 +++--- tests/bootstrap-dev.php | 2 +- tests/bootstrap.php | 2 +- 4 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..2dfc960 --- /dev/null +++ b/README.md @@ -0,0 +1,46 @@ +[![CS](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/cs.yml/badge.svg)](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/cs.yml) +[![Lint](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/lint-php.yml/badge.svg)](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/lint-php.yml) +[![Security](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/security.yml/badge.svg)](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/security.yml) +[![Test](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/phpunit.yml/badge.svg)](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/phpunit.yml) + +# Equalize Digital Enable Contributor Uploads + +## What is this? +Easy plugin which adds the capability for contributors to upload images to their blog posts. + +* [Plugin Website](https://equalizedigital.com) + +## Want to contribute? + +### Prerequisites +At Equalize Digital, we make use of a specific toolset to develop our code. Please ensure you have the following tools installed before contributing. + +* [Composer](https://getcomposer.org/) +* [NPM](https://www.npmjs.com/) + +### Getting started + +Check out this repository from GitHub, then run: + +```shell +composer install +npm install +``` + +### Package scripts +- `npm run lint` - lints the plugin's PHP +- `npm run lint:fix` - fixes linting issues in the plugin's PHP +- `npm run dist` - builds a distributable .zip for the plugin into ./dist + +## Support + +This is a developer portal for Enable Contributor Uploads and should not be used for support. Please visit the [support forums](https://wordpress.org/plugins/enable-contributor-uploads/) for support. + +## Contributions + +Anyone is welcome to contribute to Enable Contributor Uploads. Please [read the guidelines](.github/CONTRIBUTING.md) for contributing to this repository. + +There are various ways you can contribute: + +* [Raise an issue](https://github.com/equalizedigital/enable-contributor-uploads/issues) on GitHub. +* Send us a Pull Request with your bug fixes and/or new features. diff --git a/phpcs.xml b/phpcs.xml index 79fdbf2..deeb903 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,6 +1,6 @@ - - Accessibility Checker Wordpress Coding Standards + + Enable Contributor Uploads Wordpress Coding Standards . @@ -47,7 +47,7 @@ - + diff --git a/tests/bootstrap-dev.php b/tests/bootstrap-dev.php index 7050b0f..e6ed05e 100644 --- a/tests/bootstrap-dev.php +++ b/tests/bootstrap-dev.php @@ -2,7 +2,7 @@ /** * PHPUnit bootstrap file for local dev testing. * - * @package Accessibility_Checker + * @package Enable_Contributor_Uploads */ /** diff --git a/tests/bootstrap.php b/tests/bootstrap.php index c75ec27..014f970 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -2,7 +2,7 @@ /** * PHPUnit bootstrap file. * - * @package Accessibility_Checker + * @package Enable_Contributor_Uploads */ $_tests_dir = getenv( 'WP_TESTS_DIR' ); From bf9db0cf9be7f0c510d2aab978efa639c58c395d Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Sun, 3 Mar 2024 23:25:10 -0500 Subject: [PATCH 06/26] updated - url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2dfc960..29b6a07 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![CS](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/cs.yml/badge.svg)](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/cs.yml) -[![Lint](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/lint-php.yml/badge.svg)](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/lint-php.yml) +[![Lint](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/lint.yml/badge.svg)](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/lint.yml) [![Security](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/security.yml/badge.svg)](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/security.yml) [![Test](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/phpunit.yml/badge.svg)](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/phpunit.yml) From 532d9abaf1573d8599d7bbb67b3714f8441ff5fa Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Sun, 3 Mar 2024 23:27:39 -0500 Subject: [PATCH 07/26] Removed - lint badge --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 29b6a07..498cd53 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ [![CS](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/cs.yml/badge.svg)](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/cs.yml) -[![Lint](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/lint.yml/badge.svg)](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/lint.yml) [![Security](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/security.yml/badge.svg)](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/security.yml) [![Test](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/phpunit.yml/badge.svg)](https://github.com/equalizedigital/enable-contributor-uploads/actions/workflows/phpunit.yml) -# Equalize Digital Enable Contributor Uploads +# Enable Contributor Uploads ## What is this? Easy plugin which adds the capability for contributors to upload images to their blog posts. From ca6d06ba8c6c026be344e1173152482e6807a529 Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Mon, 4 Mar 2024 00:07:12 -0500 Subject: [PATCH 08/26] added - unit tests --- composer.json | 4 +- enable-contributor-uploads.php | 79 +++-------------------- inc/class-plugin.php | 78 +++++++++++++++++++++++ tests/phpunit/edecdu-plugin-test.php | 93 ++++++++++++++++++++++++++++ 4 files changed, 183 insertions(+), 71 deletions(-) create mode 100644 inc/class-plugin.php create mode 100644 tests/phpunit/edecdu-plugin-test.php diff --git a/composer.json b/composer.json index 28e5806..a6b7f60 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,9 @@ "composer/installers": "^1.12.0" }, "autoload": { - "classmap": [] + "classmap": [ + "inc" + ] }, "autoload-dev": { "classmap": [] diff --git a/enable-contributor-uploads.php b/enable-contributor-uploads.php index f9f7c63..89069a6 100644 --- a/enable-contributor-uploads.php +++ b/enable-contributor-uploads.php @@ -18,80 +18,19 @@ * Text Domain: enable-contributor-uploads */ +use EDECU\Inc\Plugin; + // If this file is called directly, abort. if ( ! defined( 'WPINC' ) ) { die; } -/** - * Class EnableContributorUploads - * - * Main plugin class. - */ -class EnableContributorUploads { - - /** - * Constructor. - */ - public function __construct() { - // Intentionally left blank. - } - - /** - * Initialize the plugin. - * - * Registers activation and deactivation hooks, and adds action to load text domain. - */ - public function init() { - register_activation_hook( __FILE__, array( $this, 'activate' ) ); - register_deactivation_hook( __FILE__, array( $this, 'deactivate' ) ); - add_action( 'init', array( $this, 'load_textdomain' ) ); - } - - /** - * Handles tasks to perform upon plugin activation. - * - * Adds the 'upload_files' capability to the 'contributor' role. - */ - public function activate() { - $contributor = get_role( 'contributor' ); - if ( null !== $contributor ) { - $contributor->add_cap( 'upload_files' ); - } - } - - /** - * Handles tasks to perform upon plugin deactivation. - * - * Removes the 'upload_files' capability from the 'contributor' role. - */ - public function deactivate() { - $contributor = get_role( 'contributor' ); - if ( null !== $contributor ) { - $contributor->remove_cap( 'upload_files' ); - } - } - - /** - * Load the plugin text domain for translation. - */ - public function load_textdomain() { - load_plugin_textdomain( 'enable-contributor-uploads', false, basename( __DIR__ ) . '/languages' ); - } - - /** - * Handles tasks to perform upon plugin uninstallation. - * - * Removes the 'upload_files' capability from the 'contributor' role. - * Note: This method should be called statically and is intended for registration with register_uninstall_hook. - */ - public static function uninstall() { - $contributor = get_role( 'contributor' ); - if ( null !== $contributor ) { - $contributor->remove_cap( 'upload_files' ); - } - } +// Autoloads classes from the 'inc' directory. +if ( file_exists( plugin_dir_path( __FILE__ ) . 'vendor/autoload.php' ) ) { + include_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php'; } -// Instantiating the class and calling the init method in one line. -( new EnableContributorUploads() )->init(); +// Initialize the plugin. +if ( class_exists( 'EDAC\Inc\Plugin' ) ) { + ( new Plugin() )->init(); +} diff --git a/inc/class-plugin.php b/inc/class-plugin.php new file mode 100644 index 0000000..13c5546 --- /dev/null +++ b/inc/class-plugin.php @@ -0,0 +1,78 @@ +add_cap( 'upload_files' ); + } + } + + /** + * Handles tasks to perform upon plugin deactivation. + * + * Removes the 'upload_files' capability from the 'contributor' role. + */ + public function deactivate() { + $contributor = get_role( 'contributor' ); + if ( null !== $contributor ) { + $contributor->remove_cap( 'upload_files' ); + } + } + + /** + * Load the plugin text domain for translation. + */ + public function load_textdomain() { + load_plugin_textdomain( 'enable-contributor-uploads', false, basename( __DIR__ ) . '/languages' ); + } + + /** + * Handles tasks to perform upon plugin uninstallation. + * + * Removes the 'upload_files' capability from the 'contributor' role. + * Note: This method should be called statically and is intended for registration with register_uninstall_hook. + */ + public static function uninstall() { + $contributor = get_role( 'contributor' ); + if ( null !== $contributor ) { + $contributor->remove_cap( 'upload_files' ); + } + } +} diff --git a/tests/phpunit/edecdu-plugin-test.php b/tests/phpunit/edecdu-plugin-test.php new file mode 100644 index 0000000..7d1e648 --- /dev/null +++ b/tests/phpunit/edecdu-plugin-test.php @@ -0,0 +1,93 @@ +plugin = new Plugin(); + } + + /** + * Test teardown. + */ + public function tearDown() { + parent::tearDown(); + unset( $this->plugin ); + } + + /** + * Test initialization of the plugin. + */ + public function test_init() { + // Simulate the plugin initialization. + $this->plugin->init(); + + // Assert that the textdomain is loaded. + $this->assertTrue( is_textdomain_loaded( 'enable-contributor-uploads' ), 'Text domain should be loaded' ); + } + + /** + * Test plugin activation. + */ + public function test_activate() { + // Activate the plugin. + $this->plugin->activate(); + + // Retrieve the 'contributor' role. + $contributor = get_role( 'contributor' ); + + // Assert that 'upload_files' capability is added to 'contributor' role. + $this->assertTrue( $contributor->has_cap( 'upload_files' ), 'Contributor role should have the upload_files capability after activation' ); + } + + /** + * Test plugin deactivation. + */ + public function test_deactivate() { + // First, activate the plugin to ensure 'contributor' has the 'upload_files' capability. + $this->plugin->activate(); + + // Then, deactivate the plugin. + $this->plugin->deactivate(); + + // Retrieve the 'contributor' role again. + $contributor = get_role( 'contributor' ); + + // Assert that 'upload_files' capability is removed from 'contributor' role. + $this->assertFalse( $contributor->has_cap( 'upload_files' ), 'Contributor role should not have the upload_files capability after deactivation' ); + } + + /** + * Test plugin uninstallation. + */ + public function test_uninstall() { + // Simulate plugin uninstallation. + Plugin::uninstall(); + + // Retrieve the 'contributor' role. + $contributor = get_role( 'contributor' ); + + // Assert that 'upload_files' capability is removed from 'contributor' role. + $this->assertFalse( $contributor->has_cap( 'upload_files' ), 'Contributor role should not have the upload_files capability after uninstallation' ); + } +} From d0b317459f4c8d6bd56aad821d200e0494ae4ee6 Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Mon, 4 Mar 2024 00:12:29 -0500 Subject: [PATCH 09/26] updated - test file name --- tests/phpunit/{edecdu-plugin-test.php => test-plugin.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/phpunit/{edecdu-plugin-test.php => test-plugin.php} (100%) diff --git a/tests/phpunit/edecdu-plugin-test.php b/tests/phpunit/test-plugin.php similarity index 100% rename from tests/phpunit/edecdu-plugin-test.php rename to tests/phpunit/test-plugin.php From b0e15123e3503f11a80ae08f757e3ffe6035b4fd Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Mon, 4 Mar 2024 00:17:08 -0500 Subject: [PATCH 10/26] included - void --- tests/phpunit/test-plugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/test-plugin.php b/tests/phpunit/test-plugin.php index 7d1e648..b53b83f 100644 --- a/tests/phpunit/test-plugin.php +++ b/tests/phpunit/test-plugin.php @@ -22,7 +22,7 @@ class EDECU_Plugin_Test extends WP_UnitTestCase { /** * Test setup. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->plugin = new Plugin(); } @@ -30,7 +30,7 @@ public function setUp() { /** * Test teardown. */ - public function tearDown() { + public function tearDown(): void { parent::tearDown(); unset( $this->plugin ); } From e4500e6a3fd87fc29ee7e4bc9020e63ead949203 Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Mon, 4 Mar 2024 00:32:01 -0500 Subject: [PATCH 11/26] removed - load_plugin_textdomain method and test --- inc/class-plugin.php | 8 -------- tests/phpunit/test-plugin.php | 27 ++++++--------------------- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/inc/class-plugin.php b/inc/class-plugin.php index 13c5546..03f185d 100644 --- a/inc/class-plugin.php +++ b/inc/class-plugin.php @@ -29,7 +29,6 @@ public function __construct() { public function init() { register_activation_hook( __FILE__, array( $this, 'activate' ) ); register_deactivation_hook( __FILE__, array( $this, 'deactivate' ) ); - add_action( 'init', array( $this, 'load_textdomain' ) ); } /** @@ -56,13 +55,6 @@ public function deactivate() { } } - /** - * Load the plugin text domain for translation. - */ - public function load_textdomain() { - load_plugin_textdomain( 'enable-contributor-uploads', false, basename( __DIR__ ) . '/languages' ); - } - /** * Handles tasks to perform upon plugin uninstallation. * diff --git a/tests/phpunit/test-plugin.php b/tests/phpunit/test-plugin.php index b53b83f..8197585 100644 --- a/tests/phpunit/test-plugin.php +++ b/tests/phpunit/test-plugin.php @@ -39,55 +39,40 @@ public function tearDown(): void { * Test initialization of the plugin. */ public function test_init() { - // Simulate the plugin initialization. $this->plugin->init(); - - // Assert that the textdomain is loaded. - $this->assertTrue( is_textdomain_loaded( 'enable-contributor-uploads' ), 'Text domain should be loaded' ); } /** * Test plugin activation. + * + * Activating the plugin should add the 'upload_files' capability to the 'contributor' role. */ public function test_activate() { - // Activate the plugin. $this->plugin->activate(); - - // Retrieve the 'contributor' role. $contributor = get_role( 'contributor' ); - - // Assert that 'upload_files' capability is added to 'contributor' role. $this->assertTrue( $contributor->has_cap( 'upload_files' ), 'Contributor role should have the upload_files capability after activation' ); } /** * Test plugin deactivation. + * + * Deactivating the plugin should remove the 'upload_files' capability from the 'contributor' role. */ public function test_deactivate() { - // First, activate the plugin to ensure 'contributor' has the 'upload_files' capability. $this->plugin->activate(); - - // Then, deactivate the plugin. $this->plugin->deactivate(); - - // Retrieve the 'contributor' role again. $contributor = get_role( 'contributor' ); - - // Assert that 'upload_files' capability is removed from 'contributor' role. $this->assertFalse( $contributor->has_cap( 'upload_files' ), 'Contributor role should not have the upload_files capability after deactivation' ); } /** * Test plugin uninstallation. + * + * Uninstalling the plugin should remove the 'upload_files' capability from the 'contributor' role. */ public function test_uninstall() { - // Simulate plugin uninstallation. Plugin::uninstall(); - - // Retrieve the 'contributor' role. $contributor = get_role( 'contributor' ); - - // Assert that 'upload_files' capability is removed from 'contributor' role. $this->assertFalse( $contributor->has_cap( 'upload_files' ), 'Contributor role should not have the upload_files capability after uninstallation' ); } } From b2d4a6ba76c42f80c9cb086fc80878dbff2e8259 Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Mon, 4 Mar 2024 00:39:40 -0500 Subject: [PATCH 12/26] added - assertion to test_init --- tests/phpunit/test-plugin.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/phpunit/test-plugin.php b/tests/phpunit/test-plugin.php index 8197585..afc3614 100644 --- a/tests/phpunit/test-plugin.php +++ b/tests/phpunit/test-plugin.php @@ -40,6 +40,7 @@ public function tearDown(): void { */ public function test_init() { $this->plugin->init(); + $this->assertNotNull( $this->plugin, 'Plugin should be initialized.' ); } /** From fe938b60fab48d33546f0be5fcc090c183345ed2 Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Mon, 4 Mar 2024 00:45:24 -0500 Subject: [PATCH 13/26] updated - dist files --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 073dcce..aac0ef0 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "files": [ "LICENSE.txt", "readme.txt", - "enable-contributor-uploads.php" + "enable-contributor-uploads.php", + "inc" ], "devDependencies": { "@wordpress/scripts": "^26.5.0", From 85547a21dd55845e6e65839b1b29ef738bf3813a Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Thu, 7 Mar 2024 00:28:23 -0500 Subject: [PATCH 14/26] fixed - class namespace --- composer.lock | 12 ++++++------ enable-contributor-uploads.php | 7 ++++++- inc/class-plugin.php | 4 ++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/composer.lock b/composer.lock index a6375e1..d224b10 100644 --- a/composer.lock +++ b/composer.lock @@ -671,16 +671,16 @@ }, { "name": "nikic/php-parser", - "version": "v5.0.1", + "version": "v5.0.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "2218c2252c874a4624ab2f613d86ac32d227bc69" + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/2218c2252c874a4624ab2f613d86ac32d227bc69", - "reference": "2218c2252c874a4624ab2f613d86ac32d227bc69", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", "shasum": "" }, "require": { @@ -723,9 +723,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" }, - "time": "2024-02-21T19:24:10+00:00" + "time": "2024-03-05T20:51:40+00:00" }, { "name": "phar-io/manifest", diff --git a/enable-contributor-uploads.php b/enable-contributor-uploads.php index 89069a6..6693186 100644 --- a/enable-contributor-uploads.php +++ b/enable-contributor-uploads.php @@ -25,12 +25,17 @@ die; } +// Plugin Root File. +if ( ! defined( 'EDECU_PLUGIN_FILE' ) ) { + define( 'EDECU_PLUGIN_FILE', __FILE__ ); +} + // Autoloads classes from the 'inc' directory. if ( file_exists( plugin_dir_path( __FILE__ ) . 'vendor/autoload.php' ) ) { include_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php'; } // Initialize the plugin. -if ( class_exists( 'EDAC\Inc\Plugin' ) ) { +if ( class_exists( 'EDECU\Inc\Plugin' ) ) { ( new Plugin() )->init(); } diff --git a/inc/class-plugin.php b/inc/class-plugin.php index 03f185d..c7bbdc3 100644 --- a/inc/class-plugin.php +++ b/inc/class-plugin.php @@ -27,8 +27,8 @@ public function __construct() { * Registers activation and deactivation hooks, and adds action to load text domain. */ public function init() { - register_activation_hook( __FILE__, array( $this, 'activate' ) ); - register_deactivation_hook( __FILE__, array( $this, 'deactivate' ) ); + register_activation_hook( EDECU_PLUGIN_FILE, array( $this, 'activate' ) ); + register_deactivation_hook( EDECU_PLUGIN_FILE, array( $this, 'deactivate' ) ); } /** From 156e4c9722cb79fd988122171db0f6e01f828d7b Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Wed, 5 Jun 2024 19:50:59 -0400 Subject: [PATCH 15/26] updated - readme --- readme.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/readme.txt b/readme.txt index 866c917..6af75e6 100644 --- a/readme.txt +++ b/readme.txt @@ -1,8 +1,8 @@ === Enable Contributor Uploads === Contributors: equalizedigital, alh0319, stevejonesdev Tags: user roles, capabilities, contributor, upload media, enable uploads -Requires at least: 6.2 -Tested up to: 6.4.3 +Requires at least: 6.3 +Tested up to: 6.5.4 Stable tag: 1.2.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -43,7 +43,13 @@ We recommend you check out other plugins in the WordPress repository. At this t == Changelog == = 1.2.0 = - +* Added: class structure +* Added: autoloader +* Added: linting scripts and workflows +* Added: testing framework +* Added: a check for uninstall that removes the upload_files capability +* Added: unit tests +* Added: distribution script = 1.1.0 = * Update upload capability to be added and removed from contributors only on plugin activation and deactivation. From 50978f6251b1d318dd3c84aeb8ccc353ed0f417e Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Wed, 5 Jun 2024 19:53:50 -0400 Subject: [PATCH 16/26] updated - dist to include vendor folder --- scripts/dist.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/scripts/dist.sh b/scripts/dist.sh index 5bd2480..ddc937e 100755 --- a/scripts/dist.sh +++ b/scripts/dist.sh @@ -1,24 +1,36 @@ -#Remove the contents of the dist folder +# Remove the contents of the dist folder rm -frd ./dist mkdir ./dist -#Run the wp script that produces the zip +# Ensure the vendor folder is present in the current directory +if [ ! -d "./vendor" ]; then + echo "Vendor folder not found. Exiting." + exit 1 +fi + +# Run the wp script that produces the zip npx wp-scripts plugin-zip -# unzip the zip into its own folder so we can zip that +# Unzip the zip into its own folder so we can zip that unzip enable-contributor-uploads.zip -d ./dist/enable-contributor-uploads +# Check if vendor folder is present in the unzipped content +if [ ! -d "./dist/enable-contributor-uploads/vendor" ]; then + echo "Vendor folder is missing in the unzipped content. Adding it manually." + cp -r ./vendor ./dist/enable-contributor-uploads/vendor +fi + # plugin-zip includes package.json which is not needed for the plugin, so remove. rm ./dist/enable-contributor-uploads/package.json rm ./dist/enable-contributor-uploads/README.md -#remove the original zip +# Remove the original zip rm enable-contributor-uploads.zip -#move into the dist folder and zip the plugin's folder +# Move into the dist folder and zip the plugin's folder cd ./dist zip -r enable-contributor-uploads.zip ./enable-contributor-uploads -#cleanup and drop back into the original dir +# Cleanup and drop back into the original dir rm -r ./enable-contributor-uploads cd .. From 9b96ad154fa869cac5b642ba7010ae824a44609f Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Wed, 5 Jun 2024 19:54:14 -0400 Subject: [PATCH 17/26] updated - composer --- composer.lock | 216 +++++++++++++++++++++++++++++--------------------- 1 file changed, 126 insertions(+), 90 deletions(-) diff --git a/composer.lock b/composer.lock index d224b10..61d8704 100644 --- a/composer.lock +++ b/composer.lock @@ -209,32 +209,32 @@ }, { "name": "automattic/vipwpcs", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/Automattic/VIP-Coding-Standards.git", - "reference": "1b8960ebff9ea3eb482258a906ece4d1ee1e25fd" + "reference": "2b1d206d81b74ed999023cffd924f862ff2753c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/1b8960ebff9ea3eb482258a906ece4d1ee1e25fd", - "reference": "1b8960ebff9ea3eb482258a906ece4d1ee1e25fd", + "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/2b1d206d81b74ed999023cffd924f862ff2753c8", + "reference": "2b1d206d81b74ed999023cffd924f862ff2753c8", "shasum": "" }, "require": { "php": ">=5.4", - "phpcsstandards/phpcsextra": "^1.1.0", - "phpcsstandards/phpcsutils": "^1.0.8", - "sirbrillig/phpcs-variable-analysis": "^2.11.17", - "squizlabs/php_codesniffer": "^3.7.2", - "wp-coding-standards/wpcs": "^3.0" + "phpcsstandards/phpcsextra": "^1.2.1", + "phpcsstandards/phpcsutils": "^1.0.11", + "sirbrillig/phpcs-variable-analysis": "^2.11.18", + "squizlabs/php_codesniffer": "^3.9.2", + "wp-coding-standards/wpcs": "^3.1.0" }, "require-dev": { "php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9", "phpcsstandards/phpcsdevtools": "^1.0", - "phpunit/phpunit": "^4 || ^5 || ^6 || ^7" + "phpunit/phpunit": "^4 || ^5 || ^6 || ^7 || ^8 || ^9" }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", @@ -259,7 +259,7 @@ "source": "https://github.com/Automattic/VIP-Coding-Standards", "wiki": "https://github.com/Automattic/VIP-Coding-Standards/wiki" }, - "time": "2023-09-05T11:01:05+00:00" + "time": "2024-05-10T20:31:09+00:00" }, { "name": "brain/monkey", @@ -529,16 +529,16 @@ }, { "name": "mockery/mockery", - "version": "1.6.7", + "version": "1.6.12", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "0cc058854b3195ba21dc6b1f7b1f60f4ef3a9c06" + "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/0cc058854b3195ba21dc6b1f7b1f60f4ef3a9c06", - "reference": "0cc058854b3195ba21dc6b1f7b1f60f4ef3a9c06", + "url": "https://api.github.com/repos/mockery/mockery/zipball/1f4efdd7d3beafe9807b08156dfcb176d18f1699", + "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699", "shasum": "" }, "require": { @@ -550,8 +550,8 @@ "phpunit/phpunit": "<8.0" }, "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.6.10", - "symplify/easy-coding-standard": "^12.0.8" + "phpunit/phpunit": "^8.5 || ^9.6.17", + "symplify/easy-coding-standard": "^12.1.14" }, "type": "library", "autoload": { @@ -608,7 +608,7 @@ "security": "https://github.com/mockery/mockery/security/advisories", "source": "https://github.com/mockery/mockery" }, - "time": "2023-12-10T02:24:34+00:00" + "time": "2024-05-16T03:13:13+00:00" }, { "name": "myclabs/deep-copy", @@ -847,16 +847,16 @@ }, { "name": "php-parallel-lint/php-parallel-lint", - "version": "v1.3.2", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", - "reference": "6483c9832e71973ed29cf71bd6b3f4fde438a9de" + "reference": "6db563514f27e19595a19f45a4bf757b6401194e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6483c9832e71973ed29cf71bd6b3f4fde438a9de", - "reference": "6483c9832e71973ed29cf71bd6b3f4fde438a9de", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6db563514f27e19595a19f45a4bf757b6401194e", + "reference": "6db563514f27e19595a19f45a4bf757b6401194e", "shasum": "" }, "require": { @@ -894,13 +894,17 @@ "email": "ahoj@jakubonderka.cz" } ], - "description": "This tool check syntax of PHP files about 20x faster than serial check.", + "description": "This tool checks the syntax of PHP files about 20x faster than serial check.", "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", + "keywords": [ + "lint", + "static analysis" + ], "support": { "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", - "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.3.2" + "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.4.0" }, - "time": "2022-02-21T12:50:22+00:00" + "time": "2024-03-27T12:14:49+00:00" }, { "name": "phpcompatibility/php-compatibility", @@ -966,28 +970,28 @@ }, { "name": "phpcompatibility/phpcompatibility-paragonie", - "version": "1.3.2", + "version": "1.3.3", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", - "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26" + "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", - "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/293975b465e0e709b571cbf0c957c6c0a7b9a2ac", + "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac", "shasum": "" }, "require": { "phpcompatibility/php-compatibility": "^9.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", "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.", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || 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", @@ -1017,22 +1021,37 @@ ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" }, - "time": "2022-10-25T01:46:02+00:00" + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-04-24T21:30:46+00:00" }, { "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.4", + "version": "2.1.5", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5" + "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", - "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/01c1ff2704a58e46f0cb1ca9d06aee07b3589082", + "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082", "shasum": "" }, "require": { @@ -1040,10 +1059,10 @@ "phpcompatibility/phpcompatibility-paragonie": "^1.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7" + "dealerdirect/phpcodesniffer-composer-installer": "^1.0" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || 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", @@ -1072,9 +1091,24 @@ ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy", "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" }, - "time": "2022-10-24T09:00:36+00:00" + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-04-24T21:37:59+00:00" }, { "name": "phpcsstandards/phpcsextra", @@ -1156,22 +1190,22 @@ }, { "name": "phpcsstandards/phpcsutils", - "version": "1.0.9", + "version": "1.0.12", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", - "reference": "908247bc65010c7b7541a9551e002db12e9dae70" + "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/908247bc65010c7b7541a9551e002db12e9dae70", - "reference": "908247bc65010c7b7541a9551e002db12e9dae70", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/87b233b00daf83fb70f40c9a28692be017ea7c6c", + "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.8.0 || 4.0.x-dev@dev" + "squizlabs/php_codesniffer": "^3.10.0 || 4.0.x-dev@dev" }, "require-dev": { "ext-filter": "*", @@ -1240,7 +1274,7 @@ "type": "open_collective" } ], - "time": "2023-12-08T14:50:00+00:00" + "time": "2024-05-20T13:34:27+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1563,16 +1597,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.17", + "version": "9.6.19", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "1a156980d78a6666721b7e8e8502fe210b587fcd" + "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1a156980d78a6666721b7e8e8502fe210b587fcd", - "reference": "1a156980d78a6666721b7e8e8502fe210b587fcd", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1a54a473501ef4cdeaae4e06891674114d79db8", + "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8", "shasum": "" }, "require": { @@ -1646,7 +1680,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.17" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.19" }, "funding": [ { @@ -1662,7 +1696,7 @@ "type": "tidelift" } ], - "time": "2024-02-23T13:14:51+00:00" + "time": "2024-04-05T04:35:58+00:00" }, { "name": "sebastian/cli-parser", @@ -2466,16 +2500,16 @@ }, { "name": "sebastian/resource-operations", - "version": "3.0.3", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", "shasum": "" }, "require": { @@ -2487,7 +2521,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -2508,8 +2542,7 @@ "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" }, "funding": [ { @@ -2517,7 +2550,7 @@ "type": "github" } ], - "time": "2020-09-28T06:45:17+00:00" + "time": "2024-03-14T16:00:52+00:00" }, { "name": "sebastian/type", @@ -2630,16 +2663,16 @@ }, { "name": "sirbrillig/phpcs-variable-analysis", - "version": "v2.11.17", + "version": "v2.11.18", "source": { "type": "git", "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", - "reference": "3b71162a6bf0cde2bff1752e40a1788d8273d049" + "reference": "ca242a0b7309e0f9d1f73b236e04ecf4ca3248d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/3b71162a6bf0cde2bff1752e40a1788d8273d049", - "reference": "3b71162a6bf0cde2bff1752e40a1788d8273d049", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/ca242a0b7309e0f9d1f73b236e04ecf4ca3248d0", + "reference": "ca242a0b7309e0f9d1f73b236e04ecf4ca3248d0", "shasum": "" }, "require": { @@ -2684,20 +2717,20 @@ "source": "https://github.com/sirbrillig/phpcs-variable-analysis", "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" }, - "time": "2023-08-05T23:46:11+00:00" + "time": "2024-04-13T16:42:46+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.9.0", + "version": "3.10.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b" + "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/d63cee4890a8afaf86a22e51ad4d97c91dd4579b", - "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/8f90f7a53ce271935282967f53d0894f8f1ff877", + "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877", "shasum": "" }, "require": { @@ -2764,7 +2797,7 @@ "type": "open_collective" } ], - "time": "2024-02-16T15:06:51+00:00" + "time": "2024-05-22T21:24:41+00:00" }, { "name": "theseer/tokenizer", @@ -2818,16 +2851,16 @@ }, { "name": "wp-coding-standards/wpcs", - "version": "3.0.1", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1" + "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/b4caf9689f1a0e4a4c632679a44e638c1c67aff1", - "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/9333efcbff231f10dfd9c56bb7b65818b4733ca7", + "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7", "shasum": "" }, "require": { @@ -2836,16 +2869,16 @@ "ext-tokenizer": "*", "ext-xmlreader": "*", "php": ">=5.4", - "phpcsstandards/phpcsextra": "^1.1.0", - "phpcsstandards/phpcsutils": "^1.0.8", - "squizlabs/php_codesniffer": "^3.7.2" + "phpcsstandards/phpcsextra": "^1.2.1", + "phpcsstandards/phpcsutils": "^1.0.10", + "squizlabs/php_codesniffer": "^3.9.0" }, "require-dev": { "php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9.0", "phpcsstandards/phpcsdevtools": "^1.2.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "suggest": { "ext-iconv": "For improved results", @@ -2876,24 +2909,24 @@ }, "funding": [ { - "url": "https://opencollective.com/thewpcc/contribute/wp-php-63406", + "url": "https://opencollective.com/php_codesniffer", "type": "custom" } ], - "time": "2023-09-14T07:06:09+00:00" + "time": "2024-03-25T16:39:00+00:00" }, { "name": "wp-phpunit/wp-phpunit", - "version": "6.4.2", + "version": "6.5.3", "source": { "type": "git", "url": "https://github.com/wp-phpunit/wp-phpunit.git", - "reference": "aa3c8f5d1b7efc295fd2b37c7264d2356a8c1099" + "reference": "ef2cb44c0d991ac0c3a7a3ed0d2d1cf3fe8d8f2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-phpunit/wp-phpunit/zipball/aa3c8f5d1b7efc295fd2b37c7264d2356a8c1099", - "reference": "aa3c8f5d1b7efc295fd2b37c7264d2356a8c1099", + "url": "https://api.github.com/repos/wp-phpunit/wp-phpunit/zipball/ef2cb44c0d991ac0c3a7a3ed0d2d1cf3fe8d8f2f", + "reference": "ef2cb44c0d991ac0c3a7a3ed0d2d1cf3fe8d8f2f", "shasum": "" }, "type": "library", @@ -2928,20 +2961,20 @@ "issues": "https://github.com/wp-phpunit/issues", "source": "https://github.com/wp-phpunit/wp-phpunit" }, - "time": "2023-12-07T00:50:08+00:00" + "time": "2024-05-07T16:46:52+00:00" }, { "name": "yoast/phpunit-polyfills", - "version": "1.1.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", - "reference": "224e4a1329c03d8bad520e3fc4ec980034a4b212" + "reference": "a0f7d708794a738f328d7b6c94380fd1d6c40446" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/224e4a1329c03d8bad520e3fc4ec980034a4b212", - "reference": "224e4a1329c03d8bad520e3fc4ec980034a4b212", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/a0f7d708794a738f328d7b6c94380fd1d6c40446", + "reference": "a0f7d708794a738f328d7b6c94380fd1d6c40446", "shasum": "" }, "require": { @@ -2949,7 +2982,9 @@ "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "require-dev": { - "yoast/yoastcs": "^2.3.0" + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "yoast/yoastcs": "^3.1.0" }, "type": "library", "extra": { @@ -2986,9 +3021,10 @@ ], "support": { "issues": "https://github.com/Yoast/PHPUnit-Polyfills/issues", + "security": "https://github.com/Yoast/PHPUnit-Polyfills/security/policy", "source": "https://github.com/Yoast/PHPUnit-Polyfills" }, - "time": "2023-08-19T14:25:08+00:00" + "time": "2024-04-05T16:01:51+00:00" }, { "name": "yoast/wp-test-utils", From f9002882dc1b094c5bd6678fcb2c5a495c4fa1ba Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Wed, 5 Jun 2024 20:18:47 -0400 Subject: [PATCH 18/26] added - github files --- .github/CONTRIBUTING.md | 51 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/Bug_report.md | 35 ++++++++++++++++ .github/ISSUE_TEMPLATE/Feature_request.md | 15 +++++++ .github/ISSUE_TEMPLATE/config.yml | 1 + 4 files changed, 102 insertions(+) create mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/ISSUE_TEMPLATE/Bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/Feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..ee21f34 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,51 @@ +# Contribution Guidelines + +Before filing a bug report or a feature request, be sure to read the contribution guidelines. + +## How to use GitHub +We use GitHub exclusively for well-documented bugs, feature requests and code contributions. Communication is always done in English. + +To receive free support for Enable Contributor Uploads: +* [Support forums](https://wordpress.org/support/plugin/enable-contributor-uploads/) on WordPress.org + +Thanks for your understanding. + +## Security issues +Please do not report security issues here. Instead, email them to security at our domain so we can deal with them securely and quickly. + +## I have found a bug +Before opening a new issue, please: +* update to the newest versions of WordPress and the Enable Contributor Uploads plugins. +* search for duplicate issues to prevent opening a duplicate issue. If there is already an open existing issue, please comment on that issue. +* follow our _New issue_ template when creating a new issue. +* add as much information as possible. For example: add screenshots, relevant links, step by step guides etc. + +## I have a feature request +Before opening a new issue, please: +* search for duplicate issues to prevent opening a duplicate feature request. If there is already an open existing request, please leave a comment there. +* add as much information as possible. For example: give us a clear explanation of why you think the feature request is something we should consider for the plugin. + +## I want to create a patch +Community made patches, localizations, bug reports and contributions are very welcome and help us tremendously. + +When contributing please ensure you follow the guidelines below so that we can keep on top of things. + +#### Submitting an issue you found +Make sure your problem does not exist as a ticket already by searching through [the existing issues](https://github.com/equalizedigital/enable-contributor-uploads/issues). If you cannot find anything which resembles your problem, please [create a new issue](https://github.com/equalizedigital/enable-contributor-uploads/issues/new). + +#### Fixing an issue + +* Fork the repository on GitHub (make sure to use the `develop` branch). +* Make the changes to your forked repository. +* Ensure you stick to the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/) and you properly document any new functions, actions and filters following the [documentation standards](https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/). +* When committing, reference your issue and include a note about the fix. +* Push the changes to your fork and submit a pull request to the `develop` branch of the Enable Contributor Uploads repository. + +We will review your pull request and merge when everything is in order. We will help you to make sure the code complies with the standards described above. + +#### 'Patch welcome' issues +Some issues are labeled 'patch-welcome'. This means we see the value in the particular enhancement being suggested but have decided for now not to prioritize it. If you however decide to write a patch for it, we'll gladly include it after some code review. + +#### Additional Resources +* [General GitHub Documentation](https://help.github.com/) +* [GitHub Pull Request documentation](https://help.github.com/send-pull-requests/) diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md new file mode 100644 index 0000000..bb7bfca --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -0,0 +1,35 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + + + +* [ ] I've read and understood the [contribution guidelines](https://github.com/equalizedigital/enable-contributor-uploads/blob/develop/.github/CONTRIBUTING.md). +* [ ] I've searched for any related issues and avoided creating a duplicate issue. + +### Please give us a description of what happened. + + + + +### Please describe what you expected to happen and why. + + + + +### How can we reproduce this behavior? +1. +2. +3. + +### Technical info +* WordPress version: +* Enable Contributor Uploads version: + +* Relevant plugins in case of a bug: + +* Tested with theme: diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md new file mode 100644 index 0000000..ddba792 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Feature_request.md @@ -0,0 +1,15 @@ +--- +name: Feature request +about: Suggest an idea for this project + +--- + + + +## Is your feature request related to a problem? Please describe. + +## Describe the solution you'd like + +## Why do you think this feature is something we should consider for this plugin? + +## Additional context diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..3ba13e0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false From 9dcc150ff7fc021c1e661cef882c02fb8aca8ad0 Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Thu, 6 Jun 2024 11:42:00 -0400 Subject: [PATCH 19/26] added - playground workflow --- .github/workflows/playground.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/playground.yml diff --git a/.github/workflows/playground.yml b/.github/workflows/playground.yml new file mode 100644 index 0000000..3769d9e --- /dev/null +++ b/.github/workflows/playground.yml @@ -0,0 +1,16 @@ +name: Playground Comment + +on: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: mshick/add-pr-comment@v2 + with: + message: | + **Test on Playground** + [Test this pull request on the Playground](https://playground.wordpress.net/#{"landingPage":"/wp-admin/index.php","features":{"networking":true},"steps":[{"step":"login","username":"admin","password":"password"},{"step":"installPlugin","pluginSlug":"user-switching","options":{"activate":true}},{"step":"installPlugin","pluginSlug":"user-role-editor","options":{"activate":true}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://bypass-cors.altha.workers.dev/${{ github.server_url }}/${{ github.repository }}/archive/${{ github.sha }}.zip"},"options":{"activate":true}}]}) From 6898d529506534c88fe23f13bf554cfbae84bc06 Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Thu, 6 Jun 2024 11:45:00 -0400 Subject: [PATCH 20/26] update - playground workflow --- .github/workflows/playground.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/playground.yml b/.github/workflows/playground.yml index 3769d9e..130cf58 100644 --- a/.github/workflows/playground.yml +++ b/.github/workflows/playground.yml @@ -13,4 +13,4 @@ jobs: with: message: | **Test on Playground** - [Test this pull request on the Playground](https://playground.wordpress.net/#{"landingPage":"/wp-admin/index.php","features":{"networking":true},"steps":[{"step":"login","username":"admin","password":"password"},{"step":"installPlugin","pluginSlug":"user-switching","options":{"activate":true}},{"step":"installPlugin","pluginSlug":"user-role-editor","options":{"activate":true}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://bypass-cors.altha.workers.dev/${{ github.server_url }}/${{ github.repository }}/archive/${{ github.sha }}.zip"},"options":{"activate":true}}]}) + [Test this pull request on the Playground](https://playground.wordpress.net/#{"landingPage":"/wp-admin/index.php","features":{"networking":true},"steps":[{"step":"login","username":"admin","password":"password"},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://downloads.wordpress.org/plugin/user-switching.latest-stable.zip"},"options":{"activate":true}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://downloads.wordpress.org/plugin/user-role-editor.latest-stable.zip"},"options":{"activate":true}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://bypass-cors.altha.workers.dev/${{ github.server_url }}/${{ github.repository }}/archive/${{ github.sha }}.zip"},"options":{"activate":true}}]}) From 087b89808b71088e1dcb3272bbf5e36aeac63f35 Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Thu, 6 Jun 2024 11:48:24 -0400 Subject: [PATCH 21/26] updated - playground workflow to create a contributor user --- .github/workflows/playground.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/playground.yml b/.github/workflows/playground.yml index 130cf58..55863d0 100644 --- a/.github/workflows/playground.yml +++ b/.github/workflows/playground.yml @@ -13,4 +13,4 @@ jobs: with: message: | **Test on Playground** - [Test this pull request on the Playground](https://playground.wordpress.net/#{"landingPage":"/wp-admin/index.php","features":{"networking":true},"steps":[{"step":"login","username":"admin","password":"password"},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://downloads.wordpress.org/plugin/user-switching.latest-stable.zip"},"options":{"activate":true}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://downloads.wordpress.org/plugin/user-role-editor.latest-stable.zip"},"options":{"activate":true}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://bypass-cors.altha.workers.dev/${{ github.server_url }}/${{ github.repository }}/archive/${{ github.sha }}.zip"},"options":{"activate":true}}]}) + [Test this pull request on the Playground](https://playground.wordpress.net/#{"landingPage":"/wp-admin/index.php","features":{"networking":true},"steps":[{"step":"login","username":"admin","password":"password"},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://downloads.wordpress.org/plugin/user-switching.latest-stable.zip"},"options":{"activate":true}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://downloads.wordpress.org/plugin/user-role-editor.latest-stable.zip"},"options":{"activate":true}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://bypass-cors.altha.workers.dev/${{ github.server_url }}/${{ github.repository }}/archive/${{ github.sha }}.zip"},"options":{"activate":true}},{"step":"createUser","username":"contributor","password":"password","role":"contributor"},{"step":"login","username":"contributor","password":"password"}]}) From dd0066deab61eef9735a020f023c8f856fd53b36 Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Thu, 6 Jun 2024 11:50:21 -0400 Subject: [PATCH 22/26] added - script to create a user --- .github/workflows/playground.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/playground.yml b/.github/workflows/playground.yml index 55863d0..19c9a7c 100644 --- a/.github/workflows/playground.yml +++ b/.github/workflows/playground.yml @@ -13,4 +13,4 @@ jobs: with: message: | **Test on Playground** - [Test this pull request on the Playground](https://playground.wordpress.net/#{"landingPage":"/wp-admin/index.php","features":{"networking":true},"steps":[{"step":"login","username":"admin","password":"password"},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://downloads.wordpress.org/plugin/user-switching.latest-stable.zip"},"options":{"activate":true}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://downloads.wordpress.org/plugin/user-role-editor.latest-stable.zip"},"options":{"activate":true}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://bypass-cors.altha.workers.dev/${{ github.server_url }}/${{ github.repository }}/archive/${{ github.sha }}.zip"},"options":{"activate":true}},{"step":"createUser","username":"contributor","password":"password","role":"contributor"},{"step":"login","username":"contributor","password":"password"}]}) + [Test this pull request on the Playground](https://playground.wordpress.net/#{"landingPage":"/wp-admin/index.php","features":{"networking":true},"steps":[{"step":"login","username":"admin","password":"password"},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://downloads.wordpress.org/plugin/user-switching.latest-stable.zip"},"options":{"activate":true}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://downloads.wordpress.org/plugin/user-role-editor.latest-stable.zip"},"options":{"activate":true}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://bypass-cors.altha.workers.dev/${{ github.server_url }}/${{ github.repository }}/archive/${{ github.sha }}.zip"},"options":{"activate":true}},{"step":"runScript","script":"wp user create contributor contributor@example.com --role=contributor --user_pass=password"},{"step":"login","username":"contributor","password":"password"}]}) From 6da30af7fc4c6aa3aad83773de1f0f4efca0d81d Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Thu, 6 Jun 2024 11:51:50 -0400 Subject: [PATCH 23/26] reverted - workflow --- .github/workflows/playground.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/playground.yml b/.github/workflows/playground.yml index 19c9a7c..130cf58 100644 --- a/.github/workflows/playground.yml +++ b/.github/workflows/playground.yml @@ -13,4 +13,4 @@ jobs: with: message: | **Test on Playground** - [Test this pull request on the Playground](https://playground.wordpress.net/#{"landingPage":"/wp-admin/index.php","features":{"networking":true},"steps":[{"step":"login","username":"admin","password":"password"},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://downloads.wordpress.org/plugin/user-switching.latest-stable.zip"},"options":{"activate":true}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://downloads.wordpress.org/plugin/user-role-editor.latest-stable.zip"},"options":{"activate":true}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://bypass-cors.altha.workers.dev/${{ github.server_url }}/${{ github.repository }}/archive/${{ github.sha }}.zip"},"options":{"activate":true}},{"step":"runScript","script":"wp user create contributor contributor@example.com --role=contributor --user_pass=password"},{"step":"login","username":"contributor","password":"password"}]}) + [Test this pull request on the Playground](https://playground.wordpress.net/#{"landingPage":"/wp-admin/index.php","features":{"networking":true},"steps":[{"step":"login","username":"admin","password":"password"},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://downloads.wordpress.org/plugin/user-switching.latest-stable.zip"},"options":{"activate":true}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://downloads.wordpress.org/plugin/user-role-editor.latest-stable.zip"},"options":{"activate":true}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://bypass-cors.altha.workers.dev/${{ github.server_url }}/${{ github.repository }}/archive/${{ github.sha }}.zip"},"options":{"activate":true}}]}) From ba5b83011531058fe49c15f951cae64148cb9000 Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Thu, 6 Jun 2024 12:03:29 -0400 Subject: [PATCH 24/26] updated - playground workflow to build the zip --- .github/workflows/playground.yml | 43 +++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/.github/workflows/playground.yml b/.github/workflows/playground.yml index 130cf58..bce39aa 100644 --- a/.github/workflows/playground.yml +++ b/.github/workflows/playground.yml @@ -8,9 +8,44 @@ jobs: runs-on: ubuntu-latest permissions: pull-requests: write + steps: - - uses: mshick/add-pr-comment@v2 + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' # specify your Node.js version + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' # specify your PHP version + + - name: Install Composer dependencies + run: composer install --no-dev && composer dump-autoload --no-dev -o + + - name: Run build script + run: npm run dist + + - name: Create zip file + run: zip -r plugin.zip dist + + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: plugin-zip + path: plugin.zip + + - name: Generate Playground comment + run: | + PLUGIN_URL="https://bypass-cors.altha.workers.dev/${{ github.server_url }}/${{ github.repository }}/suites/${{ github.run_id }}/artifact.zip" + COMMENT="**Test on Playground**\n[Test this pull request on the Playground](https://playground.wordpress.net/#{{\"landingPage\":\"/wp-admin/index.php\",\"features\":{\"networking\":true},\"steps\":[{\"step\":\"login\",\"username\":\"admin\",\"password\":\"password\"},{\"step\":\"installPlugin\",\"pluginZipFile\":{\"resource\":\"url\",\"url\":\"${PLUGIN_URL}\"},\"options\":{\"activate\":true}},{\"step\":\"installPlugin\",\"pluginZipFile\":{\"resource\":\"url\",\"url\":\"https://downloads.wordpress.org/plugin/user-switching.latest-stable.zip\"},\"options\":{\"activate\":true}},{\"step\":\"installPlugin\",\"pluginZipFile\":{\"resource\":\"url\",\"url\":\"https://downloads.wordpress.org/plugin/user-role-editor.latest-stable.zip\"},\"options\":{\"activate\":true}}]})" + + echo "${COMMENT}" > comment.md + + - name: Add PR comment + uses: mshick/add-pr-comment@v2 with: - message: | - **Test on Playground** - [Test this pull request on the Playground](https://playground.wordpress.net/#{"landingPage":"/wp-admin/index.php","features":{"networking":true},"steps":[{"step":"login","username":"admin","password":"password"},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://downloads.wordpress.org/plugin/user-switching.latest-stable.zip"},"options":{"activate":true}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://downloads.wordpress.org/plugin/user-role-editor.latest-stable.zip"},"options":{"activate":true}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://bypass-cors.altha.workers.dev/${{ github.server_url }}/${{ github.repository }}/archive/${{ github.sha }}.zip"},"options":{"activate":true}}]}) + message: ${{ steps.generate-playground-comment.outputs.comment }} From 118582ea119934aef1fd1c4b56b4d414a8fa3eaf Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Thu, 6 Jun 2024 12:06:33 -0400 Subject: [PATCH 25/26] fixed - message input --- .github/workflows/playground.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/playground.yml b/.github/workflows/playground.yml index bce39aa..6047a30 100644 --- a/.github/workflows/playground.yml +++ b/.github/workflows/playground.yml @@ -39,13 +39,13 @@ jobs: path: plugin.zip - name: Generate Playground comment + id: generate-comment run: | - PLUGIN_URL="https://bypass-cors.altha.workers.dev/${{ github.server_url }}/${{ github.repository }}/suites/${{ github.run_id }}/artifact.zip" + PLUGIN_URL="https://bypass-cors.altha.workers.dev/${{ github.server_url }}/${{ github.repository }}/suites/${{ github.run_id }}/artifacts/plugin-zip" COMMENT="**Test on Playground**\n[Test this pull request on the Playground](https://playground.wordpress.net/#{{\"landingPage\":\"/wp-admin/index.php\",\"features\":{\"networking\":true},\"steps\":[{\"step\":\"login\",\"username\":\"admin\",\"password\":\"password\"},{\"step\":\"installPlugin\",\"pluginZipFile\":{\"resource\":\"url\",\"url\":\"${PLUGIN_URL}\"},\"options\":{\"activate\":true}},{\"step\":\"installPlugin\",\"pluginZipFile\":{\"resource\":\"url\",\"url\":\"https://downloads.wordpress.org/plugin/user-switching.latest-stable.zip\"},\"options\":{\"activate\":true}},{\"step\":\"installPlugin\",\"pluginZipFile\":{\"resource\":\"url\",\"url\":\"https://downloads.wordpress.org/plugin/user-role-editor.latest-stable.zip\"},\"options\":{\"activate\":true}}]})" - echo "${COMMENT}" > comment.md - name: Add PR comment uses: mshick/add-pr-comment@v2 with: - message: ${{ steps.generate-playground-comment.outputs.comment }} + message: ${{ steps.generate-comment.outputs.comment }} From 89dcf0a9e7595dbfe8a57c71791af491ec26c860 Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Thu, 6 Jun 2024 12:07:38 -0400 Subject: [PATCH 26/26] reverted - workflow --- .github/workflows/playground.yml | 43 +++----------------------------- 1 file changed, 4 insertions(+), 39 deletions(-) diff --git a/.github/workflows/playground.yml b/.github/workflows/playground.yml index 6047a30..130cf58 100644 --- a/.github/workflows/playground.yml +++ b/.github/workflows/playground.yml @@ -8,44 +8,9 @@ jobs: runs-on: ubuntu-latest permissions: pull-requests: write - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: '14' # specify your Node.js version - - - name: Set up PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' # specify your PHP version - - - name: Install Composer dependencies - run: composer install --no-dev && composer dump-autoload --no-dev -o - - - name: Run build script - run: npm run dist - - - name: Create zip file - run: zip -r plugin.zip dist - - - name: Upload artifact - uses: actions/upload-artifact@v2 - with: - name: plugin-zip - path: plugin.zip - - - name: Generate Playground comment - id: generate-comment - run: | - PLUGIN_URL="https://bypass-cors.altha.workers.dev/${{ github.server_url }}/${{ github.repository }}/suites/${{ github.run_id }}/artifacts/plugin-zip" - COMMENT="**Test on Playground**\n[Test this pull request on the Playground](https://playground.wordpress.net/#{{\"landingPage\":\"/wp-admin/index.php\",\"features\":{\"networking\":true},\"steps\":[{\"step\":\"login\",\"username\":\"admin\",\"password\":\"password\"},{\"step\":\"installPlugin\",\"pluginZipFile\":{\"resource\":\"url\",\"url\":\"${PLUGIN_URL}\"},\"options\":{\"activate\":true}},{\"step\":\"installPlugin\",\"pluginZipFile\":{\"resource\":\"url\",\"url\":\"https://downloads.wordpress.org/plugin/user-switching.latest-stable.zip\"},\"options\":{\"activate\":true}},{\"step\":\"installPlugin\",\"pluginZipFile\":{\"resource\":\"url\",\"url\":\"https://downloads.wordpress.org/plugin/user-role-editor.latest-stable.zip\"},\"options\":{\"activate\":true}}]})" - echo "${COMMENT}" > comment.md - - - name: Add PR comment - uses: mshick/add-pr-comment@v2 + - uses: mshick/add-pr-comment@v2 with: - message: ${{ steps.generate-comment.outputs.comment }} + message: | + **Test on Playground** + [Test this pull request on the Playground](https://playground.wordpress.net/#{"landingPage":"/wp-admin/index.php","features":{"networking":true},"steps":[{"step":"login","username":"admin","password":"password"},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://downloads.wordpress.org/plugin/user-switching.latest-stable.zip"},"options":{"activate":true}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://downloads.wordpress.org/plugin/user-role-editor.latest-stable.zip"},"options":{"activate":true}},{"step":"installPlugin","pluginZipFile":{"resource":"url","url":"https://bypass-cors.altha.workers.dev/${{ github.server_url }}/${{ github.repository }}/archive/${{ github.sha }}.zip"},"options":{"activate":true}}]})