Skip to content

Subscriber ID: Verify Numeric Subscriber IDs - #1242

Merged
n7studios merged 7 commits into
update-test-plugins-urlsfrom
use-sh-kit-hash
Oct 15, 2026
Merged

n7studios merged 7 commits into
update-test-plugins-urlsfrom
use-sh-kit-hash

Conversation

@n7studios

Copy link
Copy Markdown
Contributor

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 the sh_kit parameter 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. If sh_kit is 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_signature cookie, 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=Lax attribute, and Secure on HTTPS sites.

Unchanged

  • Signed subscriber IDs, used by Member Content, work as before, as they're verified by the API.
  • Existing ck_subscriber_id and wordpress_ck_subscriber_id cookies 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:

add_filter( 'convertkit_subscriber_allow_unverified_id', '__return_true' );

Testing

  • SubscriberTest:
    • Numeric subscriber IDs in the cookie are only used with a valid signature.
    • Signed subscriber IDs are still used.
    • The convertkit_subscriber_allow_unverified_id filter permits unverified IDs.
    • sh_kit verification: matching, uppercase and wrong hashes, an empty hash, and a different subscriber ID.
  • PageTagCest: existing tests include sh_kit. New tests confirm the subscriber isn't tagged when sh_kit is missing or doesn't match.
  • PageShortcodeCustomContentCest: Custom Content isn't displayed with only ck_subscriber_id, and is displayed when sh_kit is included.
  • BlockMemberContentLoginTest: uses a signed subscriber ID, as a logged in Member Content subscriber would have.

Checklist

@n7studios n7studios added this to the 3.4.7 milestone Oct 9, 2026
@n7studios n7studios self-assigned this Oct 9, 2026
@github-actions

Copy link
Copy Markdown

WordPress Playground

🚀 Your PR has been built and is ready for testing in WordPress Playground!

Click here to test your changes in WordPress Playground

@n7studios
n7studios marked this pull request as ready for review October 12, 2026 11:43
@n7studios
n7studios requested review from a team, ciccio-kit and noelherrick and removed request for a team October 12, 2026 11:43

@noelherrick noelherrick left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make sure there's not a mismatch between the lowercasing/downcasing/trimming before we ship.

Comment thread includes/class-convertkit-subscriber.php Outdated
Comment thread includes/class-convertkit-subscriber.php Outdated
@n7studios
n7studios changed the base branch from main to update-test-plugins-urls October 14, 2026 03:24
@github-actions

Copy link
Copy Markdown

WordPress Playground

🚀 Your PR has been built and is ready for testing in WordPress Playground!

Click here to test your changes in WordPress Playground

@n7studios
n7studios requested a review from noelherrick October 14, 2026 10:22
@n7studios
n7studios merged commit 34e528b into update-test-plugins-urls Oct 15, 2026
320 of 378 checks passed
@n7studios
n7studios deleted the use-sh-kit-hash branch October 15, 2026 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants