94% calculate-bmr

Code Review | Calculate BMR

WordPress plugin Calculate BMR scored 94% from 54 tests.

About plugin

  • Plugin page: calculate-bmr
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.7
  • WordPress version: 5.8.1
  • First release: Dec 10, 2020
  • Latest release: Jul 19, 2021
  • Number of updates: 6
  • Update frequency: every 36.8 days
  • Top authors: hardikchavada (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 343 total downloads

Benchmarks

Plugin footprint Passed 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: ▼145.97ms] Passed 4 tests

This is a short check of server-side resources used by Calculate BMR
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.1744.40 ▲22.56
Dashboard /wp-admin3.11 ▲0.0547.00 ▼11.02
Posts /wp-admin/edit.php3.22 ▲0.1146.23 ▼3.36
Add New Post /wp-admin/post-new.php5.46 ▲0.0394.29 ▼568.65
Media Library /wp-admin/upload.php3.05 ▲0.0535.67 ▼0.86

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 25 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Calculate BMR
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,832 ▲23616.23 ▲0.7912.05 ▲2.9550.52 ▲4.62
Dashboard /wp-admin2,993 ▲626.06 ▲0.12139.97 ▼13.80117.80 ▼10.27
Posts /wp-admin/edit.php2,759 ▲202.68 ▼0.0169.14 ▲1.3396.96 ▲10.17
Add New Post /wp-admin/post-new.php1,697 ▲1418.73 ▲0.21369.70 ▼20.09122.71 ▲17.16
Media Library /wp-admin/upload.php1,827 ▲175.00 ▼0.04149.82 ▲4.32126.23 ▼1.33

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
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 | 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
  • 2× 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

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
3 plugin tags: bmi calculator, calculate bmr, my bmr calculator

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

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

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 detected318 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP12142554224
CSS3151171
JavaScript3156123

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%
Methods25
▷ Static methods28.00%
▷ Public methods2080.00%
▷ Protected methods00.00%
▷ Private methods520.00%
Functions4
▷ Named functions4100.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%