83% woo-transact-io-gateway

Code Review | WooCommerce Transact Payment Gateway

WordPress plugin WooCommerce Transact Payment Gateway scored83%from 54 tests.

About plugin

  • Plugin page: woo-transact-io-g...
  • Plugin version: 0.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.0.2
  • WordPress version: 6.3.1
  • First release: Jan 9, 2019
  • Latest release: Jan 9, 2019
  • Number of updates: 8
  • Update frequency: N/A
  • Top authors: transact (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /488 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
This plugin's installer ran successfully

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

An overview of server-side resources used by WooCommerce Transact Payment Gateway
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.74 ▼3.16
Dashboard /wp-admin3.31 ▲0.0144.74 ▼3.71
Posts /wp-admin/edit.php3.36 ▲0.0047.81 ▼5.41
Add New Post /wp-admin/post-new.php5.89 ▲0.0099.38 ▲1.12
Media Library /wp-admin/upload.php3.23 ▲0.0032.90 ▼0.05

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Transact Payment Gateway
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲9513.26 ▼0.962.01 ▲0.3544.81 ▼0.51
Dashboard /wp-admin2,211 ▲235.80 ▲0.89103.47 ▼3.1238.57 ▼5.14
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0239.91 ▼1.5434.97 ▲0.00
Add New Post /wp-admin/post-new.php1,538 ▲423.22 ▲0.28614.93 ▼11.7150.81 ▼0.35
Media Library /wp-admin/upload.php1,393 ▲54.22 ▼0.0394.67 ▼2.4440.28 ▼1.04

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Undefined index: action in wp-content/plugins/woo-transact-io-gateway/vendors/transact-io-php/demo/demo-api.php on line 119

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (order example), #2 (Transact keys), #3 (In wordpress configure your keys)
The official readme.txt is a good inspiration

woo-transact-io-gateway/woocommerce-gateway-transact.php 69% from 13 tests

The main file in "WooCommerce Transact Payment Gateway" v. 0.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-transact-io-gateway.php" instead of "woocommerce-gateway-transact.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Requires at least: The required version number must match the one declared in readme.txt ("4.5" instead of "4.4")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin1,605 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP173265131,055
HTML1452199
Markdown3510165
JSON400102
XML10077
YAML1317

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity12.82
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.94
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods68
▷ Static methods1420.59%
▷ Public methods6189.71%
▷ Protected methods00.00%
▷ Private methods710.29%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
Constants7
▷ Global constants7100.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
4 PNG files occupy 0.25MB with 0.18MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png67.09KB24.96KB▼ 62.80%
icon.png15.09KB0.74KB▼ 95.09%
assets/screenshot-2.png103.59KB43.35KB▼ 58.15%
assets/screenshot-1.png73.77KB26.77KB▼ 63.71%