10% ct-mortgage-calculator

Code Review | Simple Mortgage Calculator

WordPress plugin Simple Mortgage Calculator scored10%from 54 tests.

About plugin

  • Plugin page: ct-mortgage-calcu...
  • Plugin version: 1.3.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-6.4.1
  • WordPress version: 6.3.1
  • First release: Oct 15, 2012
  • Latest release: Nov 17, 2023
  • Number of updates: 68
  • Update frequency: every 59.6 days
  • Top authors: contempoinc (47.06%)rmcalculator (36.76%)makeaccessible (19.12%)

Code review

54 tests

User reviews

4 reviews

Install metrics

2,000+ active /46,086 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/ct-mortgage-calculator/ct-mortgage-calculator.php+72
    Function create_function() is deprecated

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

Server-side resources used by Simple Mortgage Calculator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.12 ▼35.89
Dashboard /wp-admin2.05 ▼1.305.03 ▼56.55
Posts /wp-admin/edit.php2.05 ▼1.315.55 ▼41.91
Add New Post /wp-admin/post-new.php2.05 ▼3.846.97 ▼75.88
Media Library /wp-admin/upload.php2.05 ▼1.185.82 ▼28.86

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_ct_mortgagecalculator
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Simple Mortgage Calculator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,898 ▲15113.30 ▼0.847.80 ▲5.9538.34 ▼5.19
Dashboard /wp-admin2,195 ▲155.63 ▲0.0389.92 ▼13.9941.12 ▼2.04
Posts /wp-admin/edit.php2,100 ▼01.95 ▼0.0540.04 ▼1.1637.82 ▲1.59
Add New Post /wp-admin/post-new.php1,528 ▼723.27 ▲0.17593.47 ▼60.6050.56 ▲1.67
Media Library /wp-admin/upload.php1,400 ▲34.24 ▲0.0694.69 ▼6.5541.72 ▼3.53

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/ct-mortgage-calculator/ct-mortgage-calculator.php+72
    Function create_function() is deprecated
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_ct_mortgagecalculator
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

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
Good news, no errors were detected

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
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 add_action() in wp-content/plugins/ct-mortgage-calculator/ct-mortgage-calculator.php:14

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: loan calculator, loan, mortgage, responsive mortgage calculator, real estate...

ct-mortgage-calculator/ct-mortgage-calculator.php Passed 13 tests

Analyzing the main PHP file in "Simple Mortgage Calculator" version 1.3.5
35 characters long description:
A simple mortgage calculator widget

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 detected128 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PO File1161856
PHP1241448
JavaScript16614
CSS171510

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.06
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin