83% loan-comparison

Code Review | Loan Comparison

WordPress plugin Loan Comparison scored83%from 54 tests.

About plugin

  • Plugin page: loan-comparison
  • Plugin version: 1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 11, 2018
  • Latest release: Oct 19, 2023
  • Number of updates: 59
  • Update frequency: every 30.6 days
  • Top authors: aerin (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

400+ active /8,381 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.48MB] [CPU: ▼5.89ms] Passed 4 tests

A check of server-side resources used by Loan Comparison
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2242.91 ▼7.16
Dashboard /wp-admin3.89 ▲0.5451.59 ▼8.20
Posts /wp-admin/edit.php4.00 ▲0.6556.96 ▲9.89
Add New Post /wp-admin/post-new.php6.46 ▲0.5881.66 ▼11.51
Media Library /wp-admin/upload.php3.79 ▲0.5638.40 ▲3.30
Loan Comparison /wp-admin/options-general.php?page=loan-comparison/settings.php3.8639.24

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Loan Comparison
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,078 ▲33215.42 ▲1.077.70 ▲5.4742.71 ▼8.47
Dashboard /wp-admin2,363 ▲1866.37 ▲0.79115.14 ▲8.5540.81 ▼4.89
Posts /wp-admin/edit.php2,285 ▲1823.66 ▲1.6356.12 ▲16.6936.08 ▼0.72
Add New Post /wp-admin/post-new.php6,389 ▲4,86128.06 ▲4.94931.48 ▲243.2039.60 ▼11.62
Media Library /wp-admin/upload.php1,431 ▲284.40 ▲0.1481.04 ▼14.4245.63 ▲3.05
Loan Comparison /wp-admin/options-general.php?page=loan-comparison/settings.php3,3243.5946.9188.68

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% 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
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/loan-comparison/settings.php:1949
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/loan-comparison/loancomparison.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (The loan comparison table), #2 (Barcharts), #3 (Bank settings), #4 (Custom layout example)
  • Contributors: The plugin contributors field is missing
  • Contributors: The plugin tags were not defined
You can look at the official readme.txt

loan-comparison/loancomparison.php 92% from 13 tests

The main PHP script in "Loan Comparison" version 1.6 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("loan-comparison.php" instead of "loancomparison.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin5,413 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP4554712,676
JavaScript5365991,364
PO File24474471,002
CSS25924371

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.52
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%
Functions35
▷ Named functions35100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 0.39MB with 0.25MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/application-form.png17.11KB4.53KB▼ 73.53%
images/Arcadia-Finans.png4.78KB2.77KB▼ 42.12%
screenshot-2.png68.71KB17.15KB▼ 75.05%
images/Consector.png6.04KB3.01KB▼ 50.19%
screenshot-4.png92.19KB26.57KB▼ 71.18%