' . implode( '

', $paragraphs ) . '

'; } public static function register(): void { Journey::registerPrivacy(); SavedViewPrivacy::register(); ReviewPrivacy::register(); add_action( 'admin_init', static function () { if ( function_exists( 'wp_add_privacy_policy_content' ) ) { wp_add_privacy_policy_content( 'Shieldlume Security', wp_kses_post( self::policy() ) ); } } ); add_filter( 'wp_privacy_personal_data_exporters', static function ( $exporters ) { $exporters['antivirus-ai'] = array( 'exporter_friendly_name' => 'Shieldlume Security email preferences', 'callback' => array( self::class, 'export' ), ); return $exporters; } ); add_filter( 'wp_privacy_personal_data_erasers', static function ( $erasers ) { $erasers['antivirus-ai'] = array( 'eraser_friendly_name' => 'Shieldlume Security email preferences', 'callback' => array( self::class, 'erase' ), ); return $erasers; } ); } public static function export( string $email, int $page = 1 ): array { $settings = get_option( 'antivirus_ai_settings', array() ); $data = array(); if ( 1 === $page && 0 === strcasecmp( (string) ( $settings['email_to'] ?? '' ), $email ) ) { $data[] = array( 'group_id' => 'antivirus-ai', 'group_label' => 'Shieldlume Security', 'item_id' => 'antivirus-ai-notification-recipient', 'data' => array( array( 'name' => 'Notification recipient', 'value' => $settings['email_to'], ), array( 'name' => 'Notifications enabled', 'value' => empty( $settings['email'] ) ? 'No' : 'Yes', ), ), ); } if ( 1 === $page ) { $data = array_merge( $data, Welcome::privacyExport( $email ) ); } return array( 'data' => $data, 'done' => true, ); } public static function erase( string $email, int $page = 1 ): array { $removed = false; try { FeedConnection::saveSettings( static function ( array $settings ) use ( $email, &$removed ): array { if ( '' !== $email && 0 === strcasecmp( (string) ( $settings['email_to'] ?? '' ), $email ) ) { $settings['email'] = false; $settings['email_to'] = ''; $removed = true; } return $settings; } ); } catch ( \RuntimeException $error ) { return array( 'items_removed' => false, 'items_retained' => true, 'messages' => array( __( 'The notification preference could not be removed from the database. Restore database access and retry erasure; the saved preference may still be active.', 'shieldlume-security' ) ), 'done' => true, ); } if ( $removed ) { wp_clear_scheduled_hook( 'antivirus_ai_notify' ); } try { $welcome = Welcome::privacyErase( $email ); } catch ( \Throwable $error ) { $welcome = new \WP_Error( 'welcome_erase', __( 'Welcome choices could not be removed. Review the saved connection and retry.', 'shieldlume-security' ) ); } if ( is_wp_error( $welcome ) ) { return array( 'items_removed' => $removed, 'items_retained' => true, 'messages' => array( $welcome->get_error_message() ), 'done' => true ); } $removed = $removed || ! empty( $welcome['removed'] ); return array( 'items_removed' => $removed, 'items_retained' => true, 'messages' => array( __( 'Security evidence, administrator history, and encrypted recovery may contain personal data and require a separate authorized retention review. Matching notification and local welcome email choices are removed. Welcome edition sharing is stopped and its remote removal requested; a confirmed newsletter subscription must be stopped with the unsubscribe link in an email.', 'shieldlume-security' ) ), 'done' => true, ); } }