84% bmi-widget

Code Review | BMI Widget

WordPress plugin BMI Widget scored84%from 54 tests.

About plugin

  • Plugin page: bmi-widget
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1
  • WordPress version: 6.3.1
  • First release: Feb 8, 2015
  • Latest release: Feb 9, 2015
  • Number of updates: 7
  • Update frequency: every 0.4 days
  • Top authors: swaincreates (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,506 total downloads

Benchmarks

Plugin footprint 83% 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.02MB] [CPU: ▼7.43ms] Passed 4 tests

A check of server-side resources used by BMI Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.43 ▼0.0425.67 ▼15.74
Dashboard /wp-admin3.35 ▲0.0449.75 ▲1.02
Posts /wp-admin/edit.php3.40 ▲0.0445.57 ▼2.87
Add New Post /wp-admin/post-new.php5.93 ▲0.0490.59 ▼7.18
Media Library /wp-admin/upload.php3.27 ▲0.0436.33 ▼3.91

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for BMI Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲8414.81 ▲0.232.04 ▲0.3943.38 ▲2.80
Dashboard /wp-admin2,206 ▲154.85 ▼1.22111.05 ▲12.4742.01 ▲1.30
Posts /wp-admin/edit.php2,089 ▼02.04 ▼0.0035.22 ▼1.7232.52 ▼2.37
Add New Post /wp-admin/post-new.php1,542 ▲2318.52 ▼4.77573.66 ▼102.1060.02 ▲7.50
Media Library /wp-admin/upload.php1,391 ▲34.14 ▼0.1292.33 ▼19.7842.62 ▼1.64

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
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_bmi_widget
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
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_action() in wp-content/plugins/bmi-widget/bmi-widget.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (A screenshot of BMI Widget in sidebar with default styling), #2 (A screenshot of BMI Widget widget options.)
Please take inspiration from this readme.txt

bmi-widget/bmi-widget.php Passed 13 tests

The entry point to "BMI Widget" version 1.0 is a PHP file that has certain tags in its header comment area
82 characters long description:
Adds a widget that displays a BMI calculator with standard or metric measurements.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected197 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP12242143
CSS17046
Markdown1508

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity5.50
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.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 images were found in this plugin