Description
SignDocs Brasil is the official WordPress plugin for legally-binding electronic signatures in Brazil. Embed signing flows on any page with a shortcode or Gutenberg block, send multi-signer envelopes (sequential or parallel), verify signed evidence directly from the WordPress admin, and track everything through an audit log with CSV export.
Built on top of the official SignDocs Brasil PHP SDK (signdocs-brasil/signdocs-brasil-php), the plugin leverages OAuth token caching shared across PHP-FPM workers, deterministic idempotency, webhook secret rotation with a grace window, and observability via RateLimit-* / Deprecation / Sunset response headers.
The plugin targets the Brazilian market (compliance with MP 2.200-2/2001, ICP-Brasil, NT65/ITI for INSS payroll loans), but works for any signing workflow worldwide. The signing UI itself is hosted on sign.signdocs.com.br, isolated from your WordPress install, so a compromised WordPress site cannot forge signatures.
Why SignDocs Brasil?
- Brazilian compliance — MP 2.200-2/2001, PKCS#7/CMS evidence package, ICP-Brasil A1/A3 certificate support, NT65/ITI flow for INSS payroll loans
- Seven verification policies — CLICK_ONLY, CLICK_PLUS_OTP, BIOMETRIC, BIOMETRIC_PLUS_OTP, DIGITAL_CERTIFICATE, BIOMETRIC_SERPRO, BIOMETRIC_SERPRO_AUTO_FALLBACK
- Multi-signer envelopes — sequential (each signer waits for the previous one) or parallel (everyone signs simultaneously), with consolidated
.p7sor combined PDF download when complete - Two authentication modes — OAuth2
client_credentials(simple) or Private Key JWT ES256 (for regulated customers who cannot store shared secrets at rest) - WooCommerce integration — automatically emails the signing link after order completion
- Complete audit trail — every API call and webhook delivery is logged in a dedicated table with a filterable WP_List_Table view and CSV export
- GDPR / LGPD — data exporter and eraser handlers registered with the WordPress privacy panel
- Observability —
RateLimit-*headers captured for the dashboard widget; deprecation warnings (RFC 8594Deprecation/Sunset) surface as admin notices - Zero code — configure everything from the WordPress admin
Features
- Shortcode
[signdocs]and Gutenberg block to embed the signing button on any post or page - Custom post type
signdocs_envelopefor multi-signer workflows with a signer repeater - “Verify Document” admin page — paste an evidence ID or envelope ID and inspect signer identities, tenant CNPJ, consolidated downloads
- Audit log with filters by level, event type, and date range, plus streaming CSV export (via
php://output, safe for multi-GB exports) - Webhook secret rotation with a 7-day grace window — both secrets (current + previous) are accepted during rotation
- All 17 webhook event types covered, including the NT65 events (
STEP.PURPOSE_DISCLOSURE_SENT,TRANSACTION.DEADLINE_APPROACHING) - Custom capabilities (
signdocs_manage,signdocs_send,signdocs_verify,signdocs_view_logs) automatically granted to administrator / editor / author - WP-CLI commands (
wp signdocs health | send | status | webhook-test | log-tail) for shell automation - WooCommerce integration — “SignDocs Signature” product tab, automatic email with the signing link, order notes after completion
- Popup, redirect, or overlay — pick the embed mode that fits your theme
- Optional anonymous signing with rate limiting
- Credentials encrypted with AES-256-CBC in
wp_options - Hardened webhook receiver: timestamp drift gate (≤300s), HMAC-SHA256 timing-safe verification, replay de-duplication via
X-SignDocs-Webhook-Id - OAuth token cache shared via WordPress transients (
WpTransientTokenCacheimplements the SDK’sTokenCacheInterface) — a single token reused by every PHP-FPM worker - Deterministic idempotency keys on every resource-creating call — AJAX retries never create duplicate sessions
- Deprecation observer (RFC 8594) that surfaces an admin notice when the API signals an endpoint is being removed
- Translatable: English, Portuguese (Brazil), Spanish
Use cases
- Law firms — powers of attorney, contracts, terms, multi-party envelopes
- Real estate — rental and sale contracts signed by tenant, landlord, and guarantor (sequential envelope)
- E-commerce — terms of service, supplier contracts, post-purchase NDAs
- HR and people ops — employment contracts, NDAs, onboarding paperwork
- Education — enrollment forms and parental consent (parents + student in a parallel envelope)
- SaaS — terms of use and license agreements at onboarding
- INSS payroll loans (Brazil-specific) — NT65 flow with SERPRO biometric verification and purpose disclosure notification
- Banks and financial institutions — Private Key JWT lets you sign without storing a shared secret in the database
How it works
- Configure your SignDocs Brasil API credentials in the WordPress admin (Client ID + Secret, or Private Key + Key ID)
- Add a shortcode, Gutenberg block, or create a multi-signer envelope from the admin
- The signer clicks “Sign Document” and is redirected to the secure domain
sign.signdocs.com.br(signing never happens inside your WordPress site — this isolates your install from any compromise) - The signer completes the flow according to the configured policy (click, OTP, biometrics, digital certificate)
- Webhooks update the status in the WordPress admin in real time; the
.p7mevidence package becomes available for download and verification
Links
Usage
Shortcode
Add to any page or post:
[signdocs document_id="123" policy="CLICK_ONLY" button_text="Sign Contract"]
With name / email / CPF form:
[signdocs document_id="123" show_form="true" policy="CLICK_PLUS_OTP"]
Available attributes:
document_id(required) — ID of the PDF attachment in the media librarypolicy— one of:CLICK_ONLY,CLICK_PLUS_OTP,BIOMETRIC,BIOMETRIC_PLUS_OTP,DIGITAL_CERTIFICATE,BIOMETRIC_SERPRO,BIOMETRIC_SERPRO_AUTO_FALLBACKlocale— language:pt-BR,en,esmode— embed mode:redirect(default),popup,overlaybutton_text— button label (default: “Sign Document”)show_form—"true"to display name / email / CPF / CNPJ inputsreturn_url— URL to redirect to after signingclass— additional CSS class for the button
Gutenberg block
- In the block editor, click “+” to add a block
- Search for “SignDocs” or “Signature”
- Pick a PDF in the right sidebar
- Configure the policy, locale, and mode
- Publish the page
Multi-signer envelopes
For contracts with more than one signer (for example, landlord + tenant + guarantor), use the Envelopes menu:
- WP Admin > Signatures > Envelopes > Add New
- Select the signing mode:
- SEQUENTIAL — each signer signs in order; the next signer only receives their link when the previous one completes
- PARALLEL — all signers can sign simultaneously, in any order
- Add the signers (name + email + CPF or CNPJ + optional per-signer policy)
- Attach the PDF and publish
- Each signer receives an email with their individual link; the admin sees the envelope status update as each signature completes
- After everyone has signed, a combined stamped PDF (or consolidated
.p7sfor non-PDF documents) becomes available for download
The webhook events STEP.STARTED, STEP.COMPLETED, and STEP.FAILED are recorded per signer in each envelope’s log.
WooCommerce
- Edit a product and open the “SignDocs Signature” tab
- Check “Requires signature” and select the PDF
- Configure the verification policy
- When an order completes, the signing link is automatically emailed to the customer
- After signing, an order note is added with the evidence ID
The customer’s CPF or CNPJ must be present in the order. The plugin reads the standard
_billing_cpf/_billing_cnpjorder meta keys used by the Brazilian Market on WooCommerce extension. If neither is present, the plugin adds an order note explaining the requirement and skips session creation.
Document verification
The Signatures > Verify page (requires the signdocs_verify capability):
- Paste an
evidence_id(single signature) orenvelope_id(multi-signer) - The plugin calls
GET /v1/verify/{id}orGET /v1/verify/envelope/{id}and renders:- Identities of every signer (name, CPF/CNPJ)
- Tenant CNPJ
- Timestamps for each step
- The applied policy profile
- Download links: evidence package (
.p7m), signed PDF, consolidated.p7s(envelopes), combined PDF (envelopes)
- Use the evidence files in external validators (ITI Validador, Adobe Acrobat) for independent confirmation
Audit log
The Signatures > Audit Log page (requires the signdocs_view_logs capability):
- WP_List_Table view over
{prefix}signdocs_log - Filters: level (debug / info / warning / error), event type, date range
- CSV export via
admin-post.php(chunked streaming, safe for multi-GB exports) - Automatic 30-day retention via the daily
signdocs_prune_logscron - Every API call, webhook delivery, and deprecation warning is recorded with JSON context
WP-CLI
For shell-based operations (useful for automation, CI/CD, and troubleshooting):
wp signdocs health
— check connectivity to the API in the configured environment
wp signdocs send --document=42 --email=alice@example.com --cpf=12345678901 --policy=CLICK_PLUS_OTP
— create a signing session from a WordPress attachment and print the session ID and URL
wp signdocs status <sessionId>
— look up the status of a session by ID
wp signdocs webhook-test <webhookId>
— send a test delivery to a registered webhook
wp signdocs log-tail --level=warning --limit=20
— show the last N entries of the audit log filtered by level
Webhook secret rotation
- In Settings > SignDocs Brasil, click “Rotate Secret”
- The plugin requests a new secret from the API; the previous secret becomes the “previous secret” with a 7-day grace window
- During the window, the
/wp-json/signdocs/v1/webhookendpoint accepts both secrets — in-flight deliveries are not rejected - After 7 days, the daily
signdocs_expire_prev_secretcron removes the old secret - The rotation status is visible in the admin (with a countdown)
For developers
Available hooks:
Session lifecycle:
signdocs_session_created— Session created (via the API, not necessarily via WordPress)signdocs_signing_completed— Signing completed successfullysigndocs_signing_cancelled— Signing cancelled by the integrator or the signersigndocs_signing_expired— Session expired without completionsigndocs_signing_failed— Signing failed (unrecoverable error)signdocs_transaction_fallback— Fallback was triggered (e.g., SERPRO unavailable)
Per-step (for envelopes and custom flows):
signdocs_step_started— Step started (OTP sent, biometric capture, etc.)signdocs_step_completed— Step completedsigndocs_step_failed— Step failedsigndocs_purpose_disclosure_sent— (NT65) Purpose disclosure notification delivered to the beneficiarysigndocs_deadline_approaching— (NT65) ≤2 business days left before the INSS submission deadline
Tenant / API:
signdocs_quota_warning— Tenant usage crossed a threshold (80 / 90 / 100%)signdocs_api_deprecation_notice— API signaled a deprecated endpoint
WooCommerce:
signdocs_wc_signing_completed— A WooCommerce order signing completed
Each action receives $post_id (of the signdocs_signing or signdocs_envelope CPT) and $payload (the raw webhook array) as arguments, except signdocs_quota_warning and signdocs_api_deprecation_notice which receive only the payload.
Capabilities:
signdocs_manage— Configure credentials, webhook, branding; manage other users’ envelopessigndocs_send— Create sessions and envelopessigndocs_verify— Use the Verify page and inspect evidencesigndocs_view_logs— Access the audit log and export CSV
Use current_user_can('signdocs_send') instead of manage_options / edit_posts when adding custom functionality.
PHP SDK:
The configured SDK client (with encrypted credentials and shared token cache) is available via:
$client = Signdocs_Client_Factory::get(); // SignDocsBrasil\Api\SignDocsBrasilClient or null
See the PHP SDK documentation for the full surface (transactions, envelopes, verification, users, documentGroups, webhooks, etc.).
External services
This plugin connects to the SignDocs Brasil platform — operated by the same company that publishes the plugin — to create, deliver, and verify electronic signatures. The plugin cannot function without sending data to these endpoints, because the signing itself happens on the SignDocs servers (the WordPress site only orchestrates the request and stores the result reference).
SignDocs Brasil API (api.signdocs.com.br / api-hml.signdocs.com.br)
Used to create signing sessions, register webhooks, verify signed evidence, and manage multi-signer envelopes. The plugin authenticates with the API credentials you enter in the WordPress admin (OAuth2 client_credentials, or alternatively Private Key JWT when configured).
- What data is sent, per signing-session create: the PDF document content (base64-encoded), the signer’s name, the signer’s email address, the signer’s CPF or CNPJ (one is required by the API), the selected verification policy (e.g.
CLICK_ONLY,BIOMETRIC), the language preference, an optional return URL, and metadata fields identifying the WordPress site URL and source surface (shortcode, AJAX, WP-CLI, WooCommerce, envelope). - When: every time a signing session is created. This happens on shortcode AJAX submission, on
wp signdocs sendfrom the WP-CLI, on WooCommerce order completion when the product is configured for signing, and on every envelope creation / new-signer add. - Other API calls that send no document data: webhook registration, status polling (
GET /v1/signing-sessions/{id}), evidence verification (GET /v1/verify/{evidenceId}), envelope status. These send only the relevant identifier you provide (session ID, evidence ID, envelope ID). - Authentication: every API call is authenticated with a short-lived Bearer token obtained from the OAuth2 token endpoint at the same domain (
POST {baseUrl}/oauth2/token). The plugin sends your Client ID and either Client Secret or a signed JWT assertion (when Private Key JWT mode is configured) to that endpoint at first call and again when the cached token expires (typically once per hour per environment); the access token is cached in a WordPress transient and reused across all subsequent API calls. No signer data is sent to the token endpoint. - Environment switch: the plugin uses
api-hml.signdocs.com.br(HML / sandbox) by default, andapi.signdocs.com.bronly when the administrator explicitly switches the environment to “Production” in the settings page. - Provided by SignDocs Brasil. Terms of Use. Privacy Policy.
SignDocs Brasil browser SDK (cdn.signdocs.com.br / cdn-hml.signdocs.com.br)
A JavaScript file (signdocs-brasil.js) loaded from the SignDocs CDN that opens the signing popup, redirect, or overlay when the signer clicks the embedded “Sign Document” button rendered by the shortcode or Gutenberg block.
- What data is sent: nothing directly by this script load — it is a static asset request, the same as any other JavaScript file from a third-party CDN. No personally identifiable information is transmitted by the CDN request itself; the script is bytes-identical for every site that loads it.
- When: every front-end page-view that renders the
[signdocs]shortcode or the SignDocs Gutenberg block (the script is enqueued conditionally — pages without the block do not load it). - The CDN environment (HML vs prod) follows the same
signdocs_environmentoption as the API. - Provided by SignDocs Brasil. Terms of Use. Privacy Policy.
SignDocs Brasil signing UI (sign.signdocs.com.br)
After the signer clicks “Sign Document”, they are taken to the secure signing page on sign.signdocs.com.br — not to a page hosted by your WordPress site. The signing flow (OTP, biometric capture, digital-certificate selection, click-only confirmation) executes entirely on this domain. This isolation is intentional: even if your WordPress site were compromised, an attacker could not forge signatures because the authentication factors are collected on a separate origin under SignDocs Brasil’s control.
- What data is sent: the signer interacts directly with this domain to complete the signing flow. The data exchanged here (OTP codes, biometric photos, certificate selections) does not pass through your WordPress site. Your plugin only receives the result back via the webhook described above.
- When: when the signer clicks the signing button rendered by the plugin and the browser SDK opens the signing surface (popup / redirect / overlay).
- Provided by SignDocs Brasil. Terms of Use. Privacy Policy.
Blocks
This plugin provides 1 block.
- SignDocs Assinatura Botão de assinatura eletrônica via SignDocs Brasil.
Installation
Automatic install
- In the WordPress admin, go to Plugins > Add New
- Search for “SignDocs Brasil”
- Click “Install” and then “Activate”
Manual install
- Upload the
signdocs-brasilfolder to/wp-content/plugins/(or use Plugins > Upload Plugin with the release ZIP) - Activate the plugin in Plugins > Installed Plugins
On activation, the plugin:
- Creates the
{prefix}signdocs_logtable for the audit log - Registers the
signdocs_signingandsigndocs_envelopecustom post types - Grants the custom capabilities (
signdocs_manage,signdocs_send,signdocs_verify,signdocs_view_logs) to administrator / editor / author - Schedules the daily cron jobs for log pruning and rotated-secret expiration
Configuration
- Open Settings > SignDocs Brasil
- Choose the authentication method:
- Client Secret (default) — Client ID + Client Secret obtained from app.signdocs.com.br
- Private Key JWT (ES256) — PEM-encoded private key + Key ID; the public key is registered separately with SignDocs. Preferred by regulated customers that cannot store a shared secret in the database
- Click “Test Connection”
- Select the environment: HML (sandbox for testing) or Production
- Configure the signing defaults (policy, locale, mode, brand color, logo)
- Click “Register Webhook” — the plugin calls the API endpoint, receives the HMAC secret, and stores it encrypted
- (Optional) Configure
signdocs_trusted_proxieswith trusted CIDR ranges if your site sits behind CloudFront, Cloudflare, or an nginx proxy, so the anonymous-signing rate limiter and audit log see the real client IP
FAQ
-
Do I need a SignDocs Brasil account?
-
Yes. Create your free account to obtain API credentials. The free plan includes test documents in the HML (sandbox) environment.
-
Are these signatures legally binding?
-
Yes. SignDocs Brasil electronic signatures comply with Brazilian Provisional Measure 2.200-2/2001 and produce cryptographic evidence packages (PKCS#7/CMS) with a complete audit trail. For high-value documents or where ICP-Brasil is required, use the
DIGITAL_CERTIFICATEpolicy with the signer’s A1 or A3 certificate. -
Where does the signing actually happen?
-
On the secure domain
sign.signdocs.com.br, not inside your WordPress site. The plugin creates the session via the API server-side (credentials never reach the browser), hands a URL +clientSecretto the browser, and receives a webhook when complete. This means that even if your WordPress site were compromised, an attacker could not forge signatures — the authentication flow (OTP, biometrics, certificate) happens on a completely separate domain under SignDocs’ control. -
How do multi-signer envelopes work?
-
Each envelope has N signers. SEQUENTIAL mode: the next signer only receives their link after the previous one completes (useful for hierarchical flows like power of attorney witness notary). PARALLEL mode: everyone can sign simultaneously (useful for multi-party NDAs, partnership agreements). The envelope admin panel shows each signer’s status in real time as the
STEP.*webhooks arrive. After the last signer, a combined PDF (or consolidated.p7sfor non-PDFs) becomes available via the Verify page. -
Yes. In the authentication tab of the settings, choose Private Key JWT (ES256). You generate an ECDSA P-256 key pair locally, register only the public key with SignDocs (via the app.signdocs.com.br panel), and the plugin stores only the PEM private key (encrypted with AES-256-CBC). On every API call the plugin signs a short-lived JWT with the private key — no shared secret in the database. This mode is required by some regulated customers (banks, fintechs).
-
What does the audit log capture?
-
Every API call the plugin makes (method, path, status, duration, rate-limit remaining), every webhook delivery received (ID, type, signer, match), every deprecation warning emitted by the API (RFC 8594
Deprecation/Sunset), and every admin operation (create session, rotate secret, etc.). 30-day retention; pruned by a daily cron. Exportable to CSV for an external SIEM. -
What about LGPD / GDPR?
-
The plugin registers handlers in
wp_privacy_personal_data_exportersandwp_privacy_personal_data_erasers:- Exporter — returns every session associated with the data subject’s email (name, emails, session ID, evidence ID, status, timestamps)
- Eraser — redacts the signer’s name and email to
[redacted-<hash8>], but preserves the evidence ID, transaction ID, session ID, and timestamps. Reason: electronic-signature law requires evidence retention for the legal retention period, even after a request to erase. Identity is redacted locally; the evidence package on the server stays intact for future legal audits.
-
Does the plugin work without WooCommerce?
-
Yes. The WooCommerce integration is optional and only loads when WooCommerce is active. The shortcode, Gutenberg block, envelopes, Verify page, audit log, and WP-CLI all work independently.
-
Can I test for free?
-
Yes. Set the environment to “HML (Sandbox)” in the settings. Test data, simulated OTP (
000000or123456are always accepted), mocked biometrics, no charges. -
What is the maximum PDF size?
-
The plugin accepts PDFs up to 15 MB. For larger files, increase
upload_max_filesizeandmemory_limitin PHP and ensure your tenant is configured for large documents on SignDocs. -
Does it work with any WordPress theme?
-
Yes. The plugin uses minimal styles and respects your theme’s CSS hierarchy. The button can be customized via a CSS class or via the brand color setting.
-
Is signer data secure?
-
Yes. API credentials are encrypted in the database (AES-256-CBC with a key derived from
wp_salt). OAuth tokens live in transients (never in permanent options). Webhook secrets are encrypted. The JWT private key (when used) is also encrypted. Webhook HMAC verification is constant-time (handled by the SDK). Webhook de-duplication via a transient lock prevents replay attacks. -
Can I customize the look of the signing page?
-
Yes. Configure the brand color and logo in the plugin settings. The page hosted at
sign.signdocs.com.brwill display your visual identity. For deeper customization, contact support — corporate-level theming is available on the Enterprise plan. -
Does it work behind CloudFront / Cloudflare / nginx proxy?
-
Yes. Set
signdocs_trusted_proxiesto a list of trusted CIDR ranges (e.g.,10.0.0.0/8, 172.16.0.0/12). The plugin usesX-Forwarded-Foronly whenREMOTE_ADDRis in a trusted range, preventing IP spoofing in the rate limiter and audit log. -
Is the plugin available in Portuguese?
-
Yes. All user-facing strings are translatable (
signdocs-brasiltext domain) and the plugin ships with Brazilian Portuguese (pt_BR) and Spanish (es_ES) translations. WordPress automatically loads the right language pack based on your site’s locale setting.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“SignDocs Brasil” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “SignDocs Brasil” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.3.7
WP.org reviewer feedback, round 2 (review ID signdocs-brasil/signdocsbrasil/8May26/T2 15May26/4.0).
- New
== External services ==section documenting every external endpoint the plugin contacts: the SignDocs API (api.signdocs.com.br/api-hml.signdocs.com.br), the OAuth2 token endpoint at the same base URL, the browser SDK CDN (cdn.signdocs.com.br/cdn-hml.signdocs.com.br), and the signing UI (sign.signdocs.com.br). Each subsection states what data is sent, when, and links to Terms of Use and Privacy Policy. - Trusted-proxy IP resolver hardened.
ClientIp::resolve()previously returned$_SERVER['REMOTE_ADDR']verbatim when no trusted-proxy chain matched, propagating malformed values into the rate-limit transient key and audit log. Both return paths now gate onfilter_var(..., FILTER_VALIDATE_IP); invalid values become empty strings. The anonymous-signing AJAX rate limiter now routes throughClientIp::resolve()instead of reading$_SERVER['REMOTE_ADDR']directly. - Allow-list validation on user-supplied policy / locale.
Signdocs_Ajax::create_sessionandSigndocs_WooCommerce::save_product_metapreviously accepted anysanitize_text_field-cleaned string for thepolicyandlocalefields, then forwarded it to the API. Both call sites now compare against the canonical lists (Signdocs_Settings::get_policy_options()for policy,['pt-BR', 'en', 'es']for locale) and fall back to the configured plugin default when the submitted value isn’t recognized. Avoids 4xx round-trips against the SignDocs API for deprecated profile names. is_email()validation on signer email.sanitize_email()strips invalid characters but doesn’t reject a value that fails to parse as an email. Added anis_email()check next to the existing required-field validation inSigndocs_Ajax::create_session.wp_unslash()on remaining admin reads. The Verify-page POST handler (VerifyPage::render) now unslashes$_POST['kind']before comparing, matching the WP coding standard the reviewer’s AI expects.esc_htmlon exception messages reaching the frontend in four call sites:Signdocs_Ajax::create_session(AJAX error response),Signdocs_Settings::ajax_test_connectionand::ajax_register_webhook(settings-page AJAX), andSigndocs_WooCommerce::create_signing_for_order(order note). Exception text from upstream APIs can contain quotes or angle brackets that would break a frontend handler that doesinnerHTML = response.message.
1.3.6
WP.org reviewer feedback, round 1 (received 2026-05-05, ~9h after submission).
- Description rephrased. The short description previously read “the most complete WordPress plugin for legally-binding electronic signatures in Brazil.” That’s a comparative marketing claim, which the WP.org Plugin Guidelines disallow (Guideline 11). Replaced with “the official WordPress plugin for legally-binding electronic signatures in Brazil” — factual (this is the first-party plugin published by SignDocs Brasil), non-comparative.
- Webhook REST route now uses a proper
permission_callback. Previously the route registered withpermission_callback => '__return_true'and verified the HMAC signature inside the request handler. While that behaved correctly (signed-out requests were rejected), the WP REST introspection layer reported the endpoint as “publicly accessible,” which the reviewer flagged. NewSigndocs_Webhook::authorize()performs HMAC verification at the permission-check phase and returnsWP_Errorwith a precise HTTP status (401 for invalid signatures, 500 for server-side misconfiguration). The handler is now responsible only for body parsing and event dispatch. No change to the wire contract — third-party callers (the SignDocs Brasil API server) see identical request / response behavior.
1.3.5
WP.org submission auto-scanner fix.
- Differentiated Plugin URI from Author URI. Both headers in
signdocs-brasil.phpwerehttps://signdocs.com.br, which the WP.org submission auto-scanner rejects (the two URIs must be distinct or one omitted; per WP.org policy a Plugin URI is a page about this specific plugin and an Author URI is a page about the author). Plugin URI now points to the canonical GitHub repository (https://github.com/signdocsbrasil/signdocs-brasil-wordpress); Author URI remains the company site (https://signdocs.com.br). Once the plugin is approved on WP.org we may switch Plugin URI to the wordpress.org/plugins/signdocs-brasil/ page.
1.3.4
Plugin Check (PCP) hardening pass for WP.org submission. No runtime behavior changes — every fix in this release is either annotation, defensive cleanup, or removal of a benign-but-noisy header.
- Dropped
Domain Path: /languagesheader — the plugin doesn’t ship.pot/.mofiles yet (translations are loaded via WP.org’s automatic language packs once approved), and the emptylanguages/folder doesn’t exist in the distribution zip. PCP rightly flagged the header as pointing to a non-existent path. wp_unslash()+ explicit sanitization on every$_POST/$_SERVERread — added acrossclass-signdocs-ajax.phpandclass-signdocs-woocommerce.php. The values were already being passed throughsanitize_text_field()/absint()/sanitize_email()/esc_url_raw(), butwp_unslash()is the WPCS-canonical pattern and reviewers expect it.- Documented
phpcs:ignoreannotations on the custom-table queries.AuditQuery,Logger,webhookcontroller, anduninstall.phpall touch{$wpdb->prefix}signdocs_log(or$wpdb->postmetafor the webhook lookup). PCP’sWordPress.DB.DirectDatabaseQuery.*is unavoidable for plugins with their own tables — every annotation now states the table being touched and why core’s caching/query API doesn’t apply. AuditQuerydynamic-prepare pattern documented inline.WordPress.DB.PreparedSQL.InterpolatedNotPreparedandPreparedSQLPlaceholders.*warnings onAuditQuery::count()/select()are PCP false positives — the{$where}fragment is built only fromFiltersallow-listed columns and the{$orderBy}/{$order}are validated againstALLOWED_ORDER_COLUMNSandvalidatedOrder(). Annotated explicitly so future readers (and reviewers) don’t have to re-discover this.wp_enqueue_scriptfor the CDN-hosted browser SDK now passes a version arg instead ofnull(includes/class-signdocs-shortcode.php:140). The CDN already serves immutablev1-pinned bundles, but a version argument silences PCP’sEnqueuedResourceParameters.MissingVersionand keeps the dev-tools network panel readable.
Plugin Check status after this release: 0 ERRORs, ~30 WARNINGs (down from 79; remaining warnings are documented false positives — webhook HMAC-vs-nonce, server-side hooks, plugin-specific custom-table queries, and the local-vs-global naming heuristic).
1.3.3
Cleanup pass after the v1.3.2 acceptance run.
wp signdocs webhook-testactually works. The SDK’s typedWebhookTestResponsemodel expects{deliveryId, status, statusCode}but the API returns{webhookId, testDelivery: {httpStatus, success, timestamp}}, so the typed call returned all-empty fields. CLI now bypasses the typed wrapper and reads the raw response, printing the real HTTP status + delivery timestamp. SDK fix tracked separately; the CLI unblocks operators today.- Dispatcher: dropped dead
SIGNING_SESSION.*branches. The OpenAPI spec lists these but the server never emits them — the lifecycle is communicated entirely through the correspondingTRANSACTION.*events. Same cleanup applied to the legacy webhook controller inincludes/. No behavior change; just removes confusion for anyone reading the dispatch table. - Audit log writes on success, not just on warnings. A
webhook.completedinfo row now lands insigndocs_logfor everyTRANSACTION.COMPLETED, capturing transaction ID, evidence ID, and the matched CPT post ID. Brings the table in line with the readme’s “every API call recorded” claim. - WP-CLI
webhook-testandlog-tailnow register with their dashed names as documented in the class header (previously the_form silently took precedence).
1.3.2
Two production-acceptance fixes uncovered while running the v1.3.1 release against real HML webhooks and the verify admin UI.
- Webhook dedup keyed off the wrong identifier —
X-SignDocs-Webhook-Idcarries the subscription ID (wh_*), not a per-delivery ID. The previous dedup transient used that header as the key, so the first delivery for a subscription poisoned the cache for the full 7-day TTL and every subsequent webhook (includingTRANSACTION.COMPLETED) returned 200/deduped without ever reaching the dispatcher. CPT records stayed stuck inPENDING. Now keys off the body’s top-levelid(the actual delivery ID,del_*). - Custom capabilities resolved to
do_not_allow— the envelope CPT’s'capabilities'map remappedread_post/edit_posttosigndocs_verify/signdocs_send/signdocs_manage, which registered them in WordPress’s$post_type_meta_capstable as meta caps. Core’smap_meta_cap()then short-circuited them todo_not_allowwhenever called without a post argument — so even an administrator got HTTP 403 on the Verify admin page. Switched the envelope CPT to a customcapability_typeand translate the generated CPT-cap names to the four primitivesigndocs_*caps viaCapabilities::mapMetaCap. - Verified end-to-end against HML: full create sign
TRANSACTION.COMPLETEDwebhook CPT updated to COMPLETED withevidenceIdverification->verify($evidenceId)returns the signed evidence record (CPF, policy, completion timestamp).
1.3.1
WP.org submission readiness — Plugin Check (PCP) baseline + canonical English readme + complete CPF/CNPJ collection.
- Plugin Check: 0 ERRORs — fixed 12 PCP error-level findings: 4× missing
defined('ABSPATH')guards insrc/Admin/{VerifyPage,AuditTable}.php,src/Cpt/EnvelopeCpt.php,src/Webhook/Controller.php; 3× missingtranslators:comments on__()calls with placeholders in WooCommerce integration; 2× output escape gaps in WooCommerce email body; 1× output escape gap on the CPT status badge (now viawp_kses_post());strip_tags()wp_strip_all_tags()in the unit-test fallback path ofFilters; documentedfopen/fwrite/fcloseinAuditExportas a streaming-CSV pattern with file-scopedphpcs:ignore. - Canonical readme rewritten in English. WP.org policy 2025-07-28 requires the description, short description, and FAQ to be in English. The old Portuguese sections move to the standard i18n flow —
pt_BRsite visitors will see the localized strings via WordPress.org’s automatic translation pack delivery once the plugin is approved. - Removed
load_plugin_textdomain()— discouraged since WordPress 4.6 for plugins on WP.org. WordPress core auto-loads the right language pack from the plugin slug. - CPF / CNPJ collection at every entry point — the SignDocs API requires
signer.cpforsigner.cnpjat session-create time. Added to: shortcode form (whenshow_form="true"), AJAX handler validation, frontend JS payload,wp signdocs send --cpf=/--cnpj=flags, WooCommerce integration (reads_billing_cpf/_billing_cnpjfrom order meta — works with the standard “Brazilian Market on WooCommerce” extension), envelope service per-signer. wp signdocs sendoutputs the full shareable URL — previously printed only the base session URL, which is not directly usable. Now appends?cs=<clientSecret>(URL-encoded) so the printed link can be opened directly to start signing.wp signdocs statusnow requires--client-secret— documented the embed-token authentication contract. Full implementation deferred to a follow-up release.- Acceptance test against real HML: WP 6.9.x + MariaDB 11 in podman, plugin installed from the v1.3.1 zip, real HML credentials. Confirmed:
signingSessions->createreturns a validsessionId+clientSecret+url;envelopes->createreturns a validenvelopeId(PARALLEL, 2 signers); WP-CLI validates CPF/CNPJ inputs correctly; capabilities install on activation; plugin co-active with WooCommerce 10.7.
1.3.0
Alignment with PHP SDK 1.4.0 + complete English readme.
- PHP SDK upgraded to
^1.4— SDK 1.4.0 fixed a model-shape divergence inCreateSigningSessionRequest/CreateEnvelopeRequestthat had existed since 1.0.0: the correct field names accepted by the API arepurpose,policy,signer,document,returnUrl,cancelUrl,metadata,locale,expiresInMinutes,appearance. Plugin call sites (CLI + AJAX) were updated. - CPF / CNPJ collection at every entry point — the API requires
signer.cpforsigner.cnpjat session creation. The shortcode form now exposes CPF + CNPJ fields whenshow_form="true"; the AJAX handler validates them;wp signdocs sendaccepts--cpf/--cnpj; the WooCommerce integration reads_billing_cpf/_billing_cnpjfrom the order (Brazilian Market on WooCommerce extension keys); the envelope service propagates per-signer CPF. - Readme rewritten in English — per WP.org policy from 2025-07-28, the canonical readme description must be in English. Portuguese localization is loaded automatically from the bundled
.po/.motranslation files forpt_BRsites. - Plugin Check (PCP) errors fixed — direct file access guards (
defined('ABSPATH')) added to 4 source files; missingtranslators:comments added to 3__()calls with placeholders; output escaping tightened in WooCommerce email and CPT badge rendering;strip_tags()swapped forwp_strip_all_tags()in non-test paths. - “Tested up to” updated to WordPress 6.9 (the version used in the automated pen test).
1.2.3
Security sniff cleanup — zero phpcs:ignore comments in source.
- Consolidated exceptions — the 7 remaining WPCS findings that can’t be fixed through refactor (MySQL doesn’t allow identifier placeholders; custom tables can’t use
WP_Query; admin audit logs shouldn’t be cached; list-table pagination doesn’t nonce in WP convention) are now declared as file-scoped exclusions inphpcs.xml.distwith written rationale for each. Zero line-levelphpcs:ignorecomments remain insrc/. EventRouter::queryByMetarefactored — dropped the direct$wpdb->postmetalookup in favor ofget_posts(['meta_query' => …, 'fields' => 'ids']). Slightly safer (adds post-type filter), eliminates twoDirectDatabaseQuerywarnings without suppression.Filters::fromRequestsignature tightened — no longer falls back to$_REQUESTwhen called without arguments; callers must pass the request array explicitly. Moves the superglobal read-site up to the admin page, where CSRF/capability context is clear.- Net result: zero security-category PHPCS findings, zero
phpcs:ignoresuppressions, and every exception documented in one auditable file.
1.2.2
Security audit + refactor.
- AuditQuery refactor — all raw SQL extracted into
src/Admin/AuditQuery.php. Newsrc/Admin/Filters.phpvalue object enforces validation at its constructor, so by the timeAuditQuerysees a value it’s already allow-list-checked.AuditTable,AuditExport, andSigndocsCommand::log_tailare now thin consumers with zero raw SQL. - SQL-injection fuzz test suite —
tests/Unit/AuditQueryFuzzTest.phpruns 24 SQL-injection payloads across every filter field (level, event_type, from, to, orderby, order) and asserts that every payload is either rejected by the allow-list or survives only via%splaceholders — never into a SQL literal. 47 total unit tests / 552 assertions, all green. - Black-box pen test —
tests/pen_test.shexercises a running WordPress 6.9.x + MariaDB 11 stack (podman pod). Tests SQLi across audit filters + CSV export, webhook HMAC bypass attempts (no-sig, wrong-sig, stale-ts, garbage-ts, valid-sig, replay-dedup), CSRF on admin-post.php, and subscriber-role authorization against the audit log. All checks passed — runtime behavior matches thephpcs:ignorejustifications.
1.2.1
WP.org submission-readiness pass.
- phpcbf auto-fixed ~3,300 cosmetic WPCS findings; remaining ~370 are pure style (snake_case / Yoda) and annotated as advisory in CI.
- Audited and annotated the 26 security-adjacent PHPCS findings (nonce verification, prepared SQL) — all verified as safe with justifying
phpcs:ignorecomments. - Added
.wordpress-org/asset bundle: icon-256, icon-128, and auto-generated branded banner-1544×500 / banner-772×250 (designer should replace banners before public launch). - Added
.github/workflows/wp-org-deploy.yml—10up/action-wordpress-plugin-deployon tag push, gated by theDEPLOY_TO_WPORGrepo variable so it’s a no-op until WP.org approves. - Added
DEPLOY.mdrunbook for the WP.org submission and release flow.
1.2.0
Enterprise feature parity with the external API.
- Multi-signer envelopes — new
signdocs_envelopeCPT (parent ofsigndocs_signing),EnvelopeServicewrapping the SDK’s envelope resource, deterministic idempotency keys on create. Sequential and parallel signing flows. - Verification admin UI — “Verificar” submenu under SignDocs, accepts an evidence ID or envelope ID and renders signer identities, tenant CNPJ, consolidated downloads (
.p7sor combined PDF). Uses SDK 1.3.0’sverifyEnvelope. - Private Key JWT auth — alternative to
client_secret. Store a PEM-encoded ES256 private key + key ID; ClientFactory branches onsigndocs_auth_method. Preferred by regulated customers who can’t store shared secrets at rest. - Audit log UI —
WP_List_Tableoverwp_signdocs_logwith filters (level, event type, date range) and CSV export, gated bysigndocs_view_logs. CSV streams fromphp://outputwith chunked reads — safe for multi-GB exports. - Webhook secret rotation —
SecretResolveraccepts both the primary and a previous secret during a 7-day grace window. Daily cronsigndocs_expire_prev_secretclears the previous secret once the window expires. Controller’s authorize step tries each configured secret before rejecting.
1.1.0
Hardening release + alignment with SignDocs PHP SDK 1.3.0.
- Shared OAuth token cache — SDK
TokenCacheInterfaceis implemented byWpTransientTokenCache, so a single token is reused across every PHP-FPM worker instead of one token fetch per request. - Webhook hardening — timestamp drift gate (≤300s), replay de-duplication via
X-SignDocs-Webhook-Idtransient lock (7-day TTL), properpermission_callbackthat runs HMAC before any business logic, input-shape guard on session / transaction IDs. - Full webhook coverage — added
TRANSACTION.CREATED,TRANSACTION.FALLBACK,STEP.STARTED/COMPLETED/FAILED,QUOTA.WARNING,API.DEPRECATION_NOTICE, plus the two NT65 INSS-consignado eventsSTEP.PURPOSE_DISCLOSURE_SENTandTRANSACTION.DEADLINE_APPROACHING. Covers the 13 events the server actually emits today. - Observability —
Deprecation/Sunset(RFC 8594) response headers surface as admin notices;RateLimit-*headers are captured in a transient for the dashboard widget; structured log table{prefix}signdocs_logwith 30-day retention and a daily cron prune. - Idempotency —
X-Idempotency-Keyis now sent on every resource-creating call, derived deterministically from site URL + user + action + resource, so AJAX retries no longer create duplicate sessions. - Capability model — four new caps (
signdocs_manage,signdocs_send,signdocs_verify,signdocs_view_logs) instead of rawmanage_options/edit_posts. Granted to administrator / editor / author on activation viaCapabilities::install();map_meta_capwires them to CPT operations. - LGPD / GDPR —
wp_privacy_personal_data_exportersandwp_privacy_personal_data_erasersare registered. The eraser redacts signer name + email but preserves evidence IDs and completion timestamps for legal retention. - WP-CLI —
wp signdocs health|send|status|webhook-test|log-tail. - Test suite — PHPUnit (Brain Monkey unit tests), PHPStan level 5 (with
phpstan-wordpress), PHPCS (WordPress-Extra + PHPCompatibilityWP), GitHub Actions matrix on PHP 8.1 / 8.2 / 8.3.
1.0.0
- Initial release
[signdocs]shortcode with 8 configurable attributes- Gutenberg block with live preview (ServerSideRender)
signdocs_signingcustom post type with status, signer, and policy columns- REST webhook receiver with HMAC-SHA256 verification
- WooCommerce integration: product tab, automatic email, order notes
- AES-256-CBC encryption for stored credentials
- Popup, redirect, and overlay support
- Rate limiting for anonymous signing
- Trilingual: pt-BR, en, es
