WP Manifestindependent plugin directory
manifest / email / wp-newsletter-builder

Newsletter Builder WP Registry grade D+. High-severity findings · 3 findingsWP RegistryHigh-severity findings · 3 findingsOpen the reportD+

WP Newsletter Builder

★ 6stars
4.1kcomposer installs
v0.8.0latest · 4mo 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/alleyinteractive/wp-newsletter-builder/archive/refs/heads/develop.zip

On Packagist as alleyinteractive/wp-newsletter-builder:

composer require alleyinteractive/wp-newsletter-builder
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Interface to manage email newsletters. Creates a Custom Post Type.

Installation

You can install the package via composer:

composer require alleyinteractive/wp-newsletter-builder

Usage

Activate the plugin in WordPress and use it like so:

$plugin = WP_Newsletter_Builder\WP_Newsletter_Builder\WP_Newsletter_Builder();
$plugin->perform_magic();

Enabling an Email Provider

The plugin supports multiple email providers. To enable an email provider, add the following code as a plugin or function in your theme wp-newsletter-builder-PROVIDER.php:

This decision was made so that only developers can switch email providers (but it may be that we want to create a settings page for this in the future.)

<?php
/**
 * Plugin Name: PROVIDER for WP Newsletter Builder
 * Description: Plugin to enable PROVIDER as an email provider for WP Newsletter Builder.
 * Version: 0.1.0
 * Author: Alley
 *
 * Text Domain: newsletter-testing
 * Domain Path: /languages/
 *
 * @package newsletter-testing
 */
add_filter( 'wp_newsletter_builder_selected_provider',
    fn( $provider ) => 'WP_Newsletter_Builder\Email_Providers\PROVIDER'
);

Filtering Post Types Available in the Post Picker

The plugin allows filtering of post types available in the Gutenberg post picker. The post picker appears in the wp-newsletter-builder/post block as a single post picker and in the wp-newsletter-builder/section block as a multiple post picker.

For example, to allow a custom podcast post type to appear in the post picker, along with the default post post type:

add_filter( 'wp_newsletter_builder_allowed_post_types',
  function( array $allowed_post_types ) {
    $allowed_post_types[] = 'podcast';
    return $allowed_post_types;
  }
);

Testing

Run npm run test to run Jest tests against JavaScript files. Run npm run test:watch to keep the test runner open and watching for changes.

Run npm run lint to run ESLint against all JavaScript files. Linting will also happen when running development or production builds.

Run composer test to run tests against PHPUnit and the PHP code in the plugin.

The entries directory and entry points

All directories created in the entries directory can serve as entry points and will be compiled with @wordpress/scripts into the build directory with an accompanied index.asset.php asset map.

Enqueuing Entry Points

You can also include an index.php file in the entry point directory for enqueueing or registering a script. This file will then be moved to the build directory and will be auto-loaded with the load_scripts() function in the functions.php file. Alternatively, if a script is to be enqueued elsewhere there are helper functions in the src/assets.php file for getting the assets.

Scaffold a block with create-block

Use the create-block command to create custom blocks with @wordpress/create-block and follow the prompts to generate all the block assets in the blocks/ directory. Block registration, script creation, etc will be scaffolded from the bin/create-block/templates/block/ templates. Run npm run build to compile and build the custom block. Blocks are enqueued using the load_scripts() function in src/assets.php.

Updating WP Dependencies

Update the WordPress dependency packages used in the project to their latest version.

To update @wordpress dependencies to their latest version use the packages-update command:

npx wp-scripts packages-update

This script provides the following custom options:

  • --dist-tag – allows specifying a custom dist-tag when updating npm packages. Defaults to latest. This is especially useful when using @wordpress/dependency-extraction-webpack-plugin. It lets installing the npm dependencies at versions used by the given WordPress major version for local testing, etc. Example:
npx wp-scripts packages-update --dist-tag=wp-WPVERSION`

Where WPVERSION is the version of WordPress you are targeting. The version must include both the major and minor version (e.g., 6.1). For example:

npx wp-scripts packages-update --dist-tag=wp-6.1`

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

This project is actively maintained by Alley Interactive. Like what you see? Come work with us.

License

The GNU General Public License (GPL) license. Please see License File for more information.

Releases

Newest 25 of 47 recorded releases.

Tag
Published
v0.8.0 latest
May 29, 2026 4mo ago
Apr 22, 2026 6mo ago
Jan 27, 2026 8mo ago
Jan 26, 2026 8mo ago
Jan 13, 2025 1 year ago
Sep 5, 2024 2 years ago
Jul 3, 2024 2 years ago
Jul 3, 2024 2 years ago
Jun 30, 2024 2 years ago
Jun 28, 2024 2 years ago
Jun 27, 2024 2 years ago
Jun 26, 2024 2 years ago
Jun 26, 2024 2 years ago
Jun 26, 2024 2 years ago
Jun 25, 2024 2 years ago
Jun 24, 2024 2 years ago
Jun 24, 2024 2 years ago
Jun 21, 2024 2 years ago
Jun 21, 2024 2 years ago
Jun 18, 2024 2 years ago
Jun 17, 2024 2 years ago
Jun 14, 2024 2 years ago
Jun 12, 2024 2 years ago
Jun 12, 2024 2 years ago
Jun 11, 2024 2 years ago
All releases on GitHub →

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

D+ grade

Security

Newsletter Builder 0.8.0 · audited by WP Registry

High-severity findings.

1 high 2 medium
Audited release
0.8.0
Findings
3
Worst severity
high
Content hash
0a312c442986fb1aed9e05a8…

Findings

  • high Stored XSS in wp-admin via unsanitized newsletter template style meta

    xss_stored

    nb_template_font, nb_template_bg_color, and nb_template_link_color are registered post meta (config/post-meta.json) on the public, show_in_rest nb_template CPT with type string, no sanitize_callback, and default auth_callback (edit_post). A Contributor or Author can PUT those keys to a payload such as </style><script>…</script> on a template they can edit, then point an nb_newsletter at that template via nb_newsletter_template. When any user opens that newsletter in the block editor, set_template_values() (hooked to admin_head) prints the three values raw into a <style> tag (explicit EscapeOutput phpcs ignores). That is stored XSS in wp-admin: the victim's session can create administrators, change options, or install plugins. The same meta is interpolated into frontend newsletter CSS in action_newsletters_enqueue_styles(); that path runs wp_strip_all_tags first so it is CSS injection rather than script execution. The Gutenberg ColorPicker/SelectControl UI does not emit this payload; the REST meta write does.

    src/assets.php:289-307

    Recommendation

    Sanitize template style meta on write (hex for colors; allowlist for font stacks). Escape all three values with esc_attr() in set_template_values(). Do not phpcs-ignore EscapeOutput here. Restrict nb_template / nb_newsletter capabilities so Contributor cannot plant templates that editors then open.

  • medium Unauthenticated visitors can list and view draft newsletters

    information_disclosure

    nb_newsletter is registered public with has_archive and rewrite slug nb-newsletters. modify_query() on pre_get_posts, for the front-end main query with post_type=nb_newsletter, forces post_status to [publish, draft]. WordPress would otherwise 404 drafts for logged-out users. The comment states this is so draft newsletters can be viewed; Campaign Monitor create_campaign() sends home_url()?post_type=nb_newsletter&p={id} as HtmlUrl. Combined with a public archive, GET /nb-newsletters/ lists unpublished newsletters and GET /?post_type=nb_newsletter&p={id} (or /nb-newsletters/{slug}/) renders single-nb_newsletter.php → the_content() for drafts. Drafts commonly embed unpublished post content via the post blocks. There is no preview token, capability check, or logged-in requirement. REST collection queries are unaffected (not the main query), but the HTML surface is public.

    src/class-wp-newsletter-builder.php:296-307

    Recommendation

    Do not globally expose drafts. Gate HtmlUrl with a secret token (query arg checked in template_include / modify_query) or a capability check, and keep the public archive to published only. Prefer sending inlined HTML to the ESP (as SendGrid/Beehiiv already render internally) instead of a world-readable draft permalink.

  • medium Unauthenticated subscribe accepts arbitrary list IDs and force-resubscribes

    unsafe_input

    POST /wp-json/wp-newsletter-builder/v1/subscribe is registered with permission_callback __return_true. subscribe() only checks that email and listIds are non-empty strings, then explodes listIds and calls the configured provider add_subscriber() for each ID with no allowlist against lists configured on signup blocks. Email is not passed through is_email() or sanitize_email(). Campaign_Monitor::add_subscriber() sends Resubscribe=true and ConsentToTrack=yes; Beehiiv::add_subscriber() sends reactivate_existing=true. Signup-form view.ts posts without a nonce (REST cookie auth is not used). List IDs are not secret: they appear in signup-form markup and in public REST meta nb_newsletter_list on published newsletters; users with edit_posts can also dump every ESP list from GET /wp-newsletter-builder/v1/lists. Observable effects: unauthenticated addition of any address to any list the stored API key can write, re-opt-in of previously unsubscribed addresses, and unbounded ESP API traffic (no rate limit). Failed provider responses are returned in results (API error bodies).

    src/class-rest-api-endpoints.php:77-84,251-299

    Recommendation

    Keep the endpoint public for the signup block, but validate is_email(), allowlist listIds against IDs actually configured on published signup-form blocks (or a managed option), set Resubscribe/reactivate_existing to false unless the list explicitly allows it, rate-limit by IP, and do not echo raw ESP API bodies to the client. Prefer rest_url() in view.ts instead of a hardcoded /wp-json path.

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.