=== Triage Agent Connector ===
Contributors: mikeywazowski
Tags: security, monitoring, agency
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 0.1.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sends WordPress inventory to WP Triage for risk scoring, vulnerability matching, and prioritized fix recommendations.

== Description ==

**Triage Agent Connector** connects your WordPress site to [WP Triage](https://wptriage.app) — a risk scoring and prioritization tool for agencies and freelancers managing multiple WordPress sites.

After you paste your agent key, the plugin registers the site and sends daily inventory snapshots (plugins, themes, PHP, WordPress version). WP Triage matches your install against known CVEs and produces a **0–100 risk score**, your **top three issues**, and a **recommended fix order** per site.

WP Triage is a **decision engine** — it tells you what to fix first across your portfolio. It is not a firewall, backup tool, or site management dashboard.

* [Setup guide](https://wptriage.app/docs/connecting-wordpress)
* [For WordPress agencies](https://wptriage.app/for-agencies)
* [WordPress risk scoring explained](https://wptriage.app/wordpress-risk-scoring)

=== External service & data usage ===

This plugin connects to the hosted WP Triage service at `https://wptriage.app`.

When you configure an agent key and save settings:

* The plugin calls the WP Triage API to **register this site** and obtain a site ID and ingest token.
* A **daily cron job** sends an inventory snapshot with:
  * Installed plugin names and versions
  * Active theme (and parent theme, if applicable) name and version
  * WordPress core version
  * PHP version
  * Server hostname (where available)

WP Triage uses this data to calculate risk scores and prioritized fix recommendations for your connected sites. The plugin does **not** send post/page content, customer data, or database contents.

You need a WP Triage account to use this plugin. By connecting, you agree to the service's **[Privacy Policy](https://wptriage.app/privacy)** and **[Terms of Use](https://wptriage.app/terms)**.

== Installation ==

1. Install the plugin:
   * From WordPress.org: go to **Plugins → Add New**, search for "Triage Agent Connector", and click **Install Now**; or
   * Manually: copy the `triage-agent-connector` folder to `wp-content/plugins/`.
2. Activate **Triage Agent Connector** in **Plugins**.
3. In WP Triage, open **Agent key** and generate your `wpa_…` key (copy it once).
4. Open **Settings → WP Triage** in your WordPress dashboard:
   * **Agent key** — your `wpa_…` key (same key on every site you manage)
   * *(Optional)* **Advanced → API base URL** — for local/staging only (defaults to `https://wptriage.app`)
5. Click **Save settings**. This links the site to WP Triage and stores the ingest token.
6. Click **Test connection** and **Send snapshot now** to verify that data is flowing.

== Frequently Asked Questions ==

= Where do I get the agent key? =

Log in to [WP Triage](https://wptriage.app) and go to **Agent key** in the app menu. Generate a key and copy it immediately — it is only shown once. Use the same key on every WordPress site you manage.

= How is this different from Wordfence or MainWP? =

Wordfence is a firewall and malware scanner for individual sites. MainWP is a site management dashboard for remote updates and monitoring. WP Triage scores risk across your portfolio and ranks what to fix first — it complements those tools rather than replacing them.

= Do I need a site ID or ingest token? =

No. The plugin obtains those automatically when you save settings.

= What if I regenerate my agent key? =

Generate a new key in WP Triage, then open **Settings → WP Triage** on each WordPress site, paste the new key, and save again.

== Changelog ==

= 0.1.6 =
* Rename PHP classes to Triage_Agent_Connector_* prefix (Plugin Check compliance)

= 0.1.5 =
* Align slug, text domain, and prefixes with WordPress.org directory name `triage-agent-connector`

= 0.1.4 =
* Display name: drop restricted "WP" term from plugin title (Plugin Check compliance)

= 0.1.3 =
* Renamed plugin for WordPress.org directory compliance
* Connect on agent key save via option update hook instead of query parameters

= 0.1.2 =
* Overdue WP-Cron events show "Due now" instead of a past datetime; nudge cron when viewing settings

= 0.1.1 =
* Status page shows next scheduled sync time

= 0.1.0 =
* Agent key onboarding via POST /api/v1/agent/connect
* Inventory collection, ingest ping, snapshot POST, daily cron, backoff on failure
