=== Inlay — Native Ad Monetisation ===
Contributors: useinlay
Tags: ads, monetization, native ads, ads.txt, advertising
Requires at least: 6.3
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Native ads that feel like content. Connect your WordPress site to Inlay in one click — 70% of every CPM goes to you.

== Description ==

[Inlay](https://www.useinlay.com) is a full-stack native advertising platform for independent publishers. AI generates ad templates that match your site's design, a real-time server-side auction sources the highest-paying creative from premium demand partners (TripleLift, Sharethrough, Teads, Taboola, Outbrain, GumGum, and more), and 70% of every CPM goes directly to you.

This plugin is the official WordPress integration. It handles everything the Inlay quickstart asks of your site:

* **One-click embed** — installs the Inlay script asynchronously in the `<head>` of every public page. Placements, URL targeting, and the auction all run on Inlay's servers; there is nothing else to configure in WordPress.
* **Automatic ads.txt** — serves `yourdomain.com/ads.txt` with the seller lines Inlay generates for your active SSP integrations, refreshed every 12 hours. Add your own lines for other partners you work with directly.
* **Per-post control** — a checkbox on any post or page disables ads on that content.
* **Audience hygiene** — optionally hide ads from logged-in users so authors and members never skew your impression counts (administrators keep the script so Inlay's template preview flow works).
* **Live status checks** — verify your connection and your public ads.txt from the settings screen, using the same check Inlay's own dashboard verifier runs.

= How Inlay works =

1. Sign up free at [useinlay.com](https://www.useinlay.com/auth/signup) and add your site.
2. Paste your Site Script ID (or your whole embed snippet) into the plugin.
3. Visit any page of your site once — Inlay's AI reads your design and generates a matching native ad template in seconds.
4. Approve the template in your Inlay dashboard. Ads go live immediately, and monthly payouts arrive by bank transfer via Stripe — no minimum threshold.

= Privacy =

The embed script only loads on your public pages. Consent handling is built in: Inlay reads the TCF 2.2 consent string from your consent management platform (if present) and forwards it to all demand partners. This plugin itself sets no cookies and collects no visitor data; the embed script communicates with useinlay.com to serve ads and record impressions. See the [Inlay privacy policy](https://www.useinlay.com/privacy).

== External services ==

This plugin connects your site to **Inlay** (useinlay.com), the native advertising platform it is the official integration for. The plugin cannot function without this service: Inlay runs the ad auction, generates the ad templates, tracks impressions for your revenue reporting, and pays out your earnings.

What is sent to Inlay, and when:

* **On your public pages**, the plugin loads the Inlay embed script from useinlay.com. On each page view the script sends to Inlay's ad-serving endpoint: the page URL, contextual page metadata (title, keywords, description, language), a redacted snapshot of the page's HTML structure (text content, links, and image sources are stripped before sending), and — where a consent management platform is present — the visitor's TCF 2.2 consent string. This is required to select, render, and measure the native ad. Impressions and clicks are recorded by Inlay so your earnings can be calculated.
* **In wp-admin**, the plugin contacts useinlay.com to validate your Site Script ID and to fetch the ads.txt seller lines generated for your account (cached locally for 12 hours). These requests include your site's URL as part of the request user agent.

No visitor data is sent on pages where ads are disabled, and the plugin itself sets no cookies.

This service is provided by Inlay: [terms of service](https://www.useinlay.com/terms), [privacy policy](https://www.useinlay.com/privacy).

== Installation ==

1. Upload the `inlay` folder to `/wp-content/plugins/`, or install through the WordPress plugins screen.
2. Activate the plugin.
3. Go to the **Inlay** menu in wp-admin and paste your Site Script ID from [Dashboard → Sites](https://www.useinlay.com/dashboard/sites).
4. Visit a page on your site, then approve the generated template in your Inlay dashboard.

== Frequently Asked Questions ==

= Where do I find my Site Script ID? =

In your Inlay dashboard under Sites → your site. It is the long string after `/api/script/` in your embed code. You can also paste the entire embed snippet into the plugin — it extracts the ID for you.

= Do I need to place ad units or widgets? =

No. Inlay decides where ads appear from the placements and URL patterns you configure in the Inlay dashboard. The script injects ads that match your site's design automatically.

= Why is nothing showing yet? =

Ads are held back until you approve your first AI-generated template in the Inlay dashboard. Visit a matching page once to trigger generation, then approve it under Sites → your site.

= My ads.txt isn't updating =

The plugin caches Inlay's generated ads.txt for 12 hours. Use "Sync & verify" on the settings screen to refresh immediately. If a physical `ads.txt` file exists in your WordPress root directory, your web server serves that file first — delete it to let the plugin manage ads.txt.

= Does it work if WordPress is installed in a subdirectory? =

The embed script works everywhere. Automatic ads.txt serving requires WordPress to answer requests at your domain root; on subdirectory sites host ads.txt at the root manually (the settings screen links to your generated content).

== Changelog ==

= 1.0.0 =
* Initial release: async embed script injection, automatic ads.txt with custom lines, per-post ad disabling, logged-in user exclusion, connection & ads.txt verification, dashboard widget.
