[WordPress] 外掛分享: Sogo Consent

首頁外掛目錄 › Sogo Consent
WordPress 外掛 Sogo Consent 的封面圖片
全新外掛
安裝啟用
尚無評分
26 天前
最後更新
問題解決
WordPress 6.0+ PHP 8.0+ v1.1.2 上架:2026-06-20

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.1.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Sogo Consent」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Sogo Consent adds a customisable cookie consent banner to your WordPress site. All settings are managed from the WordPress admin. No external services are used. No visitor data is sent anywhere.
Consent modes

Full consent mode — shows Accept All, Reject Non-Essential, and Preferences buttons. The Preferences button opens a modal where visitors can toggle Analytics and Marketing cookie categories individually.
Simple notice mode — shows a single acknowledgement button. Clicking it records that the visitor saw the notice. It does not enable analytics or marketing cookies.

Layout options
Four layout options are available: bottom full-width strip, bottom centre card, bottom right card, bottom left card. On mobile and tablet (992px and below) all layouts automatically become a centred floating card.
Behaviour options

Show or hide the banner without deactivating the plugin
Auto-hide the banner after a configurable number of seconds (1–60)
Set how long to remember the visitor’s choice (1–730 days)
Bump the policy version to ask visitors to choose again after a policy change

Appearance options
Customise background colour, text colour, title colour, primary and secondary button colours, corner radius, and box shadow — all from the Appearance tab in admin.
Consent storage
Consent is stored as a first-party browser cookie named sogo_consent. It uses SameSite=Lax and Secure (HTTPS only). The cookie contains the consent status, timestamp, policy version, banner mode, and category choices. No consent data is stored in the WordPress database.
Developer integration
A public JavaScript API is available on every page after the plugin loads:

window.SogoConsent.getConsent() — returns the current consent object or null
window.SogoConsent.hasConsented() — returns true if valid consent exists
window.SogoConsent.resetConsent() — clears the cookie and re-shows the banner

A DOM event fires whenever consent changes:
document.addEventListener('sogoconsent:change', function(e) { console.log(e.detail); });

Use this event to activate or deactivate analytics or marketing scripts based on the visitor’s choice.
Cache compatibility
The banner HTML is always present in the page source (hidden via the hidden attribute). JavaScript reads the consent cookie on DOMContentLoaded and decides whether to show the banner. This approach works with full-page caching plugins.
RTL and Hebrew support
The plugin auto-detects the WordPress admin language via is_rtl(). On Hebrew installs, all admin labels and default banner text are in Hebrew. The frontend CSS includes scoped RTL layout rules for the modal, toggle, and card positioning.
What this plugin does NOT do

It does not automatically block third-party scripts. It provides a JavaScript API and DOM event so your code or a tag manager can act on consent.
It does not guarantee legal compliance with GDPR, CCPA, or any other privacy regulation. Consult a qualified legal or privacy professional for your specific situation.
It does not scan or detect which cookies your site sets.
It does not store per-visitor consent records in the WordPress database.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon