<?php

namespace CaptureRelay;

final class Privacy
{
    public function hooks(): void
    {
        add_action('admin_init', [$this, 'addPolicyContent']);
    }

    public function addPolicyContent(): void
    {
        if (!function_exists('wp_add_privacy_policy_content')) {
            return;
        }

        $content = '<p>' . esc_html__(
            'CaptureRelay stores information supplied by mobile device operators so an administrator can review connection requests and audit image deliveries. This may include a device display name, model, mobile platform, operating-system and app versions, photo credit, timestamps, and the internet address used for a pending request.',
            'capture-relay'
        ) . '</p>';
        $content .= '<p>' . esc_html__(
            'Pending-request internet addresses are visible only to administrators who can manage CaptureRelay and are removed when a request is approved, rejected, cancelled, or expires. Hashed internet-address values may be retained temporarily for abuse prevention. Connection, upload, and security records are removed according to the retention periods selected in CaptureRelay settings.',
            'capture-relay'
        ) . '</p>';
        $content .= '<p>' . esc_html__(
            'CaptureRelay does not send plugin telemetry or stored WordPress data to CaptureRelay. WordPress may send administrator-configured approval and upload notifications through the website’s normal email system. Images accepted from approved devices become normal WordPress Media Library attachments and remain there until a site administrator deletes them.',
            'capture-relay'
        ) . '</p>';
        $content .= '<p>' . esc_html__(
            'The plugin does not associate its device records with a WordPress user email address, so they are not included automatically in WordPress personal-data email exports or erasures. Administrators can revoke or permanently block a device, remove retained plugin data through the configured uninstall option, and delete uploaded Media Library attachments using normal WordPress tools.',
            'capture-relay'
        ) . '</p>';
        $content .= '<p>' . esc_html__(
            'Requests concerning an image, device record, block, or delivery record stored on this website should be handled by this website’s administrator. Skyrocket Radio, the developer and publisher of CaptureRelay, normally cannot access or delete information stored by independently operated destination websites.',
            'capture-relay'
        ) . '</p>';
        $content .= '<p>'
            . '<a href="' . esc_url(Config::PRIVACY_URL) . '">' . esc_html__('CaptureRelay Privacy Policy', 'capture-relay') . '</a>'
            . ' · <a href="' . esc_url(Config::TERMS_URL) . '">' . esc_html__('Terms of Use', 'capture-relay') . '</a>'
            . ' · <a href="' . esc_url(Config::CONTACT_URL) . '">' . esc_html__('Contact CaptureRelay', 'capture-relay') . '</a>'
            . '</p>';

        wp_add_privacy_policy_content(
            esc_html__('CaptureRelay', 'capture-relay'),
            wp_kses_post($content)
        );
    }
}
