Skip to content

Prepare for WordPress 7.0 and improve plugin robustness#10

Open
wzul wants to merge 1 commit into
mainfrom
wp-7.0-readiness
Open

Prepare for WordPress 7.0 and improve plugin robustness#10
wzul wants to merge 1 commit into
mainfrom
wp-7.0-readiness

Conversation

@wzul
Copy link
Copy Markdown
Collaborator

@wzul wzul commented May 18, 2026

Summary

This PR prepares the plugin for WordPress 7.0 release and fixes critical bugs found during code review.

Critical Fixes

  • Bump Tested up to: 7.0readme.txt
  • Fix rgar() argument order in complete_payment() — arguments were swapped (rgar('transaction_id', $action) instead of rgar($action, 'transaction_id')), which broke delayed feed triggering after payment completion
  • Fix API singleton patternGF_CHIP_API::get_instance() previously returned the first-created instance regardless of credentials. Now instances are keyed by md5(secret_key + brand_id), preventing credential cross-contamination when a site uses both Global and Form Configuration with different keys

Improvements

  • Add WP_Error and HTTP status handling in API client request() method
  • Extract repeated credential resolution into get_credentials_for_feed() helper (DRY refactor across 5 methods)
  • Sync package.json version to match plugin version (1.2.0)
  • Update PHPCS testVersion from 7.4- to 7.4-8.4 to match CI matrix
  • Add CLAUDE.md with project context, architecture, and notes
  • Add unit tests for GF_Chip core logic (credentials resolution, callback action building, timezone)
  • Add Gravity Forms framework stubs in tests/bootstrap.php so GF_Chip can be unit tested without the full Gravity Forms plugin

Test Plan

  • Run ./vendor/bin/phpunit locally
  • Verify build-zip script: ./scripts/run-plugin-check.sh
  • Test a live payment flow (checkout, callback, refund) on WordPress 7.0 RC
  • Verify settings page renders correctly under the new Modern admin theme

🤖 Generated with Claude Code

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>
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