Security review fixes: keep pending-capture ids, ship uninstall.php (+verify step), webhook guard, IPv6 /64 + global order throttle, token-safe redirects, honest refund wording, request-id and overlay-token hardening
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
68bd917660
commit
473fe192cd
28 files changed
+747
-34
No files matched your search
@@ -59,6 +59,16 @@ final class Settings {
|
||||
update_option( 'sg_settings', array_merge( self::all(), $allowed ), false );
|
||||
}
|
||||
|
||||
/** Generates the overlay token if none is stored (a DB write: only from activation or an authenticated admin screen). */
|
||||
public static function ensure_overlay_token(): string {
|
||||
$token = (string) self::get( 'overlay_token', '' );
|
||||
if ( strlen( $token ) < 32 ) {
|
||||
$token = bin2hex( random_bytes( 16 ) );
|
||||
self::update( array( 'overlay_token' => $token ) );
|
||||
}
|
||||
return $token;
|
||||
}
|
||||
|
||||
public static function fee_calculator(): FeeCalculator {
|
||||
return new FeeCalculator( (int) self::get( 'fee_percent_bps' ), (int) self::get( 'fee_fixed_minor' ) );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user