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

Code Review | 3Pay.co Payment Gateway for WooCommerce

WordPress plugin 3Pay.co Payment Gateway for WooCommerce scored 83% 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: 6.3.1
  • 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

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

Server metrics [RAM: ▲0.08MB] [CPU: ▼6.55ms] Passed 4 tests

An overview of server-side resources used by 3Pay.co Payment Gateway for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0838.37 ▼0.66
Dashboard /wp-admin3.39 ▲0.0846.38 ▼2.35
Posts /wp-admin/edit.php3.44 ▲0.0845.31 ▼4.53
Add New Post /wp-admin/post-new.php5.97 ▲0.0885.86 ▼18.66
Media Library /wp-admin/upload.php3.31 ▲0.0836.59 ▲0.80

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, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by 3Pay.co Payment Gateway for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.30 ▼0.991.77 ▲0.0639.14 ▼0.97
Dashboard /wp-admin2,203 ▲155.83 ▲0.9494.74 ▼14.9938.83 ▼2.64
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0333.68 ▼8.3933.67 ▼3.75
Add New Post /wp-admin/post-new.php1,533 ▲1923.21 ▲5.59638.00 ▼157.1256.80 ▲2.44
Media Library /wp-admin/upload.php1,391 ▲34.28 ▲0.0495.22 ▼11.0941.89 ▼3.06

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

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 no errors were found, this is by no means 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 have triggered server-side errors or warnings:
    • > 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 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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 to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === 3pay-co-payment-gateway-for-woocommerce === )
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
You can take inspiration from this readme.txt

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

The main file in "3Pay.co Payment Gateway for WooCommerce" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: The principal 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 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected355 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
This plugin has no cyclomatic complexity issues
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

All PNG images should be compressed to minimize bandwidth usage for end users
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_icon.png16.98KB1.82KB▼ 89.27%
assets/img/logo.png16.98KB1.82KB▼ 89.27%
assets/img/logo_icon-light.png16.98KB1.82KB▼ 89.27%