93% 3pay-co-payment-gateway-for-woocommerce

Code Review | 3Pay.co Payment Gateway for WooCommerce

WordPress plugin 3Pay.co Payment Gateway for WooCommerce scored 93% from 54 tests.

About plugin

  • Plugin page: 3pay-co-payment-g...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.3.2
  • WordPress version: 5.9.2
  • First release: Mar 25, 2020
  • Latest release: Mar 25, 2020
  • Number of updates: 4
  • Update frequency: every 1.5 days
  • Top authors: 3pay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 520 total downloads

Benchmarks

Plugin footprint Passed 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.06MB] [CPU: ▼296.85ms] Passed 4 tests

Analyzing server-side resources used by 3Pay.co Payment Gateway for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.09121.26 ▲70.75
Dashboard /wp-admin3.49 ▲0.0848.48 ▲14.82
Posts /wp-admin/edit.php3.72 ▲0.0854.32 ▼6.14
Add New Post /wp-admin/post-new.php6.96 ▼0.0193.35 ▼1,184.10
Media Library /wp-admin/upload.php3.37 ▲0.0828.65 ▼11.98

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

3Pay.co Payment Gateway for WooCommerce: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,795 ▲5015.84 ▼0.246.75 ▲0.523.34 ▲0.90
Dashboard /wp-admin2,895 ▲346.15 ▼0.08115.91 ▼14.48168.69 ▲4.91
Posts /wp-admin/edit.php2,691 ▲33.23 ▼0.0081.41 ▲17.11150.09 ▲7.12
Add New Post /wp-admin/post-new.php1,719 ▲5816.76 ▼0.00407.90 ▼20.91186.44 ▲30.88
Media Library /wp-admin/upload.php1,698 ▼05.48 ▼0.07143.11 ▼4.05182.67 ▼9.54

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, 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 fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/3pay-co-payment-gateway-for-woocommerce/woocommerce-gateway-threepay.php:12

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Tags: Please delete some tags, you are using 15 tag instead of maximum 10
  • Plugin Name: Please specify the plugin name on the first line ( === 3pay-co-payment-gateway-for-woocommerce === )
The official readme.txt might help

3pay-co-payment-gateway-for-woocommerce/woocommerce-gateway-threepay.php 92% from 13 tests

Analyzing the main PHP file in "3Pay.co Payment Gateway for WooCommerce" version 1.0.0
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("3pay-co-payment-gateway-for-woocommerce.php" instead of "woocommerce-gateway-threepay.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin355 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP19580355

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity36.00
▷ Minimum class complexity36.00
▷ Maximum class complexity36.00
Average method complexity4.50
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.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
3 PNG files occupy 0.05MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/logo.png16.98KB1.82KB▼ 89.27%
assets/img/logo_icon-light.png16.98KB1.82KB▼ 89.27%
assets/img/logo_icon.png16.98KB1.82KB▼ 89.27%