94% canadian-nutrition-facts-label

Code Review | Canadian Nutrition Facts Label

WordPress plugin Canadian Nutrition Facts Label scored 94% from 54 tests.

About plugin

  • Plugin page: canadian-nutritio...
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.5.3
  • WordPress version: 5.8.1
  • First release: Jan 25, 2014
  • Latest release: Nov 26, 2020
  • Number of updates: 33
  • Update frequency: every 75.7 days
  • Top authors: dandelionweb (96.97%)emaude (6.06%)

Code review

54 tests

User reviews

2 reviews

Install metrics

70+ active / 2,742 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

Server-side resources used by Canadian Nutrition Facts Label
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.93 ▲0.2133.65 ▲13.46
Dashboard /wp-admin3.15 ▲0.0935.89 ▼10.64
Posts /wp-admin/edit.php3.20 ▲0.0935.36 ▼2.71
Add New Post /wp-admin/post-new.php5.52 ▲0.0891.39 ▼550.60
Media Library /wp-admin/upload.php3.09 ▲0.0930.08 ▼5.24
Add New /wp-admin/post-new.php?post_type=nutrition-label3.1446.20
All Labels /wp-admin/edit.php?post_type=nutrition-label3.1334.55

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Canadian Nutrition Facts Label
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,837 ▲24116.61 ▲0.7511.39 ▲2.1546.65 ▲3.25
Dashboard /wp-admin3,001 ▲705.94 ▼0.06127.91 ▼12.31138.07 ▲25.35
Posts /wp-admin/edit.php2,760 ▲212.60 ▼0.0863.94 ▼4.7291.87 ▼2.70
Add New Post /wp-admin/post-new.php1,642 ▼3021.51 ▲2.62280.09 ▼110.91106.69 ▼4.29
Media Library /wp-admin/upload.php1,786 ▼215.05 ▲0.03129.86 ▼24.17144.39 ▲27.82
Add New /wp-admin/post-new.php?post_type=nutrition-label2,3553.3282.92100.28
All Labels /wp-admin/edit.php?post_type=nutrition-label1,4732.6362.9971.04

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/canadian-nutrition-facts-label/canadian-nutrition-facts-label.php:26

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


Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: food, bilingual, nutrition labelling, nutrition facts table, canadian...

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

"Canadian Nutrition Facts Label" version 3.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 156 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin552 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
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
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions10100.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
facts-menu-icon.png0.33KB0.22KB▼ 34.99%
img/minus.png0.67KB0.61KB▼ 9.09%
img/facts-menu-icon.png0.33KB0.22KB▼ 34.99%
img/plus.png1.15KB0.45KB▼ 60.95%