=== Debmedia WebPush ===
Contributors: debmedia
Tags: push notifications, web push, subscribers, notifications, marketing
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Collect browser push subscribers on your WordPress site and automatically notify them the moment you publish a new post.

== Description ==

Debmedia WebPush connects your WordPress site to your [PushPro](https://pushpro.store) account so visitors can subscribe to real browser push notifications — no email address required, no app to install — and so every new post you publish can automatically trigger a notification to your subscriber list.

**What the plugin does:**

* Loads the PushPro subscribe widget on your site so visitors can opt in to push notifications with one click.
* Registers a lightweight service worker at `/pushpro-sw.js` so subscriptions work the way the browser Push API requires (same-origin).
* When you publish a new post, sends the title, excerpt, link, and featured image to PushPro, which delivers it as a push notification to your subscribers.

**Requirements**

This plugin requires a free [PushPro](https://pushpro.store) account and at least one website registered on that account. You'll need a PushPro API key (create a **send-only** key from your PushPro dashboard — never your full-access key) to connect this plugin.

= External services =

This plugin relies on the PushPro service (https://pushpro.store) to store subscribers and deliver notifications — it will not work without it. After you enter your API key in Settings → Debmedia WebPush, the plugin communicates with PushPro as follows:

* **On every page load** (once configured), your site loads a subscribe script and a service worker from `pushpro.store` so visitors can subscribe to push notifications.
* **When a subscriber's browser subscribes**, the subscription (a browser-issued push endpoint, not personal information) is sent from the visitor's browser directly to `pushpro.store`.
* **When you publish a post**, this plugin sends the post title, excerpt, permalink, and featured image URL from your server to `https://pushpro.store/api/v1/campaigns.php`, authenticated with the API key you provide, so PushPro can notify your subscribers.

No data is sent anywhere until you enter an API key and connect a website. See PushPro's [Terms of Service](https://pushpro.store) and Privacy Policy on the PushPro site for how that data is handled.

== Installation ==

1. Install and activate the plugin (via Plugins → Add New, or upload the zip via Plugins → Add New → Upload Plugin).
2. Go to **Settings → Debmedia WebPush** in your WordPress admin.
3. Sign in to your PushPro account (or create a free one at [pushpro.store](https://pushpro.store)), add your site as a website there, and create a **send-only** API key under API Keys.
4. Paste that API key into the plugin's settings page and save.
5. Select which PushPro website corresponds to this WordPress site, and save again.
6. Visit your site — the subscribe prompt should now appear (or embed your own button using the PushPro SDK's `PushPro.subscribe()` call).

== Frequently Asked Questions ==

= Do I need a PushPro account? =

Yes. This plugin is a connector to the PushPro service — it doesn't send or store push notifications itself. A free plan is available.

= Is my API key safe to store here? =

Use a **send-only** API key (created on your PushPro dashboard), which can only trigger a notification send — it cannot read your subscriber list, billing, or other campaigns. This limits what's exposed if your WordPress site's database were ever compromised.

= Will this notify subscribers for every post, including old ones I edit? =

No. It only fires the first time a post transitions from draft (or any non-published status) to published, and is marked so it won't fire again on later edits.

= What happens if I hit my plan's send limit? =

The post still publishes normally; the plugin simply won't be able to trigger the notification, and will show an admin notice saying so.

== Screenshots ==

1. Settings page — connect your PushPro API key and choose a website.

== Changelog ==

= 1.0.0 =
* Initial release: subscribe widget, service worker, and publish-triggered notifications.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
