63% ab-testing-for-wp

Code Review | A/B Testing for WordPress

WordPress plugin A/B Testing for WordPress scored63%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: 6.3.1
  • 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

200+ active /9,378 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.27MB] [CPU: ▼14.43ms] Passed 4 tests

A 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.89 ▲0.4343.70 ▲0.43
Dashboard /wp-admin3.71 ▲0.4048.53 ▼1.65
Posts /wp-admin/edit.php3.76 ▲0.4045.25 ▼2.90
Add New Post /wp-admin/post-new.php3.61 ▼2.2740.60 ▼53.61
Media Library /wp-admin/upload.php3.63 ▲0.4046.12 ▲13.48
Add New A/B Test /wp-admin/post-new.php?post_type=abt4wp-test3.6135.42
All A/B Tests /wp-admin/admin.php?page=ab-testing-for-wp3.5431.32
How to Use /wp-admin/admin.php?page=ab-testing-for-wp_howto3.5634.47
Advanced Options /wp-admin/admin.php?page=ab-testing-for-wp_advanced3.5432.61

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 114 new files
Database: 4 new tables, 7 new options
New tables
wp_ab_testing_for_wp_ab_test
wp_ab_testing_for_wp_log
wp_ab_testing_for_wp_variant_condition
wp_ab_testing_for_wp_variant
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
ab-testing-for-wp-options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for A/B Testing for WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,950 ▲20414.39 ▲0.1618.92 ▲17.0444.77 ▲0.29
Dashboard /wp-admin2,273 ▲855.89 ▲0.08111.49 ▼7.1545.77 ▲0.32
Posts /wp-admin/edit.php2,156 ▲702.05 ▲0.0737.14 ▲0.2533.81 ▲0.09
Add New Post /wp-admin/post-new.php6,457 ▲4,92422.33 ▼1.06939.59 ▲275.7439.53 ▼11.62
Media Library /wp-admin/upload.php1,455 ▲644.18 ▼0.03100.19 ▼6.4643.97 ▼3.16
Add New A/B Test /wp-admin/post-new.php?post_type=abt4wp-test6,49428.021,090.4253.35
All A/B Tests /wp-admin/admin.php?page=ab-testing-for-wp8342.4440.1626.72
How to Use /wp-admin/admin.php?page=ab-testing-for-wp_howto9942.2729.6031.12
Advanced Options /wp-admin/admin.php?page=ab-testing-for-wp_advanced8612.3727.2823.82

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure failed, 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 detected upon uninstall: 7 options
    • widget_recent-posts
    • ab-testing-for-wp-options
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/post-new.php?post_type=abt4wp-test
    • > User notice in wp-includes/functions.php+5905
    Function 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+5905
    Function 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+5905
    Function 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > 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 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/formidable/Formidable.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 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/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/wpforms/WPForms.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 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

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/post-new.php?post_type=abt4wp-test
    • > Console-api (warning) in wp-includes/js/dist/deprecated.min.js?ver=73ad3591e7bc95f4777a+1:627
    wp.components.IconButton is deprecated since version 5.4 and will be removed in version 6.2. 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

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: ab testing, optimise, marketing, measure, ab test...

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

The principal PHP file in "A/B Testing for WordPress" v. 1.18.2 is loaded by WordPress automatically on each request
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 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected16,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

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
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

All PNG images should be compressed to minimize bandwidth usage for end users
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-1.png102.86KB43.91KB▼ 57.31%
src/assets/how-to-3.png43.81KB13.01KB▼ 70.31%
src/assets/how-to-4.png69.07KB20.45KB▼ 70.39%