62% cz-loan-management

Code Review | CZ Loan Management

WordPress plugin CZ Loan Management scored62%from 54 tests.

About plugin

  • Plugin page: cz-loan-management
  • Plugin version: 1.1
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3
  • WordPress version: 6.3.1
  • First release: Jan 14, 2020
  • Latest release: Aug 22, 2023
  • Number of updates: 8
  • Update frequency: every 164.6 days
  • Top authors: contrive (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,384 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.43MB] [CPU: ▼9.88ms] Passed 4 tests

A check of server-side resources used by CZ Loan Management
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3838.47 ▼4.46
Dashboard /wp-admin3.78 ▲0.4344.65 ▼12.05
Posts /wp-admin/edit.php3.81 ▲0.4647.61 ▼3.14
Add New Post /wp-admin/post-new.php6.42 ▲0.5472.78 ▼19.87
Media Library /wp-admin/upload.php3.67 ▲0.4434.56 ▼1.17
Edit User /wp-admin/admin.php?page=cz-loan-management-user-edit3.5731.00
View Loan /wp-admin/admin.php?page=cz-loan-management-loan-view3.5731.25
Add New Currency /wp-admin/admin.php?page=cz-loan-management-add-new-currency3.5830.35
Chat /wp-admin/admin.php?page=cz-loan-management-admin-chat3.5831.06
Loan Management /wp-admin/admin.php?page=cz-loan-management3.6342.90
Download CSV /wp-admin/admin.php?page=cz-loan-management-download-csv3.5529.81
Currency /wp-admin/admin.php?page=cz-loan-management-add-currency3.7333.54
Loan Requests /wp-admin/admin.php?page=cz-requests_page_init3.6233.81
Edit Loan /wp-admin/admin.php?page=cz-loan-management-loan-edit3.5731.36
Notifications /wp-admin/admin.php?page=cz-loan-management-admin-notifications3.6034.22

Server storage [IO: ▲0.98MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 70 new files
Database: 2 new tables, 10 new options
New tables
wp_cz_loan_management
wp_cz_loan_management_currencies
New WordPress options
can_compress_scripts
theysaidso_admin_options
cz-loan-management-login-customer
widget_recent-comments
cz-loan-management-loan-customer
widget_recent-posts
db_upgraded
cz-loan-management-register-customer
widget_theysaidso_widget
cz-loan-management-profile-customer

Browser metrics Passed 4 tests

A check of browser resources used by CZ Loan Management
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,995 ▲26014.11 ▼0.2419.81 ▲17.6541.84 ▼11.06
Dashboard /wp-admin2,279 ▲885.81 ▲0.0298.47 ▼20.2539.12 ▲0.90
Posts /wp-admin/edit.php2,163 ▲742.01 ▲0.0235.61 ▼5.2533.32 ▼3.65
Add New Post /wp-admin/post-new.php1,576 ▲5723.22 ▼0.01619.97 ▼60.7558.36 ▲5.15
Media Library /wp-admin/upload.php1,468 ▲804.31 ▲0.1396.34 ▼6.7343.57 ▼1.38
Edit User /wp-admin/admin.php?page=cz-loan-management-user-edit9732.0226.2162.25
View Loan /wp-admin/admin.php?page=cz-loan-management-loan-view9202.0424.1730.89
Add New Currency /wp-admin/admin.php?page=cz-loan-management-add-new-currency8881.8824.9430.07
Chat /wp-admin/admin.php?page=cz-loan-management-admin-chat8742.1427.7830.15
Loan Management /wp-admin/admin.php?page=cz-loan-management1,0552.0325.7558.22
Download CSV /wp-admin/admin.php?page=cz-loan-management-download-csv110.440.000.00
Currency /wp-admin/admin.php?page=cz-loan-management-add-currency2,7932.1725.1940.31
Loan Requests /wp-admin/admin.php?page=cz-requests_page_init9232.0424.1035.56
Edit Loan /wp-admin/admin.php?page=cz-loan-management-loan-edit9232.0424.6032.13
Notifications /wp-admin/admin.php?page=cz-loan-management-admin-notifications9492.0323.4728.21

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_cz_loan_management
    • wp_cz_loan_management_currencies
  • Zombie WordPress options were found after uninstall: 10 options
    • widget_recent-comments
    • cz-loan-management-login-customer
    • widget_recent-posts
    • cz-loan-management-loan-customer
    • db_upgraded
    • theysaidso_admin_options
    • cz-loan-management-profile-customer
    • cz-loan-management-register-customer
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=cz-loan-management-admin-chat
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/cz-loan-management/includes/class-cz-loan-management-messages-ajax.php+159
    Undefined variable: returnloans
    • > GET request to /wp-admin/admin.php?page=cz-loan-management-download-csv
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
    • > GET request to /wp-admin/admin.php?page=cz-loan-management-download-csv
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query does not contain the correct number of placeholders (0) for the number of arguments passed (1). Please see Debugging in WordPress for more information. (This message was added in version 4.8.3.)

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
Please fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/cz-loan-management/public/partials/cz-loan-management-public-display.php
    • > /wp-content/plugins/cz-loan-management/admin/partials/cz-loan-management-admin-display.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/cz-loan-management/public/pages-templates/class-cz-single-loans.php:3

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)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Screenshots: Screenshot #1 (CZ Laon Management Admin Dashboard in screenshot (screenshot/Loan-Management.png).) image missing
You can take inspiration from this readme.txt

cz-loan-management/cz-loan-management.php Passed 13 tests

The principal PHP file in "CZ Loan Management" v. 1.1 is loaded by WordPress automatically on each request
36 characters long description:
This plugin use for loan management.

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
No dangerous file extensions were detected5,037 lines of code in 58 files:
LanguageFilesBlank linesComment linesLines of code
PHP414428343,380
CSS668341,213
JavaScript107062437
SVG1007

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity6.04
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity3.57
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes24
▷ Abstract classes00.00%
▷ Concrete classes24100.00%
▷ Final classes00.00%
Methods47
▷ Static methods2042.55%
▷ Public methods4289.36%
▷ Protected methods00.00%
▷ Private methods510.64%
Functions56
▷ Named functions56100.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot/loan-management.png19.63KB7.24KB▼ 63.11%