84% mortgage-loan-calculator

Code Review | Mortgage Calculator / Loan Calculator

WordPress plugin Mortgage Calculator / Loan Calculator scored84%from 54 tests.

About plugin

  • Plugin page: mortgage-loan-cal...
  • Plugin version: 1.5.20
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.1-6.4.0
  • WordPress version: 6.3.1
  • First release: Jan 26, 2010
  • Latest release: Nov 11, 2023
  • Number of updates: 144
  • Update frequency: every 35.0 days
  • Top authors: mlcalc (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

2,000+ active /76,820 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼6.37ms] Passed 4 tests

Analyzing server-side resources used by Mortgage Calculator / Loan Calculator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0638.54 ▼2.08
Dashboard /wp-admin3.37 ▲0.0647.02 ▼7.42
Posts /wp-admin/edit.php3.42 ▲0.0645.34 ▼4.95
Add New Post /wp-admin/post-new.php5.95 ▲0.0691.71 ▼11.01
Media Library /wp-admin/upload.php3.29 ▲0.0638.90 ▲4.92

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 90 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Mortgage Calculator / Loan Calculator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.27 ▼0.011.51 ▼0.2836.89 ▼8.37
Dashboard /wp-admin2,195 ▲175.64 ▼0.0892.43 ▼21.4342.33 ▼10.01
Posts /wp-admin/edit.php2,100 ▼31.97 ▲0.0140.85 ▲3.3835.97 ▲3.27
Add New Post /wp-admin/post-new.php1,526 ▼123.10 ▲0.04636.37 ▼23.2665.85 ▲16.25
Media Library /wp-admin/upload.php1,403 ▲34.30 ▲0.0798.02 ▼2.0544.17 ▲1.99

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 17× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/mortgage-loan-calculator/fr/forms.inc.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/mortgage-loan-calculator/mlcalc.php:38
    • > PHP Notice
      Undefined variable: form_size in wp-content/plugins/mortgage-loan-calculator/de/forms.inc.php on line 2
    • > PHP Notice
      Undefined variable: form_size in wp-content/plugins/mortgage-loan-calculator/ru/forms.inc.php on line 2
    • > PHP Notice
      Undefined variable: form_size in wp-content/plugins/mortgage-loan-calculator/en/forms.inc.php on line 1
    • > PHP Notice
      Undefined variable: form_size in wp-content/plugins/mortgage-loan-calculator/it/forms.inc.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/mortgage-loan-calculator/es/forms.inc.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/mortgage-loan-calculator/en/forms.inc.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/mortgage-loan-calculator/de/forms.inc.php:8
    • > PHP Notice
      Undefined variable: form_size in wp-content/plugins/mortgage-loan-calculator/fr/forms.inc.php on line 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 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: calculator, real estate, mortgage, loan calculator, mortgage calculator...

mortgage-loan-calculator/mlcalc.php 92% from 13 tests

Analyzing the main PHP file in "Mortgage Calculator / Loan Calculator" version 1.5.20
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("mortgage-loan-calculator.php" instead of "mlcalc.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected1,890 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript9176841,517
PHP93761315
CSS25058

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.12
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
68 PNG files occupy 0.21MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
en/images/top-panel-mortgage-only.png3.53KB2.07KB▼ 41.29%
it/images/top-panel-mortgage-only.png3.15KB1.89KB▼ 39.98%
pt/images/top-panel-mortgage-only-small.png2.27KB1.54KB▼ 32.04%
ru/images/top-panel-loan.png4.46KB2.63KB▼ 40.97%
de/images/top-panel-mortgage.png5.06KB2.89KB▼ 42.87%