94% nutrition-facts

Code Review | Nutrition Facts

WordPress plugin Nutrition Facts scored 94% from 54 tests.

About plugin

  • Plugin page: nutrition-facts
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3.2-5.8.0
  • WordPress version: 5.8.1
  • First release: Sep 23, 2020
  • Latest release: Aug 3, 2021
  • Number of updates: 4
  • Update frequency: every 78.5 days
  • Top authors: ibachal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 674 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.00MB] [CPU: ▼144.30ms] Passed 4 tests

An overview of server-side resources used by Nutrition Facts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0141.93 ▲6.23
Dashboard /wp-admin3.06 ▲0.0155.58 ▲8.81
Posts /wp-admin/edit.php3.11 ▲0.0149.09 ▼4.90
Add New Post /wp-admin/post-new.php5.42 ▼0.02133.56 ▼576.29
Media Library /wp-admin/upload.php3.00 ▲0.0036.82 ▼2.24

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Nutrition Facts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,681 ▲7515.85 ▼0.1512.65 ▲2.4751.30 ▼2.95
Dashboard /wp-admin2,970 ▲376.07 ▲0.05144.07 ▼17.61120.57 ▼16.55
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0267.83 ▼17.6696.99 ▼3.06
Add New Post /wp-admin/post-new.php1,686 ▲7118.96 ▼2.55381.19 ▲63.81125.55 ▲8.94
Media Library /wp-admin/upload.php1,807 ▼05.04 ▲0.03153.43 ▼11.83128.65 ▼8.96

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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 fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nutrition-facts/nutrition-facts.php:60

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: block, recipe, nutrition label, facts label, nutrition guide

nutrition-facts/nutrition-facts.php 92% from 13 tests

The primary PHP file in "Nutrition Facts" version 1.0.0 is used by WordPress to initiate all plugin functionality
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

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected60 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP251640
JSON10016
CSS2403
JavaScript1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.07
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG files were detected