84% woo-layup-payment-gateway

Code Review | LayUp payment gateway plugin for woocommerce

WordPress plugin LayUp payment gateway plugin for woocommerce scored84%from 54 tests.

About plugin

  • Plugin page: woo-layup-payment...
  • Plugin version: 1.9.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3.1
  • WordPress version: 6.3.1
  • First release: Jul 10, 2019
  • Latest release: Oct 26, 2023
  • Number of updates: 142
  • Update frequency: every 11.1 days
  • Top authors: dylanweb980505 (99.3%)zanderrootman (1.41%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /4,575 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼29.89ms] Passed 4 tests

Server-side resources used by LayUp payment gateway plugin for woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2638.50 ▼1.17
Dashboard /wp-admin3.45 ▲0.1031.55 ▼31.33
Posts /wp-admin/edit.php3.52 ▲0.1635.63 ▼8.36
Add New Post /wp-admin/post-new.php5.69 ▼0.2067.44 ▼70.73
Media Library /wp-admin/upload.php3.46 ▲0.2229.02 ▼9.15

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
recovery_mode_email_last_sent
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for LayUp payment gateway plugin for woocommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /1,457 ▼1,30412.22 ▼2.301.74 ▼0.0038.25 ▼6.00
Dashboard /wp-admin850 ▼1,3311.36 ▼4.3813.57 ▼93.1119.95 ▼25.26
Posts /wp-admin/edit.php861 ▼1,2421.33 ▼0.676.51 ▼28.3022.25 ▼15.35
Add New Post /wp-admin/post-new.php587 ▼9621.71 ▼16.4119.01 ▼793.686.86 ▼61.31
Media Library /wp-admin/upload.php746 ▼6541.71 ▼2.4622.62 ▼75.3122.16 ▼23.87

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

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 everything seems fine, this is not 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
Please take a closer look at the following
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/woo-layup-payment-gateway/includes/class-layup-wc-gateway.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-layup-payment-gateway/includes/layup-payment-plan-tab.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-layup-payment-gateway/includes/layup-wc-functions.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-layup-payment-gateway/includes/layup-is-live-check.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-layup-payment-gateway/includes/layup-cron.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/woo-layup-payment-gateway/includes/layup-payment-plan-shortcode.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: payment gateway, south africa, layup, woocommerce

woo-layup-payment-gateway/layup-gateway.php 92% from 13 tests

The main PHP script in "LayUp payment gateway plugin for woocommerce" version 1.9.8 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-layup-payment-gateway.php" instead of "layup-gateway.php")

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
Good job! No executable or dangerous file extensions detected2,561 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP71,4055382,540
CSS120210
JavaScript113010
SVG1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity84.00
▷ Minimum class complexity84.00
▷ Maximum class complexity84.00
Average method complexity8.55
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods1090.91%
▷ Protected methods00.00%
▷ Private methods19.09%
Functions52
▷ Named functions5198.08%
▷ Anonymous functions11.92%
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
5 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/modal-imageAsset 2.png4.96KB2.34KB▼ 52.87%
img/logo-color.168d4abe.png5.59KB2.58KB▼ 53.76%
img/modal-imageAsset 4.png5.45KB2.76KB▼ 49.35%
img/modal-imageAsset 3.png5.38KB2.65KB▼ 50.74%
img/layup-logo-color.png15.68KB7.67KB▼ 51.11%