Linux 软件免费装
Banner图

Cookies, Terms & Conditions Consent Log

开发者 fernandot
ayudawp
更新时间 2026年11月27日 01:20
PHP版本: 7.4 及以上
WordPress版本: 7.2
版权: GPLv2 or later
版权网址: 版权信息

标签

woocommerce gdpr cookie-consent terms-and-conditions consent-log

下载

1.7.4 1.1.0 1.7.2 2.0.0 1.2.0 1.4.0 1.4.1 1.5.0 1.6.0 1.7.1 1.7.3 1.8.1 1.8.2 1.0.0 1.9.0 1.8.0 1.9.1 1.3.0 1.7.0 2.1.0 2.1.1 2.1.2

详情介绍:

WordPress stores consent as a yes. Nothing about when, from where, or which version of your terms was on screen. The day somebody disputes it, that yes is worth very little. Cookies, Terms & Conditions Consent Log fills the gap on any acceptance checkbox of your site: WooCommerce checkout (classic and blocks), Contact Form 7, WPForms, Gravity Forms, Fluent Forms, comments, login and registration, or a stand-alone shortcode or block. It also records what each visitor chooses in the cookie banner you already run, Complianz, CookieYes and GDPR Cookie Compliance by Moove for now, without showing a banner of its own. Every accepted consent writes a row to a dedicated indexed table with the timestamp, the IP, the user agent, the document version in force and the exact text shown, sealed with a SHA-256 hash so any later change is detectable. Exactly what Article 7.1 of the GDPR requires you to be able to demonstrate. Filter, search, export to CSV, integrate with the native WordPress Privacy Tools and open a printable A4 certificate for any record, one click to save it as PDF. Works with or without WooCommerce The admin menu lives under Users → Consent log on every install, with or without WooCommerce. The WooCommerce-specific bits (checkout capture for both the classic and the block checkout, order metabox, "Consent" column on the orders list, optional consent line in the order emails) load only when WooCommerce is active; everything else (Records, Settings, CSV export, PDF certificate, Privacy Tools integration) works the same way on any WordPress site. Sources of consent For anything else (Elementor Forms, Forminator, custom flows), call tccl_save_consent() from the appropriate hook. Why a dedicated table Storing thousands of consent records in wp_postmeta is wasteful and slow. The plugin uses its own indexed table and exposes a public function (tccl_save_consent) that you can call from anywhere to log additional consents in the same place. Main features Translation ready All strings use the terms-conditions-consent-log text domain. Translations are managed through translate.wordpress.org.

安装:

  1. Upload the plugin folder to /wp-content/plugins/terms-conditions-consent-log/ or install through Plugins > Add New.
  2. Activate the plugin.
  3. Open the plugin admin page: Users > Consent log.
  4. In the Settings tab, the integrations (WordPress comments, Contact Form 7, WPForms, Gravity Forms, Fluent Forms, WP/WooCommerce registration) are on by default to support GDPR Article 7.1 (proof of consent) — turn off any that do not apply to your site. Login capture is off by default and only needs turning on if your login form carries a consent checkbox (for example a re-consent prompt). The privacy checkbox for comments and reviews, and the capture of sign-ups from membership plugins, are also off by default: enable them if they apply to your site. You can also paste [tccl_consent_box] in any page or post.
  5. (Optional, WooCommerce only) Override the checkbox text or add a pre-checkout informational paragraph. Leave them empty to keep the WooCommerce native text.
  6. Every accepted consent from any of the enabled sources will be logged automatically from now on.

屏幕截图:

  • Settings tab with editable texts, version control, retention, email options and uninstall control.
  • Order metabox with consent summary, integrity badge and printable-certificate button.
  • Consent column on the orders list.
  • Printable A4 certificate ready to be saved as PDF from the browser.
  • Exported CSV file with filtered records (metadata header + nice column names).

升级注意事项:

2.1.2 Security: the accepted text of a record is now shown on the order screen and in the log without div tags, ids, classes or styles. Closes a script injection by a role without unfiltered_html that had been given access to the log.

常见问题:

Can I use the plugin without WooCommerce?

Yes. Records, Settings, CSV export, the PDF certificate and the Privacy Tools integration work on any WordPress site. The WooCommerce parts (checkout capture, order metabox, order list column, order email line) only load when WooCommerce is active.

How do I keep a consent log for Complianz?

Nothing to set up. With Complianz active, the Cookies tab under Users > Consent log fills up on its own: one sealed row per decision, with the categories accepted, the cookie policy version on screen and the law that applied. Check it in a private window: choose something in your banner and the row appears. Complianz, CookieYes and Moove today, other banners release by release. For any other, Settings > Cookie banner decisions has a custom source to switch on and feed from your own snippet.

How do I keep a consent log for CookieYes?

Nothing to set up while CookieYes runs on its own. With its banner on, the Cookies tab gets one sealed row per decision: the categories accepted, the law that applied and a sealed copy of the banner seen. CookieYes keeps no banner version, so the plugin copies its texts, buttons and categories, and re-copies only when what the visitor reads changes. Not recorded yet: CookieYes connected to its web app (banner served from its servers) and its legacy version. Settings > Cookie banner connection says which case is yours.

How do I keep a consent log for GDPR Cookie Compliance (Moove)?

Nothing to set up. With Moove's banner active, the Cookies tab gets one sealed row per decision: the categories accepted and a sealed copy of the banner the visitor saw. Moove keeps no banner version, so the plugin copies its texts, buttons and categories, and re-copies only when what the visitor reads changes. Each new copy makes Moove ask every visitor again, so no consent outlives its text, also after a Moove update that changes the default texts your banner uses. Installing or updating this plugin asks nobody again. Purge your page cache after changing the banner. To turn it off: add_filter( 'tccl_moove_renew_consent', '__return_false' ); If you also run Moove's Premium Consent Log, it keeps receiving every decision, and its own consent renewal takes precedence.

Does the plugin set a cookie?

One, tccl_cid, and only after a visitor decides something in your banner. Somebody who just reads your site is given nothing. It holds a random identifier your server mints, scripts cannot read it, and it ties one visitor's decisions together. Declare it as strictly necessary in your cookie policy.

How do I record a banner the plugin does not know yet?

Declare it with the tccl_cookie_sources filter, then send each decision from the browser: add_filter( 'tccl_cookie_sources', function ( $sources ) { $sources['my_banner'] = array( 'label' => 'My banner', 'active' => true, 'version' => '3', 'law' => 'optin' ); return $sources; } ); window.tcclCookieConsent.record( 'my_banner', { action: 'accept_all', categories: [ 'functional' ], raw: {}, user_action: 'yes' } ); action is accept_all, reject, custom or withdraw; your server signs the version and the law. If your banner fires one event per category, use queue( 'my_banner', fn ) to collapse them into one row. With no filter, tick "Let my own snippet record decisions" in Settings and use custom.

Nothing shows up in the Cookies tab. What now?

Settings > Cookie banner connection says which banner is running, whether a decision has ever arrived and when the last one did. If it runs and nothing arrives, it has probably changed its script: say so in the support forum and it gets an updated adapter.

Do Export and Erase Personal Data cover cookie decisions?

The ones taken by someone signed in: they carry the user, so WordPress finds them from an email. Exporting returns them, erasing deletes them. A decision taken without signing in has no email and cannot be found from one. Act on those by identifier, in Users > Consent log > Cookies. Erasing deletes instead of anonymising, like the retention period: a scrubbed row would still point at the same browser and prove nothing.

What does a cookie record prove, exactly?

That your site showed that version of that banner under that law, signed by your server, and that the row has not been touched since. Not that a named person clicked: a browser reports the decision, as in every cookie consent log, paid ones included. No row is written for a visitor who has decided nothing.

How do I capture consents from Contact Form 7?

Open Consent log > Settings > Integrations and tick "Log every CF7 form submission that ticks an [acceptance] field". Then make sure your CF7 forms include an [acceptance] field, e.g.: [acceptance privacy] I have read and agree to the privacy policy. [/acceptance] The form ID is part of the consent_type (cf7_form_{ID}), so each form is filterable separately. The first email field is the subject email. No snippets, no functions.php edits.

How do I capture consents from WPForms?

Open Consent log > Settings > Integrations and tick "Log every WPForms submission that ticks a GDPR Agreement field". Then add a GDPR Agreement field (Fancy Fields → GDPR Agreement) and edit its label to the exact wording to record (e.g. "I have read and agree to the privacy policy."). The form ID is part of the consent_type (wpforms_form_{ID}). The first email field is the subject email, and the field label is the stored text. Works with WPForms Lite and Pro. No snippets, no functions.php edits.

How do I capture consents from Gravity Forms?

Open Consent log > Settings > Integrations and tick "Log every Gravity Forms submission that ticks a Consent field". Then add a Consent field (Advanced Fields → Consent) and set its checkbox label to the exact wording to record (e.g. "I have read and agree to the privacy policy."). The form ID is part of the consent_type (gravityforms_form_{ID}). The first email field is the subject email, and the checkbox label is the stored text. No snippets, no functions.php edits.

How do I capture consents from Fluent Forms?

Open Consent log > Settings > Integrations and tick "Log every Fluent Forms submission that ticks a GDPR Agreement or Terms & Conditions field". Then add one of those fields. The form ID is part of the consent_type (fluentforms_form_{ID}). The first email field is the subject email, and the field's agreement text is stored as the accepted text. Works with Fluent Forms Lite and Pro. No snippets, no functions.php edits. The Terms & Conditions field has a checkbox toggle, which is what makes it an act of consent. With it off, Fluent Forms shows plain text with no checkbox, so there is nothing to record.

I added a consent field but nothing is recorded. Why?

Most often the form has no email field. Records are identified by the email in the form's first email field. Without one the submission is skipped on purpose: a record that cannot be attributed to anybody is not evidence. A logged-in person is recorded with their WordPress profile email, so forms behind a login need no email field. Public forms need one. Also check that the consent field is a real consent field of the form builder: an [acceptance] tag in Contact Form 7, a GDPR Agreement field in WPForms, a Consent field in Gravity Forms, or a GDPR Agreement or Terms & Conditions field in Fluent Forms. A plain checkbox or an HTML block with your terms in it is not detected.

How does the [tccl_consent_box] shortcode work?

It renders a consent checkbox and a submit button, with an optional email field for logged-out visitors, and records the consent through tccl_save_consent(). Use it in any page, post or widget area, e.g.: [tccl_consent_box text="I have read and agree to the privacy policy." consent_type="newsletter_signup"] It is also available as a Gutenberg block called "Consent box".

  • Do NOT nest it inside another form builder's form (Contact Form 7, WPForms, Gravity Forms, Fluent Forms, Elementor Forms, etc.): it renders its own <form>, so you get two submit buttons and conflicting flows. Use the dedicated integration instead (the first four are built in; for the rest, hook tccl_save_consent() from the submission action, see the FAQ below).
  • Do NOT use it instead of the cookie checkbox of a cookie/banner plugin (Complianz, CookieYes, Real Cookie Banner, etc.). Cookie banners cover ePrivacy/cookies; this log covers GDPR art. 7.1 specific consents to specific personal-data processing. Mixing them yields ambiguous evidence.

How are WordPress and WooCommerce login / registration consents logged?

When a login or registration form has a ticked consent checkbox, the plugin writes a record: wp_login, wp_register, wc_login or wc_register. It listens to wp_login (wp-login.php and the WooCommerce My Account login), register_new_user and woocommerce_created_customer.

  • No checkbox, no record. "Remember me" is never a consent: it is a cookie preference, not GDPR Article 7.1 consent.
  • Checkbox detection: any field whose name contains consent, gdpr, privacy, terms, acceptance, agreement, accept, rgpd, politica, privacidad or terminos. Other names go in Settings → Integrations → "Custom consent field names" (comma-separated, exact match).
  • WooCommerce's register form has no checkbox of its own. Settings can add a required one, checked on the server, there and on the WordPress form.
  • Every ticked box is its own record. Each one after the first adds its field name, e.g. wp_register_newsletter_consent.
  • The stored text comes from Settings: "Consent text for login / registration", HTML allowed. "Use a different wording per form" covers other wordings.
  • An account created at the WooCommerce checkout is not a registration record: its box is the order's terms, recorded as terms_and_privacy.
  • Social logins are not captured on their own: see the next question.

How do I record consent from social logins (Nextend Social Login and similar)?

Not on its own, and on purpose: a social login ends in an OAuth callback with no form or ticked box. To record an acceptance your social login plugin collected, enable "Also record sign-ups created by membership, course or custom registration forms" in Settings > Integrations and feed the detector with the tccl_consent_detection_payload filter: add_filter( 'tccl_consent_detection_payload', function ( $payload, $context ) { if ( 'user_register' !== $context ) { return $payload; // Never touch the other flows. } // Read the acceptance wherever your social login plugin left it before // sending the visitor to the provider: a transient, a cookie, a session. if ( get_transient( 'my_social_consent' ) ) { $payload['privacy_consent'] = '1'; } return $payload; }, 10, 2 );

  • The key you add must look like a consent field (consent, privacy, terms, gdpr…) or be in "Custom consent field names".
  • $payload must come back untouched for every other context, or it affects logins, comments and the rest of the request.
  • Or call tccl_save_consent() from your social login plugin's "after register" hook, as in the custom-form example below.

Are WordPress comment opt-ins logged automatically?

Yes, by default, but only comments where the visitor ticks the native "Save my name, email, and website..." checkbox. You can opt out in Consent log > Settings > Integrations if your site uses Disqus, Jetpack Comments or another third-party system without that checkbox. That native checkbox only asks permission to leave a cookie: an ePrivacy preference, like "Remember me", not the GDPR Article 7.1 consent to processing the commenter's name and email. For that, use the option in the next FAQ.

How do I record a real privacy consent on comments and product reviews?

Open Consent log > Settings > Integrations and tick "Add a required privacy checkbox to the comment form and record who accepts it". Then:

  • The comment form shows a privacy checkbox, for all visitors.
  • A comment without the tick is rejected on the server, not just in the browser.
  • Each acceptance is stored as consent_type = comment_privacy, separate from the comment_consent cookie opt-in. Both can coexist on one comment.
  • WooCommerce product reviews use the same form, so they are covered.
The wording lives in "Privacy text for comments" (HTML allowed, so you can link to your privacy policy) and is stored with every record. Leave it off if another plugin already adds a checkbox to the comment form, or visitors see two.

My users register through MemberPress, LearnDash or another membership plugin. Are those sign-ups logged?

Only if you enable "Also record sign-ups created by membership, course or custom registration forms" in Consent log > Settings > Integrations. The options above hook the events WordPress and WooCommerce fire on their own forms. Membership, LMS and custom registration plugins create the account through the generic user-creation path, which those options never see. This setting covers that path and stores consent_type = user_register. It still requires a ticked consent checkbox, and never records an account you create yourself from Users > Add New. It is off by default because these forms vary: check the first record before relying on it.

Does it work with the WooCommerce block checkout?

Yes. Both checkouts are supported, and the Settings screen tells you what yours will record. WooCommerce validates the checkbox of its "Terms and Conditions" block in the browser only and never sends its value to the server, so no plugin can read it. What is recorded depends on the block:

  • "Require checkbox" enabled: recorded as terms_and_privacy, like the classic checkout.
  • No checkbox (the WooCommerce default): the shopper accepted by proceeding, not by an affirmative act. That is contractually meaningful but not the explicit consent of Article 7.1, so it is recorded as terms_notice.
  • No Terms and Conditions block on the page: nothing is recorded, because nothing was shown.
For server-validated evidence, turn on "Inject required checkbox" under Settings > Block checkout. It uses the official WooCommerce additional-checkout-fields API and is stored on the order. Those labels render as plain text, so it cannot contain links: keep the Terms and Conditions block on the page for the linked wording.

Why does my block checkout record "terms_notice" instead of "terms_and_privacy"?

Because your Terms and Conditions block has no checkbox, as WooCommerce ships it. The customer saw a sentence saying that continuing implies acceptance and ticked nothing. Logging that as consent would record an act that never happened. This is not a warning that your shop is non-compliant. Processing an order rests on performing the contract (GDPR Article 6.1.b), not on consent. Whether you also need an affirmative act depends on what you ask customers to agree to, and that is your call. For the explicit tick, enable "Require checkbox" on that block, or turn on the injected checkbox in Settings. Existing terms_notice records keep that type: they are the accurate account of what those customers saw.

My site is not in English. Will the record match what my customers read?

Only if you write your own wording into the Terms and Conditions block, as the Settings screen recommends when it detects this. WooCommerce builds the default wording in JavaScript, with translations in script files that PHP cannot read, so no plugin can fetch the exact sentence your visitor saw. This plugin reproduces it under its own text domain: the same string in English, but in other languages its own translation, which may differ word for word. Anything you type into the block is stored verbatim, in any language. The same applies to the injected checkbox, whose text comes from your own setting.

The "Terms checkbox text" setting does nothing on my checkout. Why?

That setting, and the pre-checkout informational text next to it, only apply to the classic checkout. In the block checkout the wording lives in the Terms and Conditions block, which you edit on the checkout page. This is deliberate: records store what the block shows, because the log must prove what the customer read.

Does a record prove what my terms said that day?

Yes, for records taken from now on. The plugin keeps a sealed copy of your legal pages each time they change, and each record points to the copies in force at that moment.

  • Copied without setup: the site's privacy policy page, and the WooCommerce terms and refund pages. Anything else (cookie policy, legal notice): add it in Settings > Documents in force.
  • Pages built with a shortcode or a block are covered: each copy holds the text as read.
  • The certificate lists the documents and says whether they changed since.
  • Private and password-protected pages are not copied.
Older records have no copies. WordPress revisions are no substitute: they can be limited or off.

The consent box says the form is out of date. Why?

The page was rendered before the plugin was updated and is served from a page cache. Purge the cache and it will work again. The form carries a payload signed by the server with the exact text it shows, and only what that payload says is recorded. A form with no payload, or an altered one, is rejected.

The consent box says it cannot record a consent here. Why?

You are looking at it in a preview, a draft or the editor, and you cannot publish posts.

  • Whoever edits a draft decides its wording, so the form is not signed and its button is disabled.
  • It works on the published page. Users who can publish see it working in previews too.

The consent box fails for visitors who are not logged in. Why?

Something is closing the WordPress REST API to anonymous visitors, usually a security plugin set to allow it only for logged-in users. The consent box posts to /wp-json/tccl/v1/consent, so that route has to stay public. Allow the tccl/v1 namespace in that plugin, or switch it to a mode that only blocks the routes you choose.

Where is the data stored?

In a custom indexed table called wp_tccl_consents (with your site prefix). The sealed copies of your legal pages live in a second table, wp_tccl_snapshots. With WooCommerce active, each order also gets three meta entries (_tccl_terms_accepted, _tccl_terms_version, _tccl_recorded_at) so the order screen shows the summary without querying the table.

How do I bump the document version when I change my terms?

Edit the version field in Consent log > Settings, or check "Bump version on save". The plugin also bumps it if the checkbox text changed but the version field did not. Keep in mind:

  1. The version string in Settings must match your terms document's version label character by character (e.g. 1.1-2026-05-17). The plugin just compares strings, so a trailing space is a different version.
  2. After a bump, records under the previous version show as "Outdated". This is on purpose: it is the audit trail of which wording each subject accepted.
  3. Do NOT delete Outdated records. They are the legal proof of consent for the version in force at the time.

How do I delete or anonymise data for a specific customer?

Use Tools > Erase Personal Data. The plugin's eraser anonymises records linked to the requested email (it does not delete them, since the record is the lawful basis to keep the proof of consent). You can also anonymise filtered records from the Records tab.

How do I export a customer's consent history?

Use Tools > Export Personal Data. The plugin's exporter returns every consent record linked to the requested email, and the documents in force when each one was given, with their text.

Will an uninstall destroy my data?

Only if you explicitly opt in. "Delete all data on uninstall" is off by default, so an accidental uninstall keeps your consent evidence. To remove a few test rows (until the upcoming bulk-delete UI), use a direct SQL statement against the consent table, e.g.: DELETE FROM wp_tccl_consents WHERE id IN (1, 2, 3); Replace wp_ with your table prefix. This is an escape hatch, not a day-to-day flow. For real subject requests, use Tools > Erase Personal Data (anonymises) instead.

How do I capture consents from Elementor Forms, Forminator or any other source?

Contact Form 7, WPForms, Gravity Forms and Fluent Forms need only their toggle in Settings > Integrations. For any other source, call the public tccl_save_consent() from that plugin's submission hook. Read the version from the setting (tccl_get_setting( 'consent_version', '1.0' )): a hardcoded one that differs from Settings flags every record "Outdated" forever. add_action( 'the_submission_hook_of_your_form_plugin', function ( $submission ) { tccl_save_consent( array( 'email' => sanitize_email( $submission['email'] ), // however your plugin exposes the email 'consent_type' => 'my_custom_form', 'consent_version' => tccl_get_setting( 'consent_version', '1.0' ), 'consent_text' => 'I have read and agree to the privacy policy.', 'consent_value' => 1, ) ); } ); Common hooks: elementor_pro/forms/new_record, forminator_custom_form_after_submission, user_register. Adapt the callback signature and how you read the email and the acceptance to each plugin's arguments.

Does the IP detection work behind Cloudflare or other reverse proxies?

Yes, once you tell it which proxy to trust. By default it records REMOTE_ADDR, the address your server actually talked to, and ignores forwarded headers, which anyone can fake. Behind a proxy, that address is the proxy's. In Consent log > Settings, list the proxy under "Reverse proxies you trust" (one IP or CIDR range per line, the proxy's own addresses) and pick the header it sets: X-Forwarded-For, CF-Connecting-IP, X-Real-IP or True-Client-IP. The header is only read on requests that come from a listed proxy. Private addresses in the chain count as hops of your own network and are skipped, so a visitor inside that private network can make their own record show an address of their choosing.

What does "Tamper-evident" mean here?

The plugin stores a SHA-256 hash of the exact accepted text with each record. On every read it compares it with a fresh one, and any difference is reported as TAMPERED in the records list, the order metabox and the certificate view. This is a cryptographic integrity check, not an electronic signature.

Is the certificate a real PDF?

The plugin renders a one-page A4 view with a "Print / Save as PDF" button, and modern browsers (Chrome, Safari, Firefox, Edge) export it to a real PDF natively. No external library is bundled. The plugin does NOT store any PDFs on disk and does NOT create an uploads folder. The certificate is generated on demand as HTML. The Site Icon from Settings > General, if set, shows in the header, also on certificates of older records.

I activated the plugin on some subsites only. What happens when I delete one of them?

The plugin removes a subsite's two tables (wp_<id>_tccl_consents and wp_<id>_tccl_snapshots) when it is deleted. But deleting a site runs from the network admin, which loads only the plugins active network-wide or on the main site. If the plugin is not active there, the clean-up does not run: the tables stay, records included, with no screen to see them. Export the subsite's records (CSV in Users > Consent log) before deleting it, or activate the plugin network-wide.

I changed my cookie banner. Why do some new records still show the previous version?

Each page carries a context signed by the server with the banner version shown on it, and the record stores what that page showed. A page served from a page cache was generated before the change, so it keeps sending the old version until the cache is purged. That is correct evidence of what that visitor saw. Purge the page cache after changing the banner.

更新日志:

2.1.2 Security: the accepted text of a record is now shown on the order screen and in the log without div tags, ids, classes or styles. Closes a script injection by a role without unfiltered_html that had been given access to the log. 2.1.1 Fixes the comment privacy checkbox in Astra and Storefront and for logged-in users, keeps filters intact in exports and page links, makes copies and cookie records safe when requests overlap, and records the CookieYes close button. 2.1.0 Records what your visitors choose in GDPR Cookie Compliance by Moove, with a sealed copy of the banner they saw, and has Moove ask again when what that banner says changes. For older changelog entries, please check the changelog.txt file.