68% simple-mortgage-and-affordability-calculator

Code Review | Simple Affordability Calculator

WordPress plugin Simple Affordability Calculator scored68%from 54 tests.

About plugin

  • Plugin page: simple-mortgage-a...
  • Plugin version: 1.11
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.0
  • WordPress version: 6.3.1
  • First release: Mar 15, 2013
  • Latest release: Sep 4, 2014
  • Number of updates: 64
  • Update frequency: every 8.4 days
  • Top authors: wpcream (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,898 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▼1.93MB] [CPU: ▼47.60ms] Passed 4 tests

Analyzing server-side resources used by Simple Affordability Calculator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.404.21 ▼32.44
Dashboard /wp-admin2.08 ▼1.225.33 ▼39.82
Posts /wp-admin/edit.php2.08 ▼1.285.57 ▼39.62
Add New Post /wp-admin/post-new.php2.08 ▼3.816.73 ▼78.50
Media Library /wp-admin/upload.php2.08 ▼1.155.22 ▼26.54

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Simple Affordability Calculator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,934 ▲18813.72 ▼0.595.04 ▲3.1238.24 ▼5.25
Dashboard /wp-admin2,223 ▲315.89 ▲0.95101.04 ▼12.8038.32 ▼7.12
Posts /wp-admin/edit.php2,106 ▲142.07 ▲0.0139.50 ▲5.3235.01 ▲3.13
Add New Post /wp-admin/post-new.php1,529 ▲1018.18 ▼5.16617.52 ▼67.4047.89 ▼4.39
Media Library /wp-admin/upload.php1,405 ▲174.17 ▼0.0495.05 ▼7.7842.01 ▼3.79

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the affordability-css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/simple-mortgage-and-affordability-calculator/mortgage-calc.php
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Undefined index: years_simple_mortgage_calc in wp-content/plugins/simple-mortgage-and-affordability-calculator/mortgage-calc.php on line 5
    • > PHP Warning
      Division by zero in wp-content/plugins/simple-mortgage-and-affordability-calculator/mortgage-calc.php on line 11
    • > PHP Notice
      Undefined index: monthly_mortgage_simple_mortgage_calc in wp-content/plugins/simple-mortgage-and-affordability-calculator/mortgage-calc.php on line 3
    • > PHP Notice
      Undefined index: rate_simple_mortgage_calc in wp-content/plugins/simple-mortgage-and-affordability-calculator/mortgage-calc.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-mortgage-and-affordability-calculator/affordability-calc.php:94

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: mortgage, affordability, affordability calculator, mortgage widget, affordability widget...

simple-mortgage-and-affordability-calculator/affordability-calc.php 85% from 13 tests

"Simple Affordability Calculator" version 1.11's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 280 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("simple-mortgage-and-affordability-calculator.php" instead of "affordability-calc.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
There were no executable files found in this plugin1,096 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2135109957
PHP23831106
CSS17133

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.08
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%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.73MB with 0.41MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
shortcode.png202.13KB90.91KB▼ 55.02%
screenshot-1.png202.13KB90.91KB▼ 55.02%
widget.png160.61KB75.65KB▼ 52.90%
logo.png24.63KB9.39KB▼ 61.89%
screenshot-2.png160.61KB75.65KB▼ 52.90%