83% lateral-payment-solutions-lps-uk-apigateway

Code Review | WooCommerce LPS Payment Gateway (API)

WordPress plugin WooCommerce LPS Payment Gateway (API) scored83%from 54 tests.

About plugin

  • Plugin page: lateral-payment-s...
  • Plugin version: 4.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.9
  • WordPress version: 6.3.1
  • First release: Mar 24, 2017
  • Latest release: Jul 25, 2019
  • Number of updates: 33
  • Update frequency: every 25.7 days
  • Top authors: sivadss028 (96.97%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /674 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

Server-side resources used by WooCommerce LPS Payment Gateway (API)
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.30 ▼2.87
Dashboard /wp-admin3.31 ▲0.0047.58 ▼5.76
Posts /wp-admin/edit.php3.36 ▲0.0048.05 ▼0.95
Add New Post /wp-admin/post-new.php5.89 ▲0.0096.97 ▼3.09
Media Library /wp-admin/upload.php3.23 ▲0.0038.33 ▲3.07

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce LPS Payment Gateway (API)
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.27 ▲0.001.79 ▲0.1543.07 ▲3.11
Dashboard /wp-admin2,192 ▲125.59 ▼0.0492.89 ▼1.2140.52 ▲0.04
Posts /wp-admin/edit.php2,100 ▼31.97 ▼0.0535.07 ▼11.9631.79 ▼4.00
Add New Post /wp-admin/post-new.php1,537 ▼018.25 ▲0.16640.32 ▲10.2065.43 ▼8.56
Media Library /wp-admin/upload.php1,397 ▲34.18 ▲0.06100.96 ▼7.3843.24 ▼1.92

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

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
The smoke test was a success, however most plugin functionality was not tested

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
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/lateral-payment-solutions-lps-uk-apigateway/class-woocommerce-lpsapi-payment-gateway.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/lateral-payment-solutions-lps-uk-apigateway/lps-api-gateway.php:11

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 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed: The official readme.txt might help

lateral-payment-solutions-lps-uk-apigateway/lps-api-gateway.php 92% from 13 tests

This is the main PHP file of "WooCommerce LPS Payment Gateway (API)" version 4.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("lateral-payment-solutions-lps-uk-apigateway.php" instead of "lps-api-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
Success! There were no dangerous files found in this plugin364 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP28712364

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity37.00
▷ Minimum class complexity37.00
▷ Maximum class complexity37.00
Average method complexity8.20
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
8 PNG files occupy 0.36MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/visa.png4.65KB1.63KB▼ 64.83%
get_started/screenshot1.png157.79KB58.21KB▼ 63.11%
get_started/screenshot5.png29.19KB14.99KB▼ 48.65%
images/api-image.png9.87KB3.24KB▼ 67.23%
get_started/screenshot4.png42.23KB17.99KB▼ 57.41%