Repository navigation
Subscriber ID: Verify Numeric Subscriber IDs - #1242
Merged
Merged
Conversation
WordPress Playground🚀 Your PR has been built and is ready for testing in WordPress Playground! |
n7studios
marked this pull request as ready for review
October 12, 2026 11:43
n7studios
requested review from
a team,
ciccio-kit and
noelherrick
and removed request for
a team
October 12, 2026 11:43
noelherrick
requested changes
Oct 13, 2026
noelherrick
left a comment
Contributor
There was a problem hiding this comment.
Let's make sure there's not a mismatch between the lowercasing/downcasing/trimming before we ship.
WordPress Playground🚀 Your PR has been built and is ready for testing in WordPress Playground! |
noelherrick
approved these changes
Oct 14, 2026
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
Verifies numeric subscriber IDs (
ck_subscriber_id) before they're used by the "Add a Tag" Page / Post setting and the Custom Content shortcode, and signs the subscriber ID cookie so it can't be changed.Email links
When a visitor arrives with a numeric
ck_subscriber_id, the Plugin now also requires thesh_kitparameter that Kit adds to email links when Automatically append hashed subscriber email to email links is enabled in Kit's Advanced Tracking settings.The Plugin fetches the subscriber by ID and checks that the SHA-256 hash of their email address matches
sh_kit. If it matches, the subscriber ID is used and stored in the cookie. Ifsh_kitis missing or doesn't match, the subscriber ID is ignored.Cookie
When a numeric subscriber ID is stored, the Plugin also sets a
ck_subscriber_id_signaturecookie, a hash of the subscriber ID signed with the site's WordPress salt. On later visits, a numeric subscriber ID in the cookie is only used if its signature matches. Numeric subscriber IDs stored by the Form Builder block are signed in the same way.Cookies now include the
SameSite=Laxattribute, andSecureon HTTPS sites.Unchanged
ck_subscriber_idandwordpress_ck_subscriber_idcookies are still set.Behaviour change
Creators using "Add a Tag" or the Custom Content shortcode must enable both Add subscriber_id parameter in email links and Automatically append hashed subscriber email to email links in Kit. Existing numeric subscriber ID cookies, which aren't signed, are ignored until the subscriber next clicks an email link.
The previous behaviour can be restored with:
Testing
SubscriberTest:convertkit_subscriber_allow_unverified_idfilter permits unverified IDs.sh_kitverification: matching, uppercase and wrong hashes, an empty hash, and a different subscriber ID.PageTagCest: existing tests includesh_kit. New tests confirm the subscriber isn't tagged whensh_kitis missing or doesn't match.PageShortcodeCustomContentCest: Custom Content isn't displayed with onlyck_subscriber_id, and is displayed whensh_kitis included.BlockMemberContentLoginTest: uses a signed subscriber ID, as a logged in Member Content subscriber would have.Checklist