<?php
/**
 * Privacy policy content for Speedlyst.
 *
 * @package MarketingConsole
 */

namespace MarketingConsole\Admin;

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

/**
 * Registers suggested privacy policy content.
 */
final class PrivacyContent {

	/**
	 * Register privacy policy content on the admin initialization hook.
	 *
	 * @return void
	 */
	public function register(): void {
		add_action(
			'admin_init',
			static function () {
				if ( ! function_exists( 'wp_add_privacy_policy_content' ) ) {
					return;
				}

				wp_add_privacy_policy_content(
					__( 'Speedlyst', 'speedlyst' ),
					__(
						'<p>When a user starts a speed measurement, the plugin sends the site address, a one-time verification code valid for five minutes, and the installed plugin version to a measurement service operated by the plugin author, which calls the Google PageSpeed Insights API. Page content, personal data, and visitor data are not sent.</p><p>Measurement results are stored locally in the WordPress database and are not sent anywhere else.</p><p>The measurement service stores short-term technical records containing the site address, time, and result for daily limit enforcement and abuse prevention.</p><p>The plugin does not use cookies and does not collect any data about site visitors.</p>',
						'speedlyst'
					)
				);
			}
		);
	}
}
