78% global-body-mass-index-calculator

Code Review | Global Body Mass Index Calculator

WordPress plugin Global Body Mass Index Calculator scored78%from 54 tests.

About plugin

  • Plugin page: global-body-mass-...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.1
  • WordPress version: 6.3.1
  • First release: Sep 19, 2012
  • Latest release: Apr 15, 2019
  • Number of updates: 22
  • Update frequency: every 109.1 days
  • Top authors: helpstring (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

70+ active /5,956 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
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.51ms] Passed 4 tests

Analyzing server-side resources used by Global Body Mass Index Calculator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.61 ▲0.63
Dashboard /wp-admin3.32 ▲0.0247.21 ▼2.57
Posts /wp-admin/edit.php3.37 ▲0.0144.80 ▼3.46
Add New Post /wp-admin/post-new.php5.90 ▲0.0190.77 ▲5.99
Media Library /wp-admin/upload.php3.24 ▲0.0133.69 ▼0.64
GBMI Calculator /wp-admin/options-general.php?page=gbmi_calculator3.1926.73

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 51 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
GBMI_Calc_Widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Global Body Mass Index Calculator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,927 ▲16613.52 ▼1.0110.04 ▲8.4842.77 ▲2.08
Dashboard /wp-admin2,205 ▲285.54 ▼0.1494.48 ▲2.8843.34 ▲3.81
Posts /wp-admin/edit.php2,110 ▲102.01 ▲0.0334.38 ▼2.7033.64 ▼1.90
Add New Post /wp-admin/post-new.php1,535 ▲723.16 ▲0.03608.26 ▼32.2355.75 ▲1.01
Media Library /wp-admin/upload.php1,407 ▲74.19 ▲0.0196.85 ▼0.6840.91 ▼1.32
GBMI Calculator /wp-admin/options-general.php?page=gbmi_calculator1,2702.1232.5626.46

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=gbmi_calculator
    • > Notice in wp-content/plugins/global-body-mass-index-calculator/gbmicalc.php+514
    Undefined index: height
    • > GET request to /wp-admin/options-general.php?page=gbmi_calculator
    • > Notice in wp-content/plugins/global-body-mass-index-calculator/gbmicalc.php+516
    Undefined index: width
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=gbmi_calculator
    • > Notice in wp-content/plugins/global-body-mass-index-calculator/gbmicalc.php+562
    Undefined index: tabcolor
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=gbmi_calculator
    • > Notice in wp-content/plugins/global-body-mass-index-calculator/gbmicalc.php+570
    Undefined index: currtabcolor
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=gbmi_calculator
    • > Notice in wp-content/plugins/global-body-mass-index-calculator/gbmicalc.php+584
    Undefined index: bgcolor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=gbmi_calculator
    • > Notice in wp-content/plugins/global-body-mass-index-calculator/gbmicalc.php+584
    Undefined index: bgendcolor
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=gbmi_calculator
    • > Notice in wp-content/plugins/global-body-mass-index-calculator/gbmicalc.php+577
    Undefined index: textcolor

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/global-body-mass-index-calculator/gbmicalc.php:12

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

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (BMI Calculator settings in sidebar widget.), #2 (BMI Calculator settings page in admin panel.), #3 (Frontend view of adult without result.), #4 (Frontend view of adult with result.), #5 (Frontend view of child without result.), #6 (Frontend view of child with result.)
The official readme.txt might help

global-body-mass-index-calculator/gbmicalc.php 92% from 13 tests

The principal PHP file in "Global Body Mass Index Calculator" v. 1.2 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("global-body-mass-index-calculator.php" instead of "gbmicalc.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin2,383 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript796721,354
PHP18315545
CSS43720310
PO File269158174

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity37.00
▷ Minimum class complexity37.00
▷ Maximum class complexity37.00
Average method complexity8.20
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
28 PNG files occupy 0.14MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/plugins/colorpicker/images/custom_background.png1.87KB2.12KB0.00%
js/plugins/colorpicker/images/colorpicker_rgb_r.png1.04KB0.77KB▼ 26.17%
screenshot-4.png8.11KB5.42KB▼ 33.13%
js/plugins/colorpicker/images/colorpicker_hsb_h.png0.99KB0.77KB▼ 21.94%
screenshot-1.png16.19KB8.27KB▼ 48.89%