Skip to content
zacdreyerPublic

About

Multi-platform legal notice libraries and platform-specific adapters.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

d3v-legal

Multi-platform legal notice libraries and platform-specific adapters for WordPress, EmDash CMS, and any static or framework site via native ES6. The libraries currently cover South African and United Kingdom legal notices, with South Africa available in English (ZAF-eng-legals.json) and Afrikaans (ZAF-afr-legals.json). Additional countries and languages can be supported by adding a {ISO3}-{LANG}-legals.json file to the root legal-libraries/ directory.

Note: This plugin is provided for informational purposes only and does not constitute legal advice. Please consult a qualified attorney or compliance professional before relying on it for legal or regulatory compliance.

Repository layout

  • legal-libraries/ — shared legal content used by every platform adapter.
  • src/wordpress-plugin/ — WordPress adapter (plugin entry point, tests, and platform-specific code).
  • src/javascript-native/ — standalone ES6 adapter for any static site or framework.
  • src/emdash-plugin/ — native plugin for EmDash CMS (Astro-based).
  • src/laravel/ — Laravel package adapter.
  • src/symfony/ — Symfony bundle adapter.
  • src/drupal/ — Drupal module adapter.
  • src/joomla/ — Joomla content plugin adapter.
  • src/magento/ — Magento 2 module adapter.
  • src/prestashop/ — PrestaShop module adapter.
  • src/php-shared/ — framework-agnostic PHP renderer used by the PHP adapters.
  • docs/ — design and developer documentation; excluded from release archives.
  • VERSION — single source of truth for the shared version number across all adapters.
  • Additional CMS/e-commerce adapters will be added as sibling folders under src/.

Versioning

All platform adapters are released together under a single version number defined in VERSION. When any adapter is updated, the release workflow syncs the version to every adapter and rebuilds every platform package, so each release includes matching d3v-legal-<version>-<platform>.zip assets.

Installation

Each platform has its own README with detailed installation instructions:

Local development

  • Install PHP 8.1+.
  • Install Composer.
  • Run composer install.
  • Run php -l src/wordpress-plugin/d3v-legal.php to lint the plugin.
  • Run composer test to execute the PHPUnit regression suite.

Backend Settings

The plugin adds a Settings > D3V Legal page where you can store default values for country, company name, contact details, VAT number, Information Officer, default return window and policy URL. Once saved, shortcodes only need to supply the notice attribute (and any values you want to override per page).

Shortcode Usage

[d3v-legal notice='' country='' language='' company='' email='' support_email='' officer_email='' address='' tel='' smp='' websiteurl='' officer='' regno='' vatno='' returnwindow='' policyurl='']

All attributes are optional except notice. Values supplied in the shortcode take priority; missing or empty values fall back to the backend defaults configured under Settings > D3V Legal.

  • notice: Type of notice to render.
  • country: ISO3 country code taken from the library filename (e.g. ZAF or GBR). Case-insensitive. Defaults to the backend setting, or ZAF if none is configured.
  • language: Three-letter language code taken from the library filename (e.g. eng). Case-insensitive. Defaults to the backend setting, or the first available language for the selected country, otherwise ENG.
  • company: Company or brand name shown in the output.
  • email: General contact email address used as the default for all notices.
  • support_email: Customer support email address. Used in support, returns, shipping, e-commerce and accessibility notices. Falls back to email if not provided.
  • officer_email: Information Officer / privacy / data protection email address. Used in privacy, PAIA and data-rights notices. Falls back to email if not provided.
  • address: Physical address or registered office.
  • tel: Contact number.
  • smp: Social media platform name.
  • websiteurl: Website URL for email disclaimer content.
  • officer: Information Officer name, used in the PAIA manual.
  • regno: Company registration number, used in the PAIA manual.
  • vatno: VAT registration number, used in e-commerce terms.
  • returnwindow: Number of days within which returns are accepted (default 30), used in the returns/refunds policy.
  • policyurl: Optional URL to a full standalone policy page. When supplied, a "Read our full ..." link is appended to the notice.

Shortcode Examples

Minimal usage (backend defaults)

If you have saved your details under Settings > D3V Legal:

[d3v-legal notice='cookies']
[d3v-legal notice='privacy']

Selecting a country and language

Render the UK cookie notice explicitly:

[d3v-legal notice='cookies' country='GBR' company='ABC Holdings']

The language is case-insensitive and read directly from the filename:

[d3v-legal notice='cookies' country='gbr' language='eng' company='ABC Holdings']

Render the Afrikaans South African cookie notice:

[d3v-legal notice='cookies' country='ZAF' language='afr' company='ABC Holdings']

Cookie Notice

[d3v-legal notice='cookies' company='ABC Holdings']

Privacy Policy

[d3v-legal notice='privacy' company='ABC Holdings' address='21 Random Street, Somewhere, South Africa' email='info@abc.com' tel='+27 82 000 0000']

PAIA Manual

[d3v-legal notice='paia' company='ABC Holdings' address='21 Random Street, Somewhere, South Africa' email='info@abc.com' tel='+27 82 000 0000' officer='A. B. Officer' regno='2020/123456/07']

Copyright Notice

[d3v-legal notice='copyright' company='ABC Holdings']

Footer Copyright Notice

[d3v-legal notice='copyrightfooter' company='ABC Holdings']

Disclaimer

[d3v-legal notice='disclaimer' company='ABC Holdings']

Email Disclaimer

[d3v-legal notice='emaildisclaimer' company='ABC Holdings' address='21 Random Street, Somewhere, South Africa' websiteurl='www.abcexample.com']

Terms and Conditions

[d3v-legal notice='tscs' company='ABC Holdings' address='21 Random Street, Somewhere, South Africa']

Competition Terms and Conditions

[d3v-legal notice='comptscs' company='ABC Holdings' email='info@abc.com' address='21 Random Street, Somewhere, South Africa' tel='+27 82 000 0000' smp='Facebook']

Contact

[d3v-legal notice='contact' company='ABC Holdings' email='info@abc.com']

Social Media Release Statement

[d3v-legal notice='smr' company='ABC Holdings' smp='Facebook']

Social Media Netiquette

[d3v-legal notice='smn' company='ABC Holdings' smp='Facebook']

Returns and Refunds Policy

[d3v-legal notice='returns' company='ABC Holdings' email='info@abc.com' address='21 Random Street, Somewhere, South Africa' returnwindow='30']

Customer Support Notice

[d3v-legal notice='support' company='ABC Holdings' email='info@abc.com' tel='+27 82 000 0000' address='21 Random Street, Somewhere, South Africa']

Shipping and Delivery Notice

[d3v-legal notice='shipping' company='ABC Holdings' email='info@abc.com']

Payment and Security Notice

[d3v-legal notice='payments' company='ABC Holdings']

E-commerce Terms and Conditions

[d3v-legal notice='ecomtscs' company='ABC Holdings' address='21 Random Street, Somewhere, South Africa' email='info@abc.com' tel='+27 82 000 0000' vatno='4567890123']

Accessibility Notice

[d3v-legal notice='accessibility' company='ABC Holdings' email='info@abc.com']

Documentation

Release Process

The repository includes a GitHub Actions workflow in .github/workflows/release.yml that lints the WordPress adapter, runs the PHP test suite, builds the EmDash plugin, and creates platform-specific release ZIPs whenever a release is triggered. Current assets include:

  • d3v-legal-<version>-wordpress.zip
  • d3v-legal-<version>-javascript-native.zip
  • d3v-legal-<version>-emdash-plugin.zip

The shared legal-libraries/ directory is copied into each package, and docs/ is excluded to keep archives lean.

About

Multi-platform legal notice libraries and platform-specific adapters.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages