Personenbezogene Daten exportieren/loeschen). * * Gespeichert wird je Anmeldeversuch ein pseudonymer IP-Hash, der eingegebene * Benutzername (nur bei vorhandenen Konten im Klartext), das Ergebnis und die * Uhrzeit -- sieben Tage lang. Der IP-Hash laesst sich keinem Konto zuordnen * und gehoert deshalb nicht in Export und Loeschung. */ if ( ! defined( 'ABSPATH' ) ) { exit; } class Wp360_Login_Guard_Privacy { public static function init() { add_action( 'admin_init', array( __CLASS__, 'add_policy_content' ) ); add_filter( 'wp_privacy_personal_data_exporters', array( __CLASS__, 'register_exporter' ) ); add_filter( 'wp_privacy_personal_data_erasers', array( __CLASS__, 'register_eraser' ) ); } public static function add_policy_content() { if ( ! function_exists( 'wp_add_privacy_policy_content' ) ) { return; } $days = Wp360_Login_Guard_Database::RETENTION_DAYS; $content = '

' . esc_html__( 'Login protection', '360-orbit-login-guard' ) . '

'; $content .= '

' . esc_html__( 'Suggested text for your privacy policy. Adapt it to your website.', '360-orbit-login-guard' ) . '

'; $content .= '

' . esc_html( sprintf( /* translators: %d: number of days */ __( 'To protect the login against automated password guessing, this website records every sign-in attempt: the time, whether it succeeded, the user name entered (only if the account exists) and a pseudonymous, irreversibly hashed value derived from the visitor\'s IP address — the IP address itself is not stored. These entries are deleted automatically after %d days. After repeated failed attempts, further attempts from the same source are temporarily blocked. No data is transmitted to third parties.', '360-orbit-login-guard' ), $days ) ) . '

'; $content .= '

' . esc_html__( 'For signed-in users, WordPress stores each active session with the IP address, the browser identification and the time of sign-in; this website additionally stores the time of the last activity. Users can see their own sessions in their profile and sign them out. A session ends when the user signs out, after its expiry or, if set up, after a period without activity.', '360-orbit-login-guard' ) . '

'; wp_add_privacy_policy_content( '360 Orbit Login Guard', $content ); } /** * @param array $exporters Bereits registrierte Exporter. * @return array */ public static function register_exporter( $exporters ) { $exporters['360-orbit-login-guard'] = array( 'exporter_friendly_name' => __( '360 Orbit Login Guard sign-in history', '360-orbit-login-guard' ), 'callback' => array( __CLASS__, 'export' ), ); return $exporters; } /** * @param array $erasers Bereits registrierte Loescher. * @return array */ public static function register_eraser( $erasers ) { $erasers['360-orbit-login-guard'] = array( 'eraser_friendly_name' => __( '360 Orbit Login Guard sign-in history', '360-orbit-login-guard' ), 'callback' => array( __CLASS__, 'erase' ), ); return $erasers; } /** * @param string $email_address E-Mail-Adresse der betroffenen Person. * @return array{data: array, done: bool} */ public static function export( $email_address ) { $data = array(); $user = get_user_by( 'email', (string) $email_address ); if ( $user ) { foreach ( Wp360_Login_Guard_Database::attempts_for_username( $user->user_login ) as $attempt ) { $data[] = array( 'group_id' => 'wp360-lg-sign-in-history', 'group_label' => __( 'Sign-in history', '360-orbit-login-guard' ), 'item_id' => 'wp360-lg-attempt-' . (int) $attempt->id, 'data' => array( array( 'name' => __( 'Time (UTC)', '360-orbit-login-guard' ), 'value' => $attempt->created_at, ), array( 'name' => __( 'Result', '360-orbit-login-guard' ), 'value' => $attempt->success ? __( 'Successful', '360-orbit-login-guard' ) : __( 'Failed', '360-orbit-login-guard' ), ), ), ); } } return array( 'data' => $data, 'done' => true, ); } /** * @param string $email_address E-Mail-Adresse der betroffenen Person. * @return array{items_removed: int, items_retained: bool, messages: array, done: bool} */ public static function erase( $email_address ) { $removed = 0; $user = get_user_by( 'email', (string) $email_address ); if ( $user ) { $removed = Wp360_Login_Guard_Database::delete_for_username( $user->user_login ); } return array( 'items_removed' => $removed, 'items_retained' => false, 'messages' => array(), 'done' => true, ); } }