83% woo-paystack

Code Review | Paystack WooCommerce Payment Gateway

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

About plugin

  • Plugin page: woo-paystack
  • Plugin version: 5.8.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 7.0-6.4
  • WordPress version: 6.3.1
  • First release: Feb 3, 2016
  • Latest release: Nov 28, 2023
  • Number of updates: 101
  • Update frequency: every 28.3 days
  • Top authors: tubiz (100%)

Code review

54 tests

User reviews

23 reviews

Install metrics

20,000+ active /324,726 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.31ms] Passed 4 tests

Analyzing server-side resources used by Paystack WooCommerce Payment Gateway
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0334.69 ▼3.90
Dashboard /wp-admin3.34 ▼0.0146.39 ▼19.53
Posts /wp-admin/edit.php3.39 ▲0.0348.62 ▲1.23
Add New Post /wp-admin/post-new.php5.92 ▲0.03102.97 ▲2.27
Media Library /wp-admin/upload.php3.26 ▲0.0332.72 ▲0.97

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 76 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Paystack WooCommerce Payment Gateway
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲2514.30 ▼0.081.81 ▼0.0640.46 ▲2.33
Dashboard /wp-admin2,196 ▲165.53 ▼0.1191.43 ▼11.8340.42 ▼3.92
Posts /wp-admin/edit.php2,110 ▲101.95 ▼0.0739.81 ▼0.2138.15 ▲0.38
Add New Post /wp-admin/post-new.php1,533 ▲723.12 ▼0.11584.07 ▼73.3854.28 ▲0.93
Media Library /wp-admin/upload.php1,401 ▲44.24 ▲0.0498.08 ▼1.0541.10 ▼2.82

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 13× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Gateway_Custom_Paystack' not found in wp-content/plugins/woo-paystack/includes/custom-gateways/gateway-one/class-wc-gateway-paystack-one.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Gateway_Custom_Paystack_Blocks_Support' not found in wp-content/plugins/woo-paystack/includes/custom-gateways/gateway-one/class-wc-gateway-paystack-one-blocks-support.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Gateway_Custom_Paystack_Blocks_Support' not found in wp-content/plugins/woo-paystack/includes/custom-gateways/gateway-three/class-wc-gateway-paystack-three-blocks-support.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\WooCommerce\\Blocks\\Payments\\Integrations\\AbstractPaymentMethodType' not found in wp-content/plugins/woo-paystack/includes/custom-gateways/class-wc-gateway-custom-paystack-blocks-support.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Gateway_Custom_Paystack_Blocks_Support' not found in wp-content/plugins/woo-paystack/includes/custom-gateways/gateway-five/class-wc-gateway-paystack-five-blocks-support.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Gateway_Custom_Paystack' not found in wp-content/plugins/woo-paystack/includes/custom-gateways/gateway-five/class-wc-gateway-paystack-five.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Gateway_Custom_Paystack' not found in wp-content/plugins/woo-paystack/includes/custom-gateways/gateway-four/class-wc-gateway-paystack-four.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Gateway_Custom_Paystack' not found in wp-content/plugins/woo-paystack/includes/custom-gateways/gateway-three/class-wc-gateway-paystack-three.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Gateway_Custom_Paystack_Blocks_Support' not found in wp-content/plugins/woo-paystack/includes/custom-gateways/gateway-two/class-wc-gateway-paystack-two-blocks-support.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Gateway_Custom_Paystack_Blocks_Support' not found in wp-content/plugins/woo-paystack/includes/custom-gateways/gateway-four/class-wc-gateway-paystack-four-blocks-support.php:3

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

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 14 tag instead of maximum 10
The official readme.txt might help

woo-paystack/woo-paystack.php 92% from 13 tests

"Paystack WooCommerce Payment Gateway" version 5.8.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("5.8" instead of "7.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin2,575 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP229186252,309
JavaScript10809266

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity20.73
▷ Minimum class complexity1.00
▷ Maximum class complexity158.00
Average method complexity6.44
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes640.00%
Methods56
▷ Static methods00.00%
▷ Public methods5394.64%
▷ Protected methods23.57%
▷ Private methods11.79%
Functions10
▷ Named functions660.00%
▷ Anonymous functions440.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
42 PNG files occupy 1.12MB with 0.49MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/zenith.png5.17KB2.67KB▼ 48.48%
assets/images/mastercard.png7.97KB2.82KB▼ 64.67%
assets/images/ecobank.png5.97KB3.83KB▼ 35.83%
assets/images/paystack-za.png4.40KB3.06KB▼ 30.39%
assets/images/paystackwhite.png11.93KB7.09KB▼ 40.55%