84% laybuy-gateway-for-woocommerce

Code Review | Laybuy Payment Extension for WooCommerce

WordPress plugin Laybuy Payment Extension for WooCommerce scored 84% from 54 tests.

About plugin

  • Plugin page: laybuy-gateway-fo...
  • Plugin version: 5.3.9
  • PHP compatiblity: 5.6.32+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Aug 6, 2019
  • Latest release: Dec 8, 2022
  • Number of updates: 94
  • Update frequency: every 13.0 days
  • Top authors: laybuyholdings (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active / 23,386 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.03MB] [CPU: ▼3.37ms] Passed 4 tests

This is a short check of server-side resources used by Laybuy Payment Extension for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0335.88 ▼11.49
Dashboard /wp-admin3.34 ▲0.0448.40 ▲2.45
Posts /wp-admin/edit.php3.39 ▲0.0349.31 ▲1.42
Add New Post /wp-admin/post-new.php5.92 ▲0.0394.13 ▼2.30
Media Library /wp-admin/upload.php3.26 ▲0.0334.18 ▼1.12

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Laybuy Payment Extension for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲3713.55 ▼0.831.59 ▼1.1039.07 ▼4.33
Dashboard /wp-admin2,214 ▲264.85 ▼0.02109.85 ▼10.0441.88 ▼3.08
Posts /wp-admin/edit.php2,096 ▲71.97 ▼0.0341.51 ▲7.2136.45 ▲0.70
Add New Post /wp-admin/post-new.php1,533 ▼022.81 ▼0.40622.04 ▼6.4653.90 ▼5.06
Media Library /wp-admin/upload.php1,396 ▲144.20 ▼0.0199.75 ▼4.2844.43 ▲0.60

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 12× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Laybuy_Processes_AbstractProcess' not found in wp-content/plugins/laybuy-gateway-for-woocommerce/includes/Laybuy/Processes/CreateQuote/CreateQuoteAbstract.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_editor() in wp-content/plugins/laybuy-gateway-for-woocommerce/includes/admin/wysiwyg.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Laybuy_Processes_AbstractProcess' not found in wp-content/plugins/laybuy-gateway-for-woocommerce/includes/Laybuy/Processes/Refund.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Laybuy_Processes_CreateQuote_CreateQuoteAbstract' not found in wp-content/plugins/laybuy-gateway-for-woocommerce/includes/Laybuy/Processes/CreateQuote/WC_GT_3_6/Process.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Laybuy_Processes_AbstractProcess' not found in wp-content/plugins/laybuy-gateway-for-woocommerce/includes/Laybuy/Processes/CreateOrder/CreateOrderAbstract.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Laybuy_Processes_AbstractProcess' not found in wp-content/plugins/laybuy-gateway-for-woocommerce/includes/Laybuy/Processes/CreateOrder/CompatibilityMode/Process.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Laybuy_Processes_CreateOrder_CreateOrderAbstract' not found in wp-content/plugins/laybuy-gateway-for-woocommerce/includes/Laybuy/Processes/CreateOrder/WC_LT_3_6/Process.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Laybuy_Processes_CreateOrder_CreateOrderAbstract' not found in wp-content/plugins/laybuy-gateway-for-woocommerce/includes/Laybuy/Processes/CreateOrder/WC_GT_3_6/Process.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Laybuy_Processes_CreateQuote_CreateQuoteAbstract' not found in wp-content/plugins/laybuy-gateway-for-woocommerce/includes/Laybuy/Processes/CreateQuote/WC_LT_3_6/Process.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Laybuy_Processes_AbstractProcess' not found in wp-content/plugins/laybuy-gateway-for-woocommerce/includes/Laybuy/Processes/RedirectPayment/CompatibilityMode/Process.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
2 plugin tags: payment-gateway, woocommerce

laybuy-gateway-for-woocommerce/laybuy-gateway-for-woocommerce.php 92% from 13 tests

The main PHP file in "Laybuy Payment Extension for WooCommerce" ver. 5.3.9 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.6" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin3,624 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP279053943,438
JavaScript1310122
CSS31133
SVG10130
Markdown1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity20.10
▷ Minimum class complexity1.00
▷ Maximum class complexity150.00
Average method complexity3.53
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes20
▷ Abstract classes315.00%
▷ Concrete classes1785.00%
▷ Final classes00.00%
Methods153
▷ Static methods95.88%
▷ Public methods13789.54%
▷ Protected methods63.92%
▷ Private methods106.54%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants26
▷ Global constants519.23%
▷ Class constants2180.77%
▷ Public constants21100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/laybuy_logo_transparent.png35.87KB17.34KB▼ 51.66%
assets/images/laybuy-logo.png6.30KB5.77KB▼ 8.40%