10% mortgage-and-loan-calculator

Code Review | Simple Mortgage Calculator

WordPress plugin Simple Mortgage Calculator scored10%from 54 tests.

About plugin

  • Plugin page: mortgage-and-loan...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-4.0
  • WordPress version: 6.3.1
  • First release: Aug 26, 2013
  • Latest release: Sep 4, 2014
  • Number of updates: 28
  • Update frequency: every 13.6 days
  • Top authors: wpcream (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /3,166 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/mortgage-and-loan-calculator/monthly-mortgage-calc-widget.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; monthly_mortgage_free_Widget has a deprecated constructor

Server metrics [RAM: ▼1.91MB] [CPU: ▼50.74ms] Passed 4 tests

Server-side resources used by Simple Mortgage Calculator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.384.28 ▼36.10
Dashboard /wp-admin2.10 ▼1.205.77 ▼43.59
Posts /wp-admin/edit.php2.10 ▼1.256.43 ▼38.76
Add New Post /wp-admin/post-new.php2.10 ▼3.795.57 ▼84.52
Media Library /wp-admin/upload.php2.10 ▼1.135.84 ▼24.97

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_monthly_mortgage_free_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Mortgage Calculator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲8614.83 ▲0.522.64 ▲0.6339.32 ▼12.35
Dashboard /wp-admin2,212 ▲214.96 ▼0.95102.06 ▼9.8838.94 ▼7.35
Posts /wp-admin/edit.php2,095 ▲62.07 ▲0.0241.01 ▼2.1436.47 ▲3.31
Add New Post /wp-admin/post-new.php1,529 ▼418.20 ▼5.05617.35 ▼61.4155.47 ▼4.46
Media Library /wp-admin/upload.php1,397 ▲64.26 ▲0.09101.35 ▲4.5242.82 ▼1.10

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/mortgage-and-loan-calculator/monthly-mortgage-calc-widget.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; monthly_mortgage_free_Widget has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_monthly_mortgage_free_widget
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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
The following issues need your attention
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/mortgage-and-loan-calculator/mortgage-calc.php
    • > /wp-content/plugins/mortgage-and-loan-calculator/mortgage-calc-for-php-less-than-3x.php
  • 14× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/mortgage-and-loan-calculator/mortgage-calc.php on line 71
    • > PHP Warning
      Division by zero in wp-content/plugins/mortgage-and-loan-calculator/mortgage-calc.php on line 14
    • > PHP Notice
      Undefined index: advanced_mortgage_calc_loan in wp-content/plugins/mortgage-and-loan-calculator/mortgage-calc-for-php-less-than-3x.php on line 3
    • > PHP Notice
      Undefined offset: -1 in wp-content/plugins/mortgage-and-loan-calculator/mortgage-calc-for-php-less-than-3x.php on line 72
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/mortgage-and-loan-calculator/monthly-mortgage-calc-widget.php:2
    • > PHP Notice
      Undefined index: advanced_mortgage_calc_rate in wp-content/plugins/mortgage-and-loan-calculator/mortgage-calc-for-php-less-than-3x.php on line 4
    • > PHP Notice
      Undefined offset: -1 in wp-content/plugins/mortgage-and-loan-calculator/mortgage-calc.php on line 71
    • > PHP Notice
      Undefined index: advanced_mortgage_calc_loan in wp-content/plugins/mortgage-and-loan-calculator/mortgage-calc.php on line 3
    • > PHP Warning
      Division by zero in wp-content/plugins/mortgage-and-loan-calculator/mortgage-calc-for-php-less-than-3x.php on line 14
    • > PHP Notice
      Undefined index: advanced_mortgage_calc_rate in wp-content/plugins/mortgage-and-loan-calculator/mortgage-calc.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Please fix this invalid URI: ""
  • Screenshots: Please add an image for screenshot #3 (logo.png)
You can look at the official readme.txt

mortgage-and-loan-calculator/monthly-mortgage-calc.php 85% from 13 tests

The primary PHP file in "Simple Mortgage Calculator" version 1.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 433 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("mortgage-and-loan-calculator.php" instead of "monthly-mortgage-calc.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin1,371 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2141111967
PHP53733333
CSS215171

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.18
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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
logo.png19.07KB8.08KB▼ 57.60%
shortcode.png20.04KB7.85KB▼ 60.85%
widget.png9.10KB3.82KB▼ 58.00%