73% nelio-ab-testing

Code Review | Nelio AB Testing

WordPress plugin Nelio AB Testing scored73%from 54 tests.

About plugin

  • Plugin page: nelio-ab-testing
  • Plugin version: 6.2.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4
  • WordPress version: 6.3.1
  • First release: Sep 17, 2013
  • Latest release: Nov 23, 2023
  • Number of updates: 411
  • Update frequency: every 9.1 days
  • Top authors: nelio (60.34%)davilera (39.66%)

Code review

54 tests

User reviews

69 reviews

Install metrics

3,000+ active /198,244 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.70MB] [CPU: ▲10.61ms] Passed 4 tests

Server-side resources used by Nelio AB Testing
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /5.00 ▲1.5448.83 ▲4.20
Dashboard /wp-admin5.06 ▲1.7565.85 ▲16.54
Posts /wp-admin/edit.php5.11 ▲1.7563.70 ▲14.16
Add New Post /wp-admin/post-new.php7.71 ▲1.8298.09 ▲7.55
Media Library /wp-admin/upload.php4.99 ▲1.7553.60 ▲20.26
/wp-admin/admin.php?page=nelio-ab-testing-css-editor4.6838.03
/wp-admin/admin.php?page=nelio-ab-testing-javascript-editor4.6834.82

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 535 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
nab_version
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Nelio AB Testing: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲4914.35 ▼0.051.72 ▼0.1441.05 ▼3.46
Dashboard /wp-admin2,230 ▲505.68 ▼0.0099.02 ▼2.1043.35 ▼10.35
Posts /wp-admin/edit.php2,136 ▲331.99 ▲0.0438.72 ▼3.0136.24 ▼2.92
Add New Post /wp-admin/post-new.php1,539 ▲1323.05 ▼0.22686.26 ▲19.1166.65 ▲8.39
Media Library /wp-admin/upload.php1,435 ▲324.22 ▼0.0298.48 ▲1.6341.76 ▼1.45
/wp-admin/admin.php?page=nelio-ab-testing-css-editor280.410.073.83
/wp-admin/admin.php?page=nelio-ab-testing-javascript-editor280.410.073.54

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • nab_version
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 8× PHP files output text when accessed directly:
    • > /wp-content/plugins/nelio-ab-testing/includes/utils/notifications/almost-no-more-quota-in-site.php
    • > /wp-content/plugins/nelio-ab-testing/includes/lib/settings/partials/nelio-ab-testing-radio-setting.php
    • > /wp-content/plugins/nelio-ab-testing/includes/utils/notifications/no-more-quota-in-site.php
    • > /wp-content/plugins/nelio-ab-testing/includes/utils/notifications/experiment-stop.php
    • > /wp-content/plugins/nelio-ab-testing/includes/lib/settings/partials/nelio-ab-testing-tabs.php
    • > /wp-content/plugins/nelio-ab-testing/includes/utils/notifications/no-more-quota.php
    • > /wp-content/plugins/nelio-ab-testing/includes/utils/notifications/almost-no-more-quota.php
    • > /wp-content/plugins/nelio-ab-testing/includes/utils/notifications/experiment-start.php
  • 30× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_x() in wp-content/plugins/nelio-ab-testing/includes/utils/notifications/almost-no-more-quota.php:284
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Nelio_AB_Testing\\WooCommerce\\Compat\\add_action() in wp-content/plugins/nelio-ab-testing/includes/hooks/woocommerce/compat/custom-hooks.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_x() in wp-content/plugins/nelio-ab-testing/includes/utils/notifications/experiment-start.php:284
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/nelio-ab-testing/includes/lib/settings/partials/nelio-ab-testing-range-setting.php:31
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/nelio-ab-testing/includes/lib/settings/partials/nelio-ab-testing-radio-setting.php on line 25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Nelio_AB_Testing\\WooCommerce\\Experiment_Library\\Product_Experiment\\add_filter() in wp-content/plugins/nelio-ab-testing/includes/hooks/woocommerce/experiments/product/edit.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/nelio-ab-testing/includes/lib/settings/partials/nelio-ab-testing-select-setting.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_x() in wp-content/plugins/nelio-ab-testing/includes/utils/notifications/no-more-quota.php:284
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Exceptions\\BasicException' not found in wp-content/plugins/nelio-ab-testing/vendor/matthiasmullie/minify/src/Exceptions/FileImportException.php:20
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/nelio-ab-testing/includes/lib/settings/partials/nelio-ab-testing-radio-setting.php on line 25

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=nelio-ab-testing-css-editor
    • > Network (severe)
    wp-admin/admin.php?page=nelio-ab-testing-css-editor - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=nelio-ab-testing-javascript-editor
    • > Network (severe)
    wp-admin/admin.php?page=nelio-ab-testing-javascript-editor - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
You can take inspiration from this readme.txt

nelio-ab-testing/nelio-ab-testing.php Passed 13 tests

The primary PHP file in "Nelio AB Testing" version 6.2.1 is used by WordPress to initiate all plugin functionality
139 characters long description:
Optimize your site based on data, not opinions. With this plugin, you will be able to perform AB testing (and more) on your WordPress site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected25,507 lines of code in 444 files:
LanguageFilesBlank linesComment linesLines of code
PHP3265,9237,19721,285
TypeScript403453792,489
Sass111170652
Markdown1650350
JavaScript382349347
JSON300208
CSS2210140
SVG20028
XML1208

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity15.76
▷ Minimum class complexity1.00
▷ Maximum class complexity146.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces58
Interfaces2
Traits0
Classes73
▷ Abstract classes79.59%
▷ Concrete classes6690.41%
▷ Final classes11.52%
Methods712
▷ Static methods527.30%
▷ Public methods46765.59%
▷ Protected methods618.57%
▷ Private methods18425.84%
Functions646
▷ Named functions36356.19%
▷ Anonymous functions28343.81%
Constants6
▷ Global constants350.00%
▷ Class constants350.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
includes/lib/settings/assets/images/help.png0.30KB0.32KB0.00%