'PUT', 'headers' => array( 'Content-Type' => 'application/json', 'Authorization' => $token, ), 'timeout' => 30, ) ); } function adflipr_verify_remote_disconnect_signature($store_uuid, $timestamp, $signature) { $signing_key = get_option(ADFLIPR_DISCONNECT_SIGNING_KEY_OPTION, ''); if (! is_string($signing_key) || $signing_key === '' || ! is_string($store_uuid) || $store_uuid === '') { return false; } $ts = (int) $timestamp; if ($ts <= 0 || abs(time() - $ts) > 300) { return false; } $payload = $store_uuid . '|' . $ts; $expected = hash_hmac('sha256', $payload, $signing_key); $provided = is_string($signature) ? strtolower(trim($signature)) : ''; return $provided !== '' && hash_equals($expected, $provided); }