78% light-ab-testing

Code Review | Light AB Test

WordPress plugin Light AB Test scored78%from 54 tests.

About plugin

  • Plugin page: light-ab-testing
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.0
  • WordPress version: 6.3.1
  • First release: Nov 10, 2014
  • Latest release: Nov 10, 2014
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: djaney (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /948 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼1.23MB] [CPU: ▼41.78ms] Passed 4 tests

Analyzing server-side resources used by Light AB Test
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.74 ▼0.7214.61 ▼22.47
Dashboard /wp-admin2.78 ▼0.5218.65 ▼28.07
Posts /wp-admin/edit.php2.78 ▼0.5716.54 ▼33.99
Add New Post /wp-admin/post-new.php2.78 ▼3.1118.32 ▼82.59
Media Library /wp-admin/upload.php2.78 ▼0.4516.72 ▼15.90

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Light AB Test
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,860 ▲8913.43 ▼1.002.03 ▲0.1646.14 ▲2.78
Dashboard /wp-admin2,234 ▲465.18 ▲0.28123.97 ▲23.2244.27 ▼0.48
Posts /wp-admin/edit.php2,120 ▲282.36 ▲0.2938.59 ▼3.9433.72 ▼3.16
Add New Post /wp-admin/post-new.php1,538 ▲523.52 ▲0.35671.32 ▲45.9140.03 ▼18.97
Media Library /wp-admin/upload.php1,416 ▲284.47 ▲0.13101.35 ▲1.0542.70 ▼0.77

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% 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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/light-ab-testing/light-abtest.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/light-ab-testing/admin-menu.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WordpressPlugin' not found in wp-content/plugins/light-ab-testing/LightABTest.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 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
3 plugin tags: analytics, ab testing, statistics

light-ab-testing/light-abtest.php 92% from 13 tests

"Light AB Test" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("light-ab-testing.php" instead of "light-abtest.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin524 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP411510322
JavaScript333248202

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity22.50
▷ Minimum class complexity12.00
▷ Maximum class complexity33.00
Average method complexity2.41
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods26
▷ Static methods311.54%
▷ Public methods2180.77%
▷ Protected methods00.00%
▷ Private methods519.23%
Functions7
▷ Named functions00.00%
▷ Anonymous functions7100.00%
Constants8
▷ Global constants00.00%
▷ Class constants8100.00%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin