<?php
/**
 * Privacy policy helper.
 *
 * @package CertaCart_EU_Product_Readiness
 */

namespace CertaCart\EU_Product_Readiness;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

final class Privacy {
	public static function register(): void {
		add_action( 'admin_init', array( __CLASS__, 'policy_text' ) );
	}

	public static function policy_text(): void {
		if ( ! function_exists( 'wp_add_privacy_policy_content' ) ) {
			return;
		}
		$content  = '<p>' . esc_html__( 'CertaCart EU Product Readiness stores product information and scan results in this WordPress database. It does not upload catalog, customer, order, or scan-report data to CertaCart or Freemius.', 'certacart-eu-product-readiness' ) . '</p>';
		$content .= '<p>' . esc_html__( 'The plugin includes the Freemius SDK for optional installation analytics and, when applicable, account, licensing, checkout, and paid-update services. Analytics remains disabled unless an administrator explicitly opts in. If allowed, Freemius may receive the administrator first name, last name, and email; site URL and title; WordPress, PHP, plugin, and SDK versions; site language; plugin activation/deactivation or uninstall status; and installed plugin/theme names, slugs, versions, and active status.', 'certacart-eu-product-readiness' ) . '</p>';
		$content .= '<p><a href="https://freemius.com/terms/">' . esc_html__( 'Freemius terms', 'certacart-eu-product-readiness' ) . '</a>. <a href="https://freemius.com/privacy/">' . esc_html__( 'Freemius privacy policy', 'certacart-eu-product-readiness' ) . '</a>.</p>';
		wp_add_privacy_policy_content( __( 'CertaCart EU Product Readiness', 'certacart-eu-product-readiness' ), wp_kses_post( $content ) );
	}
}
