From 8eb82404488a67517befc0481aad0baf65bf6502 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Wed, 21 Feb 2024 17:48:08 -0500 Subject: [PATCH 1/5] add context module dependency --- composer.json | 3 + composer.lock | 201 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 201 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index b6c2c02..8492560 100644 --- a/composer.json +++ b/composer.json @@ -45,5 +45,8 @@ "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true } + }, + "require": { + "newfold-labs/wp-module-context": "^0.3.0" } } \ No newline at end of file diff --git a/composer.lock b/composer.lock index c16ce3d..3884a6b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,203 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "faf757c05c7bc8420fbd029ab3e2b4ad", - "packages": [], + "content-hash": "c0fb84ceb1de6f7192f0b728a349844b", + "packages": [ + { + "name": "doctrine/inflector", + "version": "1.4.4", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9", + "reference": "4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Inflector\\": "lib/Doctrine/Inflector", + "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", + "keywords": [ + "inflection", + "inflector", + "lowercase", + "manipulation", + "php", + "plural", + "singular", + "strings", + "uppercase", + "words" + ], + "support": { + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/1.4.4" + }, + "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%2Finflector", + "type": "tidelift" + } + ], + "time": "2021-04-16T17:34:40+00:00" + }, + { + "name": "newfold-labs/wp-module-context", + "version": "0.3.0", + "source": { + "type": "git", + "url": "https://github.com/newfold-labs/wp-module-context.git", + "reference": "aff2a223b4d1ff7b93df1bffa29d61f700101921" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/newfold-labs/wp-module-context/zipball/aff2a223b4d1ff7b93df1bffa29d61f700101921", + "reference": "aff2a223b4d1ff7b93df1bffa29d61f700101921", + "shasum": "" + }, + "require": { + "wp-forge/helpers": "^2.0" + }, + "require-dev": { + "newfold-labs/wp-php-standards": "^1.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "NewfoldLabs\\WP\\Context\\": "includes" + }, + "files": [ + "includes/functions.php", + "bootstrap.php" + ] + }, + "scripts": { + "fix": [ + "vendor/bin/phpcbf . --standard=phpcs.xml" + ], + "lint": [ + "vendor/bin/phpcs . --standard=phpcs.xml -s" + ] + }, + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Evan Mullins", + "homepage": "https://evanmullins.com" + } + ], + "description": "Newfold module to determine context for various brands and platforms.", + "support": { + "source": "https://github.com/newfold-labs/wp-module-context/tree/0.3.0", + "issues": "https://github.com/newfold-labs/wp-module-context/issues" + }, + "time": "2024-02-21T22:38:37+00:00" + }, + { + "name": "wp-forge/helpers", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/wp-forge/helpers.git", + "reference": "28ebc09a3390dbff427270a4ed2b93395e8b9b78" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-forge/helpers/zipball/28ebc09a3390dbff427270a4ed2b93395e8b9b78", + "reference": "28ebc09a3390dbff427270a4ed2b93395e8b9b78", + "shasum": "" + }, + "require": { + "doctrine/inflector": "^1.3", + "ext-mbstring": "*" + }, + "type": "library", + "autoload": { + "files": [ + "includes/functions.php" + ], + "psr-4": { + "WP_Forge\\Helpers\\": "includes" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Micah Wood", + "email": "micah@wpscholar.com" + } + ], + "description": "A collection of helpers for WordPress and PHP development.", + "support": { + "issues": "https://github.com/wp-forge/helpers/issues", + "source": "https://github.com/wp-forge/helpers/tree/2.0" + }, + "time": "2022-01-06T13:10:47+00:00" + } + ], "packages-dev": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -412,5 +607,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } From 4ccfb7cc0ffee8c569523c75ac04347e8d790576 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Wed, 21 Feb 2024 17:48:31 -0500 Subject: [PATCH 2/5] only load staging instance if proper context platform --- bootstrap.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bootstrap.php b/bootstrap.php index d91a75c..46d9b26 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -3,6 +3,7 @@ use NewfoldLabs\WP\ModuleLoader\Container; use NewfoldLabs\WP\Module\Staging\Staging; use function NewfoldLabs\WP\ModuleLoader\register; +use function NewfoldLabs\WP\Context\getContext; if ( function_exists( 'add_action' ) ) { @@ -15,6 +16,9 @@ function () { 'name' => 'staging', 'label' => __( 'Staging', 'newfold-staging-module' ), 'callback' => function ( Container $container ) { + if ( 'atomic' === getContext( 'platform' ) ) { + return; + } return new Staging( $container ); }, 'isActive' => true, From 551ff2ba99d24069ec68908f72b4e91d5d9970e8 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Thu, 22 Feb 2024 13:46:38 -0500 Subject: [PATCH 3/5] composer updates - Upgrading newfold-labs/wp-module-context (0.3.0 => 1.0.0) - Upgrading squizlabs/php_codesniffer (3.7.2 => 3.9.0) - Installing phpcsstandards/phpcsutils (1.0.9) - Installing phpcsstandards/phpcsextra (1.2.1) - Upgrading wp-coding-standards/wpcs (2.3.0 => 3.0.1) --- composer.json | 2 +- composer.lock | 264 ++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 235 insertions(+), 31 deletions(-) diff --git a/composer.json b/composer.json index 8492560..29437e8 100644 --- a/composer.json +++ b/composer.json @@ -47,6 +47,6 @@ } }, "require": { - "newfold-labs/wp-module-context": "^0.3.0" + "newfold-labs/wp-module-context": "^1.0" } } \ No newline at end of file diff --git a/composer.lock b/composer.lock index 3884a6b..8188a24 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c0fb84ceb1de6f7192f0b728a349844b", + "content-hash": "9825283ccab2a4bab9d08c5ed304f60c", "packages": [ { "name": "doctrine/inflector", @@ -104,16 +104,16 @@ }, { "name": "newfold-labs/wp-module-context", - "version": "0.3.0", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-context.git", - "reference": "aff2a223b4d1ff7b93df1bffa29d61f700101921" + "reference": "0d852f83f353f1631309e5ae7da9cb1e046bc984" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-context/zipball/aff2a223b4d1ff7b93df1bffa29d61f700101921", - "reference": "aff2a223b4d1ff7b93df1bffa29d61f700101921", + "url": "https://api.github.com/repos/newfold-labs/wp-module-context/zipball/0d852f83f353f1631309e5ae7da9cb1e046bc984", + "reference": "0d852f83f353f1631309e5ae7da9cb1e046bc984", "shasum": "" }, "require": { @@ -151,10 +151,10 @@ ], "description": "Newfold module to determine context for various brands and platforms.", "support": { - "source": "https://github.com/newfold-labs/wp-module-context/tree/0.3.0", + "source": "https://github.com/newfold-labs/wp-module-context/tree/1.0.0", "issues": "https://github.com/newfold-labs/wp-module-context/issues" }, - "time": "2024-02-21T22:38:37+00:00" + "time": "2024-02-22T18:22:13+00:00" }, { "name": "wp-forge/helpers", @@ -491,18 +491,184 @@ }, "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": "squizlabs/php_codesniffer", - "version": "3.7.2", + "version": "3.9.0", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/d63cee4890a8afaf86a22e51ad4d97c91dd4579b", + "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b", "shasum": "" }, "require": { @@ -512,11 +678,11 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", "extra": { @@ -531,49 +697,80 @@ "authors": [ { "name": "Greg Sherwood", - "role": "lead" + "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/squizlabs/PHP_CodeSniffer", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "keywords": [ "phpcs", "standards", "static analysis" ], "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + "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" }, - "time": "2023-02-22T23:07:41+00:00" + "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": "wp-coding-standards/wpcs", - "version": "2.3.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "7da1894633f168fe244afc6de00d141f27517b62" + "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62", - "reference": "7da1894633f168fe244afc6de00d141f27517b62", + "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", - "squizlabs/php_codesniffer": "^3.3.1" + "phpcsstandards/phpcsextra": "^1.1.0", + "phpcsstandards/phpcsutils": "^1.0.8", + "squizlabs/php_codesniffer": "^3.7.2" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", + "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.0", + "phpcsstandards/phpcsdevtools": "^1.2.0", "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." + "ext-iconv": "For improved results", + "ext-mbstring": "For improved results" }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", @@ -590,6 +787,7 @@ "keywords": [ "phpcs", "standards", + "static analysis", "wordpress" ], "support": { @@ -597,7 +795,13 @@ "source": "https://github.com/WordPress/WordPress-Coding-Standards", "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" }, - "time": "2020-05-13T23:57:56+00:00" + "funding": [ + { + "url": "https://opencollective.com/thewpcc/contribute/wp-php-63406", + "type": "custom" + } + ], + "time": "2023-09-14T07:06:09+00:00" } ], "aliases": [], From 2d92d239439ce689dd3fd58af11e6dbbc419f75e Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Fri, 23 Feb 2024 11:40:58 -0500 Subject: [PATCH 4/5] test on plugin context module branch --- .github/workflows/brand-plugin-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/brand-plugin-test.yml b/.github/workflows/brand-plugin-test.yml index c92f34d..010ce4d 100644 --- a/.github/workflows/brand-plugin-test.yml +++ b/.github/workflows/brand-plugin-test.yml @@ -31,6 +31,7 @@ jobs: module-repo: ${{ github.repository }} module-branch: ${{ needs.setup.outputs.branch }} plugin-repo: 'bluehost/bluehost-wordpress-plugin' + plugin-branch: 'add/context-module' secrets: inherit hostgator: From f2930821226b70105831c718b43fbf4384c11bb1 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 27 Feb 2024 15:06:11 -0500 Subject: [PATCH 5/5] remove temp workflow tweak --- .github/workflows/brand-plugin-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/brand-plugin-test.yml b/.github/workflows/brand-plugin-test.yml index 010ce4d..c92f34d 100644 --- a/.github/workflows/brand-plugin-test.yml +++ b/.github/workflows/brand-plugin-test.yml @@ -31,7 +31,6 @@ jobs: module-repo: ${{ github.repository }} module-branch: ${{ needs.setup.outputs.branch }} plugin-repo: 'bluehost/bluehost-wordpress-plugin' - plugin-branch: 'add/context-module' secrets: inherit hostgator: