Title: Double Opt-In Helper
Author: Rock Lobster Inc.
Published: <strong>2021 年 12 月 10 日</strong>
Last modified: 2024 年 5 月 7 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/doi-helper.svg)

# Double Opt-In Helper

 作者：[Rock Lobster Inc.](https://profiles.wordpress.org/rocklobsterinc/)

[下载](https://downloads.wordpress.org/plugin/doi-helper.zip)

 * [详情](https://cn.wordpress.org/plugins/doi-helper/#description)
 * [评价](https://cn.wordpress.org/plugins/doi-helper/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/doi-helper/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/doi-helper/#developers)

 [支持](https://wordpress.org/support/plugin/doi-helper/)

## 描述

Double Opt-In Helper is a WordPress plugin that helps developers implement the double
opt-in process in their plugins.

#### What is double opt-in?

Double opt-in is a procedure used to confirm user’s consent. Today, service providers
are required to obtain clear consent from users prior to collecting or using their
personal data. In some situations, however, asking the user to tick an “I agree.”
checkbox is not sufficient. Double opt-in serves a useful role in such situations.

A typical double opt-in process starts by the service provider sending an email 
message to the user. The message includes a URL link to the provider’s website and
asks the user to click the link if they agree on conditions. Usually, the URL includes
some sort of unique random code that works as a token to confirm the user’s consent.

By doing this, the service provider can confirm that the real user (not a bot or
someone else) has consented, because only the user should be able to access messages
to their email address.

#### I’m a developer. How can I use this plugin?

First, register an “agent” who can handle double opt-in sessions for you, and knows
what to do when a user opts-in.

To register an agent, use the `doihelper_register_agent()` function. `doihelper_register_agent()`
takes two parameters: the name of the agent (required), and an optional associative
array of arguments. The available arguments are:

 * `acceptance_period` — The length of time (in seconds) for how long a double opt-
   in session remains live. Default value: 86400 (24 hours)
 * `optin_callback` — The callback function that will be called when a user opts-
   in.
 * `email_callback` — The callback function that will be called to send a confirmation
   email.

After registering an agent, start a double opt-in session by calling the `doihelper_start_session()`
function. `doihelper_start_session()` takes two parameters: the name of the agent(
required), and an optional associative array of arguments. The available arguments
are:

 * `email_to` — The recipient’s email address, used for the confirmation email. 
   If you omit this argument, no email will be sent. If you do not provide this 
   argument, you will need to provide the user with the confirmation link another
   way.
 * `properties` — The properties array of the session. This array is to be passed
   to the `optin_callback` function as its only parameter. While you can include
   any information into this, the primary purpose of it is to pass user-related 
   data to the opt-in callback.

The session data will be stored in the database until the user opts-in, or the acceptance
period (from `doihelper_register_agent()`) expires.

## 安装

 1. Upload the entire `doi-helper` folder to the `/wp-content/plugins/` directory.
 2. Activate the plugin through the **Plugins** screen (**Plugins > Installed Plugins**).

## 评价

此插件暂无评价。

## 贡献者及开发者

「Double Opt-In Helper」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Rock Lobster Inc. ](https://profiles.wordpress.org/rocklobsterinc/)
 *   [ Takayuki Miyoshi ](https://profiles.wordpress.org/takayukister/)

「Double Opt-In Helper」插件已被翻译至 2 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/doi-helper/contributors)
为本插件所做的贡献。

[帮助将「Double Opt-In Helper」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/doi-helper)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/doi-helper/)，查看[SVN仓库](https://plugins.svn.wordpress.org/doi-helper/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/doi-helper/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/doi-helper/)。

## 更新日志

#### 1.0

 * Bumps up the minimum required WordPress version to 6.1.
 * Bumps up the minimum required PHP version to 7.4.

#### 0.73

Initial release.

## 额外信息

 *  版本 **1.0**
 *  最后更新：**2 年前**
 *  活跃安装数量 **100+**
 *  WordPress 版本 ** 6.4 或更高版本 **
 *  已测试的最高版本为 **6.5.8**
 *  PHP 版本 ** 7.4 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/doi-helper/) 、 [German](https://de.wordpress.org/plugins/doi-helper/)
   和 [Japanese](https://ja.wordpress.org/plugins/doi-helper/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/doi-helper)
 * 标签
 * [consent](https://cn.wordpress.org/plugins/tags/consent/)[Opt-in](https://cn.wordpress.org/plugins/tags/opt-in/)
   [privacy](https://cn.wordpress.org/plugins/tags/privacy/)
 *  [高级视图](https://cn.wordpress.org/plugins/doi-helper/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/doi-helper/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/doi-helper/reviews/)

## 贡献者

 *   [ Rock Lobster Inc. ](https://profiles.wordpress.org/rocklobsterinc/)
 *   [ Takayuki Miyoshi ](https://profiles.wordpress.org/takayukister/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/doi-helper/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://contactform7.com/donate/)