Skip to content

Update dev environment#2

Merged
BrianHenryIE merged 11 commits into
masterfrom
update
Feb 13, 2026
Merged

Update dev environment#2
BrianHenryIE merged 11 commits into
masterfrom
update

Conversation

@BrianHenryIE

Copy link
Copy Markdown
Owner
  • Add .editorconfig, .gitattributes, rector.php
  • Add .wp-env.json with PHP 8.4, test-plugin and src/assets mappings, woocommerce
  • Add package.json with @wordpress/env
  • Add tests/_wp-env/ lifecycle scripts (external + internal)
  • Add .github/dependabot.yml (Actions, npm, Composer)
  • Add .github/workflows/unit-coverage.yml (multi-PHP 8.0-8.4, PR coverage comments)
  • Add .github/workflows/phpcbf.yml (PHP 8.4, PR trigger)
  • Add .github/workflows/phpstan.yml (PR-aware, only fails on changed files)
  • Update phpcs.xml with standard global exclusions
  • Update .env.testing to standard format (root/password, separate DB_PORT)
  • Update codeception.dist.yml (cleaned up)
  • Update .gitignore with additional patterns
  • Update composer.json:
    • Add johnpbloch/wordpress-core-installer to allow-plugins
    • Add autoload-dev PSR-4 for test dirs + classmap for tests/_support
    • Add rector, php-codecoverage-markdown, johnpbloch/wordpress to require-dev
    • Replace coverage-tests/lint/lint-changes with test/test-coverage/cs/cs-fix/cs-strict/cs-changes/cs-changes-strict

- Add .editorconfig, .gitattributes, rector.php
- Add .wp-env.json with PHP 8.4, test-plugin and src/assets mappings, woocommerce
- Add package.json with @wordpress/env
- Add tests/_wp-env/ lifecycle scripts (external + internal)
- Add .github/dependabot.yml (Actions, npm, Composer)
- Add .github/workflows/unit-coverage.yml (multi-PHP 8.0-8.4, PR coverage comments)
- Add .github/workflows/phpcbf.yml (PHP 8.4, PR trigger)
- Add .github/workflows/phpstan.yml (PR-aware, only fails on changed files)
- Update phpcs.xml with standard global exclusions
- Update .env.testing to standard format (root/password, separate DB_PORT)
- Update codeception.dist.yml (cleaned up)
- Update .gitignore with additional patterns
- Update composer.json:
  - Add johnpbloch/wordpress-core-installer to allow-plugins
  - Add autoload-dev PSR-4 for test dirs + classmap for tests/_support
  - Add rector, php-codecoverage-markdown, johnpbloch/wordpress to require-dev
  - Replace coverage-tests/lint/lint-changes with test/test-coverage/cs/cs-fix/cs-strict/cs-changes/cs-changes-strict
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @BrianHenryIE, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly upgrades the project's development and continuous integration environment. It introduces standardized configurations for code style, version control attributes, and automated code refactoring. A new wp-env setup provides a consistent local WordPress development environment with specific PHP versions and plugin mappings. Furthermore, it establishes comprehensive CI/CD pipelines for dependency updates, unit testing, code coverage, and static analysis, ensuring higher code quality and maintainability.

Highlights

  • Development Environment Setup: Introduced comprehensive development environment configurations including .editorconfig for consistent coding styles, .gitattributes for version control, and rector.php for automated code refactoring.
  • WordPress Environment with wp-env: Established a new WordPress development environment using wp-env, configured for PHP 8.4, custom plugin and asset mappings, and integration with WooCommerce, along with lifecycle scripts for initialization.
  • Automated Dependency Management: Implemented automated dependency management via Dependabot, configured to monitor and update dependencies for GitHub Actions, npm, and Composer.
  • CI/CD Workflows: Added robust CI/CD workflows for unit test coverage (multi-PHP 8.0-8.4), PHP Code Beautifier and Fixer (PHPCBF), and PHPStan static analysis, including PR-aware checks.
  • Code Quality Tooling Enhancements: Refined PHP Code Sniffer (phpcs.xml) rules with new global exclusions and specific rule adjustments to improve code quality checks and reduce noise in test files.
  • Composer Script Updates: Enhanced Composer scripts by replacing older coverage-tests, lint, and lint-changes commands with a more granular set of test, test-coverage, cs, cs-fix, cs-strict, cs-changes, and cs-changes-strict scripts for better control over testing and code style checks.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .editorconfig
    • Added a new file to define consistent coding styles across various file types (PHP, JS/TS, JSON/YAML, Markdown, XML).
  • .env.testing
    • Updated database credentials to root/password and added TEST_DB_PORT.
    • Standardized TEST_SITE_WP_URL and TEST_SITE_WP_DOMAIN.
  • .gitattributes
    • Added a new file to configure Git attributes, primarily setting export-ignore for various development-related files and directories.
  • .github/dependabot.yml
    • Added a new file to configure Dependabot for automated dependency updates for GitHub Actions, npm, and Composer.
  • .gitignore
    • Updated to include new patterns for node_modules, wordpress, wp-content exclusions, and various build/cache files.
  • .wp-env.json
    • Added a new file to configure the WordPress development environment, specifying PHP 8.4, debug logging, plugin mappings (including WooCommerce), and lifecycle scripts.
  • codeception.dist.yml
    • Reordered exclude patterns in the coverage section.
  • composer.json
    • Added johnpbloch/wordpress-core-installer to allow-plugins.
    • Added psr-4 autoload-dev for test directories and classmap for tests/_support.
    • Added brianhenryie/php-codecoverage-markdown, johnpbloch/wordpress, and rector/rector to require-dev.
    • Replaced coverage-tests, lint, and lint-changes scripts with new test, test-coverage, cs, cs-fix, cs-strict, cs-changes, and cs-changes-strict scripts.
  • package.json
    • Added a new file to manage npm dependencies, specifically @wordpress/env, and defined a wp-env script.
  • phpcs.xml
    • Updated to add global exclude patterns for dist-archive, node_modules, and specific wp-content subdirectories.
    • Added new rules and exclusions for WordPress.Files.FileName.InvalidClassFileName, Squiz.Commenting.VariableComment.MissingVar, Generic.CodeAnalysis.UnusedFunctionParameter, WordPress.Security.EscapeOutput.ExceptionNotEscaped, Generic.Commenting.DocComment.MissingShort, Universal.Operators.DisallowShortTernary.Found, Squiz.Commenting.FunctionCommentThrowTag.WrongNumber, Squiz.Commenting.VariableComment.Missing, WordPress.DB.DirectDatabaseQuery, WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase, WordPress.Security.ValidatedSanitizedInput, WordPress.WP.AlternativeFunctions.json_encode_json_encode, WordPress.WP.AlternativeFunctions, WordPress.PHP.NoSilencedErrors, and Squiz.Commenting.FunctionCommentThrowTag.Missing specifically for test files.
  • rector.php
    • Added a new file to configure Rector for automated PHP code refactoring, targeting PHP 8.4 and skipping certain rules.
  • tests/_wp-env/initialize-external.sh
    • Added a new bash script to be run outside Docker by wp-env after startup, executing internal initialization scripts.
  • tests/_wp-env/initialize-internal.sh
    • Added a new bash script to be run inside Docker by wp-env, activating plugins, setting up uploads directory permissions, installing jq, and configuring pretty permalinks.
Ignored Files
  • Ignored by pattern: .github/workflows/** (3)
    • .github/workflows/phpcbf.yml
    • .github/workflows/phpstan.yml
    • .github/workflows/unit-coverage.yml
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly updates the development environment by introducing new configuration files for editor settings, git, wp-env, and Dependabot, as well as adding several GitHub Actions workflows for CI/CD. It also refactors composer scripts and updates dependencies. My review focuses on improving the consistency, security, and maintainability of these new configurations. I've pointed out a potential security risk with a disabled PHPCS security rule, use of weak credentials in the test environment, inconsistencies in editor configuration, and overly complex shell scripts in composer.json.

Comment thread phpcs.xml
Comment on lines +49 to +52
<!-- I'm not really sure how this is a security problem. -->
<rule ref="WordPress.Security.EscapeOutput.ExceptionNotEscaped">
<exclude-pattern>*</exclude-pattern>
</rule>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Disabling the WordPress.Security.EscapeOutput.ExceptionNotEscaped rule globally is a security risk. Exception messages can sometimes contain user-controllable data. If these messages are displayed without escaping (e.g., in an error log viewable in a browser or on a debug page), it could lead to Cross-Site Scripting (XSS) vulnerabilities. It is strongly recommended to address these warnings on a case-by-case basis, either by ensuring the data is safe or by using a // phpcs:ignore comment with a justification, rather than disabling the rule for the entire project.

Comment thread .editorconfig
Comment on lines +35 to +37
[*.xml]
indent_style = tab
indent_size = 4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The indentation style for XML files is set to tab, but the phpcs.xml file in this repository uses spaces for indentation. To maintain consistency across the project's configuration files, it's recommended to use spaces for XML files as well.

[*.xml]
indent_style = space
indent_size = 4

Comment thread .env.testing
Comment on lines +6 to +7
TEST_DB_USER="root"
TEST_DB_PASSWORD="password"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using common default credentials like root and password (here and on lines 13-14) is a security risk, even in a testing environment. If this configuration is ever accidentally used in a more exposed setting, it could be easily compromised. It's better practice to use more specific and less guessable credentials, for example by appending the project name.

Comment thread composer.json
Comment on lines +201 to 203
"cs-changes": [
"updated_files=$(echo $(git diff --name-only `git merge-base origin/master HEAD` | grep \\.php | tr '\\n' '\\0' | xargs -0 ls -1df 2>/dev/null)); if [ -n \"$updated_files\" ]; then phpcbf $(echo $updated_files); phpcs $(echo $updated_files); phpstan analyse $(echo $updated_files) --memory-limit 1G; else echo \"No modified php files for phpstan.\"; fi;"
],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The cs-changes script is overly complex and not fully robust. The echo $(...) is redundant, and $(echo $updated_files) is not safe for filenames with spaces. The file discovery part using grep, tr, and xargs ls can also be simplified. Consider rewriting this for better readability and robustness. A more modern approach would use git diff --name-only --diff-filter=ACMRTUXB to get the list of files and pipe it to xargs.

Comment thread composer.json
Comment on lines +204 to 206
"cs-changes-strict": [
"updated_files=$(echo $(git diff --name-only `git merge-base origin/master HEAD` | grep \\.php | tr '\\n' '\\0' | xargs -0 ls -1df 2>/dev/null)); if [ -n \"$updated_files\" ]; then phpcbf $(echo $updated_files); phpcs $(echo $updated_files); phpstan analyse $(echo $updated_files) --level max --memory-limit 1G; else echo \"No modified php files for phpstan.\"; fi;"
]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to the cs-changes script, this script is overly complex and not fully robust. It has the same issues with redundant commands and unsafe handling of filenames with spaces. It should be simplified for better readability and robustness.

@github-actions

Copy link
Copy Markdown

Project Code Coverage
project coverage report 43% @ 7808c32

Generated: Fri, Feb 13, 2026, 7:28:56 UTC.

Lines Functions and Methods Classes and Traits
Total 🟥🟥🟥🟥⬜⬜⬜⬜⬜⬜ 43.79% (374 / 854) 🟥🟥🟥⬜⬜⬜⬜⬜⬜⬜ 30.34% (27 / 89) 🟥🟥⬜⬜⬜⬜⬜⬜⬜⬜ 29.41% (5 / 17)
admin/class-admin-notices.php 🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜ 14.29% (6 / 42) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 4) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
admin/class-ajax.php 🟧🟧🟧🟧🟧🟧🟧⬜⬜⬜ 71.43% (15 / 21) 🟥🟥🟥⬜⬜⬜⬜⬜⬜⬜ 33.33% (1 / 3) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
admin/class-logs-list-table.php 🟥🟥🟥⬜⬜⬜⬜⬜⬜⬜ 31.03% (27 / 87) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 9) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
admin/class-logs-page.php 🟥🟥⬜⬜⬜⬜⬜⬜⬜⬜ 23.71% (23 / 97) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 5) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
admin/class-plugin-installer.php 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 100.00% (7 / 7) 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 100.00% (2 / 2) 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 100.00% (1 / 1)
admin/class-plugins-page.php 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 100.00% (15 / 15) 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 100.00% (2 / 2) 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 100.00% (1 / 1)
api/class-api.php 🟥🟥⬜⬜⬜⬜⬜⬜⬜⬜ 27.68% (49 / 177) 🟥🟥⬜⬜⬜⬜⬜⬜⬜⬜ 21.05% (4 / 19) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
api/class-bh-wp-psr-logger.php 🟧🟧🟧🟧🟧🟧🟧⬜⬜⬜ 78.12% (50 / 64) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 4) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
php/class-php-error-handler.php 🟧🟧🟧🟧🟧🟧🟧⬜⬜⬜ 72.22% (39 / 54) 🟥🟥🟥⬜⬜⬜⬜⬜⬜⬜ 33.33% (2 / 6) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
php/class-php-shutdown-handler.php 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 100.00% (11 / 11) 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 100.00% (3 / 3) 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 100.00% (1 / 1)
private-uploads/class-url-is-public.php 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 100.00% (2 / 2) 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 100.00% (1 / 1) 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 100.00% (1 / 1)
wp-includes/class-cron.php 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 100.00% (15 / 15) 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 100.00% (3 / 3) 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 100.00% (1 / 1)
wp-includes/class-functions.php 🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜ 18.97% (22 / 116) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 5) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
wp-includes/class-init.php 🟥🟥🟥⬜⬜⬜⬜⬜⬜⬜ 39.58% (19 / 48) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 3) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
wp-includes/class-plugin-logger-actions.php 🟧🟧🟧🟧🟧🟧⬜⬜⬜⬜ 67.27% (37 / 55) 🟥🟥🟥🟥⬜⬜⬜⬜⬜⬜ 46.15% (6 / 13) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
class-logger.php 🟩🟩🟩🟩🟩🟩🟩🟩🟩⬜ 93.94% (31 / 33) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 2) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)
trait-logger-settings-trait.php 🟧🟧🟧🟧🟧🟧⬜⬜⬜⬜ 60.00% (6 / 10) 🟧🟧🟧🟧🟧🟧⬜⬜⬜⬜ 60.00% (3 / 5) ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ 0.00% (0 / 1)

phpcov 8.2.1 by Sebastian Bergmann.

Unable to detect executable lines that were changed.
Are you sure your --path-prefix is correct?

@BrianHenryIE BrianHenryIE merged commit 7ef88d7 into master Feb 13, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant