=== Yak Event Hooks ===
Contributors: oliverdj123
Tags: webhook, automation, n8n, workflow, post
Requires at least: 5.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Send WordPress events (posts, comments, media uploads, new users) to any webhook URL so your workflows start automatically.

== Description ==

Stop hand-copying data between WordPress and your automation tools. Yak Event Hooks fires a webhook whenever an event happens on your site, carrying a clean JSON payload with everything your workflow needs — no API keys, no accounts, no third-party servers.

Developed by **[YakWP](https://yakwp.com)**. See the [plugin homepage](https://yakwp.com/yak-event-hooks/) for the demo, documentation, and downloads.

Point it at any endpoint that accepts a JSON POST — n8n, Zapier, Make, IFTTT, your own server, or a cloud automation — and instantly start workflows on:

Posts
* Published — share to social, email subscribers, summarize with AI, republish elsewhere.
* Updated — send diffs, updated titles or URLs to downstream systems.
* Trashed / Deleted — clean up records, sheets, or external feeds.

Comments
* Added — forward new comments (author, content, post) to Slack, ticketing, or AI-reply pipelines.
* Status changed — approve/unapprove/spam moderation notifications.
* Deleted — keep moderation logs in sync.

Media
* Uploaded — every new attachment (image, file) with dimensions, size, and URL — perfect for image pipelines.

Users
* Registered — new-user signups (username, email, role) for membership/CRM automation.

Payload example (post published):

```
{
  "event": "publish",
  "post_id": 42,
  "title": "How to automate WordPress",
  "slug": "automate-wordpress",
  "url": "https://example.com/automate-wordpress",
  "post_type": "post",
  "status": "publish",
  "author": "Oliver",
  "categories": ["Automation"],
  "tags": ["webhook"],
  "timestamp": "2026-09-05 12:00:00"
}
```

Your webhook URL is all it needs. Each event is toggleable, so you only send what you want.

= Made by YakWP =

Developed and maintained by **[YakWP](https://yakwp.com)**. YakWP also makes a **free AI chatbot plugin for WordPress** that answers your visitors' questions right on your site — pair it with Yak Event Hooks so your site not only fires workflows but also talks to every visitor automatically.

* **[Plugin homepage](https://yakwp.com/yak-event-hooks/)** — demo, docs, and downloads
* **[YakWP](https://yakwp.com)** — free AI chatbot for WordPress

= Features =

* Fires on post lifecycle (publish/update/trash/delete), comments (added/status/deleted), media uploads, and new-user registrations.
* Works with any post type (posts, pages, custom types) and filters events by selected post types.
* Optional excerpt and full-content fields in the post payload.
* Cool-down timer prevents repeat firing during rapid saves.
* Test button — send a sample payload to verify your endpoint before trusting it live.
* Delivery log — see every send, its HTTP status, and any errors, right in wp-admin.
* REST API — read and update settings remotely (`/wp-json/yak-event-hooks/v1/settings`, `/log`).
* Lightweight: one HTTP request per event, no database tables, no scheduled tasks, no external services.

= Privacy =

No data ever leaves your site except the JSON payload you asked us to send to your own webhook URL. There are no analytics, no tracking, and no third-party requests.

== Installation ==

1. Upload the `yak-event-hooks` folder to `/wp-content/plugins/` or install via Plugins &rarr; Add New.
2. Activate the plugin.
3. Go to Settings &rarr; Yak Event Hooks.
4. In n8n (or your automation tool), add a Webhook node, enable it, and copy the full URL.
5. Paste the URL into the plugin, tick the events you want, and save.
6. Use the Send Test Payload Now button to confirm the connection.

== Frequently Asked Questions ==

= Do I need an API key or account? =

No. You only need the webhook URL of your own endpoint.

= Does it only work with n8n? =

No. It works with any endpoint that accepts a JSON POST — n8n, Zapier, Make, IFTTT, webhooks.dev, or your own server.

= Which events are supported? =

Post published, updated, trashed, and permanently deleted; comment added, comment status changed, comment deleted; media (attachment) uploaded; and new user registered. Every event is toggleable.

= Which WordPress versions are supported? =

WordPress 5.0 and later, including the latest releases. PHP 7.4 or higher.

== Screenshots ==

1. Configure your webhook URL, pick the events to send, and watch every delivery (with HTTP status) in the on-page log.

== Changelog ==

= 1.2.0 =
* Rebranded to "Yak Event Hooks" (new permalink `yak-event-hooks`) per the WordPress.org naming guidelines — the "Webhook Events" name was too generic.
* Added the plugin owner (oliverdj123) to the Contributors list.
* Settings keys, REST namespace, and admin menu slug updated to match the new name.

= 1.1.0 =
* Added: comment events (added, status changed, deleted).
* Added: media upload event (new attachment added).
* Added: new-user registration event.
* Expanded event coverage beyond posts.

= 1.0.3 =
* Maintenance: PCP clean-up — removed a direct database call, removed a translator placeholder, bumped "Tested up to" to WP 7.1.

= 1.0.2 =
* Added: "Settings" quick-link in the plugin's row on the Plugins screen.

= 1.0.1 =
* Added: authenticated REST endpoints (`/wp-json/yak-event-hooks/v1/settings` and `/log`).

= 1.0.0 =
* Initial release.