=== Pottr ===
Contributors: tangibledesign, pushkarsaraf
Tags: rest api, custom database, database, headless, api
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.12.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Turn your WordPress site into the backend for your web app.

== Description ==

Pottr gives your WordPress site schema-driven custom collections and a clean REST API for application data. Build modern web and mobile apps with built-in JWT authentication, automated schema management, webhooks, and API metering — all without running a separate backend server or moving your application data off WordPress.

= Key Features =

* **App Data in WordPress:** Create flexible collections and structured fields for the custom data your application needs.
* **Auto-Generated REST API:** Clean, decoupled CRUD endpoints with filtering, sorting, pagination, and relation expansion for every collection.
* **Isolated App Authentication:** Decoupled JWT access tokens and secure refresh tokens keep app end-users completely separate from WordPress's native `wp_users` table.
* **Declarative Blueprints:** Define your collections and auth fields in code; Pottr automatically provisions and migrates the database schema on deploy.
* **Outgoing Webhooks:** Instant HMAC-SHA256 signed event delivery to external services such as Zapier or Make, with delivery logs and manual retries.
* **API Key Gateway:** Public (`pk_live_`) and Secret (`sk_live_`) API keys with route-level scoping and metering.
* **Data Sovereignty:** Your application data is stored directly in your own WordPress database. Pottr does not automatically transmit your application content to tangble.

== External Services ==

Pottr utilizes Google Apps Script and Google Sheets to handle voluntary email submissions made through the plugin interface.

* **What the service does:**
Google Apps Script processes email submissions, and Google Sheets stores the submitted information in a private spreadsheet accessible only to authorized personnel operating tangble.

* **When the service is used:**
1. Tips and updates (`free_capture`): When a user voluntarily submits their email address through the plugin to receive product tips, updates, and early-access news.

Email submission is entirely optional. External requests never occur automatically during plugin activation or ordinary plugin usage. The email form includes a consent checkbox, and nothing is sent until you tick it.

* **What information is transmitted:**
- The submitted email address.
- The WordPress site URL, obtained through `home_url()`.

* **What is not transmitted:**
- Customer application data.
- Database contents.
- Credentials.
- WordPress source code.

* **Privacy Policies:**
- Pottr Privacy Policy: https://pottr.tangble.com/privacy-policy
- Google Privacy Policy: https://policies.google.com/privacy

Pottr also contacts two other services:

1. Update checks (pottr.tangble.com): Pottr is distributed from pottr.tangble.com rather than WordPress.org, so WordPress asks `https://pottr.tangble.com/updates/pottr.json` for the latest version, at most every 12 hours. The request carries your Pottr version in the User-Agent and nothing else about you or your site. Updates are checked against a published checksum before they are installed.

2. License checks (Polar, api.polar.sh): Only if you enter a Pro or Business license key. Pottr sends the license key and your site URL (as the activation label) to Polar to activate the key, then once a day to confirm it is still valid. Free sites without a key never contact Polar. Polar Privacy Policy: https://polar.sh/legal/privacy

== Installation ==

1. Upload the `pottr` plugin folder to the `/wp-content/plugins/` directory, or install the ZIP directly via **Plugins > Add New > Upload Plugin** in WordPress.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Access **Pottr** from the WordPress admin menu to start creating collections or connect your client application using the provided API keys.

== Frequently Asked Questions ==

= Does Pottr create custom post types? =
No. Pottr uses dedicated database tables optimized for application data rather than WordPress posts, eliminating slow EAV (Entity-Attribute-Value) queries and postmeta bloat.

= Are app users added to wp_users? =
No. Pottr provides isolated, per-app authentication tables so your application end-users are kept separate from WordPress administrators and subscribers.

= Can anyone write data to my site without an API key? =

No. Requests without a valid key are refused with a 401. The one exception is a keyless POST to a collection that does not exist yet. Pottr holds that request (up to 64 KB, for at most 2 hours) and shows a notice in wp-admin. No collection or entry is created unless an administrator reviews and approves it. This is rate-limited to 3 requests per 10 minutes per client, with at most 5 collections pending at once.

= Where can I find API documentation? =
Pottr includes a built-in Developer Docs flyout in the WordPress admin with copy-paste code snippets for authentication, CRUD endpoints, filtering, relations, and blueprints.

== Credits ==

Pottr is developed and maintained by:
* Tangible Design (tangibledesign11@gmail.com)

= Bundled third-party libraries =

All libraries and fonts are shipped inside the plugin and loaded from your own site. Nothing is loaded from a CDN.

* **Lucide** 1.34.0 (ISC licence), icons. `assets/js/vendor/lucide.min.js` is the project's published minified build. Source: https://github.com/lucide-icons/lucide
* **SortableJS** 1.15.7 (MIT licence), drag-and-drop field ordering. `assets/js/vendor/Sortable.min.js` is the project's published minified build. Source: https://github.com/SortableJS/Sortable
* **Inter** variable font (SIL Open Font License 1.1), served from `assets/fonts/`. Source: https://github.com/rsms/inter
* **Geist Mono** variable font 1.9.2 (SIL Open Font License 1.1), served from `assets/fonts/`, used for code, keys and URLs. Source: https://github.com/vercel/geist-font

Versions, licences and source links are also listed in `assets/js/vendor/README.txt`. Pottr's own scripts (`assets/js/pottr*.js`) are not minified.

== Changelog ==

= 1.12.2 - 2026-11-24 =
* Fixed: Recent live events are no longer removed early on sites where the database server's time zone differs from the site's.

= 1.12.1 - 2026-11-24 =
* Improved: Notices look like the rest of the screen, with the status shown by a coloured icon instead of a coloured background.
* Improved: Your plan (Free, Pro or Business) sits next to the Pottr logo at the top of every screen.
* Improved: The Collections tab matches the Webhooks tab when empty, and the Deactivate license card has the same heading and spacing as the Updates card.
* Fixed: A stray lighter rectangle behind the site info and .env values in dark mode is gone.

= 1.12.0 - 2026-11-22 =
* Added: A Check for updates link on the Plugins screen and an Updates card on the License screen, with a clear message when the update server cannot be reached.
* Improved: Copy site info now includes when Pottr last checked for updates and whether it could reach the update server.

= 1.11.1 - 2026-11-19 =
* Added: A Copy site info button in Settings that copies versions, plan and basic counts for support requests, with no keys or data.
* Improved: The unused workspaces limit was removed and the upgrade comparison now matches the website, including media file sizes.
* Improved: Settings, Docs and Support links on the Plugins screen, and a short welcome notice after activation.
* Improved: Deactivating Pottr now uses the normal WordPress link with no extra dialog, and the Plugins screen no longer names an individual author.
* Improved: Calmer Settings and API Keys screens, including better spacing in the connected apps table.

= 1.11.0 - 2026-11-17 =
* Added: Pottr is now a single plugin. Start on the Free plan and unlock Pro or Business with your license key, with no second plugin to install.
* Added: Update notices for every install, with one-click updates checked for integrity before they are installed.
* Improved: The License screen is always available, and Pro and Business share one checkout page.
* Improved: Lighter admin styles, consistent dark mode, a private admin font, background webhook delivery and a clearer email consent checkbox.
* Fixed: Requests made with your secret API key now follow your plan's limits.
* Fixed: Safer API keys and sign-in tokens, stricter SVG upload checks, and webhooks that fire for every collection.

= 1.10.0 - 2026-11-01 =
* Added: Platform-wide dark mode across all interfaces with a navigation toggle, instant theme persistence, and high-contrast styling.
* Improved: Streamlined first-run setup guiding administrators smoothly through onboarding before landing on the dashboard.
* Improved: Restored seamless dark and light mode switching across all administrative and onboarding views.
* Improved: Verified and certified compatibility with WordPress core up to version 7.1.
* Improved: Security and data safety hardening with enhanced request validation, secure token generation, and database query protection.
* Improved: Harmonized text domains and translation annotations for complete WordPress localization support.
* Fixed: Resolved setup navigation timing to ensure getting-started guides display reliably on first activation.

= 1.9.1 - 2026-10-27 =
* Added: Streamlined first-time activation flow to launch the Getting Started setup guide while bypassing non-interactive contexts.
* Improved: Streamlined admin navigation menus so the License screen only appears when a paid add-on is installed, keeping Free focused on Dashboard, API Keys, and Settings.
* Improved: Synchronized in-app feature limits and tier specifications with active plan allowances, clearly presenting collection and record quotas.
* Improved: Enhanced Settings interface with diagnostic logging controls and safe-by-default uninstallation data retention.
* Improved: Automated, non-destructive upgrade transition for existing installations with preserved collections, entries, and settings.
* Improved: Refined pricing modal and license status display without internal developer terminology.
* Fixed: Improved schema migration checks during plugin activation for reliable, error-free database initialization.

= 1.8.0 - 2026-10-22 =
* Added: Zero-config application connection handshake allowing external web applications to connect without manual API keys or configuration files.
* Added: Intelligent request interception and auto-schema inference to inspect incoming payloads and provision collections with one click.
* Added: Slide-out drawer architecture replacing modal dialogs for webhooks, schema review, and record inspection.
* Added: Real-time webhook test ping dispatch with round-trip latency metrics, plain-English delivery status explanations, and signature verification guides.
* Added: Dashboard navigation record count badges and compact number formatting.
* Improved: Redesigned webhooks interface with contextual creation guides, streamlined action buttons, and progressive disclosure for signing secrets.
* Improved: Standardized accessible form design tokens, keyboard focus states, and input validation styling across admin views.
* Improved: Real-time entry and field count summaries in the Collections table with optimized single-query performance.

= 1.7.0 - 2026-10-18 =
* Added: Dedicated 5-step Postman-guided onboarding stepper with live request arrival verification and collection provisioning.
* Added: Plugin deactivation confirmation modal on the WordPress Plugins screen with safe deactivation and typed data deletion.
* Improved: Unified form input styling and refined button typography across the onboarding flow.
* Improved: API Keys dashboard clipboard fallback for non-secure local environments and instant visual feedback.
* Improved: Contributor attribution, automated release workflow, collaborator evaluation guide, and developer root documentation.
* Fixed: Cleaned up obsolete legacy route deprecation logging on entry creation endpoints.

= 1.6.0 - 2026-10-14 =
* Added: Application Users high-performance search, multi-column sorting, and responsive pagination.
* Added: System Activity Logs multi-facet filtering, keyword search, severity classifications, and category filters.
* Added: Complete site cleanup upon plugin uninstallation, leaving zero residual database tables or orphaned options.
* Improved: Comprehensive accessibility (WCAG AA), responsive mobile layouts, and security enhancements across API Keys, Dashboard Overview, Collections, Webhooks, Activity Logs, and Application Users admin views.
* Fixed: Administrative visibility into records within user-owned collections in the admin Entries tab and secret-key REST API queries.
* Fixed: Collection Entry dialog interactions, keyboard focus management, and modal form submission on the Collection Detail screen.
* Fixed: Application Users tab initialization when navigating directly to the user management view.
* Security: User-owned collection listing guard enforcing HTTP 401 Unauthorized for unauthenticated requests.
* Fixed: Onboarding blueprint snippet schema validation and clarified REST endpoint and entry creation workflow guidance.
* Improved: Synchronized in-app Developer Docs with REST endpoints, soft-delete behavior, standard envelopes, SSE streaming, media uploads, and client SDK.

= 1.5.1 - 2026-09-25 =
* Fixed: Super Admin and development license isolation in background cron checks to prevent false payment failure notices.
* Added: Polar Customer Portal direct management links in License settings and Pricing modal.
* Added: Downgrade safeguarding, cancellation period access persistence, and automatic tier synchronization from Polar.
* Added: Self-healing database migration 016 to restore active status on affected local development environments.

= 1.5.0 - 2026-09-24 =
* Added: Refresh token rotation with reuse detection, and granular per-device session management endpoints.

= 1.4.0 - 2026-09-24 =
* Added: REST response format standardization (?format=standard) and release of official @pottr/client TypeScript SDK.

= 1.3.0 - 2026-09-24 =
* Added: Real-time Server-Sent Events (SSE) streaming gateway (GET /pottr/v1/events) for instant collection mutation updates.

= 1.2.0 - 2026-09-24 =
* Added: Application-scoped media upload REST API (POST /pottr/v1/media) supporting multipart/form-data and isolated app storage.
* Security: Hardened single-entry IDOR ownership guard and optimistic concurrency checks (HTTP 409).
* Improved: Harmonized collection media schema fields to accept media IDs, objects, and URLs.

= 0.9.9 - 2026-08-27 =
* Improved: Refreshed plugin description across settings, documentation, and the update modal.
* Security: Switched to WordPress native URL parser for SSRF host validation on webhook endpoint registration.
* Optimization: Bundled vendor assets locally and added standard readme.txt.

= 0.9.8 - 2026-05-30 =
* Improved: Rich summary description and local changelog display in the plugin details modal.

= 0.9.7 - 2026-05-30 =
* Improved: Author attribution and release packaging enhancements.

== Upgrade Notice ==

= 1.12.2 =
Fixes live events being removed too early on some servers.

= 1.12.1 =
Tidier notices, the plan next to the logo and cleaner dark-mode code blocks.

= 1.12.0 =
Adds a Check for updates link so you can look for a new version right away.

= 1.11.1 =
Adds a Copy site info button for support requests and removes the unused workspaces limit.

= 1.11.0 =
Pottr is now one plugin. If you used the separate Pottr Pro add-on, it is deactivated automatically; your license key keeps working inside Pottr.

= 1.10.0 =
See the changelog for the latest improvements, fixes, and updates.
