84% bmi-imc-calculator

Code Review | BMI / IMC Calculator

WordPress plugin BMI / IMC Calculator scored 84% from 53 tests.

About plugin

  • Plugin page: bmi-imc-calculator
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.1
  • WordPress version: 5.8.1
  • First release: Jan 4, 2015
  • Latest release: Jan 12, 2015
  • Number of updates: 9
  • Update frequency: every 1.0 days
  • Top authors: solokco (100%)

Code review

53 tests

User reviews

2 reviews

Install metrics

500+ active / 7,309 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
Installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼260.71ms] Passed 4 tests

Analyzing server-side resources used by BMI / IMC Calculator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.92 ▲0.2032.05 ▲11.66
Dashboard /wp-admin3.14 ▲0.0943.87 ▲2.75
Posts /wp-admin/edit.php3.19 ▲0.0843.65 ▼0.55
Add New Post /wp-admin/post-new.php5.50 ▲0.0794.03 ▼1,038.32
Media Library /wp-admin/upload.php3.08 ▲0.0731.67 ▼6.71

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 2 new options
New WordPress options
myplugin_version
widget_imc_calculator_wydget

Browser metrics Passed 4 tests

Checking browser requirements for BMI / IMC Calculator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,673 ▲6716.22 ▲0.298.99 ▲2.0247.06 ▲5.05
Dashboard /wp-admin2,927 ▲745.88 ▲0.03140.23 ▲8.6599.68 ▼1.66
Posts /wp-admin/edit.php2,703 ▼32.69 ▼0.0069.43 ▲0.0391.23 ▲1.13
Add New Post /wp-admin/post-new.php1,653 ▼19818.82 ▲1.45360.24 ▼11.40111.59 ▲4.83
Media Library /wp-admin/upload.php1,772 ▼05.02 ▲0.02153.46 ▼5.84112.49 ▲2.54

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 2 options in the database
    • myplugin_version
    • widget_imc_calculator_wydget

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
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
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 plugin_basename() in wp-content/plugins/bmi-imc-calculator/esw_imc_calculator.php:13

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: imc, calculator, bmi, health, weight

bmi-imc-calculator/esw_imc_calculator.php 92% from 13 tests

"BMI / IMC Calculator" version 1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("bmi-imc-calculator.php" instead of "esw_imc_calculator.php")

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
Everything looks great! No dangerous files found in this plugin978 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript25552382
PHP16239281
CSS83549217
PO File1336485
SVG10013

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity4.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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
includes/images/header_background_1.png21.31KB7.61KB▼ 64.31%