83% woo-lhv-hire-purchase

Code Review | WooCommerce LHV hire-purchase

WordPress plugin WooCommerce LHV hire-purchase scored83%from 54 tests.

About plugin

  • Plugin page: woo-lhv-hire-purc...
  • Plugin version: 1.1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Sep 11, 2017
  • Latest release: Jan 5, 2023
  • Number of updates: 15
  • Update frequency: every 130.9 days
  • Top authors: indrek_k (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,441 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼9.45ms] Passed 4 tests

This is a short check of server-side resources used by WooCommerce LHV hire-purchase
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0138.53 ▲1.79
Dashboard /wp-admin3.32 ▼0.0347.96 ▼9.50
Posts /wp-admin/edit.php3.37 ▲0.0146.13 ▼2.43
Add New Post /wp-admin/post-new.php5.90 ▲0.0180.32 ▼27.65
Media Library /wp-admin/upload.php3.24 ▲0.0134.76 ▲1.93

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 141 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce LHV hire-purchase
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.30 ▲0.051.74 ▲0.1443.76 ▲6.65
Dashboard /wp-admin2,198 ▲245.52 ▼0.0787.74 ▲2.1737.79 ▼4.28
Posts /wp-admin/edit.php2,107 ▲101.98 ▼0.0434.69 ▼1.8132.17 ▼3.12
Add New Post /wp-admin/post-new.php1,541 ▲1518.36 ▼5.42613.11 ▼73.3175.49 ▲22.32
Media Library /wp-admin/upload.php1,409 ▲64.18 ▼0.0494.74 ▼7.3041.88 ▼2.02

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
The following issues need your attention
  • 101× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woo-lhv-hire-purchase/vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woo-lhv-hire-purchase/vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woo-lhv-hire-purchase/vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woo-lhv-hire-purchase/vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woo-lhv-hire-purchase/vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woo-lhv-hire-purchase/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woo-lhv-hire-purchase/vendor/composer/installers/src/Composer/Installers/OxidInstaller.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woo-lhv-hire-purchase/vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woo-lhv-hire-purchase/vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woo-lhv-hire-purchase/vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: woocommerce, lhv, gateway

woo-lhv-hire-purchase/woocommerce-lhv-hire-purchase.php 69% from 13 tests

The main file in "WooCommerce LHV hire-purchase" v. 1.1.7 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woo-lhv-hire-purchase.php" instead of "woocommerce-lhv-hire-purchase.php")
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Requires at least: The required version number must match the one declared in readme.txt ("4.8" instead of "3.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin4,854 lines of code in 132 files:
LanguageFilesBlank linesComment linesLines of code
PHP1207461,2124,148
Markdown4590276
PO File14897145
JSON300133
JavaScript12417103
YAML27026
XML12023

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity2.80
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes110
▷ Abstract classes21.82%
▷ Concrete classes10898.18%
▷ Final classes00.00%
Methods223
▷ Static methods52.24%
▷ Public methods16774.89%
▷ Protected methods5122.87%
▷ Private methods52.24%
Functions10
▷ Named functions440.00%
▷ Anonymous functions660.00%
Constants8
▷ Global constants00.00%
▷ Class constants8100.00%
▷ Public constants8100.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
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/lhv-hire-purchase-badge.png15.72KB6.81KB▼ 56.70%
assets/img/order-status-pending-icon.png3.64KB0.50KB▼ 86.14%