84% mortgage-calculator

Code Review | Mortgage Calculator

WordPress plugin Mortgage Calculator scored84%from 54 tests.

About plugin

  • Plugin page: mortgage-calculator
  • Plugin version: 1.1.12
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4.0
  • WordPress version: 6.3.1
  • First release: Jun 17, 2016
  • Latest release: Nov 11, 2023
  • Number of updates: 40
  • Update frequency: every 68.0 days
  • Top authors: mcitar (37.5%)saqibsarwar (32.5%)sungraiz (30%)fahidjavid (7.5%)

Code review

54 tests

User reviews

8 reviews

Install metrics

7,000+ active /150,262 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼2.76ms] Passed 4 tests

This is a short check of server-side resources used by Mortgage Calculator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0435.52 ▼6.40
Dashboard /wp-admin3.45 ▲0.1548.15 ▼5.81
Posts /wp-admin/edit.php3.51 ▲0.1551.32 ▲2.44
Add New Post /wp-admin/post-new.php5.95 ▲0.0689.93 ▼1.26
Media Library /wp-admin/upload.php3.29 ▲0.0640.46 ▲6.07
Mortgage Calculator /wp-admin/options-general.php?page=mc_setting_page3.2935.49

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 24 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-comments
mc_settings
widget_mortgage-calculator
widget_recent-posts
misc_settings
mc_defaults

Browser metrics Passed 4 tests

A check of browser resources used by Mortgage Calculator
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,046 ▲28415.17 ▲0.776.51 ▲4.8941.54 ▼6.09
Dashboard /wp-admin2,356 ▲1786.33 ▲0.56117.13 ▲5.5840.07 ▼3.69
Posts /wp-admin/edit.php2,287 ▲1903.48 ▲1.4656.77 ▲18.0737.00 ▲1.13
Add New Post /wp-admin/post-new.php1,541 ▲1523.47 ▲0.29634.16 ▼54.3938.04 ▼19.93
Media Library /wp-admin/upload.php1,415 ▲184.28 ▲0.0683.68 ▼18.6943.08 ▼2.46
Mortgage Calculator /wp-admin/options-general.php?page=mc_setting_page1,2423.4547.5326.65

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 10 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • mc_settings
    • misc_settings
    • can_compress_scripts
    • widget_recent-comments
    • widget_mortgage-calculator
    • db_upgraded
    • theysaidso_admin_options
    • mc_defaults

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/mortgage-calculator/mc-layout.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Please fix the following attributes: Please take inspiration from this readme.txt

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

"Mortgage Calculator" version 1.1.12's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected1,698 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP5111272761
PO File6287344689
JavaScript25737170
CSS13078

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity33.33
▷ Minimum class complexity3.00
▷ Maximum class complexity70.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods40
▷ Static methods00.00%
▷ Public methods40100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/chart_icon.png0.80KB0.15KB▼ 81.14%