63% ab-testing-for-wp

Code Review | A/B Testing for WordPress

WordPress plugin A/B Testing for WordPress scored 63% from 54 tests.

About plugin

  • Plugin page: ab-testing-for-wp
  • Plugin version: 1.18.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4
  • WordPress version: 5.9.2
  • First release: Mar 22, 2019
  • Latest release: Apr 14, 2020
  • Number of updates: 51
  • Update frequency: every 7.7 days
  • Top authors: clevernode (98.04%)gayakessler (3.92%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active / 7,143 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▼0.52MB] [CPU: ▼311.97ms] Passed 4 tests

This is a short check of server-side resources used by A/B Testing for WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4155.60 ▲8.54
Dashboard /wp-admin3.75 ▲0.3435.36 ▲0.93
Posts /wp-admin/edit.php4.04 ▲0.4037.38 ▲0.23
Add New Post /wp-admin/post-new.php3.74 ▼3.2332.02 ▼1,251.14
Media Library /wp-admin/upload.php3.70 ▲0.4026.50 ▲2.09
How to Use /wp-admin/admin.php?page=ab-testing-for-wp_howto3.6925.74
Add New A/B Test /wp-admin/post-new.php?post_type=abt4wp-test3.7431.39
All A/B Tests /wp-admin/admin.php?page=ab-testing-for-wp3.6725.03
Advanced Options /wp-admin/admin.php?page=ab-testing-for-wp_advanced3.6824.18

Server storage [IO: ▲2.57MB] [DB: ▲0.00MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 114 new files
Database: 4 new tables, 1 new option
New tables
wp_ab_testing_for_wp_ab_test
wp_ab_testing_for_wp_variant_condition
wp_ab_testing_for_wp_variant
wp_ab_testing_for_wp_log
New WordPress options
ab-testing-for-wp-options

Browser metrics Passed 4 tests

A/B Testing for WordPress: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,939 ▲18518.03 ▲2.0325.06 ▲18.812.29 ▼0.10
Dashboard /wp-admin2,966 ▲1056.16 ▼0.09118.48 ▼16.71157.30 ▼4.88
Posts /wp-admin/edit.php2,765 ▲743.25 ▲0.0063.34 ▼2.38146.38 ▼9.82
Add New Post /wp-admin/post-new.php1,730 ▲1915.89 ▼4.77425.21 ▼8.19155.94 ▼0.88
Media Library /wp-admin/upload.php1,776 ▲785.55 ▲0.03137.99 ▼1.95185.31 ▲0.75
How to Use /wp-admin/admin.php?page=ab-testing-for-wp_howto1,3273.8874.55114.48
Add New A/B Test /wp-admin/post-new.php?post_type=abt4wp-test6,55820.23607.95197.51
All A/B Tests /wp-admin/admin.php?page=ab-testing-for-wp1,0343.9367.2795.62
Advanced Options /wp-admin/admin.php?page=ab-testing-for-wp_advanced1,1103.8762.1997.22

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 50% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The plugin did not uninstall successfully, leaving 4 tables in the database
    • wp_ab_testing_for_wp_variant
    • wp_ab_testing_for_wp_variant_condition
    • wp_ab_testing_for_wp_log
    • wp_ab_testing_for_wp_ab_test
  • Zombie WordPress options were found after uninstall: 1 option
    • ab-testing-for-wp-options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/post-new.php?post_type=abt4wp-test
    • > User notice in wp-includes/functions.php+5768
    register_rest_route was called incorrectly. The REST API route definition for ab-testing-for-wp/v1/ab-test is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback. Please see Debugging in WordPress for more information. (This message was added in version 5.5.0.)
    • > GET request to /wp-admin/post-new.php?post_type=abt4wp-test
    • > User notice in wp-includes/functions.php+5768
    register_rest_route was called incorrectly. The REST API route definition for ab-testing-for-wp/v1/track is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback. Please see Debugging in WordPress for more information. (This message was added in version 5.5.0.)
    • > GET request to /wp-admin/post-new.php?post_type=abt4wp-test
    • > User notice in wp-includes/functions.php+5768
    register_rest_route was called incorrectly. The REST API route definition for ab-testing-for-wp/v1/outbound is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback. Please see Debugging in WordPress for more information. (This message was added in version 5.5.0.)

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 10× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ab-testing-for-wp/src/php/integrations/Integration.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'ABTestingForWP\\Integration' not found in wp-content/plugins/ab-testing-for-wp/src/php/integrations/wpforms/WPForms.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'ABTestingForWP\\Integration' not found in wp-content/plugins/ab-testing-for-wp/src/php/integrations/ninja-forms/NinjaForms.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'ABTestingForWP\\Integration' not found in wp-content/plugins/ab-testing-for-wp/src/php/integrations/gravityforms/GravityForms.php:5
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/ab-testing-for-wp/src/php/integrations/Integration.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'ABTestingForWP\\Integration' not found in wp-content/plugins/ab-testing-for-wp/src/php/integrations/html-forms/HTMLForms.php:5
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/ab-testing-for-wp/src/php/integrations/Integration.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'ABTestingForWP\\Integration' not found in wp-content/plugins/ab-testing-for-wp/src/php/integrations/contact-form-7/ContactForm7.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'ABTestingForWP\\Integration' not found in wp-content/plugins/ab-testing-for-wp/src/php/integrations/mc4wp/MC4WP.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'ABTestingForWP\\Integration' not found in wp-content/plugins/ab-testing-for-wp/src/php/integrations/formidable/Formidable.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/post-new.php?post_type=abt4wp-test
    • > Console-api (warning) in wp-includes/js/dist/deprecated.min.js?ver=8778985ac0dfb16f24f8ef86d0718f43+1:1537
    wp.components.IconButton is deprecated since version 5.4. Please use wp.components.Button instead.
    • > GET request to /wp-admin/admin.php?page=ab-testing-for-wp
    • > Intervention (severe) in unknown
    /wp-admin/post-new.php?post_type=abt4wp-test - Blocked attempt to show a 'beforeunload' confirmation panel for a frame that never had a user gesture since its load. https://www.chromestatus.com/feature/5082396709879808

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: split test, ab test, optimise, measure, marketing...

ab-testing-for-wp/ab-testing-for-wp.php Passed 13 tests

This is the main PHP file of "A/B Testing for WordPress" version 1.18.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
89 characters long description:
Easiest way to create split tests on your WordPress sites, right from the content editor!

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin16,459 lines of code in 117 files:
LanguageFilesBlank linesComment linesLines of code
JSON50010,819
TypeScript42477282,655
PHP396642622,337
CSS13640351
JavaScript10416127
YAML26064
Markdown136056
SVG30031
Bourne Shell27119

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity7.00
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes32
▷ Abstract classes00.00%
▷ Concrete classes32100.00%
▷ Final classes00.00%
Methods176
▷ Static methods158.52%
▷ Public methods12571.02%
▷ Protected methods1810.23%
▷ Private methods3318.75%
Functions23
▷ Named functions313.04%
▷ Anonymous functions2086.96%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.28MB with 0.17MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/assets/how-to-2.png69.13KB34.70KB▼ 49.81%
src/assets/how-to-4.png69.07KB20.45KB▼ 70.39%
src/assets/how-to-1.png102.86KB43.91KB▼ 57.31%
src/assets/how-to-3.png43.81KB13.01KB▼ 70.31%