Hold donations with flagged donor names for moderation; reconcile lost side effects (schema v6)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
473fe192cd
commit
353f7ca5be
16 files changed
+681
-41
No files matched your search
@@ -12,6 +12,11 @@ final class Recorder {
|
||||
* @return int[] ids of the tiers this call unlocked.
|
||||
*/
|
||||
public static function forDonation( int $donationId ): array {
|
||||
return self::forDonationChecked( $donationId ) ?? array();
|
||||
}
|
||||
|
||||
/** Same as forDonation() but null (instead of an empty list) when something failed. Never throws. @return int[]|null */
|
||||
public static function forDonationChecked( int $donationId ): ?array {
|
||||
try {
|
||||
global $wpdb;
|
||||
$row = $wpdb->get_row( $wpdb->prepare( 'SELECT id, goal_id, status FROM ' . $wpdb->prefix . 'sg_donations WHERE id = %d', $donationId ), ARRAY_A );
|
||||
@@ -27,7 +32,7 @@ final class Recorder {
|
||||
return $repo->markReached( $goalId, $raised, $donationId );
|
||||
} catch ( \Throwable $e ) {
|
||||
error_log( 'StreamGoals: tier unlock failed for donation ' . $donationId . ': ' . $e->getMessage() ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions
|
||||
return array();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user