diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e5b0ed..bdc1df5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,7 @@ jobs: - name: Run Plugin Check uses: wordpress/plugin-check-action@v1 with: + slug: open-trust-center-by-ettic ignore-warnings: true exclude-directories: 'dist' exclude-files: '.phpstan-bootstrap.php' @@ -95,16 +96,16 @@ jobs: - name: Regenerate POT run: | - wp i18n make-pot . languages/opentrust.pot \ - --slug=opentrust \ - --domain=opentrust \ + wp i18n make-pot . languages/open-trust-center-by-ettic.pot \ + --slug=open-trust-center-by-ettic \ + --domain=open-trust-center-by-ettic \ --exclude=dist,vendor,node_modules,languages \ --allow-root - name: Verify POT is up to date run: | - if ! git diff --exit-code -I 'POT-Creation-Date' -- languages/opentrust.pot; then - echo "::error::languages/opentrust.pot is stale. Run \`wp i18n make-pot . languages/opentrust.pot --slug=opentrust --domain=opentrust --exclude=dist,vendor,node_modules,languages\` locally and commit the result." + if ! git diff --exit-code -I 'POT-Creation-Date' -- languages/open-trust-center-by-ettic.pot; then + echo "::error::languages/open-trust-center-by-ettic.pot is stale. Run \`wp i18n make-pot . languages/open-trust-center-by-ettic.pot --slug=open-trust-center-by-ettic --domain=open-trust-center-by-ettic --exclude=dist,vendor,node_modules,languages\` locally and commit the result." exit 1 fi echo "OK: POT is in sync with source." @@ -120,12 +121,13 @@ jobs: run: | set -euo pipefail - header_version=$(grep -E '^\s*\*\s*Version:' opentrust.php | head -1 | sed -E 's/.*Version:\s*//' | tr -d '[:space:]') - constant_version=$(grep -E "define\('OPENTRUST_VERSION'" opentrust.php | sed -E "s/.*'OPENTRUST_VERSION',[[:space:]]*'([^']+)'.*/\1/") + plugin_file=open-trust-center-by-ettic.php + header_version=$(grep -E '^\s*\*\s*Version:' "$plugin_file" | head -1 | sed -E 's/.*Version:\s*//' | tr -d '[:space:]') + constant_version=$(grep -E "define\('ETTIC_OTC_VERSION'" "$plugin_file" | sed -E "s/.*'ETTIC_OTC_VERSION',[[:space:]]*'([^']+)'.*/\1/") readme_version=$(grep -E '^Stable tag:' readme.txt | sed -E 's/Stable tag:\s*//' | tr -d '[:space:]') - echo "opentrust.php header: $header_version" - echo "OPENTRUST_VERSION: $constant_version" + echo "$plugin_file header: $header_version" + echo "ETTIC_OTC_VERSION: $constant_version" echo "readme.txt Stable tag: $readme_version" if [[ -z "$header_version" || -z "$constant_version" || -z "$readme_version" ]]; then diff --git a/.phpstan-bootstrap.php b/.phpstan-bootstrap.php index c97c929..5672642 100644 --- a/.phpstan-bootstrap.php +++ b/.phpstan-bootstrap.php @@ -7,18 +7,18 @@ declare(strict_types=1); -if (!defined('OPENTRUST_VERSION')) { - define('OPENTRUST_VERSION', '1.0.0'); +if (!defined('ETTIC_OTC_VERSION')) { + define('ETTIC_OTC_VERSION', '1.0.0'); } -if (!defined('OPENTRUST_PLUGIN_DIR')) { - define('OPENTRUST_PLUGIN_DIR', __DIR__ . '/'); +if (!defined('ETTIC_OTC_PLUGIN_DIR')) { + define('ETTIC_OTC_PLUGIN_DIR', __DIR__ . '/'); } -if (!defined('OPENTRUST_PLUGIN_URL')) { - define('OPENTRUST_PLUGIN_URL', 'https://example.com/wp-content/plugins/opentrust/'); +if (!defined('ETTIC_OTC_PLUGIN_URL')) { + define('ETTIC_OTC_PLUGIN_URL', 'https://example.com/wp-content/plugins/open-trust-center-by-ettic/'); } -if (!defined('OPENTRUST_PLUGIN_FILE')) { - define('OPENTRUST_PLUGIN_FILE', __DIR__ . '/opentrust.php'); +if (!defined('ETTIC_OTC_PLUGIN_FILE')) { + define('ETTIC_OTC_PLUGIN_FILE', __DIR__ . '/open-trust-center-by-ettic.php'); } -if (!defined('OPENTRUST_DB_VERSION')) { - define('OPENTRUST_DB_VERSION', 2); +if (!defined('ETTIC_OTC_DB_VERSION')) { + define('ETTIC_OTC_DB_VERSION', 1); } diff --git a/README.md b/README.md index c79cc4c..d76492f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
%s
%s. Only Anthropic uses a structural Citations API — every other provider relies on prompted citation tags the model can ignore or fabricate. For a published trust center, switch to Anthropic below.', 'opentrust'), ['strong' => []]), + wp_kses(__('You are currently using %s. Only Anthropic uses a structural Citations API — every other provider relies on prompted citation tags the model can ignore or fabricate. For a published trust center, switch to Anthropic below.', 'open-trust-center-by-ettic'), ['strong' => []]), esc_html(ucfirst($active_provider)) ); ?> @@ -88,22 +88,22 @@ public function render_ai_tab(array $settings): void {
+
Anthropic Claude with the native Citations API to answer visitor questions about your trust center. Every claim the assistant makes is tied to an exact quote from one of your published documents — so no policy text is invented and nothing is paraphrased into something you did not actually publish.', 'opentrust'), + __('Open Trust Center uses Anthropic Claude with the native Citations API to answer visitor questions about your trust center. Every claim the assistant makes is tied to an exact quote from one of your published documents — so no policy text is invented and nothing is paraphrased into something you did not actually publish.', 'open-trust-center-by-ettic'), ['strong' => []] ); ?>
-compliance surface. If the assistant invents a security commitment you never made, that is not a UX papercut — it is a misrepresentation of your security posture, and your customers and auditors will hold you to it.', 'opentrust'), + __('A trust center is a compliance surface. If the assistant invents a security commitment you never made, that is not a UX papercut — it is a misrepresentation of your security posture, and your customers and auditors will hold you to it.', 'open-trust-center-by-ettic'), ['strong' => []] ); ?> @@ -111,13 +111,13 @@ public function render_ai_tab(array $settings): void {
only major provider that exposes a structural Citations API. Documents are sent as typed blocks and the model emits citations as first-class events containing the exact source document and the exact quoted text. The model literally cannot return a citation for text that is not in your source documents.', 'opentrust'), + __('Anthropic is the only major provider that exposes a structural Citations API. Documents are sent as typed blocks and the model emits citations as first-class events containing the exact source document and the exact quoted text. The model literally cannot return a citation for text that is not in your source documents.', 'open-trust-center-by-ettic'), ['strong' => []] ); ?>
- +
- +
- - + +
- +
+
-+
-%s
- +
| - | - | - | - | - | + | + | + | + | + | + | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| created_at . ' UTC'))); ?> | refused): ?> - + question); ?> | @@ -181,8 +183,13 @@ public function render_page(): void {||||||||||
' . esc_html__('Choose which sections to display on the trust center.', 'opentrust') . '
'), - 'opentrust-settings-general' + 'ettic_otc_sections', + __('Visible Sections', 'open-trust-center-by-ettic'), + fn() => print('' . esc_html__('Choose which sections to display on the trust center.', 'open-trust-center-by-ettic') . '
'), + 'ettic-otc-settings-general' ); - $this->add_field('sections_visible', __('Sections', 'opentrust'), 'render_sections_field', 'opentrust_sections', 'opentrust-settings-general'); + $this->add_field('sections_visible', __('Sections', 'open-trust-center-by-ettic'), 'render_sections_field', 'ettic_otc_sections', 'ettic-otc-settings-general'); // ── Contact tab ────────────────────────────────────────────── // Fields are optional — the frontend block renders only when at least one field below is populated. add_settings_section( - 'opentrust_contact', - __('Get in touch', 'opentrust'), - fn() => print('' . esc_html__('Publish a dark-accent "Get in touch" block on the trust center. Every field is optional — the block only appears if at least one is filled in.', 'opentrust') . '
'), - 'opentrust-settings-contact' + 'ettic_otc_contact', + __('Get in touch', 'open-trust-center-by-ettic'), + fn() => print('' . esc_html__('Publish a dark-accent "Get in touch" block on the trust center. Every field is optional — the block only appears if at least one is filled in.', 'open-trust-center-by-ettic') . '
'), + 'ettic-otc-settings-contact' ); - $this->add_field('company_description', __('Company Description', 'opentrust'), 'render_textarea_field', 'opentrust_contact', 'opentrust-settings-contact', [ - 'description' => __('Two or three sentences describing what the company does. Rendered under the "Get in touch" section title.', 'opentrust'), + $this->add_field('company_description', __('Company Description', 'open-trust-center-by-ettic'), 'render_textarea_field', 'ettic_otc_contact', 'ettic-otc-settings-contact', [ + 'description' => __('Two or three sentences describing what the company does. Rendered under the "Get in touch" section title.', 'open-trust-center-by-ettic'), ]); - $this->add_field('dpo_name', __('DPO Name', 'opentrust'), 'render_text_field', 'opentrust_contact', 'opentrust-settings-contact', [ - 'description' => __('Data Protection Officer name. Required under GDPR for many organisations.', 'opentrust'), + $this->add_field('dpo_name', __('DPO Name', 'open-trust-center-by-ettic'), 'render_text_field', 'ettic_otc_contact', 'ettic-otc-settings-contact', [ + 'description' => __('Data Protection Officer name. Required under GDPR for many organisations.', 'open-trust-center-by-ettic'), ]); - $this->add_field('dpo_email', __('DPO Email', 'opentrust'), 'render_email_field', 'opentrust_contact', 'opentrust-settings-contact', [ - 'description' => __('Dedicated DPO mailbox. Rendered as a mailto link.', 'opentrust'), + $this->add_field('dpo_email', __('DPO Email', 'open-trust-center-by-ettic'), 'render_email_field', 'ettic_otc_contact', 'ettic-otc-settings-contact', [ + 'description' => __('Dedicated DPO mailbox. Rendered as a mailto link.', 'open-trust-center-by-ettic'), ]); - $this->add_field('security_email', __('Security Contact Email', 'opentrust'), 'render_email_field', 'opentrust_contact', 'opentrust-settings-contact', [ - 'description' => __('For vulnerability reports and security questions. Often separate from the DPO.', 'opentrust'), + $this->add_field('security_email', __('Security Contact Email', 'open-trust-center-by-ettic'), 'render_email_field', 'ettic_otc_contact', 'ettic-otc-settings-contact', [ + 'description' => __('For vulnerability reports and security questions. Often separate from the DPO.', 'open-trust-center-by-ettic'), ]); - $this->add_field('contact_form_url', __('Contact Form URL', 'opentrust'), 'render_url_field', 'opentrust_contact', 'opentrust-settings-contact', [ - 'description' => __('Optional link to a gated contact form.', 'opentrust'), + $this->add_field('contact_form_url', __('Contact Form URL', 'open-trust-center-by-ettic'), 'render_url_field', 'ettic_otc_contact', 'ettic-otc-settings-contact', [ + 'description' => __('Optional link to a gated contact form.', 'open-trust-center-by-ettic'), ]); - $this->add_field('contact_address', __('Mailing Address', 'opentrust'), 'render_textarea_field', 'opentrust_contact', 'opentrust-settings-contact', [ - 'description' => __('Postal address for formal GDPR / legal notices.', 'opentrust'), + $this->add_field('contact_address', __('Mailing Address', 'open-trust-center-by-ettic'), 'render_textarea_field', 'ettic_otc_contact', 'ettic-otc-settings-contact', [ + 'description' => __('Postal address for formal GDPR / legal notices.', 'open-trust-center-by-ettic'), ]); - $this->add_field('pgp_key_url', __('PGP Public Key URL', 'opentrust'), 'render_url_field', 'opentrust_contact', 'opentrust-settings-contact', [ - 'description' => __('Optional link to your security team\'s PGP public key.', 'opentrust'), + $this->add_field('pgp_key_url', __('PGP Public Key URL', 'open-trust-center-by-ettic'), 'render_url_field', 'ettic_otc_contact', 'ettic-otc-settings-contact', [ + 'description' => __('Optional link to your security team\'s PGP public key.', 'open-trust-center-by-ettic'), ]); - $this->add_field('company_registration', __('Company Registration Number', 'opentrust'), 'render_text_field', 'opentrust_contact', 'opentrust-settings-contact', [ - 'description' => __('KvK (NL), Companies House (UK), Handelsregister (DE), EIN (US), or equivalent business registration.', 'opentrust'), + $this->add_field('company_registration', __('Company Registration Number', 'open-trust-center-by-ettic'), 'render_text_field', 'ettic_otc_contact', 'ettic-otc-settings-contact', [ + 'description' => __('KvK (NL), Companies House (UK), Handelsregister (DE), EIN (US), or equivalent business registration.', 'open-trust-center-by-ettic'), ]); - $this->add_field('vat_number', __('VAT / Tax ID', 'opentrust'), 'render_text_field', 'opentrust_contact', 'opentrust-settings-contact', [ - 'description' => __('VAT number, sales-tax ID, or equivalent international tax identifier.', 'opentrust'), + $this->add_field('vat_number', __('VAT / Tax ID', 'open-trust-center-by-ettic'), 'render_text_field', 'ettic_otc_contact', 'ettic-otc-settings-contact', [ + 'description' => __('VAT number, sales-tax ID, or equivalent international tax identifier.', 'open-trust-center-by-ettic'), ]); } - private function add_field(string $key, string $title, string $callback, string $section, string $page = 'opentrust-settings-general', array $extra = []): void { + private function add_field(string $key, string $title, string $callback, string $section, string $page = 'ettic-otc-settings-general', array $extra = []): void { add_settings_field( - 'opentrust_' . $key, + 'ettic_otc_' . $key, $title, [$this, $callback], $page, @@ -184,14 +184,14 @@ public function render_textarea_field(array $args): void { * @param array