84% latipay-for-woo

Code Review | Latipay WooCommerce Payment Gateway

WordPress plugin Latipay WooCommerce Payment Gateway scored84%from 54 tests.

About plugin

  • Plugin page: latipay-for-woo
  • Plugin version: 3.2.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.6.2
  • WordPress version: 6.3.1
  • First release: Nov 29, 2020
  • Latest release: Sep 12, 2023
  • Number of updates: 60
  • Update frequency: every 17.0 days
  • Top authors: latipaynz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /992 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼4.99ms] Passed 4 tests

A check of server-side resources used by Latipay WooCommerce Payment Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0543.92 ▲2.98
Dashboard /wp-admin3.36 ▲0.0154.95 ▼8.31
Posts /wp-admin/edit.php3.41 ▲0.0549.32 ▼7.58
Add New Post /wp-admin/post-new.php5.94 ▲0.0590.56 ▼2.35
Media Library /wp-admin/upload.php3.28 ▲0.0532.61 ▼1.73
Latipay /wp-admin/options-general.php?page=xh_latipay3.2331.77

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Latipay WooCommerce Payment Gateway: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.33 ▲0.361.95 ▲0.3344.27 ▲2.35
Dashboard /wp-admin2,202 ▲285.63 ▼0.0385.22 ▼11.1244.27 ▲6.15
Posts /wp-admin/edit.php2,104 ▲12.00 ▼0.0233.75 ▼8.2138.30 ▲1.90
Add New Post /wp-admin/post-new.php1,529 ▲323.28 ▼0.48678.35 ▲60.9849.72 ▲0.08
Media Library /wp-admin/upload.php1,401 ▲44.22 ▲0.0199.61 ▼6.4846.28 ▲2.68
Latipay /wp-admin/options-general.php?page=xh_latipay9211.9722.1529.68

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=xh_latipay
    • > Notice in wp-content/plugins/latipay-for-woo/init.php+116
    Undefined variable: response
    • > GET request to /wp-admin/options-general.php?page=xh_latipay
    • > Notice in wp-content/plugins/latipay-for-woo/init.php+116
    Trying to access array offset on value of type null

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
10 plugin tags: moneymore, wechatpay, payid, latipay, card payments...

latipay-for-woo/init.php 92% from 13 tests

This is the main PHP file of "Latipay WooCommerce Payment Gateway" version 3.2.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("latipay-for-woo.php" instead of "init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin1,019 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP17241421,019

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity3.94
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes16.25%
▷ Concrete classes1593.75%
▷ Final classes00.00%
Methods53
▷ Static methods47.55%
▷ Public methods53100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions350.00%
▷ Anonymous functions350.00%
Constants5
▷ Global constants5100.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
8 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/wechat.png0.93KB0.41KB▼ 56.22%
images/alipay.png1.31KB0.49KB▼ 62.37%
images/moneymore.png2.73KB2.11KB▼ 22.68%
images/nzbanks.png1.19KB0.72KB▼ 39.82%
images/payid.png2.35KB1.90KB▼ 18.89%