84% woo-addpay-gateway

Code Review | AddPay WooCommerce

WordPress plugin AddPay WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: woo-addpay-gateway
  • Plugin version: 2.5.19
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: May 15, 2017
  • Latest release: Nov 2, 2022
  • Number of updates: 57
  • Update frequency: every 35.0 days
  • Top authors: stephenaddpay (98.25%)rslabbert94 (3.51%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,086 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.01MB] [CPU: ▲0.05ms] Passed 4 tests

A check of server-side resources used by AddPay WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.77 ▲2.24
Dashboard /wp-admin3.32 ▲0.0155.17 ▲6.21
Posts /wp-admin/edit.php3.37 ▲0.0150.68 ▲2.91
Add New Post /wp-admin/post-new.php5.90 ▲0.0197.98 ▼4.63
Media Library /wp-admin/upload.php3.24 ▲0.0137.72 ▼0.33

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for AddPay WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.48 ▲0.241.69 ▼0.1641.52 ▼1.03
Dashboard /wp-admin2,206 ▲184.83 ▼0.05110.34 ▼1.4241.17 ▼2.96
Posts /wp-admin/edit.php2,092 ▲32.01 ▼0.0242.25 ▼2.1135.72 ▼4.55
Add New Post /wp-admin/post-new.php1,519 ▼1523.48 ▲0.44669.59 ▲52.1755.14 ▲3.20
Media Library /wp-admin/upload.php1,388 ▼04.19 ▼0.09104.76 ▼9.1245.70 ▼2.37

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/woo-addpay-gateway/includes/class-wc-gateway-addpay.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: instant eft, credit card, debit order, reconcilliation, payments...

woo-addpay-gateway/gateway-addpay.php 92% from 13 tests

This is the main PHP file of "AddPay WooCommerce" version 2.5.19, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woo-addpay-gateway.php" instead of "gateway-addpay.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin295 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP24267265
Markdown18030

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity4.80
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods120.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.05MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
logo.png51.62KB13.64KB▼ 73.57%