Self-hosted Push Notifications from your Wordpress server for free! 🥳
Perfecty Push WP is an Open Source plugin for WordPress that allows you to send web Push Notifications directly from your server: No hidden fees, no third-party dependencies and you own your data. 👏
Install it now: https://wordpress.org/plugins/perfecty-push-notifications/
More information about the project: https://perfecty.org/
Perfecty_Push_Integration
classPHP >= 7.2
gmp
extension for message encryption (optional)Note: The gmp
extension is optional and recommended
for better performance.
You can use and extend Perfecty Push Notifications from third party plugins or your own code.
You can use the Perfecty_Push_Integration
class to send Push Notifications from other plugins:
Perfecty_Push_Integration::notify( $wp_user_id, $message, $title = '', $image_url = '', $url_to_open = '' )
Send a notification to a registered WordPress user. If the user has multiple devices, it will send the notification to all the devices the user has subscribed.
Perfecty_Push_Integration::broadcast( $message, $title = '', $image_url = '', $url_to_open = '' )
Schedule a broadcast notification that will be sent to all the Push Notifications users.
perfecty_push_broadcast_scheduled($payload)
executed when a broadcast notification has been scheduled. You have access to the provided payload.
perfecty_push_wp_user_notified($payload, $wp_user_id)
executed when a notification has been sent to a WordPress user. You have access to the provided payload and WP User ID.
perfecty_push_custom_payload($payload)
use this filter to customize the $payload
array content. More information about the payload array here.To see it in action in your local development environment, you need a set of services which Wordpress relies on. You start off by creating the docker image:
docker build -t custom-wordpress:5.6-php7.2-apache .
Then start all the services and run the setup:
make up
make setup
You can now go to https://localhost/wp-login.php > Plugins > Activate the Perfecty Push plugin.
# start the service containers
make up
# stop de service containers
make down
# remote console
make console
# run the unit tests
make test
# run the formatter
make format
# setup all: make wordpress, make composer, make phpunit and make sdk
make setup
# setup wordpress and plugins
make wordpress
# install all the composer dependencies
make deps
# setup wordpress as a testing environment for phpunit
make phpunit
# generates the redistributable bundle in dist/perfecty-push-notifications.zip
make bundle
This project relies on automated tests as in the Wordpress Core guidelines.
Run all the test suites:
make test
Run a single test:
make console
cd wp-contents/plugins/perfecty-push/
phpunit --filter test_schedule_broadcast_async
Not intended for production: In case the plugins cannot be installed on your local installation do:
make console
chown -R www-data wp-content
The WordPress Plugin is an Open Source project licensed under GPL v2.
The bell icon SVG code is a Font Awesome icon, a MIT License.
Banner photo by NASA on Unsplash
If you're interesting on contributing to this project, feel free to submit your suggestions as a PR or an issue directly to any of the projects repos. Remember to read the Code of Conduct and the license information of each project, which in general use the MIT license, except the WordPress plugin (GPL v2).
Rowinson Gallego | MocioF |
Thanks to Jetbrains for supporting this Open Source project with their magnificent tools.