# double-opt-in/5.5.0/core/helpers/uuid.php

Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification, version 5.5.0. 28 lines.

- Page: https://pluginprobe.com/plugins/double-opt-in/5.5.0/code/core/helpers/uuid.php
- Raw: https://pluginprobe.com/plugins/double-opt-in/5.5.0/raw/core/helpers/uuid.php
- Modified: 2026-07-13T12:16:42+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/double-opt-in/5.5.0/code/core/helpers/uuid.php#L10-L20`.

```php
<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( ! function_exists( 'f12_cf7_doubleoptin_get_installation_uuid' ) ) {
	function f12_cf7_doubleoptin_get_installation_uuid(): string {
		$uuid = get_option( 'f12_cf7_doubleoptin_installation_uuid' );
		if ( empty( $uuid ) ) {
			if ( function_exists( 'wp_generate_uuid4' ) ) {
				$uuid = wp_generate_uuid4();
			} else {
				$uuid = sprintf(
					'%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
					mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
					mt_rand( 0, 0xffff ),
					mt_rand( 0, 0x0fff ) | 0x4000,
					mt_rand( 0, 0x3fff ) | 0x8000,
					mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )
				);
			}
			update_option( 'f12_cf7_doubleoptin_installation_uuid', $uuid, true );
		}

		return $uuid;
	}
}

```
