Real Notify
A plugin to notify users of new posts in real-time.
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/ronak3899/wp-real-notify/archive/refs/heads/main.zipReadme
Real Notify
Plugin Name: Real Notify
Description: A plugin to notify users of new posts in real-time.
Version: 1.0
Author: ronak3899
Author URI: https://profiles.wordpress.org/ronak3899/
Text Domain: real-notify
Description
Real Notify is a WordPress plugin that sends real-time notifications to logged-in users whenever a new post is published. Notifications appear as pop-ups on the user's screen and are powered by the WordPress Heartbeat API.
Installation
-
Download the Plugin
You can download the plugin from the GitHub repository or by cloning the repository. -
Upload the Plugin
- Navigate to the
Pluginsmenu in your WordPress dashboard. - Click
Add Newand thenUpload Plugin. - Choose the downloaded
real-notify.zipfile and clickInstall Now.
- Navigate to the
-
Activate the Plugin
- After installation, click
Activateto enable the plugin on your WordPress site.
- After installation, click
Usage
-
No Configuration Required
The plugin automatically displays notifications for all public post types when a new post is published. -
Check Notifications
- Logged-in users will see a pop-up notification on their screen.
- The notification includes the title and a link to the newly published post.
Configuration
-
Heartbeat Interval
The plugin sets the Heartbeat API interval to 15 seconds. This interval determines how often the plugin checks for new notifications. -
Custom Post Types
To include or exclude specific post types from notifications, edit the$post_typesarray in the plugin code.
Customization
-
Modify Notification Content
You can customize the notification content and appearance by editing thereal_notify_published_postfunction and thescript.jsfile located in thejsfolder. -
Change Heartbeat Interval
To adjust the frequency of the Heartbeat API checks, modify the$settings['interval']value in thereal_notify_heartbeat_settingsfunction.
Functionality
-
Notification Handling
- Notifications are generated when a post is published and stored using the
set_transientfunction. - Logged-in users receive pop-up notifications if they are currently on the site and their Heartbeat API check finds new notifications.
- Notifications are generated when a post is published and stored using the
-
User-Specific Notifications
- Notifications are shown only to logged-in users.
- Non-logged-in users will not receive notifications.
Troubleshooting
-
No Notifications?
Ensure that the Heartbeat API is enabled and that you are logged in as a user with notifications. -
Notifications Not Showing
Check the plugin’s JavaScript console for errors and ensure the plugin is correctly enqueued.