' . __( 'What personal data we collect and why we collect it' ) . ''; if ( 'on' === get_option( 'relevanssi_log_queries_with_ip' ) ) { $content .= '

' . __( 'IP address for searches', 'relevanssi' ) . '

'; $content .= '

' . __( 'All searches performed using the internal site search are logged in the database, including the following information: the search query, the number of hits found, user ID for users who are logged in, date and time and the IP address. The IP address is stored for security and auditing purposes.', 'relevanssi' ) . '

'; } else { $content .= '

' . __( 'All searches performed using the internal site search are logged in the database, including the following information: the search query, the number of hits found, user ID for users who are logged in and date and time.', 'relevanssi' ) . '

'; } $interval = intval( get_option( 'relevanssi_trim_logs' ) ); $content .= '

' . __( 'How long we retain your data' ) . '

'; if ( $interval > 0 ) { // Translators: %d is the number of days. $content .= '

' . sprintf( __( 'The search logs are stored for %d days before they are automatically removed.', 'relevanssi' ), $interval ) . '

'; } else { $content .= '

' . __( 'The search logs are stored indefinitely.', 'relevanssi' ) . '

'; } } wp_add_privacy_policy_content( $name, $content ); } /** * Registers the Relevanssi data exporter. * * @since 4.0.10 * * @param array $exporters The exporters array. * * @return array The exporters array, with Relevanssi added. */ function relevanssi_register_exporter( $exporters ) { $exporters['relevanssi'] = array( 'exporter_friendly_name' => __( 'Relevanssi Search Logs' ), 'callback' => 'relevanssi_privacy_exporter', ); return $exporters; } /** * Registers the Relevanssi data eraser. * * @since 4.0.10 * * @param array $erasers The erasers array. * * @return array The erasers array, with Relevanssi added. */ function relevanssi_register_eraser( $erasers ) { $erasers['relevanssi'] = array( 'eraser_friendly_name' => __( 'Relevanssi Search Logs' ), 'callback' => 'relevanssi_privacy_eraser', ); return $erasers; } /** * Exports the log entries based on user email. * * @since 4.0.10 * * @param string $email_address The user email address. * @param int $page The page number, default 1. * * @return array Two-item array: 'done' is a Boolean that tells if the exporter is * done, 'data' contains the actual data. */ function relevanssi_privacy_exporter( $email_address, $page = 1 ) { $user = get_user_by( 'email', $email_address ); if ( ! $user ) { // No user found. return array( 'done' => true, 'data' => array(), ); } else { $result = relevanssi_export_log_data( $user->ID, $page ); return array( 'done' => $result['done'], 'data' => $result['data'], ); } } /** * Erases the log entries based on user email. * * @since 4.0.10 * * @param string $email_address The user email address. * @param int $page The page number, default 1. * * @return array Four-item array: 'items_removed' is a Boolean that tells if * something was removed, 'done' is a Boolean that tells if the eraser is done, * 'items_retained' is always false, 'messages' is always an empty array. */ function relevanssi_privacy_eraser( $email_address, $page = 1 ) { $user = get_user_by( 'email', $email_address ); if ( ! $user ) { // No user found. return array( 'items_removed' => false, 'done' => true, 'items_retained' => false, 'messages' => array(), ); } else { $result = relevanssi_erase_log_data( $user->ID, $page ); return array( 'items_removed' => $result['items_removed'], 'done' => $result['done'], 'items_retained' => false, 'messages' => array(), ); } }