67% lendingq

Code Review | LendingQ

WordPress plugin LendingQ scored67%from 54 tests.

About plugin

  • Plugin page: lendingq
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1.1
  • WordPress version: 6.3.1
  • First release: Jun 9, 2020
  • Latest release: Jan 30, 2023
  • Number of updates: 12
  • Update frequency: every 80.4 days
  • Top authors: chuhpl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /721 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.71MB] [CPU: ▲0.08ms] Passed 4 tests

An overview of server-side resources used by LendingQ
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.15 ▲0.6941.26 ▲2.77
Dashboard /wp-admin4.06 ▲0.7268.22 ▲7.88
Posts /wp-admin/edit.php4.12 ▲0.7656.60 ▲9.03
Add New Post /wp-admin/post-new.php6.63 ▲0.7582.65 ▼14.60
Media Library /wp-admin/upload.php3.92 ▲0.7039.98 ▲4.27
Check In /wp-admin/edit.php?post_type=lendingq_hold&page=lendingq_check_in_list3.9441.61
Settings /wp-admin/edit.php?post_type=lendingq_stock&page=lendingq_settings3.9437.00
Delete Item /wp-admin/admin.php?page=lendingq_cancel_stock3.8731.69
New Item /wp-admin/post-new.php?post_type=lendingq_stock3.9948.59
Contact /wp-admin/admin.php?page=lendingq_contact_hold3.8734.50
Cancel Hold /wp-admin/admin.php?page=lendingq_cancel_hold3.8634.76
All Items /wp-admin/edit.php?post_type=lendingq_stock3.9741.57
Check Out /wp-admin/admin.php?page=lendingq_check_out3.8633.02
Item Types /wp-admin/edit-tags.php?taxonomy=lendingq_item_type&post_type=lendingq_stock3.9237.43
New Hold /wp-admin/post-new.php?post_type=lendingq_hold4.0152.59

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 41 new options
New WordPress options
lendingq_field_staff_desc
lendingq_field_header_hold
can_compress_scripts
lendingq_field_card_desc
lendingq_field_item_desc
lendingq_field_name_desc
lendingq_field_phone
lendingq_field_item_notes_desc
lendingq_field_verified_desc
db_upgraded
...

Browser metrics Passed 4 tests

An overview of browser requirements for LendingQ
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,050 ▲30414.00 ▼0.318.13 ▲6.3638.50 ▼4.45
Dashboard /wp-admin2,296 ▲1055.02 ▼0.88104.08 ▲3.5340.75 ▼1.69
Posts /wp-admin/edit.php2,185 ▲962.31 ▲0.2939.32 ▲0.8135.41 ▲2.15
Add New Post /wp-admin/post-new.php1,592 ▲7217.82 ▼5.23683.15 ▼5.7637.66 ▼21.15
Media Library /wp-admin/upload.php1,484 ▲964.45 ▲0.2997.94 ▼12.3843.51 ▼1.33
Check In /wp-admin/edit.php?post_type=lendingq_hold&page=lendingq_check_in_list8871.8926.4625.64
Settings /wp-admin/edit.php?post_type=lendingq_stock&page=lendingq_settings1,7356.69131.4660.24
Delete Item /wp-admin/admin.php?page=lendingq_cancel_stock8611.9325.0823.28
New Item /wp-admin/post-new.php?post_type=lendingq_stock1,5012.7550.9030.12
Contact /wp-admin/admin.php?page=lendingq_contact_hold8611.9025.1225.83
Cancel Hold /wp-admin/admin.php?page=lendingq_cancel_hold8641.9025.4825.14
All Items /wp-admin/edit.php?post_type=lendingq_stock1,2082.3832.3631.97
Check Out /wp-admin/admin.php?page=lendingq_check_out8611.9324.7726.85
Item Types /wp-admin/edit-tags.php?taxonomy=lendingq_item_type&post_type=lendingq_stock1,3331.9833.2727.45
New Hold /wp-admin/post-new.php?post_type=lendingq_hold1,5542.9452.2331.59

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

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/admin.php?page=lendingq_check_out
    • > Notice in wp-content/plugins/lendingq/lendingq.php+1834
    Undefined index: post_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 fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/lendingq/template_quick_widget.php
  • 14× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_transient() in wp-content/plugins/lendingq/template_check_in_form.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/lendingq/template_post_item.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/lendingq/template_check_out_form.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/lendingq/template_check_in_list.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/lendingq/template_cancel_stock_form.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/lendingq/template_cancel_stock_form_checked_out.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/lendingq/template_no_item_types.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/lendingq/template_post_hold.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/lendingq/template_cancel_hold_form.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/lendingq/template_check_out_list.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=lendingq_hold
    • > Network (severe)
    wp-content/plugins/lendingq/includes/jquery-ui.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === lendingq === )
Please take inspiration from this readme.txt

lendingq/lendingq.php Passed 13 tests

This is the main PHP file of "LendingQ" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
95 characters long description:
A simple system to manage the lending of items (like hotspots) with an integrated waiting list.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin3,669 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP151391893,547
CSS204113
JavaScript2039

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity265.00
▷ Minimum class complexity265.00
▷ Maximum class complexity265.00
Average method complexity2.84
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods95
▷ Static methods33.16%
▷ Public methods95100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions114.29%
▷ Anonymous functions685.71%
Constants31
▷ Global constants31100.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
No PNG files were detected