10% loan-calculator-pro

Code Review | Loan Calculator Pro

WordPress plugin Loan Calculator Pro scored10%from 54 tests.

About plugin

  • Plugin page: loan-calculator-pro
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.1-6.0
  • WordPress version: 6.3.1
  • First release: Jan 12, 2014
  • Latest release: Jun 27, 2022
  • Number of updates: 120
  • Update frequency: every 25.8 days
  • Top authors: lightimagemedia (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /6,270 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/loan-calculator-pro/loan-calc-widget.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; loan_calculator has a deprecated constructor

Server metrics [RAM: ▼1.97MB] [CPU: ▼57.51ms] Passed 4 tests

An overview of server-side resources used by Loan Calculator Pro
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.434.67 ▼34.32
Dashboard /wp-admin2.09 ▼1.296.22 ▼58.71
Posts /wp-admin/edit.php2.09 ▼1.305.74 ▼47.44
Add New Post /wp-admin/post-new.php2.09 ▼3.845.48 ▼89.55
Media Library /wp-admin/upload.php2.09 ▼1.186.38 ▼34.29

Server storage [IO: ▲0.08MB] [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: 13 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
widget_loan_calculator
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Loan Calculator Pro
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,938 ▲18813.75 ▼0.989.31 ▲7.5445.78 ▼6.49
Dashboard /wp-admin2,215 ▲385.78 ▲0.1689.08 ▼1.0279.53 ▲35.29
Posts /wp-admin/edit.php2,132 ▲352.26 ▲0.2336.38 ▼2.7133.92 ▼6.00
Add New Post /wp-admin/post-new.php1,546 ▲2023.38 ▼0.26699.12 ▼22.0455.40 ▼2.94
Media Library /wp-admin/upload.php1,429 ▲324.57 ▲0.40100.69 ▼0.8866.80 ▲21.47

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/loan-calculator-pro/loan-calc-widget.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; loan_calculator has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_loan_calculator
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% 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
Please fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/loan-calculator-pro/loan-calc.php
    • > /wp-content/plugins/loan-calculator-pro/loan-calc-admin.php
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Division by zero in wp-content/plugins/loan-calculator-pro/loan-calc.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/loan-calculator-pro/loan-calc-main.php:13
    • > PHP Notice
      Undefined index: advanced_mortgage_calc_years in wp-content/plugins/loan-calculator-pro/loan-calc.php on line 5
    • > PHP Notice
      Undefined index: advanced_mortgage_calc_loan in wp-content/plugins/loan-calculator-pro/loan-calc.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/loan-calculator-pro/loan-calc-widget.php:2
    • > PHP Notice
      Undefined index: advanced_mortgage_calc_rate in wp-content/plugins/loan-calculator-pro/loan-calc.php on line 4

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

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed: The official readme.txt is a good inspiration

loan-calculator-pro/loan-calc-main.php 92% from 13 tests

"Loan Calculator Pro" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("loan-calculator-pro.php" instead of "loan-calc-main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin1,299 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript3141103969
PHP55134238
CSS16051
HTML15041

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
loan-calc.png1.00KB1.20KB0.00%