Documentation

PushAI user and developer documentation.

This guide is based on the actual PushAI Free and PushAI Pro plugin code. It covers setup, admin workflows, Pro automation, troubleshooting, and the PHP and REST surfaces available to theme and plugin developers.

Current plugin version

0.9.0

Minimum WordPress

6.4+

Minimum PHP

8.1+

What PushAI does

Overview

PushAI is a self-hosted Web Push plugin for WordPress. Browser subscriptions, notifications, queue jobs, license state, and analytics data live in your WordPress installation instead of a third-party push SaaS. Delivery uses VAPID credentials and the native Web Push standard.

Free plugin

Manual notifications, automatic new-post notifications, subscriber collection, guest subscriptions, background delivery queue, VAPID credentials, GDPR export/erasure hooks, and developer APIs.

Pro plugin

Licensed automation for AI digests, analytics, templates, custom post types, comments, admin alerts, WooCommerce events, Trending Today, and the permission popup.

PushAI Pro requires the main PushAI plugin and an active Pro license. Installing the Pro plugin alone does not unlock paid features.

First install

Quick start

  1. 1Install and activate PushAI from WordPress -> Plugins.
  2. 2Open PushAI -> Settings and enable Push service.
  3. 3Leave Guest subscriptions enabled if visitors without WordPress accounts should subscribe.
  4. 4Set a square notification icon. A 192x192 PNG is recommended.
  5. 5Open PushAI -> Credentials and confirm that VAPID credentials exist.
  6. 6Add the shortcode [pushai_button] to a page, post, widget, or template.
  7. 7Open the page in a supported browser, click the button, and allow notifications.
  8. 8Go to PushAI -> Notifications and send a manual test campaign.
[pushai_button]
[pushai_button label="Enable browser notifications" align="center"]
<?php echo do_shortcode( '[pushai_button]' ); ?>

Common tasks

How-to guides

Start here when you want to do a specific job in the WordPress admin. Each guide assumes the main PushAI plugin is installed and active.

Add the subscribe button to a page

Outcome: Visitors can click one button and allow browser notifications.

  1. 1Open the WordPress page or post where you want the button to appear.
  2. 2Paste [pushai_button] into the content editor, shortcode block, widget, or template.
  3. 3Optional: customize it with label, on, blocked, align, and class attributes.
  4. 4Update the page, open it in a supported browser, and click the button.
  5. 5Accept the browser permission prompt. The browser should appear under PushAI -> Subscribers.
[pushai_button label="Enable browser notifications" align="center"]

Send your first test notification

Outcome: Confirms that subscription collection, VAPID credentials, and delivery queue all work.

  1. 1Subscribe from the front end first. Use the same browser you will use for testing.
  2. 2Go to PushAI -> Notifications.
  3. 3Create a manual notification with a short title, message, and destination URL.
  4. 4Send it to all subscribers, or select your WordPress user if you are testing a targeted send.
  5. 5Open PushAI -> Dashboard and check Recent notifications, Queue depth, and Failed jobs.

Automatically notify subscribers when a post is published

Outcome: PushAI queues a notification whenever a post is published.

  1. 1Go to PushAI -> Settings.
  2. 2Enable Push service.
  3. 3Enable New post automation.
  4. 4Publish a new post. Existing already-published posts will not re-trigger unless republished through a new transition.
  5. 5Check PushAI -> Notifications to confirm that a new campaign was created.

Allow visitors without accounts to subscribe

Outcome: Logged-out readers can become browser subscribers.

  1. 1Go to PushAI -> Settings.
  2. 2Enable Guest subscriptions.
  3. 3Place [pushai_button] somewhere public on the site.
  4. 4Test in an incognito/private window.
  5. 5Confirm the new row appears in PushAI -> Subscribers under Guests.

Send to selected WordPress users only

Outcome: A notification reaches only users with active browser subscriptions.

  1. 1Ask the target users to log in and subscribe from their browsers.
  2. 2Go to PushAI -> Notifications.
  3. 3Create a manual notification and search/select the recipients.
  4. 4Send the notification.
  5. 5If a selected user has no active subscription, PushAI skips that target by default.

Change the notification icon

Outcome: Notifications show a recognizable site or brand icon.

  1. 1Prepare a square PNG image. 192x192px or larger is recommended.
  2. 2Go to PushAI -> Settings.
  3. 3Use Notification icon -> Select image.
  4. 4Save settings.
  5. 5Send a test notification. Some browsers may cache old icons briefly.

Licensed workflows

Pro how-to guides

These tasks require PushAI Pro to be installed and the site license to be active from PushAI > Plans & License.

Activate PushAI Pro

Outcome: Unlocks Pro menus and licensed automation.

  1. 1Install and activate the main PushAI plugin first.
  2. 2Install and activate PushAI Pro.
  3. 3Go to PushAI -> Plans & License.
  4. 4Paste or confirm the license key and activate it for this site.
  5. 5Reload the PushAI menu. AI Digests, Statistics, Templates, and Pro settings become available.

Set up scheduled AI digests

Outcome: Recent posts are collected and sent as scheduled browser push summaries.

  1. 1Go to PushAI -> AI Digests.
  2. 2Enable AI digest service.
  3. 3Set Delivery times using the WordPress site timezone, for example 09:00,18:00.
  4. 4Choose Lookback window, Minimum posts, Maximum posts, and Digest language.
  5. 5Optionally add an OpenAI API key and model. Without a key, PushAI uses a template fallback.
  6. 6Save AI settings and watch Recent AI Digest Summaries after the next scheduled run.

Enable notifications for custom post types

Outcome: Publishing selected content types can trigger automatic browser notifications.

  1. 1Go to PushAI -> Settings with Pro active.
  2. 2Find Automatic notification post types.
  3. 3Select the public post types you want to notify for.
  4. 4Add comma-separated custom post type slugs if a type does not appear in the checkbox list.
  5. 5Save settings and publish a new item in that post type.

Notify authors about new comments

Outcome: Post authors receive browser notifications when their content gets comments.

  1. 1Go to PushAI -> Settings.
  2. 2Enable Comment notifications.
  3. 3Enable Notify post author.
  4. 4Select the post types that should trigger comment notifications.
  5. 5Make sure authors are logged in and subscribed to browser notifications.

Turn on WooCommerce order and stock alerts

Outcome: Subscribed administrators and registered customers receive store events by push.

  1. 1Make sure WooCommerce is active before configuring this section.
  2. 2Go to PushAI -> Settings and find WooCommerce.
  3. 3Enable WooCommerce notifications.
  4. 4Enable the exact events you need: admin orders, admin stock, customer order status, customer order notes, or customer cross-sell.
  5. 5For cross-sell, set Delay after order and Max suggested products.
  6. 6Remember: customer notifications only reach registered, subscribed customers. Guest checkouts cannot be targeted.

Customize automatic notification text

Outcome: Automatic notifications use your own titles and message templates.

  1. 1Go to PushAI -> Templates.
  2. 2Edit the template for the event you want: new content, comments, trending, admin alerts, or WooCommerce.
  3. 3Use placeholders such as {title}, {excerpt}, {post_title}, {comment_author}, {order_number}, or {product_names}.
  4. 4Leave a field blank to fall back to the plugin default.
  5. 5Save templates and trigger the event again to test the output.
Pro features are gated by the license check at runtime. If Pro is installed but locked, activate or refresh the license from PushAI > Plans & License.

Operational checks

Fix common issues

Button does not subscribe

Confirm Push service is enabled, guest subscriptions are allowed when testing logged out, HTTPS is active in production, and the browser supports Web Push.

Notifications stopped after VAPID change

Regenerating credentials invalidates all existing browser subscriptions. Visitors must subscribe again.

Queue is not moving

Check WP-Cron, server loopback requests, and the Dashboard cards for queue depth and failed jobs.

WooCommerce customer alerts do not arrive

Customer order status, order note, and cross-sell notifications reach registered customers with active subscriptions. Guest checkouts cannot be targeted.

Use PushAI > Dashboard as the first diagnostic screen. Service health tells you whether Push service, new-post automation, guest subscriptions, and VAPID credentials are currently active.

WordPress admin

Admin reference

Dashboard

PushAI -> Dashboard

Monitors active subscribers, sent notifications, completed campaigns, queue depth, failed jobs, recent notifications, and service health.

Notifications

PushAI -> Notifications

Creates manual campaigns, filters history by queued, processing, sent, or failed status, and supports targeted sends to selected WordPress users.

Subscribers

PushAI -> Subscribers

Lists browser subscriptions for registered users and guests. Each row represents one browser endpoint, not one human account.

Settings

PushAI -> Settings

Controls the push service, automatic new-post notifications, guest subscriptions, notification icon, shortcode usage, Pro panels, and maintenance actions.

Credentials

PushAI -> Credentials

Shows the masked public VAPID key and can regenerate Web Push credentials. Regeneration invalidates existing browser subscriptions.

Plans & License

PushAI -> Plans & License

Manages checkout, license activation, refresh, renewal, and site deactivation for PushAI Pro.

What Pro adds

  • Scheduled AI digests with delivery times, lookback window, minimum posts, maximum posts, language, public digest pages, OpenAI API key, and model setting.
  • Automatic notification post types, including public post types, pages, posts, and comma-separated custom post type slugs.
  • Comment notifications for post authors and comment replies, scoped by post type.
  • Site management notifications for administrators with manage_options: moderation queue, pending review, and published post alerts.
  • WooCommerce admin order alerts, stock alerts, customer order status updates, customer order notes, and delayed cross-sell follow-ups.
  • Trending Today notifications based on daily post view milestones, with per-day caps.
  • Permission popup text for visitors who have not enabled browser notifications.
  • Notification templates for posts, comments, admin alerts, WooCommerce events, cross-sell messages, and trending alerts.
  • Statistics for deliveries, clicks, subscriber growth, clicked links, category CTR, and AI digest conversion.

PHP integration

Developer API

Developers can queue notifications directly from a theme, plugin, or custom automation. The helper returns the notification ID on success or a WP_Error on failure.

$notification_id = pushai_trigger_notification( array(
  'title'           => 'New update',
  'body'            => 'A new article is available.',
  'url'             => home_url( '/news/' ),
  'image'           => '',
  'source_type'     => 'developer',
  'source_id'       => 0,
  'target_user_ids' => array( 12, 34 ),
  'exclude_user_ids'=> array( 56 ),
) );

Equivalent action form:

do_action( 'pushai_send_notification', array(
  'title' => 'Order ready',
  'body'  => 'Your order is ready for pickup.',
  'url'   => wc_get_endpoint_url( 'orders', '', wc_get_page_permalink( 'myaccount' ) ),
) );

Supported arguments

title, body, url, image, source_type, source_id, target_user_id, target_user_ids, and exclude_user_ids.

License helpers

Use pushai_license_is_active(), pushai_license_is_active_cached(), and pushai_get_license() when building integrations that depend on Pro.

Browser integration

REST endpoints

GET/wp-json/pushai/v1/subscription-nonce

Returns a PushAI nonce and a fresh wp_rest nonce for the current browser session.

POST/wp-json/pushai/v1/subscriptions

Stores or updates the browser push subscription. Requires X-Pushai-Nonce and same-origin validation. Guests are accepted only when Guest subscriptions is enabled.

GET/wp-json/pushai/v1/subscriptions

Checks whether the current browser endpoint is active.

DELETE/wp-json/pushai/v1/subscriptions

Marks the current browser endpoint as unsubscribed. This remains available even if guest subscriptions are later disabled.

GET/wp-json/pushai/v1/notification-status

Returns the current logged-in user notification status.

POST/wp-json/pushai-pro/v1/click

Pro endpoint used by the service worker to record signed notification click events.

Extension points

Actions and filters

pushai_send_notificationActionQueue a notification with the same arguments accepted by pushai_trigger_notification().
pushai_notification_queuedActionRuns after a notification row and queue job are created.
pushai_notification_failedActionRuns when a developer-triggered notification cannot be queued.
pushai_notification_delivery_completedActionRuns after delivery finishes with success, failed, and expired counts.
pushai_loadedActionRuns after PushAI initializes shared services.
pushai_should_create_post_notificationFilterAllow or block automatic notification creation for a published post.
pushai_post_notification_argsFilterModify title, body, URL, image, targeting, or context before a post notification is queued.
pushai_should_send_to_subscriptionFilterDecide per subscription whether it should receive a notification.
pushai_notification_payloadFilterChange the browser payload before delivery. Pro uses this to add click tracking.
pushai_utm_parametersFilterCustomize or disable UTM parameters appended to notification URLs.
pushai_skip_inactive_targetsFilterControl whether targeted users without active subscriptions are pruned before queueing.
pushai_localize_configFilterExtend the front-end JavaScript config. Pro uses this for the permission prompt.
pushai_pro_notification_post_typesFilterAdjust Pro automatic notification post types.
pushai_pro_comment_notification_post_typesFilterAdjust Pro comment notification post types.

Storage

Data and privacy

Core tables

PushAI stores browser subscriptions, notifications, and queue jobs in WordPress database tables with the site table prefix.

Pro analytics

Pro creates a pushai_pro_analytics table for delivery and click events. Click tracking uses a signed token and rate limiting.

Subscriber data

Stored subscription data includes endpoint, public key, auth token, content encoding, device type, status, user ID or guest ID, and delivery timestamps.

Maintenance

Settings includes Clear Cache and Delete All Data. Delete All Data removes subscriptions, notifications, and jobs and cannot be undone.

Release notes

Changelog

Version 0.9.0

Current
  • Added the PushAI admin workspace: Dashboard, Notifications, Subscribers, Settings, Credentials, and Plans & License.
  • Added manual campaigns with title, message, target URL, optional image, and selected-user targeting.
  • Added the [pushai_button] shortcode with label, on, blocked, align, and class options.
  • Added guest subscriptions, user-linked subscriptions, browser unsubscribe support, and subscriber status display.
  • Added automatic new-post notifications and block editor auto-share control.
  • Added VAPID credential generation and regeneration.
  • Added the one-minute WP-Cron delivery queue with queue depth and failed job visibility.
  • Added PushAI Pro license activation, refresh, renewal, and site deactivation.
  • Added scheduled AI digests with delivery times, lookback window, post limits, language, OpenAI settings, and template fallback.
  • Added Pro notification templates for posts, comments, admin alerts, WooCommerce events, cross-sell messages, and trending alerts.
  • Added WooCommerce admin order alerts, stock alerts, customer order status updates, customer order notes, and delayed cross-sell notifications.
  • Added comment notifications, site management alerts, custom post type automation, permission popup, and Trending Today notifications.
  • Added Pro statistics for deliveries, clicks, subscriber growth, clicked links, category CTR, and AI digest conversion.
  • Added developer APIs: pushai_trigger_notification(), pushai_send_notification, targeting arguments, REST endpoints, and extension hooks.
  • Added maintenance actions for clearing PushAI cache and deleting all PushAI data.