99% collect-payment-gateway-for-woocommerce

Code Review | Collect Payment Gateway Plugin for WooCommerce

WordPress plugin Collect Payment Gateway Plugin for WooCommerce scored 99% from 54 tests.

About plugin

  • Plugin page: collect-payment-g...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.8
  • WordPress version: 5.8.1
  • First release: Sep 12, 2021
  • Latest release: Sep 30, 2021
  • Number of updates: 15
  • Update frequency: every 1.3 days
  • Top authors: shadrachodek (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 113 total downloads

Benchmarks

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

Analyzing server-side resources used by Collect Payment Gateway Plugin for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1237.01 ▲14.10
Dashboard /wp-admin3.07 ▲0.0152.36 ▲4.78
Posts /wp-admin/edit.php3.12 ▲0.0146.95 ▲0.55
Add New Post /wp-admin/post-new.php5.43 ▼0.0189.67 ▼564.71
Media Library /wp-admin/upload.php3.01 ▲0.0134.40 ▼1.28

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Collect Payment Gateway Plugin for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8316.18 ▲0.469.82 ▲0.0344.75 ▼2.22
Dashboard /wp-admin2,970 ▲395.88 ▼0.32145.39 ▼4.58111.28 ▲4.48
Posts /wp-admin/edit.php2,739 ▼02.70 ▼0.0262.50 ▼8.0881.77 ▼11.41
Add New Post /wp-admin/post-new.php1,498 ▼11718.86 ▼2.85397.67 ▲89.66110.73 ▲10.05
Media Library /wp-admin/upload.php1,810 ▼05.06 ▲0.06152.09 ▲3.04113.86 ▲2.23

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled completely, with no zombie files or tables

Smoke tests Passed 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)
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

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

The main PHP file in "Collect Payment Gateway Plugin for WooCommerce" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("collect-payment-gateway-for-woocommerce.php" instead of "woo-collect.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("4.7" instead of "3.0.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
There were no executable files found in this plugin800 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP2294239655
Markdown146086
JavaScript217759

PHP code Passed 2 tests

An short overview of 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.38
Average class complexity104.00
▷ Minimum class complexity104.00
▷ Maximum class complexity104.00
Average method complexity5.29
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods1770.83%
▷ Protected methods28.33%
▷ Private methods520.83%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/collect-payment.png12.94KB4.77KB▼ 63.15%