83% ai-mortgage-calculator

Code Review | AI Mortgage Calculator

WordPress plugin AI Mortgage Calculator scored83%from 54 tests.

About plugin

  • Plugin page: ai-mortgage-calcu...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 5, 2022
  • Latest release: Jun 9, 2022
  • Number of updates: 3
  • Update frequency: every 12.3 days
  • Top authors: choicehomemortgage (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /642 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

Server-side resources used by AI Mortgage Calculator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0340.42 ▲2.89
Dashboard /wp-admin3.39 ▲0.0447.55 ▼11.71
Posts /wp-admin/edit.php3.50 ▲0.1444.63 ▼3.58
Add New Post /wp-admin/post-new.php5.97 ▲0.0882.42 ▼12.18
Media Library /wp-admin/upload.php3.31 ▲0.0834.63 ▲2.34
AI Mortgage Calculator /wp-admin/options-general.php?page=ai-mortgage-calculator3.2831.48

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for AI Mortgage Calculator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3614.34 ▲0.3910.17 ▲8.6145.29 ▲6.64
Dashboard /wp-admin2,199 ▲255.56 ▼0.0682.29 ▼3.6139.15 ▼4.27
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0033.52 ▼6.2036.41 ▲3.84
Add New Post /wp-admin/post-new.php1,531 ▲523.05 ▼0.43680.67 ▼8.0158.25 ▲4.84
Media Library /wp-admin/upload.php1,407 ▲44.19 ▼0.0097.00 ▼0.4243.22 ▼1.62
AI Mortgage Calculator /wp-admin/options-general.php?page=ai-mortgage-calculator8932.1521.5431.27

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ai-mortgage-calculator/calculators/default.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/ai-mortgage-calculator/includes/options-page.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'AI_Mortgage_Calculator' not found in wp-content/plugins/ai-mortgage-calculator/calculators/refinance.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Requires at least: The plugin version is formatted incorrectly
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

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

The principal PHP file in "AI Mortgage Calculator" v. 1.0.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("ai-mortgage-calculator.php" instead of "aimortgagecalculator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin439 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP712546437
CSS1001
JavaScript1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity9.33
▷ Minimum class complexity2.00
▷ Maximum class complexity19.00
Average method complexity1.96
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods26
▷ Static methods311.54%
▷ Public methods26100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
There are no PNG files in this plugin