Provides an interface to the A/B tests.

Installs: 21 538

Dependents: 1

Suggesters: 0

Security: 0

Stars: 4

Watchers: 4

Forks: 1


v2.0.3 2024-04-25 07:24 UTC


Provides an interface to the A/B tests.

Used to retrieve the variation of a valid, active A/B test running on for the current user.


Retrieve the A/B test variation of the current user for the example_abtest_name A/B test:

use Automattic\Jetpack\Abtest;

$abtest = new Abtest();
$variation = $abtest->get_variation( 'example_abtest_name' );

Will return null if the A/B test is invalid or is currently inactive.

Using this package in your WordPress plugin

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.


Need to report a security vulnerability? Go to or directly to our security bug bounty site


jetpack-abtest is licensed under GNU General Public License v2 (or later)