WP Manifestindependent plugin directory
manifest / utilities / method-alerts

Method Alerts WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA

This plugin implements a system for displaying alerts on specific pages or posts, loading alerts through the browser to keep performance impact low.

★ 0stars
v1.0.3latest · 3 years ago

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/pixelwatt/method-alerts/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Method Alerts Banner

Method Alerts

This plugin implements a system for displaying alerts on specific pages or posts, loading alerts through the browser to keep performance impact low. This plugin requires CMB2 and a theme built with Bootstrap 5 (or Bootstrap's CSS for the '.alert' class and applicable modifier classes).

Functionality

Whenever you modify or add an alert, a json file containing all currently-active and future/perpetual alerts is written to the method-alerts/ subdirectory in wp-uploads/.

When a user visits a post, the post ID is passed to an alerts loader js file, which downloads the json file and checks to see if any alerts are available for that post's ID. If so, those alerts are pushed to any elements with the .method-alerts-container class (you must add this container yourself to your theme's templates, wherever you wish to display alerts).

The URL for the alerts file has a partial timestamp appended to the end of its URL, which changes every 1000 seconds, breaking any browser caches. This means that the user always has a current set of alerts, and means that new alerts may take up to 1000 seconds to appear. As long as the user's alerts data is up to date, scheduled alerts will appear the second they are scheduled to display, and be removed in the same fashion, as the browser is executing all the logic to determine whether or not each alert should appear.

By offsetting the burden of loading alerts to the user's browser, agressive caching can be used on the host server without interupting alert scheduling.

Controlling Targetable Post Types

By default, only pages are available as alert targets. This can easily be changed, however, by adding a few lines of code to your theme's functions.php file.

For example, to include posts as available targets, you'd include something like the following:

function my_theme_change_method_alerts_query( $args ) {   
    $args['post_type'] = array( 'page', 'post' );
    return $args;
} 
add_filter( 'method_alerts_query_args', 'my_theme_change_method_alerts_query', 1 );

Tasks / Roadmap:

  • [X] Add ability to schedule alerts.
  • [ ] Add plugin documentation to the Method Wiki.

Releases

4 releases.

Tag
Published
v1.0.3 latest
Jul 17, 2023 3 years ago
Mar 22, 2023 3 years ago
Aug 23, 2021 5 years ago
Aug 23, 2021 5 years ago

These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.

A grade

Security

Method Alerts 1.0.3 · audited by WP Registry

No security issues found.

Audited release
1.0.3
Findings
none
Worst severity
—
Content hash
5f9a99c5bd9550e1145e7187…

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.