77% caloriea-calculator

Code Review | Calorie Calculator

WordPress plugin Calorie Calculator scored77%from 54 tests.

About plugin

  • Plugin page: caloriea-calculator
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.2
  • WordPress version: 6.3.1
  • First release: Mar 8, 2023
  • Latest release: Jun 8, 2023
  • Number of updates: 3
  • Update frequency: every 32.7 days
  • Top authors: mgplugin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /136 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.00MB] [CPU: ▼9.24ms] Passed 4 tests

Analyzing server-side resources used by Calorie Calculator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0042.27 ▼2.20
Dashboard /wp-admin3.31 ▼0.0345.97 ▼20.09
Posts /wp-admin/edit.php3.36 ▲0.0147.02 ▼1.75
Add New Post /wp-admin/post-new.php5.91 ▲0.0392.38 ▼12.92
Media Library /wp-admin/upload.php3.24 ▲0.0141.75 ▲5.89

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Calorie Calculator
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,910 ▲16413.63 ▼0.989.00 ▲7.2343.58 ▼1.91
Dashboard /wp-admin2,236 ▲595.84 ▲0.2392.83 ▲2.5938.17 ▼1.95
Posts /wp-admin/edit.php2,143 ▲432.32 ▲0.3141.75 ▲3.9835.04 ▼5.53
Add New Post /wp-admin/post-new.php1,557 ▲3123.32 ▲0.17670.10 ▼18.4435.06 ▼15.83
Media Library /wp-admin/upload.php1,432 ▲354.48 ▲0.2899.28 ▼10.9042.89 ▼3.17

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/caloriea-calculator/calorie-calculator.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/caloriea-calculator/inc/ccfw_fronted.php:261
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/caloriea-calculator/inc/ccfw_backend.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots lack descriptions #1, #2, #3 in caloriea-calculator/assets to your readme.txt
  • Contributors: The plugin contributors field is missing
You can look at the official readme.txt

caloriea-calculator/calorie-calculator.php 85% from 13 tests

The primary PHP file in "Calorie Calculator" version 1.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("caloriea-calculator.php" instead of "calorie-calculator.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
There were no executable files found in this plugin1,419 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP32111591
JavaScript371229422
CSS225406

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.03
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin