MCPcopy Index your code
hub / github.com/JJJ/ab-testing-for-wp

github.com/JJJ/ab-testing-for-wp @1.18.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.18.2 ↗ · + Follow
363 symbols 689 edges 91 files 1 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

A/B Testing for WordPress

WordPress plugin which allow you to run A/B tests from anywhere within your content.

Utilize the new Gutenberg editor to create split tests to serve to your visitors and find out which variation works best.

Gutenberg Demo

Installing

  1. Download ab-testing-for-wp.zip found on the latest release
  2. Unzip contents and upload "ab-testing-for-wp" folder to the "/wp-content/plugins/" directory.
  3. Activate the plugin through the "Plugins" screen in WordPress.
  4. You can now add tests to your content!

Requirements

  • At least WordPress 5.0 (uses the new Gutenberg editor)

JavaScript Bundle Development

Requirements: Node.js

Clone the project and npm install.

Use the following commands:

# one time build
npm run build

# development watch mode for JavaScript
npm run dev

# prepare for release (clean, build, archive)
npm run release

Using Docker for development

Requirements: Composer, Docker

# Starting Docker container:
docker-compose up -d

Development WordPress install now runs at localhost:8000

./wp-content of the project root is synced with the development install's wp-content.

Look at docker-compose.yml for database passwords.

Testing and linting

This project is tested using Cypress and linted using eslint. These dependencies get installed with the project automatically.

ESLint

Linting makes sure the code style is in order. This will also be performed on the main repository when creating a pull request.

In order to run linting on your local environment run the following command from the root of the project:

npm run lint

Cypress

Running all end-to-end tests makes sure all functionality is still in place after updates to the code have been made.

Run all tests by entering the following command:

npm run test

There are a few extra command to help you test and develop locally:

# run local test environment and open Cypress
npm run test:dev

# tear down the setup environment and create a new one
npmr run e2e:setup-env

# reset the database to be a fresh WordPress install
npm run e2e:reset-db

Extension points exported contracts — how you extend this code

AbTestingForWpData (Interface)
(no doc)
src/js/types/ab-testing-for-wp.d.ts
Chainable (Interface)
(no doc)
cypress/types/index.d.ts
AbTestingForWpOptions (Interface)
(no doc)
src/js/types/ab-testing-for-wp.d.ts
ABTestVariantCondition (Interface)
(no doc)
src/js/types/ab-testing-for-wp.d.ts
ABTestVariant (Interface)
(no doc)
src/js/types/ab-testing-for-wp.d.ts
ABTestAttributes (Interface)
(no doc)
src/js/types/ab-testing-for-wp.d.ts

Core symbols most depended-on inside this repo

visitAdmin
called by 40
cypress/types/index.d.ts
addBlockInEditor
called by 27
cypress/types/index.d.ts
savePost
called by 21
cypress/types/index.d.ts
login
called by 12
cypress/types/index.d.ts
logout
called by 10
cypress/types/index.d.ts
cleanInstall
called by 8
cypress/types/index.d.ts
disableTooltips
called by 7
cypress/types/index.d.ts
isAvailable
called by 6
src/php/helpers/cookie-manager.php

Shape

Method 215
Function 72
Class 49
Interface 27

Languages

PHP50%
TypeScript50%

Modules by API surface

src/js/blocks/ab-test.tsx24 symbols
src/php/data/ab-test-manager.php22 symbols
src/php/data/installer.php17 symbols
src/php/registrations/register-admin-page.php14 symbols
cypress/types/index.d.ts14 symbols
src/js/components/VariantSettings/Conditionals.tsx13 symbols
src/js/components/GoalSelector/GoalSelector.tsx12 symbols
src/php/helpers/block-renderer.php10 symbols
src/php/helpers/cookie-manager.php9 symbols
src/php/integrations/Integration.php8 symbols
src/js/types/ab-testing-for-wp.d.ts8 symbols
src/js/components/Inserter/Inserter.tsx8 symbols

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add ab-testing-for-wp \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact