=== Trevilo ===
Contributors: trevilo
Tags: forms, sms, email, automation
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Send your website forms to Trevilo for email, SMS and automations.

== Description ==

Trevilo adds the Trevilo script to your site so form submissions are delivered by email and SMS and can trigger automations. Add your Site ID, then choose where it loads:

* **Entire site**: every front-end page, including the blog, archives, search and 404 pages.
* **Only selected pages**: pick pages from Settings → Trevilo or switch it on in the page editor.
* **Entire site except…**: load everywhere except the pages you exclude.

The script loads with `defer`, so it never blocks page rendering. It is never loaded in wp-admin, on the login page, or in feeds and embeds.

== External service ==

This plugin loads `https://trevilo.app/t.js` from Trevilo on the pages you choose. That script sends the forms visitors submit (for example name, email address, phone number and message) to Trevilo, together with your Site ID, so they can be delivered and automated. Nothing is loaded until a Site ID is saved.

The plugin also checks `https://trevilo.app` for new versions of itself, about twice a day (hourly while trevilo.app cannot be reached). That request sends nothing about your site beyond what WordPress sends with any update check (your WordPress version and site address in the user agent).

Service: https://trevilo.app

== Installation ==

1. Plugins → Add New → Upload Plugin, choose the Trevilo zip, then Install and Activate.
2. Go to Settings → Trevilo.
3. Paste your Site ID (or the whole script tag from your Trevilo dashboard) and save.

== Frequently Asked Questions ==

= I use a Content Security Policy =

Allow `https://trevilo.app` in `script-src` and `connect-src`.

= A caching or optimisation plugin delays scripts =

Exclude `trevilo.app/t.js` from "delay JavaScript" features (WP Rocket, LiteSpeed, Perfmatters, etc.). For Cloudflare Rocket Loader, add this to a small mu-plugin:

`add_filter( 'trevilo_script_attributes', fn( $a ) => $a + array( 'data-cfasync' => 'false' ) );`

= Hooks for developers =

* `trevilo_should_load` (bool $load, int $post_id, string $mode): override whether the script loads on the current request.
* `trevilo_script_attributes` (array $attributes): add attributes to the script tag.
* `trevilo_post_types` (string[] $types): change which post types can be targeted.

= What is removed when I delete the plugin? =

The settings and every per-page flag, on every site of a multisite network.

== Changelog ==

= 1.1.0 =
* Updates arrive from trevilo.app like any other plugin update.

= 1.0.0 =
* First release.
