84% cc-bmi-calculator

Code Review | CC BMI Calculator

WordPress plugin CC BMI Calculator scored84%from 54 tests.

About plugin

  • Plugin page: cc-bmi-calculator
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Jul 27, 2015
  • Latest release: Jul 26, 2023
  • Number of updates: 33
  • Update frequency: every 88.6 days
  • Top authors: CalculatorsCanada.ca (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active /12,295 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.01MB] [CPU: ▼7.36ms] Passed 4 tests

Analyzing server-side resources used by CC BMI Calculator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.20 ▼1.70
Dashboard /wp-admin3.32 ▲0.0147.56 ▼0.84
Posts /wp-admin/edit.php3.37 ▲0.0147.37 ▲2.27
Add New Post /wp-admin/post-new.php5.92 ▲0.0393.32 ▼27.78
Media Library /wp-admin/upload.php3.24 ▲0.0134.83 ▲0.90

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_cc_bmi_calculator
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for CC BMI Calculator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,902 ▲14513.93 ▼0.445.94 ▲3.7543.67 ▼0.50
Dashboard /wp-admin2,222 ▲345.09 ▲0.20111.82 ▲5.5836.76 ▼5.80
Posts /wp-admin/edit.php2,113 ▲242.32 ▲0.2642.82 ▲8.2635.81 ▲2.56
Add New Post /wp-admin/post-new.php1,528 ▼023.51 ▲5.25626.47 ▲10.6332.58 ▼32.28
Media Library /wp-admin/upload.php1,404 ▲164.44 ▲0.2299.96 ▼5.6640.97 ▼1.75

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_cc_bmi_calculator
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/cc-bmi-calculator/cc-bmi-calculator.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

cc-bmi-calculator/cc-bmi-calculator.php Passed 13 tests

The primary PHP file in "CC BMI Calculator" version 2.0.1 is used by WordPress to initiate all plugin functionality
32 characters long description:
BMI (Body Mass Index) Calculator

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin830 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
CSS16311341
PHP25639299
JavaScript24819190

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity4.80
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods120.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin