Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0250b2a
feat: initial reader registration API rollup from working branch
jason10lee Apr 2, 2026
96516b2
docs: annotated new functions with type hints
jason10lee Apr 2, 2026
e38a94f
fix: centralize, normalize definition of `$referer`
jason10lee Apr 2, 2026
ea9af30
fix: use returned status rather than hardcoded value
jason10lee Apr 2, 2026
e0b2de8
test: annotate with group like we do elsewhere for isolated testing
jason10lee Apr 2, 2026
d206c54
docs: note to self about parameterizing `verify_captcha()`
jason10lee Apr 2, 2026
f143df2
docs: note about better mitigating attacks
jason10lee Apr 2, 2026
4d2fcd4
docs: note potential disclosure and mitigation path
jason10lee Apr 2, 2026
3200cc0
fix: merge into existing `reader` now that we are out of POC
jason10lee Apr 3, 2026
a70d5ff
fix: condition reCAPTCHA v3 actions on their `ready()`
jason10lee Apr 3, 2026
ea549c1
style: explicit fallback for `wp_parse_url()` as suggested by Copilot
jason10lee Apr 3, 2026
18de923
fix: make endpoint available only when RAS is enabled, per Copilot
jason10lee Apr 3, 2026
689107b
test: properly tear down our new routes
jason10lee Apr 3, 2026
56ba6ea
feat: localize reCAPTCHA site key and version for both v2 and v3
jason10lee Apr 3, 2026
60b0e77
feat: add reCAPTCHA v2 invisible support to register()
jason10lee Apr 3, 2026
f224df8
fix: move grecaptcha.execute inside try block to prevent Promise leak
jason10lee Apr 3, 2026
9cfcc30
fix: add isolated flag to v2 invisible widget to prevent interference
jason10lee Apr 3, 2026
8fd1a17
fix: add 30s timeout to v2 invisible token acquisition to prevent hang
jason10lee Apr 3, 2026
334c6d0
docs: note potential concurrent-call guard for v2 invisible token
jason10lee Apr 3, 2026
dd4c46b
fix: gracefully reject calls if essential config is missing
jason10lee Apr 3, 2026
9941580
docs: potential future directions for rate limiting
jason10lee Apr 3, 2026
4fbb990
fix: address potential race condition on multiple registrations with …
jason10lee Apr 3, 2026
be59918
fix: ensure idempotency by making sure callers get current reader dat…
jason10lee Apr 3, 2026
22c87af
fix: condition config output on RAS
jason10lee Apr 3, 2026
56e699f
fix: use server-side email, not submitted email, for logged-in users
jason10lee Apr 3, 2026
099a109
fix: reject Promise and provide helpful error if reCAPTCHA not happy
jason10lee Apr 3, 2026
0ec69a2
fix: move reCAPTCHA behind rate limiting to protect metered service f…
jason10lee Apr 3, 2026
4d88837
test: regression test for race condition
jason10lee Apr 4, 2026
e6d6216
test: test our referrer normalization
jason10lee Apr 4, 2026
59a2242
test: regression test reCAPTCHA at the filter level, as mocking the A…
jason10lee Apr 4, 2026
7fb7989
test: verify registry gating on RAS
jason10lee Apr 4, 2026
4fbf3e0
test: verify stability of our integration keys
jason10lee Apr 4, 2026
e6826ff
refactor: extract Reader_Registration class from Reader_Activation
jason10lee Apr 9, 2026
4341739
refactor: delegate frontend registration to Reader_Registration class
jason10lee Apr 9, 2026
b224401
test: update references to Reader_Registration class
jason10lee Apr 9, 2026
b0074c0
fix: add `use` statements for clarity
jason10lee Apr 9, 2026
2b4d04f
feat: add overridable registration key methods to Integration base class
jason10lee Apr 9, 2026
6aba746
feat: delegate key generation and validation to Integration instances
jason10lee Apr 9, 2026
c3ad735
test: add tests for Integration-based key generation and validation
jason10lee Apr 9, 2026
9e48c6e
test: register integration within test because apparently PHPUnit doe…
jason10lee Apr 9, 2026
09236d8
docs: make it clear that overriding the validation step means writing…
jason10lee Apr 9, 2026
5a28ab9
Merge branch 'trunk' into feat/integrations-reader-registration
jason10lee Apr 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions includes/class-newspack.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ private function includes() {
include_once NEWSPACK_ABSPATH . 'includes/class-theme-manager.php';
include_once NEWSPACK_ABSPATH . 'includes/class-admin-plugins-screen.php';
include_once NEWSPACK_ABSPATH . 'includes/reader-activation/class-reader-activation.php';
include_once NEWSPACK_ABSPATH . 'includes/reader-activation/class-reader-registration.php';
include_once NEWSPACK_ABSPATH . 'includes/reader-activation/class-reader-activation-emails.php';
include_once NEWSPACK_ABSPATH . 'includes/reader-activation/class-reader-data.php';
include_once NEWSPACK_ABSPATH . 'includes/reader-activation/sync/class-sync.php';
Expand Down
7 changes: 4 additions & 3 deletions includes/reader-activation/class-reader-activation.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,13 @@ public static function enqueue_scripts() {
'is_ras_enabled' => self::is_enabled(),
];

$script_data = array_merge( $script_data, Reader_Registration::get_script_data() );

if ( Recaptcha::can_use_captcha() ) {
$recaptcha_version = Recaptcha::get_setting( 'version' );
$script_dependencies[] = Recaptcha::SCRIPT_HANDLE;
if ( 'v3' === $recaptcha_version ) {
$script_data['captcha_site_key'] = Recaptcha::get_site_key();
}
$script_data['captcha_site_key'] = Recaptcha::get_site_key();
$script_data['captcha_version'] = $recaptcha_version;
}

Newspack::load_common_assets();
Expand Down
Loading
Loading