承接 automattic/jetpack-explat 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

automattic/jetpack-explat

最新稳定版本:v0.4.4

Composer 安装命令:

composer require automattic/jetpack-explat

包简介

A package for running A/B tests on the Experimentation Platform (ExPlat) in the plugin.

README 文档

README

A package for running A/B tests on the Experimentation Platform (ExPlat) in the plugin.

How to install Jetpack ExPlat

Run composer require automattic/jetpack-explat and pnpm install -S "@automattic/jetpack-explat" in the root folder of your project.

Using this package in your WordPress plugin

In the PHP method that initializes your project, call the following static method to initialize the ExPlat API and register its endpoints:

use Automattic\Jetpack\ExPlat;

ExPlat::init();

In your React code, import the Experiment component and start running experiments:

import { Experiment } from '@automattic/jetpack-explat';

const DefaultExperience = <div>__( 'Control title' )</div>;
const TreatmentExperience = <div>__( 'Treatment title' )</div>;
const LoadingExperience = <div></div>;

<Experiment
	name="jetpack_example_experiment"
	defaultExperience={ DefaultExperience }
	treatmentExperience={ TreatmentExperience }
	loadingExperience={ LoadingExperience }
/>;

If you plan on using this package in your WordPress plugin, we would recommend that you use Jetpack Autoloader as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.

Security

Need to report a security vulnerability? Go to https://automattic.com/security/ or directly to our security bug bounty site https://hackerone.com/automattic.

License

Jetpack ExPlat is licensed under GNU General Public License v2 (or later)

统计信息

  • 总下载量: 10.41k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

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