=== 3Min API Connector ===
Contributors: 3minapi
Tags: api, shortcode, forms, rest-api, ai
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Build the UI for your 3Min API data in plain HTML, CSS, and JavaScript, and drop it onto any post or page with a single shortcode.

== Description ==

3Min API Connector is the official WordPress plugin for [3Min API](https://3minapi.com) — a service that turns a data model into a REST API endpoint in minutes, with no backend code to write.

The plugin maps each endpoint's responses to a UI you author in plain HTML, CSS, and JavaScript, and renders it on any page through a single shortcode.

= Resources =

* [Take a tour of 3Min API](https://3minapi.com/tour) — see how a REST API gets spun up in minutes, no backend required.
* [The plugin's WordPress page](https://3minapi.com/wordpress) — usage examples and a quick-start walkthrough for this plugin.

= Features =

* **Plain HTML, CSS, and JavaScript** — no proprietary template language, no new DSL to learn. Whether you're showing a single record, paginating a list, or submitting a form, the workflow stays the same — and a single shortcode (`[3minapi name="..."]`) drops the result into any page.

* **Six built-in templates** — Card, List, Hero, List feed, Form, and Comment. You start from a working example rather than a blank page, and tweak only what you need to make it your own.

* **Copy AI prompt** — one click in the Builder copies a fully contextualised system prompt to your clipboard. Paste it into ChatGPT, Claude, or Gemini, iterate on the UI with the assistant, then paste the result back into the Builder.

* **Live preview** — the Builder renders your snippet right next to your editor using real data from the endpoint, so you can see exactly how variables fill in before you save.

= Security =

* The API key is stored per-snippet, **server-side only** — never exposed to the browser, even in the Builder.
* All requests to 3Min API are proxied through admin-ajax on the server. No direct browser → 3Min API call.
* User-defined templates support `{{variable}}` substitution only — PHP tags are stripped on save and never executed.
* `<script>` tags in the HTML/CSS pane are stripped on save; JavaScript lives in a separate pane that requires the `unfiltered_html` capability (Administrator by default on single-site WordPress).
* Every AJAX endpoint verifies a WordPress nonce and a capability check.

= Requirements =

* WordPress 6.5+
* PHP 7.4+
* A free or paid account at [3minapi.com](https://3minapi.com) to obtain endpoints and API keys.

== Installation ==

1. Upload and activate the plugin.
2. Open **3Min API → Overview** in the admin menu and read the quick start.
3. Click **+ New**, paste an endpoint ID + API key, choose an HTTP method, and press **Test endpoint**.
4. Pick a starter template, optionally click **Copy AI prompt** and iterate the UI with your favorite LLM.
5. Save the snippet, then drop `[3minapi name="your-snippet"]` into any post, page, widget, or block.

== Frequently Asked Questions ==

= Where do I get an endpoint and API key? =

Sign up at [3minapi.com](https://3minapi.com). Each data model you create gives you an endpoint ID and a unique API key — paste both into the Snippet Builder.

= Is the API key sent to the browser? =

No. The API key is stored in `wp_options` and only read by the server-side AJAX handlers when proxying requests to 3Min API. The browser never sees it.

= Does the plugin store visitor data? =

No. Form submissions are forwarded to 3Min API and the response (a queue acknowledgement) is returned to the page. The plugin does not persist visitor data on your WordPress site.

== Screenshots ==

1. Overview tab — orientation, quick start, and authoring guides.
2. Snippets list — search, copy shortcode, edit, delete.
3. Snippet Builder — endpoint configuration with test result and detected variables.
4. Template gallery with live preview — six built-in starters across Get Record / Get List / POST, plus one-click AI prompt copy.
5. Snippet rendered on a page via `[3minapi name="..."]`.

== Changelog ==

= 1.0.1 =
* Distribution moved outside the WordPress.org directory (self-hosted / manual ZIP upload).
* Bundled translations (ko_KR, zh_CN, zh_TW, es_ES, ja) load explicitly again, since automatic loading is WordPress.org-only.
* Built-in self-hosted update notifications via the WordPress `Update URI` mechanism — no external library.

= 1.0.0 =
* Snippet Builder UI with live preview, six built-in templates, and one-click AI prompt copy.
* Four modes: Get Record, Get List (with `threeminApi.fetch` pagination), POST, and by-id helpers.
* Optional per-snippet JavaScript pane with lifecycle hooks.
* `unfiltered_html` capability gate for the JS pane.
