Prepare for WordPress 7.0 and improve plugin robustness#10
Merged
Conversation
Changes: - Bump Tested up to 7.0 in readme.txt - Fix rgar() argument order in complete_payment() that broke delayed feeds - Fix API singleton to key instances by credentials hash, preventing cross-contamination when global and form configs use different keys - Add WP_Error and HTTP status code checking in API client request() - Extract repeated credential resolution into get_credentials_for_feed() helper - Sync package.json version with plugin version - Update PHPCS testVersion to 7.4-8.4 - Add unit tests for GF_Chip core logic (credentials, callback actions, timezone) - Add GF framework stubs in bootstrap.php so GF_Chip can be unit tested - Add CLAUDE.md with project context and notes - Add CLAUDE.md to .gitattributes export-ignore Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Changes: - plugin-check.yml: add concurrency, PHP matrix testing (7.4/8.0/8.2/8.4), modern action versions, simplified job dependencies - Add pr-summary.yml: auto-generate PR descriptions with AI - Add prepare-release.yml: AI-powered changelog + automated version bump + PR - Add deploy.yml: consolidated SVN deployment with trunk/release stages, sparse checkout, automatic GitHub release creation - Remove old gravity-forms.release.yml and gravity-forms.upload.yml (replaced) - Add bump-version.sh, generate_release_notes.py, generate_pr_summary.py Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Downloaded existing assets from SVN: - banner-1544x500.png, banner-772x250.png - icon-128x128.png, icon-256x256.png - screenshot-1.png through screenshot-5.png Added .wordpress-org/ to .gitignore since these are deployed to SVN separately via deploy.yml and should not be tracked in git. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Restructure with required CLAUDE.md header - Add common development commands (phpunit single test/class, phpcs, plugin-check) - Expand architecture section with credential resolution, webhook verification, and per-payment locking details - Add CI/CD workflow descriptions - Add .claude/ to .gitattributes export-ignore Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Create CONTRIBUTING.md with dev setup, coding standards, release process, and version bump instructions adapted from chip-for-woocommerce - Add .wordpress-org/ to .gitattributes export-ignore - Add .phpunit.result.cache to .gitattributes export-ignore Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- plugin-check.yml: add 8.5 to PHP compatibility matrix - phpcs.xml: update testVersion to 7.4-8.5 - CLAUDE.md: update PHP compatibility references to 8.5 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace gravity-forms-upload-vX.Y.Z with vX.Y.Z across all workflows, scripts, and documentation for consistency with standard semver tagging. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Remove composer.lock from git tracking (was causing merge conflicts) - Add composer.lock, ci-build/, diff.txt, changelog_entry.md to .gitignore Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Document WordPress.org asset naming conventions and deploy sync process, maintaining parity with chip-for-woocommerce project structure. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Replace WP_Mock\Tools\TestCase extends with PHPUnit\Framework\TestCase to fix "Cannot override final method run()" fatal on PHPUnit 9.6+ - Add tearDown() calling WP_Mock::tearDown() in all test classes - Fix equals sign alignment in class-gf-chip.php lines 1132-1133 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add is_wp_error(), wp_remote_retrieve_response_code(), and WP_Error class stubs to tests/bootstrap.php so the new API error handling tests pass. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Update GF_CHIP_APITest::setUp() to reset $instances array property instead of the old $instance property - Fix json_decode(null) deprecation in class-gf-chip-api.php by adding a guard for null/empty response before calling json_decode() Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Update run-wp-plugin-check.sh to build a clean directory via git archive before running plugin check, matching the CI workflow behavior - Use absolute path in .wp-env.json mapping so wp-env mounts the clean build instead of the source repo (which contains dev files) - This eliminates hidden_files and application_detected errors from dev-only files that are already export-ignored in releases Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
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.
What does this change?
This PR focuses on stabilizing the plugin for the WordPress 7.0 release cycle by addressing architectural flaws in the API client and significantly maturing the CI/CD pipeline.
Core Logic & Bug Fixes
GF_CHIP_API::get_instance()to return instances keyed by a hash of credentials (md5(secret_key + brand_id)). This prevents "cross-talk" where credentials from one form might persist into an API call for a different form using different settings.get_credentials_for_feed()to DRY up the logic used to determine whether to use Global or Form-specific settings. This refactor impacts redirect, callback, refund, and cancellation flows.GF_CHIP_API::request()withis_wp_error()checks and HTTP status code validation (ensuring 2xx range) to handle malformed or unauthorized responses gracefully.json_decode.DevOps & CI/CD Enhancements
deploy.ymlto automate syncing the Git repository to the WordPress.org SVN repository (trunk, tags, and assets), replacing older, fragmented workflows.prepare-release.ymlwhich utilizes AI to generate changelogs from commit history and automates version bumping across project files.plugin-check.ymlto test across a wider range of PHP versions (7.4 through 8.5) and integrated PHPUnit into the CI flow.pr-summary.ymlto automatically maintain and update PR descriptions using AI.Documentation & Standards
CLAUDE.mdandCONTRIBUTING.mdto provide comprehensive project context, architectural notes (locking mechanisms, credential resolution), and contribution guidelines..wordpress-org/directory for plugin banners and icons, ensuring they are excluded from the plugin zip but correctly deployed to the SVNassets/folder.How to test
./vendor/bin/phpunit. New tests should cover the refactoredget_credentials_for_feedlogic.GF_CHIP_API::requestreturnsnulland does not trigger PHP warnings.phpcs --standard=PHPCompatibilityWP --runtime-set testVersion 7.4-8.5 .to ensure no regressions for supported PHP versions.Potential Risks & Review Items
get_credentials_for_feedis now used in every critical payment method, verify that the fallback logic (Global vs. Form) matches the previous implementation exactly to avoid breaking existing configurations.GF_CHIP_APIreturnnullon failure. Ensure all callers (likeget_paymentorcreate_payment) handle thisnullreturn to avoid "accessing property on non-object" errors.deploy.ymlworkflow uses a sparse-checkout andrsyncstrategy. The first live run against the WordPress.org SVN should be monitored closely to ensure thetrunkandassetsfolders are updated as expected.Is this PR safe for automatic approval?
No. It contains critical changes to the API client architecture and refactors the core credential resolution logic used for processing payments.
Images
New plugin assets (banners/icons/screenshots) have been added to the
.wordpress-org/folder for the WordPress.org plugin directory.Related Tasks / PRs
Checklist