User Data Protection Privacy 标志

User Data Protection Privacy

组织
wpultimatesecurity
user-data-protection-privacy

WordPress 插件或主题存储、处理或公开个人数据时使用,包括电子邮件、姓名、IP 地址、用户内容或分析数据。通过 wp_privacy_personal_data_exporters / _erasers 注册数据导出器和擦除器,声明隐私政策内容,对 IP 地址进行匿名化,并尽量减少收集和安全处理个人身份信息(PII)。帮助履行 GDPR/CCPA 义务。凡代码涉及个人身份信息,都应主动应用此技能。

Add to TypingMind

概览

发布者wpultimatesecurity
代码仓库WordPress-Security-Skills
技能名称user-data-protection-privacy
星标数
54
复刻数
3
附带文件
2
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 2 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 wpultimatesecurity 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 User Data Protection Privacy AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/wpultimatesecurity/WordPress-Security-Skills/tree/dev/skills/user-data-protection-privacy
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wpultimatesecurity/WordPress-Security-Skills.git /tmp/WordPress-Security-Skills
mkdir -p .claude/skills
cp -r /tmp/WordPress-Security-Skills/skills/user-data-protection-privacy .claude/skills/user-data-protection-privacy
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 User Data Protection Privacy,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 User Data Protection Privacy。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 User Data Protection Privacy 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

User data protection & privacy

When to use this skill

Use this skill whenever code handles personal data:

  • Storing emails, names, addresses, phone numbers, IPs, or user-generated content.
  • Logging requests/analytics that capture IPs or identifiers.
  • Building forms, CRMs, comment features, membership/e-commerce data.
  • Integrating third-party services that receive user data.

WordPress ships privacy tooling (export/erase requests, policy content) since 4.9.6. Plugins that store PII should integrate with it. Applicable privacy duties depend on jurisdiction and the site's processing; these integrations alone do not establish legal compliance. Minimizing data also reduces the impact of a security breach.

Core principles (and why they matter)

  1. Data minimization. Collect and retain only what the feature needs. Less stored PII means less to leak, export, or erase.
  2. Integrate with WordPress privacy tools. Register an exporter and an eraser so the admin's Export/Erase Personal Data screens include your plugin's data — users have a right to access and deletion.
  3. Declare what you collect. Use wp_add_privacy_policy_content() so the suggested privacy policy reflects your plugin's data practices.
  4. Anonymize where identity isn't needed. Store anonymized IPs (wp_privacy_anonymize_ip()) and use wp_privacy_anonymize_data() for other types.
  5. Secure PII at rest and in transit. Restrict who can read it (capabilities), don't expose it in REST/AJAX to under-privileged users, and never log secrets.
  6. Honor consent and retention. Gate optional collection behind consent; delete data on schedule and on erasure requests.

Step-by-step implementation

  1. Map what PII you store and where (tables, options, meta).
  2. Register an exporter on wp_privacy_personal_data_exporters returning the user's data in the expected paginated structure.
  3. Register an eraser on wp_privacy_personal_data_erasers that deletes/anonymizes that data and reports what it did.
  4. Add policy text via admin_init → wp_add_privacy_policy_content().
  5. Anonymize IPs at capture; minimize fields; set retention.
  6. Gate any display/export of PII behind capability checks.
  7. For consent-required tracking, configure a real consent manager to block script, pixel, and iframe loading until the relevant category is explicitly allowed. Unknown or denied is not consent. Shared cached HTML must remain tracker-free/inert until the visitor's client-side consent check; a PHP cookie gate alone is unsafe with shared page/CDN caches. Gate server-side collection separately and provide withdrawal.

Supporting references

ReferenceLoad when
User data protection & privacy checklistBefore final verification of the user data protection & privacy controls.
Privacy data handlersImplementing personal-data exporter and eraser callbacks with privacy-policy integration.

Common AI mistakes / anti-patterns

Mistake 1 — Storing PII with no export/erase integration

php
// Missing integration: data is invisible to WordPress' privacy tools.
add_option( 'my_newsletter_subscribers', array() ); // emails with no exporter/eraser
php
// Register exporter + eraser so requests cover this data.
add_filter( 'wp_privacy_personal_data_exporters', 'my_plugin_register_exporter' );
add_filter( 'wp_privacy_personal_data_erasers',  'my_plugin_register_eraser' );

Mistake 2 — Storing full IP addresses unnecessarily

php
// ❌ Excessive: full IP retained for basic analytics/anti-spam.
$ip = $_SERVER['REMOTE_ADDR'];
$wpdb->insert( $table, array( 'ip' => $ip ) );
php
// ✅ Minimized: anonymize the IP before storing.
$raw = isset( $_SERVER['REMOTE_ADDR'] )
    ? sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) )
    : '';
$ip  = wp_privacy_anonymize_ip( $raw );
$wpdb->insert(
    $wpdb->prefix . 'my_log',
    array( 'ip' => $ip ),
    array( '%s' )
);

Mistake 3 — Exposing PII to under-privileged users

php
// ❌ Insecure: any subscriber can read everyone's emails via the endpoint.
'permission_callback' => '__return_true',
'callback'            => fn() => get_option( 'my_newsletter_subscribers' ),
php
// ✅ Secure: gate PII behind a capability.
'permission_callback' => static fn() => current_user_can( 'list_users' ),

Mistake 4 — Eraser that doesn't report or doesn't actually erase

php
// ❌ Broken: returns nothing; admin tool can't confirm erasure.
function my_eraser( $email, $page ) {
    delete_metadata( /* ... */ );
}
php
// ✅ Correct: delete/anonymize AND return the documented status array.
function my_eraser( $email, $page = 1 ) {
    $removed = my_plugin_delete_subscriber( $email );
    return array(
        'items_removed'  => $removed,
        'items_retained' => false,
        'messages'       => array(),
        'done'           => true,
    );
}

Mistake 5 — Collecting consent-optional data without consent

php
// ❌ Risky: marketing opt-in assumed.
$wpdb->insert( $table, array( 'email' => $email, 'marketing' => 1 ) );
php
// ✅ Respect explicit consent.
// The form's opt-in checkbox has value="yes"; nonce verified upstream.
$consent = isset( $_POST['marketing_consent'] ) && 'yes' === $_POST['marketing_consent'] ? 1 : 0;
$wpdb->insert(
    $wpdb->prefix . 'my_subs',
    array( 'email' => sanitize_email( wp_unslash( $_POST['email'] ?? '' ) ), 'marketing' => $consent ),
    array( '%s', '%d' )
);

Mistake 6 — Tracking scripts enqueued before consent

php
// Risky: consent-required analytics loads before any consent decision.
add_action( 'wp_enqueue_scripts', function () {
    wp_enqueue_script( 'my-analytics', 'https://cdn.example.com/analytics.js', array(), '1.0', true );
} );

For example, with Cookiebot CMP installed and configured for explicit opt-in, use its documented manual-blocking markup for a statistics script instead of an unconditional wp_enqueue_script() call. Replace the illustrative URL with the actual tracker; do not also load it via a theme, tag manager, or another plugin.

html
<!-- Inert in shared cached HTML; Cookiebot activates only for allowed statistics. -->
<script type="text/plain" data-cookieconsent="statistics"
        src="https://cdn.example.com/analytics.js"></script>

The selected manager must load correctly and cover every tracking entry point. For another manager, use its documented blocking integration, not Cookiebot-specific attributes or a made-up consent cookie. A cookie may encode a denial; its presence or nonempty value is not permission. WP Consent API is an interoperability plugin, not a banner or script blocker, and its consent-type configuration matters.

Blocking only initialization after a normal script src has loaded is too late: the network request already disclosed data. Keep trackers inert in shared HTML and gate server-side tracking separately; do not let a cached consenting response authorize another visitor. Also cover tag managers, dynamically inserted embeds, and preloads.

Provide a persistent consent-settings/withdrawal control (for Cookiebot, its Privacy Trigger and documented renew()/withdraw() APIs). On withdrawal or category denial, stop future collection and remove optional cookies/storage as appropriate using the tracker's documented teardown; reload into a blocked state if scripts cannot be safely stopped. Removing a script tag does not undo executed code or already sent data. Verify unknown, denied, granted, and withdrawn states in browser network and storage tools, including warm shared caches. This is an implementation pattern, not a guarantee of GDPR/CCPA or other legal compliance.

Mistake 7 — Erasing the primary record but not its copies

php
// ❌ Incomplete: the eraser clears the plugin table, but copies survive in a
// transient cache, a search index table, a public export file, and debug logs.
function my_plugin_eraser( $email, $page = 1 ) {
    global $wpdb;
    $wpdb->delete( $wpdb->prefix . 'my_plugin_leads', array( 'email' => $email ) );
    return array( 'items_removed' => true, 'items_retained' => false, 'messages' => array(), 'done' => true );
}
php
// ✅ Secure: erase every derived copy the plugin owns, and report honestly.
function my_plugin_eraser( $email, $page = 1 ) {
    global $wpdb;
    $ids = $wpdb->get_col( $wpdb->prepare( "SELECT id FROM {$wpdb->prefix}my_plugin_leads WHERE email = %s", $email ) );
    foreach ( $ids as $id ) {
        delete_transient( 'my_plugin_lead_' . (int) $id );
        $wpdb->delete( $wpdb->prefix . 'my_plugin_search_index', array( 'lead_id' => (int) $id ) );
    }
    $removed = (bool) $wpdb->delete( $wpdb->prefix . 'my_plugin_leads', array( 'email' => $email ) );
    return array(
        'items_removed'  => $removed,
        'items_retained' => false,
        'messages'       => array(),
        'done'           => true,
    );
}

Inventory derived data too: caches and transients, search or analytics tables, export files, logs, and records restored from backups or imports. Also clean up on delete_user, and never write export files to a public, guessable uploads/ path.

Correct code examples

A complete exporter + eraser registration and a privacy-policy-content example are in references/privacy-data-handlers.php.

Related: see the woocommerce-security skill for order and customer PII handling, and the cron-background-job-security and http-api-ssrf-prevention skills — IP anonymization and retention limits apply to logs written by cron jobs and outbound HTTP helpers too.

Checklist

  • All stored PII is inventoried (tables, options, meta).
  • An exporter is registered on wp_privacy_personal_data_exporters.
  • An eraser is registered on wp_privacy_personal_data_erasers and returns the status array.
  • Privacy policy content declared via wp_add_privacy_policy_content().
  • IPs anonymized with wp_privacy_anonymize_ip() unless full IPs are required.
  • Only necessary fields collected; retention/cleanup defined.
  • PII display/export gated behind capability checks.
  • Consent-optional data is gated behind explicit consent; unknown/denied states do not enable it.
  • A configured consent manager blocks tracker loading before category opt-in, including shared cached pages.
  • Consent can be withdrawn; subsequent collection stops and optional storage is handled appropriately.
  • Cookies and trackers are disclosed in the suggested privacy policy content.
  • PII not leaked in REST/AJAX responses to under-privileged users.
  • No PII or secrets written to logs.
  • Erasers and user deletion also remove derived copies: caches/transients, search or analytics tables, generated export files, and logs.
  • Generated export or backup files are not stored at public, guessable URLs and are deleted after download or expiry.
  • Import and restore paths re-apply current ownership and capability checks instead of trusting stored author or user IDs.

Official references

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

User Data Protection Privacy AI 技能有什么作用?

WordPress 插件或主题存储、处理或公开个人数据时使用,包括电子邮件、姓名、IP 地址、用户内容或分析数据。通过 wp_privacy_personal_data_exporters / _erasers 注册数据导出器和擦除器,声明隐私政策内容,对 IP 地址进行匿名化,并尽量减少收集和安全处理个人身份信息(PII)。帮助履行 GDPR/CCPA 义务。凡代码涉及个人身份信息,都应主动应用此技能。

为什么在 TypingMind 中使用 User Data Protection Privacy?

因为您只需安装一次,就能搭配任何模型使用。User Data Protection Privacy 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 User Data Protection Privacy?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/wpultimatesecurity/WordPress-Security-Skills/tree/dev/skills/user-data-protection-privacy。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 User Data Protection Privacy?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

User Data Protection Privacy 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 User Data Protection Privacy 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

User Data Protection Privacy AI 技能免费吗?

是的。wpultimatesecurity 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇