84% nutrition-info-woocommerce

Code Review | Nutrition Info WooCommerce

WordPress plugin Nutrition Info WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: nutrition-info-wo...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 6.3.1
  • First release: Jun 21, 2021
  • Latest release: Jul 29, 2021
  • Number of updates: 3
  • Update frequency: every 14.0 days
  • Top authors: closemarketing (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /590 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.19MB] [CPU: ▼4.75ms] Passed 4 tests

A check of server-side resources used by Nutrition Info WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1943.50 ▲5.29
Dashboard /wp-admin3.49 ▲0.1950.84 ▼0.90
Posts /wp-admin/edit.php3.60 ▲0.2552.99 ▼2.22
Add New Post /wp-admin/post-new.php6.07 ▲0.1885.15 ▼3.70
Media Library /wp-admin/upload.php3.41 ▲0.1840.90 ▼12.16

Server storage [IO: ▲0.11MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Please fix the following
  • You have illegally modified 1 file (4.00KB) outside of "wp-content/plugins/nutrition-info-woocommerce/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Nutrition Info WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲5613.42 ▼1.161.68 ▼0.0439.27 ▼0.73
Dashboard /wp-admin2,218 ▲185.83 ▼0.0298.52 ▼4.5239.01 ▲2.07
Posts /wp-admin/edit.php2,103 ▲32.01 ▲0.0036.12 ▲1.0936.20 ▲2.16
Add New Post /wp-admin/post-new.php1,533 ▲723.36 ▲5.80623.51 ▼115.4055.79 ▼9.20
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.0798.40 ▼16.2844.84 ▼7.53

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% 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 50% 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
Almost there! Just fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/nutrition-info-woocommerce/includes/product-tab.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/nutrition-info-woocommerce/includes/shortcode.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nutrition-info-woocommerce/nutrition-info-woocommerce.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Donate link: Invalid url: ""
You can look at the official readme.txt

nutrition-info-woocommerce/nutrition-info-woocommerce.php Passed 13 tests

The main PHP script in "Nutrition Info WooCommerce" version 0.1 is automatically included on every request by WordPress
65 characters long description:
Display nutritional information on you woocommerce product pages.

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,276 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP784139914
PO File188118191
CSS1151102
JSON10037
Sass12032

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods16
▷ Static methods531.25%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin