83% fitness-calculators

Code Review | fitness calculators plugin

WordPress plugin fitness calculators plugin scored83%from 54 tests.

About plugin

  • Plugin page: fitness-calculators
  • Plugin version: 2.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.2
  • WordPress version: 6.3.1
  • First release: Oct 17, 2018
  • Latest release: Jul 23, 2023
  • Number of updates: 57
  • Update frequency: every 30.5 days
  • Top authors: gurcharanphp (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active /16,727 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.24MB] [CPU: ▼3.49ms] Passed 4 tests

A check of server-side resources used by fitness calculators plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2548.31 ▲7.72
Dashboard /wp-admin3.54 ▲0.2350.04 ▲0.90
Posts /wp-admin/edit.php3.65 ▲0.2948.29 ▼4.09
Add New Post /wp-admin/post-new.php6.14 ▲0.2589.50 ▼15.22
Media Library /wp-admin/upload.php3.46 ▲0.2341.90 ▲4.45

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 19 new files
Database: no new tables, 10 new options
New WordPress options
widget_fcpbfc_widget
widget_recent-comments
widget_theysaidso_widget
widget_fcpprotein_widget
can_compress_scripts
widget_fcpwater_widget
widget_recent-posts
db_upgraded
widget_fcpbmi_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for fitness calculators plugin
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,910 ▲14913.54 ▼0.988.11 ▲6.5837.58 ▼7.75
Dashboard /wp-admin2,230 ▲505.82 ▲0.2285.02 ▼4.4939.93 ▲1.68
Posts /wp-admin/edit.php2,140 ▲402.29 ▲0.3137.04 ▼4.0235.21 ▼7.41
Add New Post /wp-admin/post-new.php1,553 ▲2522.97 ▼0.32695.19 ▲23.2738.24 ▼15.23
Media Library /wp-admin/upload.php1,435 ▲354.34 ▲0.13113.33 ▲7.4645.45 ▼2.02

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 10 options
    • widget_fcpbfc_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_fcpwater_widget
    • widget_recent-comments
    • db_upgraded
    • widget_fcpprotein_widget
    • widget_fcpbmi_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fitness-calculators/includes/js_css_register.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fitness-calculators/includes/fc-class-widgets.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/fitness-calculators/includes/fc-class-short-code.php:727

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

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Donate link: Please fix this invalid url: ""
  • Screenshots: Screenshot #5 (screnshort-5.png shows Carb calculator.) image missing
You can take inspiration from this readme.txt

fitness-calculators/fitness-calculators-plugin.php 92% from 13 tests

This is the main PHP file of "fitness calculators plugin" version 2.0.7, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("fitness-calculators.php" instead of "fitness-calculators-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin3,312 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1114641,855
PHP5121401,306
CSS192151

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity17.50
▷ Minimum class complexity4.00
▷ Maximum class complexity59.00
Average method complexity4.54
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods28
▷ Static methods517.86%
▷ Public methods28100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 0.86MB with 0.59MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/FCP_proteinn_intake_calculator.png37.51KB12.04KB▼ 67.90%
images/FCP_bmp_calculator.png30.17KB9.33KB▼ 69.08%
screenshort-3.png181.15KB51.81KB▼ 71.40%
images/FCP_water_intake_calculator.png39.32KB12.95KB▼ 67.06%
screenshort-2.png184.80KB52.21KB▼ 71.75%