定制 alleyinteractive/wp-newsletter-builder 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

alleyinteractive/wp-newsletter-builder

Composer 安装命令:

composer require alleyinteractive/wp-newsletter-builder

包简介

Interface to manage email newsletters

README 文档

README

Contributors: alleyinteractive

Tags: alleyinteractive, wp-newsletter-builder

Stable tag: 0.3.35

Requires at least: 6.2

Tested up to: 6.4.1

Requires PHP: 8.0

License: GPL v2 or later

Coding Standards Testing Suite

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.

alleyinteractive/wp-newsletter-builder 适用场景与选型建议

alleyinteractive/wp-newsletter-builder 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.17k 次下载、GitHub Stars 达 6, 最近一次更新时间为 2024 年 05 月 07 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「alleyinteractive」 「wp-newsletter-builder」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 alleyinteractive/wp-newsletter-builder 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 alleyinteractive/wp-newsletter-builder 我们能提供哪些服务?
定制开发 / 二次开发

基于 alleyinteractive/wp-newsletter-builder 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 3.17k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 17
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2024-05-07