56% 1003-mortgage-application

Code Review | 1003 Mortgage Application

WordPress plugin 1003 Mortgage Application scored 56% from 54 tests.

About plugin

  • Plugin page: 1003-mortgage-app...
  • Plugin version: 1.72
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8
  • WordPress version: 5.9.2
  • First release: Sep 24, 2019
  • Latest release: Sep 28, 2021
  • Number of updates: 45
  • Update frequency: every 16.3 days
  • Top authors: 8blocks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active / 1,936 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼1.45MB] [CPU: ▼352.79ms] Passed 4 tests

This is a short check of server-side resources used by 1003 Mortgage Application
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.92 ▼0.608.32 ▼38.80
Dashboard /wp-admin2.93 ▼0.479.04 ▼23.72
Posts /wp-admin/edit.php2.94 ▼0.707.75 ▼29.17
Add New Post /wp-admin/post-new.php2.93 ▼4.038.13 ▼1,317.82
Media Library /wp-admin/upload.php2.94 ▼0.377.79 ▼25.38
Applications /wp-admin/edit.php?post_type=mortgage_application2.948.71
Settings /wp-admin/edit.php?post_type=mortgage_application&page=ma_setting2.948.02
Bulk Export /wp-admin/edit.php?post_type=mortgage_application&page=ma_export2.948.57

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 111 new files
Database: no new tables, 18 new options
New WordPress options
mortgage_application_mail_from_name
mortgage_application_mail_reply_to
mortgage_application_email_recipients
mortgage_application_button_color
mortgage_application_submision_client_message
mortgage_application_reminder_mail_subject
mortgage_application_user_mail_subject
mortgage_application_mail_from
mortgage_application_progress_bar_color
mortgage_application_mail_subject
...

Browser metrics Passed 4 tests

An overview of browser requirements for 1003 Mortgage Application
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,967 ▲21317.11 ▲1.3614.40 ▲7.822.73 ▼0.17
Dashboard /wp-admin2,942 ▲816.69 ▲0.53118.54 ▼19.93180.31 ▲19.49
Posts /wp-admin/edit.php2,710 ▲193.29 ▲0.0568.13 ▲0.03142.76 ▲0.55
Add New Post /wp-admin/post-new.php1,706 ▼4615.66 ▼5.94424.47 ▼36.74188.96 ▲28.29
Media Library /wp-admin/upload.php1,744 ▲466.07 ▲0.57117.14 ▼24.61201.66 ▲0.47
Applications /wp-admin/edit.php?post_type=mortgage_application1,4483.2765.37126.54
Settings /wp-admin/edit.php?post_type=mortgage_application&page=ma_setting3,32111.42229.13242.10
Bulk Export /wp-admin/edit.php?post_type=mortgage_application&page=ma_export1,5383.1961.86100.30

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
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5768
    wp_enqueue_script 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 jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin did not uninstall successfully, leaving 19 options in the database
    • mortgage_application_mail_subject
    • mortgage_application_button_color
    • 6393e45fbf20334ce364c523829c7213
    • mortgage_application_webhooks
    • disclaimer_field_1
    • mortgage_application_email_recipients
    • mortgage_application_mail_from
    • mortgage_application_reminder_mail_message
    • mortgage_ma_submissions_subject
    • mortgage_application_user_mail_subject
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=mortgage_application&page=ma_export
    • > User notice in wp-includes/functions.php+5768
    wp_enqueue_script 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 jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=mortgage_application&page=ma_export
    • > User notice in wp-includes/functions.php+5768
    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 wp-color-picker handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=mortgage_application&page=ma_export
    • > User notice in wp-includes/functions.php+5768
    wp_enqueue_script 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 sl-script-handle handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=mortgage_application&page=ma_setting
    • > Notice in wp-content/plugins/1003-mortgage-application/inc/admin/functions/functions.php+1089
    Undefined index: placeholder
    • > GET request to /wp-admin/edit.php?post_type=mortgage_application&page=ma_setting
    • > Notice in wp-content/plugins/1003-mortgage-application/inc/admin/functions/functions.php+1200
    Undefined index: id

SRP 0% 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
Please take a closer look at the following
  • 19× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/1003-mortgage-application/inc/class/licenses.php
    • > /wp-content/plugins/1003-mortgage-application/inc/class/fnm/src/FNM/fnm-import/getdata.php
    • > /wp-content/plugins/1003-mortgage-application/inc/templates/mortgage_license_details.php
    • > /wp-content/plugins/1003-mortgage-application/inc/initialize-plugin.php
    • > /wp-content/plugins/1003-mortgage-application/inc/admin/actions.php
    • > /wp-content/plugins/1003-mortgage-application/mortgage-application-pro.php
    • > /wp-content/plugins/1003-mortgage-application/inc/templates/mortgage_export_form.php
    • > /wp-content/plugins/1003-mortgage-application/inc/templates/mortgage_metabox.php
    • > /wp-content/plugins/1003-mortgage-application/inc/class/fnm/export.php
    • > /wp-content/plugins/1003-mortgage-application/inc/functions/functions.php
  • 51× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined property: stdClass::$co_applicant_same_mailing_address in wp-content/plugins/1003-mortgage-application/inc/class/fnm/src/FNM.php on line 78
    • > PHP Notice
      Trying to get property 'dec_us_citizen' of non-object in wp-content/plugins/1003-mortgage-application/inc/class/fnm/src/FNM/getData.php on line 275
    • > PHP Notice
      Undefined property: stdClass::$former_emp_data in wp-content/plugins/1003-mortgage-application/inc/class/fnm/src/FNM.php on line 54
    • > PHP Warning
      file_get_contents(ROOT/src/Controller/FNM/bin/ijaracdc/fnm.json): failed to open stream: No such file or directory in wp-content/plugins/1003-mortgage-application/inc/class/fnm/src/FNM/src/Formatter.php on line 73
    • > PHP Notice
      Undefined property: stdClass::$dec_permanent_resident in wp-content/plugins/1003-mortgage-application/inc/class/fnm/src/FNM.php on line 349
    • > PHP Notice
      Undefined property: stdClass::$asset_market_value in wp-content/plugins/1003-mortgage-application/inc/class/fnm/src/FNM.php on line 91
    • > PHP Warning
      Use of undefined constant MAPP_MORTGAGE_APP_BASE_PATH - assumed 'MAPP_MORTGAGE_APP_BASE_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/1003-mortgage-application/inc/class/export_fannie.php on line 6
    • > PHP Notice
      Undefined property: stdClass::$dec_permanent_resident in wp-content/plugins/1003-mortgage-application/inc/class/fnm/src/FNM.php on line 346
    • > PHP Notice
      Undefined property: stdClass::$co_applicant_former_emp_data in wp-content/plugins/1003-mortgage-application/inc/class/fnm/src/FNM.php on line 57
    • > PHP Notice
      Undefined property: stdClass::$applicant_home_phone in wp-content/plugins/1003-mortgage-application/inc/class/fnm/src/FNM.php on line 62

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=mortgage_application&page=ma_export
    • > Network (severe)
    wp-content/plugins/1003-mortgage-application/inc/admin/assets/js/admin-js.js?ver=5.9.2 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 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
7 plugin tags: mortgage application, 1003 mortgage application, 1003 application, 1003, application...

1003-mortgage-application/mortgage-application-pro.php 69% from 13 tests

The primary PHP file in "1003 Mortgage Application" version 1.72 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Git Repository: Please do not include Git repositories in your plugin
  • Description: The description should be shorter than 140 characters (currently 190 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("1003-mortgage-application.php" instead of "mortgage-application-pro.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected66,905 lines of code in 90 files:
LanguageFilesBlank linesComment linesLines of code
JSON110052,502
PHP478072,8028,522
JavaScript63487503,036
CSS44261842,195
XML21170614
Markdown12036

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 383)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity56.96
▷ Minimum class complexity1.00
▷ Maximum class complexity447.00
Average method complexity11.08
▷ Minimum method complexity1.00
▷ Maximum method complexity383.00
Code structure
Namespaces6
Interfaces1
Traits0
Classes26
▷ Abstract classes00.00%
▷ Concrete classes26100.00%
▷ Final classes00.00%
Methods153
▷ Static methods00.00%
▷ Public methods7549.02%
▷ Protected methods1912.42%
▷ Private methods5938.56%
Functions71
▷ Named functions6895.77%
▷ Anonymous functions34.23%
Constants5
▷ Global constants5100.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
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/remove.png0.26KB0.24KB▼ 8.86%
assets/img/cancel.png4.12KB1.30KB▼ 68.42%
assets/img/correct.png4.94KB1.49KB▼ 69.84%
assets/img/add.png0.26KB0.25KB▼ 6.64%