@extends('layouts.app') @section('content') {{-- Hero --}}
Add-On Plugin

Agency Pulse Secure-Sign

Add legally-defensible client signature capture directly to your invoices — generating tamper-evident signed PDFs stored securely in the cloud with a full audit trail.

Agency Pulse Secure-Sign Plugin
{{-- Feature Groups --}}
{{-- Signature Collection --}}

✍️ Signature Collection & Client Signing Page

  • Dedicated Client Signing Page: A purpose-built, fully self-contained signing page delivered to clients via a secure tokenized URL, requiring no login and no WordPress theme.
  • Signature Canvas: An interactive drawing canvas powered by Signature Pad v4.2.0, allowing clients to draw their signature with mouse or touch input, with a one-click clear button.
  • Agreement Checkpoint: A mandatory “I agree to the terms of this invoice” checkbox must be checked before submission, creating an explicit client acknowledgement on record.
  • Frozen Invoice Preview: The invoice displayed on the signing page is a point-in-time snapshot captured when the admin sends the request, ensuring the client signs exactly what was presented — not a live-editable copy.
  • State-Aware Page Rendering: The signing page intelligently adapts to the token’s state — showing the signing form if pending, a confirmation screen if already signed, and a descriptive error page for invalid or expired tokens.
  • Search Engine Protection: Signing pages include noindex, nofollow meta tags to prevent indexing of sensitive client documents.
{{-- Token Security --}}

🔐 Token Security & Access Control

  • Cryptographically Secure Tokens: Each signing request generates a 64-character hex token using random_bytes(32), making tokens computationally infeasible to guess or brute-force.
  • Configurable Token Expiry: Signing links expire after a configurable number of days (default 7), preventing stale links from being used. Expiry is visible to the admin in the signing panel.
  • Single-Use Tokens: Tokens are permanently deleted after the client successfully submits their signature and cannot be reused.
  • Server-Side Signature Verification: Beyond client-side canvas checks, the server independently validates that the submitted image is a valid base64 PNG or JPEG and uses PHP GD image analysis to confirm the signature contains actual pen marks (non-white pixels), rejecting blank or near-blank submissions.
  • Client IP Capture: The client’s real IP address is captured at signing time, supporting Cloudflare, X-Forwarded-For, and X-Real-IP headers, and stored as part of the audit record.
  • PDF Integrity Hashing: A SHA-256 hash of the generated signed PDF is stored at signing time and re-verified on every download request, ensuring the cloud-stored document has not been tampered with.
{{-- Signature Requirement Management --}}

📋 Signature Requirement Management

  • Per-Invoice Requirement Toggle: A checkbox in the invoice editor lets administrators enable or disable the signature requirement on a per-invoice basis, with full admin override capability.
  • Global “Always Require” Mode: A global setting forces signature collection on every invoice, removing the per-invoice checkbox entirely and ensuring no invoice can be issued without a signature.
  • Require by Default: An optional global setting pre-checks the per-invoice signature toggle for all new invoices, while still allowing administrators to override on a case-by-case basis.
  • Master Feature Switch: A top-level enable/disable toggle controls the entire plugin. When disabled, all signing UI is hidden, issuance is never blocked, and the {SIGNATURE} placeholder is cleanly stripped from templates.
{{-- Admin Signing Workflow --}}

📤 Admin Signing Workflow

  • Send for Signing Panel: A dedicated signing panel is injected directly above the Issue button in the invoice metabox, providing a clear workflow from within the standard invoice editor.
  • One-Click Send: A “Send for Signing” button generates the token, freezes the invoice snapshot, and dispatches the signing request email to the client — all in a single AJAX action.
  • Signing URL Copy Button: A clipboard copy button in the admin panel lets administrators manually share the signing link outside of email if needed.
  • Resend Capability: If a signing request has already been sent, a “Resend” button is available to resend the email to the client without generating a new token.
  • Live Status Display: The signing panel shows the current state of each invoice — no request sent, awaiting client signature (with expiry date), or signed (with date and IP address).
  • Connector Status Indicator: The panel shows a real-time green/red indicator for whether the Agency Pulse Pro Connector is active and authenticated, with a direct link to the connector settings if configuration is needed.
  • Edit Invalidation: If an invoice is edited after a signing request has been sent but before the client signs, the pending token and snapshot are automatically cleared to prevent the client from signing a stale document.
  • Revocation Cleanup: When an invoice is revoked (reopened), all signing state — tokens, snapshots, completion flags, and PDF paths — is fully cleared, while the requirement toggle is preserved for the next request.
{{-- External Signing Service --}}

🌐 External Signing Service Integration

  • Server-to-Server Architecture: All communication with the external signing service is server-side only — the client’s browser never interacts with the service directly, preventing credential exposure.
  • Signed PDF Generation: On signature submission, the complete invoice HTML (with embedded images and a CSS reset for consistent rendering) plus the client’s signature image are posted to the external service, which produces a tamper-evident signed PDF.
  • Cloud PDF Storage: Signed PDFs are stored in S3-compatible cloud storage by the external service. Only the S3 path and integrity hash are stored locally — the PDF itself is never stored in WordPress.
  • Pre-Signed Download URLs: When a signed PDF is downloaded, a time-limited pre-signed URL is requested from the service on demand. URL validity is configurable (1–365 days).
  • Subscription Health Monitoring: If the signing service returns a 403 Forbidden response, the plugin sets a flag that triggers a persistent admin notice and clears it automatically on the next successful request.
{{-- Invoice Lifecycle Integration --}}

📊 Invoice Lifecycle Integration

  • Pro-Forma Status Enforcement: Before generating the client-facing snapshot, the plugin forces the invoice to “Pro-Forma” status, ensuring the document the client sees and signs accurately reflects the pre-issuance state.
  • Invoice Number Assignment at Signing: The formal invoice number is not assigned until the client successfully submits their signature, ensuring only signed invoices receive official numbers and maintaining an accurate audit trail.
  • Automatic Issuance: Upon successful signature submission and PDF generation, the invoice is automatically transitioned from Pro-Forma to Unpaid status via the core issuance hook — no manual admin action required.
  • Version History Integration: Each signed PDF is appended to the core invoice version history with its S3 path, integrity hash, and timestamp. A custom download button replaces the standard PDF link for S3-backed entries.
  • Local PDF Suppression: When a signed PDF exists for an invoice, the plugin suppresses local PDF generation to prevent duplicate, unsigned copies from being created.
{{-- Email Notifications --}}

📧 Email Notifications

  • Signing Request Email: A fully customizable HTML email is sent to the client when the admin dispatches a signing request. Supports dynamic placeholders: {customer_name}, {invoice_amount}, {signing_link}, {signing_expires}, {company_name}.
  • Client Signed Confirmation: Upon successful signature submission, a customizable confirmation email is sent to the client with their invoice details, signing date, and a link to the payment portal. Supports placeholders: {customer_name}, {invoice_number}, {invoice_amount}, {signed_date}, {payment_url}, {company_name}.
  • Admin Signed Notification: Simultaneously, a notification is sent to the site admin email with full signing details including the client IP address for audit purposes via the {signed_ip} placeholder.
  • Email Settings Integration: All three email templates (subject and body) are configurable via dedicated tabs in the Agency Pulse Invoice Email Settings page, using the same TinyMCE editor interface as other system emails.
{{-- Settings & Configuration --}}

⚙️ Settings & Configuration

  • Dedicated Settings Tab: A “Secure Sign” tab is added to the Agency Pulse Invoice settings page for all plugin configuration, with a live Pro Connector status indicator at the top.
  • Requirement Behaviour Controls: Settings for the master switch, always-require mode, and require-by-default mode, with the require-by-default option automatically disabled (visually and functionally) when always-require is active.
  • Download URL TTL: Administrators can set the number of days (1–365) that pre-signed S3 download links remain valid, balancing convenience with security.
{{-- Extensibility & Hook Integration --}}

🔗 Extensibility & Hook Integration

  • {SIGNATURE} Template Tag: Registers the {SIGNATURE} placeholder with the core template replacement system. On standard renders the tag resolves to an empty string; on the signing page it is replaced with the full interactive signing block at the exact position in the document.
  • apss_invoice_signed Action: Fires immediately after a successful signature is recorded, allowing downstream integrations such as webhooks, CRM updates, and workflow automation to react to the signing event.
  • Issuance Gate Filter: Hooks into agency_pulse_invoice_can_be_issued to block invoice issuance when a signature is required but not yet collected, returning a descriptive error with context-appropriate messaging.
  • PDF Generation Filter: Hooks into agency_pulse_invoice_should_generate_pdf to suppress redundant local PDF creation when a cloud-signed PDF already exists.
  • Admin Notice Integration: Hooks into the agency_pulse_admin_notices system to surface subscription warnings across all admin pages without directly touching the WordPress admin_notices hook.
{{-- Bottom CTA --}} @if($product ?? null)

Get {{ $product->name }}

Unlock all the features above for your agency.

${{ number_format($product->price, 2) }} / monthly ${{ number_format($product->price * 10, 2) }} / yearly
@csrf
@endif @endsection