93% woocommerce-custom-options-lite

Code Review | WooCommerce Product Custom Options Lite

WordPress plugin WooCommerce Product Custom Options Lite scored 93% from 54 tests.

About plugin

  • Plugin page: woocommerce-custo...
  • Plugin version: 1.9.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-5.6
  • WordPress version: 5.8.1
  • First release: Jun 18, 2015
  • Latest release: Dec 28, 2020
  • Number of updates: 213
  • Update frequency: every 9.5 days
  • Top authors: phoeniixx (100%)

Code review

54 tests

User reviews

30 reviews

Install metrics

1,000+ active / 55,060 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.09MB] [CPU: ▼145.28ms] Passed 4 tests

Server-side resources used by WooCommerce Product Custom Options Lite
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1332.84 ▲13.80
Dashboard /wp-admin3.12 ▲0.0736.00 ▼7.49
Posts /wp-admin/edit.php3.17 ▲0.0742.50 ▲0.71
Add New Post /wp-admin/post-new.php5.71 ▲0.2887.44 ▼565.88
Media Library /wp-admin/upload.php3.08 ▲0.0731.64 ▼8.44

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 37 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce Product Custom Options Lite
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,686 ▲9015.94 ▲0.519.55 ▼3.2446.57 ▼9.33
Dashboard /wp-admin2,980 ▲455.90 ▼0.04134.65 ▼9.22111.17 ▼10.24
Posts /wp-admin/edit.php2,746 ▲72.72 ▼0.0063.06 ▼0.8687.19 ▲2.80
Add New Post /wp-admin/post-new.php1,505 ▼40018.88 ▼0.30379.22 ▼8.17111.45 ▲4.09
Media Library /wp-admin/upload.php1,814 ▲45.01 ▼0.04160.89 ▲15.70116.86 ▼5.22

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 13× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/woocommerce-custom-options-lite/templates/custom_textareas.php on line 2
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/woocommerce-custom-options-lite/templates/custom_textareas.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/woocommerce-custom-options-lite/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/woocommerce-custom-options-lite/templates/custom_textareas.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/woocommerce-custom-options-lite/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/woocommerce-custom-options-lite/templates/custom_fields.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/woocommerce-custom-options-lite/templates/custom_fields.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/woocommerce-custom-options-lite/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/woocommerce-custom-options-lite/templates/custom_textareas.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/woocommerce-custom-options-lite/templates/custom_fields.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 27 tag instead of maximum 10
Please take inspiration from this readme.txt

woocommerce-custom-options-lite/plugin.php 77% from 13 tests

The main file in "WooCommerce Product Custom Options Lite" v. 1.9.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woocommerce-custom-options-lite.php" instead of "plugin.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("4.0" instead of "2.6.0")

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
Everything looks great! No dangerous files found in this plugin2,864 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP99621,7042,728
JavaScript155872
PO File123064

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity40.33
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity4.22
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods110
▷ Static methods54.55%
▷ Public methods8779.09%
▷ Protected methods2320.91%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants3100.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
17 PNG files occupy 0.24MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/add-multiple-fields.png19.13KB4.18KB▼ 78.12%
images/27.png41.00KB13.20KB▼ 67.82%
images/premium-btn.png5.72KB5.28KB▼ 7.69%
images/image-frame-even.png0.67KB0.62KB▼ 8.42%
images/price-of-option.png7.33KB3.24KB▼ 55.82%