84% calculate-bmr

Code Review | Calculate BMR and BMI

WordPress plugin Calculate BMR and BMI scored84%from 54 tests.

About plugin

  • Plugin page: calculate-bmr
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9
  • WordPress version: 6.3.1
  • First release: Dec 10, 2020
  • Latest release: Apr 13, 2022
  • Number of updates: 27
  • Update frequency: every 18.1 days
  • Top authors: hardikchavada (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /3,220 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼5.36ms] Passed 4 tests

This is a short check of server-side resources used by Calculate BMR and BMI
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0637.68 ▼1.00
Dashboard /wp-admin3.36 ▲0.0548.99 ▼5.81
Posts /wp-admin/edit.php3.47 ▲0.1145.44 ▼0.94
Add New Post /wp-admin/post-new.php5.96 ▲0.0781.40 ▼9.59
Media Library /wp-admin/upload.php3.28 ▲0.0532.68 ▼5.05

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Calculate BMR and BMI
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,892 ▲13113.39 ▼1.028.10 ▲6.5845.81 ▲6.20
Dashboard /wp-admin2,211 ▲375.51 ▼0.2082.45 ▼14.0639.26 ▼2.83
Posts /wp-admin/edit.php2,116 ▲161.98 ▲0.0135.06 ▼2.4835.55 ▼1.14
Add New Post /wp-admin/post-new.php1,540 ▲322.85 ▲4.70654.38 ▲30.5954.30 ▼12.76
Media Library /wp-admin/upload.php1,416 ▲194.19 ▼0.0296.19 ▼7.9841.27 ▼1.98

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/calculate-bmr/admin/partials/calculate-bmr-admin-display.php
    • > /wp-content/plugins/calculate-bmr/public/partials/calculate-bmr-public-display.php
    • > /wp-content/plugins/calculate-bmr/public/partials/calculate-bmi-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: calculate bmi, bmi calculator plugin, bmi calculator, my bmr calculator, calculate bmr

calculate-bmr/calculate-bmr.php Passed 13 tests

"Calculate BMR and BMI" version 1.3.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
45 characters long description:
This is a Plugin for Calculating BMR And BMI.

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
No dangerous file extensions were detected583 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
CSS43612276
PHP13142551248
JavaScript4314259

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.06
Average class complexity1.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.12
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods24
▷ Static methods14.17%
▷ Public methods1979.17%
▷ Protected methods00.00%
▷ Private methods520.83%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
1 PNG file occupies 0.07MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/assets/screenshot.PNG67.01KB14.39KB▼ 78.52%