64% ing-lease-now

Code Review | ING Lease Now

WordPress plugin ING Lease Now scored64%from 54 tests.

About plugin

  • Plugin page: ing-lease-now
  • Plugin version: 1.2.5
  • PHP compatiblity: 5.4.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2.2
  • WordPress version: 6.3.1
  • First release: May 4, 2022
  • Latest release: Jul 11, 2023
  • Number of updates: 24
  • Update frequency: every 18.6 days
  • Top authors: leasenow (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /387 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.13MB] [CPU: ▼4.55ms] Passed 4 tests

This is a short check of server-side resources used by ING Lease Now
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1342.71 ▲0.55
Dashboard /wp-admin3.43 ▲0.1347.54 ▼3.16
Posts /wp-admin/edit.php3.54 ▲0.1948.88 ▼4.31
Add New Post /wp-admin/post-new.php6.01 ▲0.1387.66 ▼11.29
Media Library /wp-admin/upload.php3.35 ▲0.1339.53 ▲2.52

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 88 new files
Database: 1 new table, 6 new options
New tables
wp_ln_reservationlist
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by ING Lease Now
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.27 ▼1.354.90 ▲2.9743.23 ▲0.49
Dashboard /wp-admin2,206 ▲245.82 ▲0.00107.53 ▲0.3040.18 ▼2.88
Posts /wp-admin/edit.php2,086 ▼62.02 ▼0.0336.49 ▼4.7033.79 ▼2.74
Add New Post /wp-admin/post-new.php1,535 ▼323.01 ▼0.06649.27 ▼34.8553.07 ▼0.29
Media Library /wp-admin/upload.php1,388 ▼04.16 ▼0.09100.59 ▼7.2544.38 ▼1.53

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_ln_reservationlist
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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
Please fix the following items
  • 40× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'JsonSchema\\Constraints\\TypeCheck\\TypeCheckInterface' not found in wp-content/plugins/ing-lease-now/includes/libs/Payment-core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/TypeCheck/StrictTypeCheck.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'JsonSchema\\Constraints\\Constraint' not found in wp-content/plugins/ing-lease-now/includes/libs/Payment-core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/TypeConstraint.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/ing-lease-now/woocommerce-leasenow.php:99
    • > PHP Fatal error
      Uncaught Error: Class 'JsonSchema\\Constraints\\Constraint' not found in wp-content/plugins/ing-lease-now/includes/libs/Payment-core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/NumberConstraint.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'JsonSchema\\Constraints\\Constraint' not found in wp-content/plugins/ing-lease-now/includes/libs/Payment-core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/StringConstraint.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'JsonSchema\\Constraints\\Constraint' not found in wp-content/plugins/ing-lease-now/includes/libs/Payment-core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/SchemaConstraint.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/ing-lease-now/includes/templates/leasenow_button_test.php:69
    • > PHP Fatal error
      Uncaught Error: Class 'JsonSchema\\Constraints\\Constraint' not found in wp-content/plugins/ing-lease-now/includes/libs/Payment-core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/EnumConstraint.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'JsonSchema\\UriRetrieverInterface' not found in wp-content/plugins/ing-lease-now/includes/libs/Payment-core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriRetriever.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'JsonSchema\\Exception\\RuntimeException' not found in wp-content/plugins/ing-lease-now/includes/libs/Payment-core/vendor/justinrainbow/json-schema/src/JsonSchema/Exception/InvalidSchemaMediaTypeException.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: leasing, ing, ing lease now, online payments, ing lease...

ing-lease-now/woocommerce-leasenow.php 85% from 13 tests

"ING Lease Now" version 1.2.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("ing-lease-now.php" instead of "woocommerce-leasenow.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Please make sure to remedy the following
  • Do not distribute dangerous files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/ing-lease-now/includes/libs/Payment-core/vendor/bin/validate-json.bat
5,467 lines of code in 78 files:
LanguageFilesBlank linesComment linesLines of code
PHP651,1672,0134,667
JSON7310463
Markdown2500170
PO File14049129
XML12024
Bourne Shell13110
DOS Batch1004

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity11.19
▷ Minimum class complexity1.00
▷ Maximum class complexity92.00
Average method complexity3.53
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces10
Interfaces7
Traits0
Classes46
▷ Abstract classes24.35%
▷ Concrete classes4495.65%
▷ Final classes00.00%
Methods230
▷ Static methods4318.70%
▷ Public methods17174.35%
▷ Protected methods3615.65%
▷ Private methods2310.00%
Functions45
▷ Named functions3782.22%
▷ Anonymous functions817.78%
Constants94
▷ Global constants22.13%
▷ Class constants9297.87%
▷ Public constants92100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/images/leasenow_button_test.png0.29KB0.12KB▼ 58.22%
resources/images/logo.png4.29KB2.61KB▼ 39.20%