$site . ' (' . home_url( '/' ) . ')', __( 'Started', 'brickmoat' ) => Util::local_time( $started ), __( 'Ended', 'brickmoat' ) => $running ? __( 'Still in progress when this report was made', 'brickmoat' ) : Util::local_time( $ended ), ); if ( ! $running ) { $facts[ __( 'Lasted', 'brickmoat' ) ] = self::minutes( $ended - $started ); } if ( null !== $summary['detectedInSeconds'] ) { /* translators: %s: number of seconds. */ $facts[ __( 'Noticed after', 'brickmoat' ) ] = sprintf( _n( '%s second', '%s seconds', (int) $summary['detectedInSeconds'], 'brickmoat' ), number_format_i18n( (int) $summary['detectedInSeconds'] ) ); } $numbers = array( __( 'Payment attempts during the attack', 'brickmoat' ) => (int) $summary['attempts'], __( 'Stopped before the payment provider was contacted', 'brickmoat' ) => $stopped, __( 'Cards declined by the payment provider', 'brickmoat' ) => (int) $summary['declined'], __( 'Different internet addresses used', 'brickmoat' ) => (int) $summary['uniqueIps'], __( 'Different browsers or devices used', 'brickmoat' ) => (int) $summary['uniqueDevices'], __( 'Failed orders left behind', 'brickmoat' ) => (int) $summary['junkOrders'], ); $css = 'body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:1.55;color:#1b1b18;max-width:720px;margin:0 auto;padding:32px 20px}'; $css .= 'h1{font-size:24px;line-height:1.25;margin:0 0 6px}h2{font-size:17px;margin:28px 0 8px}p{margin:0 0 12px}'; $css .= 'table{border-collapse:collapse;width:100%;margin:0 0 8px}th,td{text-align:left;padding:7px 0;border-bottom:1px solid #e5e3dd;vertical-align:top}'; $css .= 'td.n,th.n{text-align:right;font-variant-numeric:tabular-nums}td.k{color:#5e5d58;width:46%}.muted{color:#5e5d58;font-size:13px}'; $css .= '@media print{body{padding:0}}'; $html = ''; $html .= ''; /* translators: %s: store name. */ $html .= '' . esc_html( sprintf( __( 'Card-testing attack report: %s', 'brickmoat' ), $site ) ) . ''; $html .= ''; $html .= '

' . esc_html__( 'Card-testing attack report', 'brickmoat' ) . '

'; $html .= '

' . esc_html( sprintf( /* translators: %s: date and time. */ __( 'Made on %s from this store’s own checkout records.', 'brickmoat' ), Util::local_time( time() ) ) ) . '

'; $html .= '

' . esc_html__( 'What happened', 'brickmoat' ) . '

'; $html .= '

' . esc_html__( 'Automated software used this store’s checkout to try many payment cards in a short time, a pattern known as card testing. These attempts were not made by the store’s customers. The store was running Brickmoat, which stopped most attempts before any payment was requested.', 'brickmoat' ) . '

'; $html .= ''; foreach ( $facts as $label => $value ) { $html .= ''; } $html .= '
' . esc_html( $label ) . '' . esc_html( $value ) . '
'; $html .= '

' . esc_html__( 'The numbers', 'brickmoat' ) . '

'; foreach ( $numbers as $label => $value ) { $html .= ''; } $html .= '
' . esc_html( $label ) . '' . esc_html( number_format_i18n( $value ) ) . '
'; if ( ! empty( $detail['sources'] ) ) { $html .= '

' . esc_html__( 'Where the attempts came from', 'brickmoat' ) . '

'; $html .= ''; foreach ( array_slice( (array) $detail['sources'], 0, 15 ) as $source ) { $html .= ''; $html .= ''; $html .= ''; } $html .= '
' . esc_html__( 'Country', 'brickmoat' ) . '' . esc_html__( 'Kind of connection', 'brickmoat' ) . '' . esc_html__( 'Attempts', 'brickmoat' ) . '' . esc_html__( 'Share', 'brickmoat' ) . '
' . esc_html( (string) $source['country'] ) . '' . esc_html( (string) $source['kind'] ) . '' . esc_html( number_format_i18n( (int) $source['attempts'] ) ) . '' . esc_html( number_format_i18n( 100 * (float) $source['share'], 1 ) ) . '%
'; } $on = array(); foreach ( (array) $detail['protections'] as $protection ) { if ( ! empty( $protection['on'] ) ) { $on[] = (string) $protection['label']; } } if ( ! empty( $on ) ) { $html .= '

' . esc_html__( 'What the store did about it', 'brickmoat' ) . '

'; } $html .= '

' . esc_html__( 'Card numbers are handled by the payment provider only. Brickmoat never sees or stores them, so none appear in this report.', 'brickmoat' ) . '

'; $html .= ''; return $html; } }