78% ab-testing-with-javascript

Code Review | AB Testing with Javascript

WordPress plugin AB Testing with Javascript scored78%from 54 tests.

About plugin

  • Plugin page: ab-testing-with-j...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.5.1
  • WordPress version: 6.3.1
  • First release: Dec 3, 2013
  • Latest release: Feb 11, 2014
  • Number of updates: 18
  • Update frequency: every 3.9 days
  • Top authors: bmorenate (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,184 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.10MB] [CPU: ▼6.37ms] Passed 4 tests

This is a short check of server-side resources used by AB Testing with Javascript
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1136.88 ▼4.62
Dashboard /wp-admin3.42 ▲0.0746.36 ▼16.24
Posts /wp-admin/edit.php3.53 ▲0.1750.21 ▲5.68
Add New Post /wp-admin/post-new.php6.00 ▲0.1189.43 ▼3.68
Media Library /wp-admin/upload.php3.34 ▲0.1034.60 ▼0.94

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 18 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for AB Testing with Javascript
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲4113.27 ▼1.291.71 ▼0.1743.41 ▼1.25
Dashboard /wp-admin2,221 ▲334.88 ▼1.01108.64 ▼3.4538.90 ▼4.59
Posts /wp-admin/edit.php2,101 ▲122.06 ▲0.0139.08 ▲2.3635.08 ▼1.37
Add New Post /wp-admin/post-new.php1,524 ▲1017.72 ▲0.26677.35 ▼22.8963.95 ▲0.64
Media Library /wp-admin/upload.php1,400 ▲94.20 ▼0.0595.55 ▼6.2340.38 ▼4.61

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/ab-testing-with-javascript/split-testing-page.php
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ab-testing-with-javascript/functions/split-testing-menu.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ab-testing-with-javascript/functions/create-app-js-file.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/ab-testing-with-javascript/split-testing-page.php:119
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ab-testing-with-javascript/functions/split-testing-menu.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ab-testing-with-javascript/functions/ajax-requests.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ab-testing-with-javascript/functions/load-resources.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: content experiments, ab tests, ab testing, ab experiments

ab-testing-with-javascript/split-testing.php 92% from 13 tests

The entry point to "AB Testing with Javascript" version 1.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ab-testing-with-javascript.php" instead of "split-testing.php")

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
Everything looks great! No dangerous files found in this plugin1,641 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2153235773
PHP6254227641
CSS2240108
Markdown1460108
HTML10011

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity24.75
▷ Minimum class complexity1.00
▷ Maximum class complexity94.00
Average method complexity3.11
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods45
▷ Static methods00.00%
▷ Public methods2044.44%
▷ Protected methods00.00%
▷ Private methods2555.56%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin