Standardise CI configuration and add unit test infrastructure#184
Merged
Conversation
Aligns CI configuration with Automattic plugin standards to improve security posture and reduce maintenance overhead across the plugin portfolio. These changes bring the repository in line with established patterns used in other a8c plugins, making it easier for the team to maintain consistent security practices and dependency update schedules. The Dependabot configuration moves from daily to weekly updates with intelligent grouping of related dependencies, reducing PR noise whilst maintaining currency. GitHub Actions now use SHA-pinned references rather than mutable tags, preventing supply chain attacks where action maintainers could push malicious code to existing version tags. Template injection vulnerabilities in workflow commands are eliminated by using environment variables rather than direct context expansion. The addition of explicit permission blocks and credential persistence controls implements least privilege principles, ensuring workflows can only access the resources they genuinely require. The yoast/wp-test-utils constraint is tightened to ^1.2 to ensure compatibility with the updated testing approach, whilst the integration workflow filename is simplified to match standard naming conventions across the plugin collection.
Standardises .gitignore with consistent patterns and adds .distignore for WordPress.org release packaging. Development files like tests, vendor, and node_modules are now properly excluded from distributions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds unit tests for Ad_Code_Manager class methods that can be tested without WordPress, including validate_script_url() for URL whitelist validation and filter_output_tokens() for token replacement logic. Changes: - Add tests/Unit/ directory with TestCase base class - Add AdCodeManagerTest.php (10 tests) covering URL validation and token filtering - Add tests/bootstrap.php to support both unit and integration tests - Update phpunit.xml.dist to include Unit testsuite - Add test:unit composer script - Add phpunit ^9.6 to require-dev - Rename test-integration to test:integration for consistency 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
f435d1d to
9f44b4d
Compare
Adds GitHub Actions workflow for running unit tests across multiple PHP versions (7.4, 8.1, 8.2, 8.3). Unit tests run without WordPress using Brain Monkey, enabling faster feedback on pure PHP logic. Workflow is hardened with: - Minimal permissions (contents: read) - Pinned action versions with SHA - persist-credentials: false 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
9f44b4d to
947805c
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request modernises the plugin's development infrastructure by standardising CI workflows and introducing proper unit testing capabilities.
Summary
Test plan
composer test:unitcomposer test:integration🤖 Generated with Claude Code