Repository navigation
Scrub the Gravity Forms Mailchimp Add-On's API credentials - #222
Merged
Merged
Conversation
A copy of a production site kept the add-on's OAuth token and legacy API key, so a form submitted on the copy could subscribe people to the live audience. Blank access_token and apiKey inside its settings array and keep the rest, since the add-on fatals on PHP 8 when it writes a group key into a blanked settings value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🔱 Poseidon started reviewing this PR — central run. |
There was a problem hiding this comment.
🔱 Poseidon Review
No issues found on this pass. The new partial_options entry goes through the existing partial path in scrub_options(): it keeps the _sn_backup and only blanks keys that exist (scrub_option_keys()), so server_prefix and the group_key_* entries stay. The C8 count of 4 matches how the CLI sums options and partial_options.
ℹ️ Review info
- Commit: 571e28a
- Files reviewed: README.md, includes/integrations/mailchimp.php, tests/smoke/fixtures/php/seed.php, tests/smoke/fixtures/plugins/gravityformsmailchimp/mailchimp.php, tests/smoke/scenarios/staging-plugin.test.mjs, tests/smoke/scenarios/wp-cli.test.mjs
- Files skipped: none
- Model: claude-opus-5-5
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.
Summary
includes/integrations/mailchimp.phpnow blanksaccess_tokenandapiKeyingravityformsaddon_gravityformsmailchimp_settingsthroughpartial_options, with the usual_sn_backup. The option name, slug and keys were checked against the add-on's source (5.7.2).server_prefixand thegroup_key_*entries among them: the add-on'sget_group_setting_key()writes into that array, which throws aTypeErroron PHP 8 when the whole option has been blanked to''.gf_addon_feedstay. Their fields hold audience IDs, field mappings, tags and conditions, not credentials.Notes
mailchimpplugin pattern already matchesgravityformsmailchimp/mailchimp.php, so the add-on is deactivated as before; the new fixture plugin and the A14 assertion keep that covered.gf_entry,gf_entry_meta,gf_entry_notes,gf_draft_submissions) and the Jetpack CRM Mailchimp extension's settings, which the same copy also kept.Test plan
npm test -- staging-plugin: A2-A13 showsaccess_tokenandapiKeyblanked,server_prefixand the group key kept and the backup holding the token; A14 showsgravityformsmailchimp/mailchimp.phpdeactivated.npm test -- wp-cli: C8 lists the Mailchimp integration with 4 options and the newpartial_optionsentry in its JSON.npm test: every scenario passes (304 passed locally on PHP 8.3, WordPress latest).phpcs includes/integrations/mailchimp.phpreports no errors.