=== smidgen.io Paywalls ===
Contributors: smidgenio
Tags: paywall, micropayments, usdc, x402, monetization
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.1
Stable tag: 0.5.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Server-side USDC (x402) paywalls for WordPress — withhold content until payment, HTTP 402 for bots/agents.

== Description ==

**smidgen.io Paywalls** lets publishers charge for posts and pages with USDC micropayments over [x402](https://smidgen.io/blog/what-is-x402).

* **Hard lock:** unpaid visitors see a teaser only — premium HTML is not in the page source
* **Bots & agents:** matching requests get HTTP 402 via the smidgen gate
* **Editor toggle:** enable “Paywall this content” on any post or page
* **Elementor:** page-level withhold plus a Smidgen Paywall widget for section-level locks
* **Agent catalog:** optional `/.well-known/ai-catalog.json` for AI buyers

This plugin is the WordPress adapter for [smidgen.io](https://smidgen.io). A free smidgen account and Publisher API key are required for payments and rule sync.

= External services =

This plugin connects to **smidgen.io** (or the API URL you configure) to:

1. **Validate unlock cookies** after a visitor pays (`/api/v1/.../unlock/validate`)
2. **Sync paywall rules** when you enable “Paywall this content” (`/api/v1/publisher/rules`)
3. **Gate bot/agent requests** with HTTP 402 (`/api/v1/gate/...`)
4. **Load the browser checkout snippet** (`/snippet.js`) on paywalled pages
5. **Fetch the agent catalog** when you click Sync (`/api/v1/publisher/agent-sitemap`)

Data sent may include: site origin, page path, paywall selector/price, unlock tokens from cookies, and (for rule sync) your Publisher API key over HTTPS.

Privacy policy: https://smidgen.io/privacy
Terms: https://smidgen.io/terms

Without a Publisher API key, the plugin can still withhold content locally, but visitors cannot pay and rules will not sync.

== Installation ==

1. Install from Plugins → Add New, or upload the `smidgen` folder to `/wp-content/plugins/`
2. Activate **smidgen.io Paywalls**
3. Create a project at [smidgen.io/dashboard](https://smidgen.io/dashboard) and generate a Publisher API key
4. Go to Settings → smidgen.io and enter:
   * API URL (`https://smidgen.io`)
   * Project ID (`smid_…`)
   * Publisher API key (`smid_sk_…`)
5. Edit a post or page → enable **Paywall this content** → Update
6. Visit the page while logged out — you should see the teaser and checkout UI

Docs: https://smidgen.io/integrations/wordpress

== Frequently Asked Questions ==

= Do I need a smidgen account? =

Yes. There is no signup API inside WordPress. Sign in at https://smidgen.io/login, create a project, then paste the Project ID and Publisher API key into Settings → smidgen.io.

= Which wallets / chains are supported? =

USDC on Base and Solana via x402, configured on your smidgen project.

= Does this work with Elementor? =

Yes. Page-level paywalls withhold Elementor’s `the_content`. For section-level locks, use the **Smidgen Paywall** widget.

= What happens if smidgen.io is down? =

Bot gate requests fail closed (HTTP 502). Unpaid humans stay locked (fail closed on unlock). The rest of your site continues to load.

= Is the zip on smidgen.io the same plugin? =

Yes. https://smidgen.io/downloads/smidgen-wordpress.zip is the same codebase for direct upload before / alongside the directory listing.

== Screenshots ==

1. Settings → smidgen.io — API URL, project ID, Publisher API key, gate options
2. WordPress admin — smidgen.io under Settings
3. Locked front-end — teaser plus USDC checkout on Base / Solana

== Changelog ==

= 0.5.1 =
* WordPress.org readiness: `readme.txt`, dual GPLv2+/MIT licensing, uninstall cleanup
* Mask Publisher API key on the settings screen (password field; blank keeps existing)
* Document external smidgen.io services for plugin review

= 0.5.0 =
* Server-side content withhold, bot HTTP 402 gate, Publisher rule sync
* Elementor hard-lock widget and agent catalog sync

== Upgrade Notice ==

= 0.5.1 =
Recommended before submitting or updating from the WordPress.org directory.
