84% nutrition-facts-vitamins

Code Review | Nutrition Facts Vitamins

WordPress plugin Nutrition Facts Vitamins scored84%from 54 tests.

About plugin

  • Plugin page: nutrition-facts-v...
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.6
  • WordPress version: 6.3.1
  • First release: Jun 17, 2014
  • Latest release: Aug 25, 2016
  • Number of updates: 57
  • Update frequency: every 18.3 days
  • Top authors: dandelionweb (91.23%)ankitpokhrel (10.53%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /3,915 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
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.25ms] Passed 4 tests

A check of server-side resources used by Nutrition Facts Vitamins
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0340.64 ▼0.75
Dashboard /wp-admin3.33 ▲0.0351.54 ▼0.33
Posts /wp-admin/edit.php3.38 ▲0.0350.25 ▼7.44
Add New Post /wp-admin/post-new.php5.92 ▲0.0385.12 ▼16.48
Media Library /wp-admin/upload.php3.26 ▲0.0342.10 ▲4.63
All Labels /wp-admin/edit.php?post_type=nutrition-label3.3034.17
Add New /wp-admin/post-new.php?post_type=nutrition-label3.3048.35

Server storage [IO: ▲0.06MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Nutrition Facts Vitamins: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲15113.44 ▼1.128.40 ▲6.0844.97 ▼1.27
Dashboard /wp-admin2,228 ▲485.67 ▲0.1081.77 ▼9.8775.82 ▲32.40
Posts /wp-admin/edit.php2,133 ▲302.03 ▲0.0535.99 ▼5.2334.66 ▼1.70
Add New Post /wp-admin/post-new.php1,560 ▲3423.21 ▼0.59691.12 ▲15.7855.45 ▼2.74
Media Library /wp-admin/upload.php1,433 ▲304.20 ▲0.0499.94 ▼0.7679.63 ▲33.06
All Labels /wp-admin/edit.php?post_type=nutrition-label1,1101.9332.2329.49
Add New /wp-admin/post-new.php?post_type=nutrition-label1,7182.5150.6659.19

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/nutrition-facts-vitamins/nutrition-facts-vitamins.php:25

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 important because it is parsed by WordPress.org for the public listing of your plugin
9 plugin tags: nutrition, vitamins, nutrition facts label, nutrition facts, nutrition label...

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

The entry point to "Nutrition Facts Vitamins" version 3.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 364 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin747 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP110281494
PO File14242108
CSS11413100
JavaScript1141945

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/facts-menu-icon.png0.33KB0.22KB▼ 34.99%
img/minus.png0.67KB0.61KB▼ 9.09%
img/plus.png1.15KB0.45KB▼ 60.95%