| 开发者 | victoriavegab |
|---|---|
| 更新时间 | 2026年8月18日 11:09 |
| PHP版本: | 8.1 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
window.abTestData, and your theme (or a small snippet) reads it to render the assigned variant server-side via the abtf_runner() helper. This is the standard server-side pattern used by tools like LaunchDarkly, Optimizely and Split: the plugin decides, your code applies. A minimal integration example is provided in the FAQ.
Key features
/wp-content/plugins/ directory, or install the plugin through the WordPress plugins screen.No. In Local mode the plugin decides variants on your own server and needs no third-party account. You only need a Flagship account if you choose Flagship mode, which adds remote targeting, segmentation and the Flagship dashboard.
Redis is not strictly required, but it is recommended at scale. The plugin uses Redis to cache variant assignments and to store conversion counters for fast reporting. Without Redis the plugin still works: variant assignments fall back to the database, and in Local mode conversions are recorded in the database as well.
Starting paused lets you verify the configuration (selector, URLs, flag key, variants) before the experiment serves any variant. Only active experiments are applied, so a paused start prevents assignments from being cached before you are ready.
The variant is decided in PHP before the HTML is generated, so your theme can render the correct variant from the first byte. There is no JavaScript swap after load, which is what causes flicker in client-side tools.
No. The plugin decides and exposes the variant; your theme renders it. This keeps the plugin theme-agnostic and avoids the flicker that DOM-manipulation approaches cause. See the next question for a minimal integration example.
The plugin exposes the decided variant through the abtf_runner() helper. Call it in your theme where you want to render the variant, before output. For example:
`<?php
$runner = abtf_runner();
$result = $runner->run( 'your_flag_key' );
$variant = $result['variant'];
if ( $variant === 'control' ) {
// render the control version
} else {
// render the variant version
}
?>`
The decision is made in PHP before the HTML is sent, so there is no flicker. The same variant is also available in JavaScript as window.abTestData for client-side needs.