83% woo-payworks-payment-gateway

Code Review | WooCommerce PayWorks Payment Gateway

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

About plugin

  • Plugin page: woo-payworks-paym...
  • Plugin version: 5.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.0.1
  • WordPress version: 6.3.1
  • First release: Feb 16, 2018
  • Latest release: Dec 17, 2018
  • Number of updates: 30
  • Update frequency: every 10.1 days
  • Top authors: payworks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,240 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by WooCommerce PayWorks Payment Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.32 ▼4.85
Dashboard /wp-admin3.31 ▲0.0048.78 ▼0.74
Posts /wp-admin/edit.php3.36 ▲0.0049.47 ▲1.82
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.99 ▼2.55
Media Library /wp-admin/upload.php3.23 ▲0.0038.00 ▼0.44

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

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

Browser metrics Passed 4 tests

WooCommerce PayWorks Payment Gateway: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▼0.301.98 ▲0.3245.71 ▲1.33
Dashboard /wp-admin2,195 ▲155.62 ▼0.0386.30 ▼17.2542.55 ▼0.78
Posts /wp-admin/edit.php2,097 ▼01.95 ▼0.0735.37 ▼2.7531.86 ▼1.30
Add New Post /wp-admin/post-new.php1,528 ▲222.85 ▼0.44664.67 ▼45.5859.37 ▼0.44
Media Library /wp-admin/upload.php1,400 ▼04.20 ▲0.08101.98 ▼11.4447.26 ▼0.52

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 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 50% from 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
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/woo-payworks-payment-gateway/class-woocommerce-payworks-payment-gateway.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/woo-payworks-payment-gateway/woocommerce-payworks-payment-gateway.php:12

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

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (15 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #4, #5 in woo-payworks-payment-gateway/assets to your readme.txt
The official readme.txt is a good inspiration

woo-payworks-payment-gateway/woocommerce-payworks-payment-gateway.php 85% from 13 tests

This is the main PHP file of "WooCommerce PayWorks Payment Gateway" version 5.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-payworks-payment-gateway.php" instead of "woocommerce-payworks-payment-gateway.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
There were no executable files found in this plugin370 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP21332333
PO File191137

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin