89% wc-usaepay-payment-gateway

Code Review | Payment Gateway for USAePay on WooCommerce

WordPress plugin Payment Gateway for USAePay on WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: wc-usaepay-paymen...
  • Plugin version: 4.1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-6.3
  • WordPress version: 6.3.1
  • First release: Jun 30, 2022
  • Latest release: Aug 11, 2023
  • Number of updates: 7
  • Update frequency: every 58.1 days
  • Top authors: mohsinoffline (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /1,410 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.04MB] [CPU: ▼3.34ms] Passed 4 tests

A check of server-side resources used by Payment Gateway for USAePay on WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0541.84 ▲1.43
Dashboard /wp-admin3.36 ▲0.0155.59 ▼8.56
Posts /wp-admin/edit.php3.42 ▲0.0553.48 ▲2.05
Add New Post /wp-admin/post-new.php5.95 ▲0.0590.69 ▼8.27
Media Library /wp-admin/upload.php3.29 ▲0.0541.42 ▲4.21

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
wc_usaepay_version
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Payment Gateway for USAePay on WooCommerce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲3114.33 ▼0.072.26 ▲0.7745.58 ▲4.43
Dashboard /wp-admin2,195 ▲175.55 ▼0.0389.78 ▼10.1338.40 ▼4.45
Posts /wp-admin/edit.php2,103 ▼02.03 ▲0.0540.30 ▼1.3137.00 ▼0.62
Add New Post /wp-admin/post-new.php1,529 ▼823.06 ▲4.79636.49 ▼10.7650.01 ▼29.84
Media Library /wp-admin/upload.php1,400 ▼04.28 ▲0.08109.13 ▲4.8350.29 ▲3.07

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • wc_usaepay_version

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

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

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

wc-usaepay-payment-gateway/gateway.php 69% from 13 tests

The main file in "Payment Gateway for USAePay on WooCommerce" v. 4.1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wc-usaepay-payment-gateway.php" instead of "gateway.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("4.4" instead of "3.3")
  • Description: Please don't use more than 140 characters for the plugin description (currently 196 characters long)
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin1,083 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP7228368948
Markdown2390110
JavaScript18325

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity21.83
▷ Minimum class complexity3.00
▷ Maximum class complexity61.00
Average method complexity3.51
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods51
▷ Static methods1223.53%
▷ Public methods4792.16%
▷ Protected methods23.92%
▷ Private methods23.92%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants8
▷ Global constants675.00%
▷ Class constants225.00%
▷ Public constants2100.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
No PNG files were detected