78% roi-calculator

Code Review | Roi Calculator

WordPress plugin Roi Calculator scored78%from 54 tests.

About plugin

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

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /398 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼3.69ms] Passed 4 tests

Analyzing server-side resources used by Roi Calculator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1447.54 ▲6.78
Dashboard /wp-admin3.47 ▲0.1249.77 ▼4.86
Posts /wp-admin/edit.php3.58 ▲0.1856.04 ▲1.56
Add New Post /wp-admin/post-new.php6.07 ▲0.1492.94 ▼8.46
Media Library /wp-admin/upload.php3.39 ▲0.1236.70 ▼3.00

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Roi Calculator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,966 ▲20514.54 ▼0.1115.22 ▲13.4642.75 ▼5.84
Dashboard /wp-admin2,233 ▲555.85 ▲0.1489.73 ▼13.6440.39 ▼3.53
Posts /wp-admin/edit.php2,143 ▲432.31 ▲0.3441.66 ▲3.4937.40 ▲4.49
Add New Post /wp-admin/post-new.php1,557 ▲2723.23 ▲0.11668.99 ▼26.4739.02 ▼16.12
Media Library /wp-admin/upload.php1,438 ▲354.45 ▲0.29106.97 ▲2.0745.64 ▼2.45

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • 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 output text when accessed directly:
    • > /wp-content/plugins/roi-calculator/roi-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/roi-calculator/inc/roi_fronted.php:174
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/roi-calculator/inc/roi_backend.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Contributors: The plugin contributors field is not present
  • Screenshots: Add descriptions for screenshots #1, #2 in roi-calculator/assets to your readme.txt
The official readme.txt is a good inspiration

roi-calculator/roi-calculator.php Passed 13 tests

The main PHP file in "Roi Calculator" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
66 characters long description:
For Using This Plugin you Can Know profitability of an investment.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin14,746 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript415825513,910
PHP33111587
CSS2214249

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.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin