84% sgdiet-tdee-calculator

Code Review | The SGDiet TDEE Calculator

WordPress plugin The SGDiet TDEE Calculator scored84%from 54 tests.

About plugin

  • Plugin page: sgdiet-tdee-calcu...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 9, 2023
  • Latest release: Mar 9, 2023
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: webcreativemaster (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /263 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼13.63ms] Passed 4 tests

A check of server-side resources used by The SGDiet TDEE Calculator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.63 ▼6.29
Dashboard /wp-admin3.35 ▲0.0547.82 ▼6.51
Posts /wp-admin/edit.php3.40 ▲0.0452.53 ▼19.04
Add New Post /wp-admin/post-new.php5.95 ▲0.0692.61 ▼22.66
Media Library /wp-admin/upload.php3.27 ▲0.0436.35 ▼0.83
TheSGDiet TDEE Settings /wp-admin/options-general.php?page=thesgdiet-tdee-settings3.2438.59

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for The SGDiet TDEE Calculator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,891 ▲13413.61 ▼1.034.76 ▲2.7240.20 ▼3.97
Dashboard /wp-admin2,214 ▲435.75 ▲0.8496.63 ▼33.5944.77 ▼22.24
Posts /wp-admin/edit.php2,097 ▲82.04 ▲0.0039.45 ▲2.6437.77 ▼4.33
Add New Post /wp-admin/post-new.php1,530 ▼318.63 ▼4.69631.71 ▼47.2252.07 ▼7.25
Media Library /wp-admin/upload.php1,396 ▲54.24 ▲0.0695.68 ▼6.0644.70 ▼2.58
TheSGDiet TDEE Settings /wp-admin/options-general.php?page=thesgdiet-tdee-settings8322.0525.3728.52

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/sgdiet-tdee-calculator/public/partials/sgdiet-calculator-public-display.php
    • > /wp-content/plugins/sgdiet-tdee-calculator/admin/partials/sgdiet-calculator-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: nutrition, recipes, food plan, calories, tdee

sgdiet-tdee-calculator/sgdiet-calculator.php 85% from 13 tests

This is the main PHP file of "The SGDiet TDEE Calculator" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("sgdiet-tdee-calculator.php" instead of "sgdiet-calculator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected1,062 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP123475751,056
JavaScript24546
CSS2080

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.04
Average class complexity2.62
▷ Minimum class complexity1.00
▷ Maximum class complexity11.00
Average method complexity1.38
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods34
▷ Static methods25.88%
▷ Public methods2985.29%
▷ Protected methods00.00%
▷ Private methods514.71%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There were not PNG files found in your plugin