84% wp-nutrition-facts

Code Review | WP Nutrition Facts

WordPress plugin WP Nutrition Facts scored84%from 54 tests.

About plugin

  • Plugin page: wp-nutrition-facts
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.8
  • WordPress version: 6.3.1
  • First release: Jan 14, 2014
  • Latest release: Jan 25, 2014
  • Number of updates: 8
  • Update frequency: every 1.6 days
  • Top authors: kilukrumedia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /2,046 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.46MB] [CPU: ▼18.10ms] Passed 4 tests

An overview of server-side resources used by WP Nutrition Facts
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2341.75 ▼1.07
Dashboard /wp-admin3.53 ▲0.2247.71 ▲1.73
Posts /wp-admin/edit.php3.64 ▲0.2844.01 ▼4.26
Add New Post /wp-admin/post-new.php3.37 ▼2.5238.93 ▼65.61
Media Library /wp-admin/upload.php3.45 ▲0.2235.26 ▼1.44
All Labels /wp-admin/edit.php?post_type=wp-nutrition-facts3.4941.97
Add New /wp-admin/post-new.php?post_type=wp-nutrition-facts3.5046.30

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Nutrition Facts
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,905 ▲17013.26 ▼1.094.64 ▲2.8643.43 ▼9.09
Dashboard /wp-admin2,287 ▲995.89 ▲1.02108.77 ▲3.7091.67 ▲49.24
Posts /wp-admin/edit.php2,126 ▲372.07 ▲0.1033.62 ▼5.8034.65 ▼2.04
Add New Post /wp-admin/post-new.php1,544 ▲1022.47 ▼0.66676.31 ▼5.0638.93 ▼12.61
Media Library /wp-admin/upload.php1,416 ▲254.31 ▲0.0598.50 ▼19.3478.84 ▲30.20
All Labels /wp-admin/edit.php?post_type=wp-nutrition-facts1,1002.0334.6729.38
Add New /wp-admin/post-new.php?post_type=wp-nutrition-facts1,9492.6755.0886.35

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

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 | 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 plugin_dir_path() in wp-content/plugins/wp-nutrition-facts/wp-nutrition-facts.php:41

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed: You can look at the official readme.txt

wp-nutrition-facts/wp-nutrition-facts.php Passed 13 tests

The main file in "WP Nutrition Facts" v. 1.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
68 characters long description:
Insert a Nutrition Facts Table to pages, posts and custom post type.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin1,943 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP4391263940
JavaScript5137129510
CSS34743303
PO File15970151
SVG10020
XML14019

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity177.00
▷ Minimum class complexity177.00
▷ Maximum class complexity177.00
Average method complexity6.03
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods35
▷ Static methods00.00%
▷ Public methods35100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants18
▷ Global constants18100.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
6 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icons/ico-delete.png0.70KB0.72KB0.00%
images/wpnutrifacts-logo.png2.82KB1.63KB▼ 42.07%
images/icons/help.png3.32KB0.46KB▼ 86.10%
images/wpnutrifacts-logo-mini.png2.05KB0.95KB▼ 53.52%
images/icons/edit.png0.48KB0.47KB▼ 2.44%