93% woocomm-2co-dynamic-payment-gateway

Code Review | 2Checkout Dynamic Payment Gateway for WooCommerce

WordPress plugin 2Checkout Dynamic Payment Gateway for WooCommerce scored 93% from 54 tests.

About plugin

  • Plugin page: woocomm-2co-dynam...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4.1
  • WordPress version: 5.8.1
  • First release: Jan 16, 2016
  • Latest release: Jan 16, 2016
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: patzz (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active / 5,945 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼140.36ms] Passed 4 tests

This is a short check of server-side resources used by 2Checkout Dynamic Payment Gateway for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.1631.70 ▲13.24
Dashboard /wp-admin3.10 ▲0.0546.10 ▼0.23
Posts /wp-admin/edit.php3.15 ▲0.0546.95 ▲2.03
Add New Post /wp-admin/post-new.php5.46 ▲0.0385.62 ▼573.79
Media Library /wp-admin/upload.php3.04 ▲0.0437.41 ▲10.55

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

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

Browser metrics Passed 4 tests

A check of browser resources used by 2Checkout Dynamic Payment Gateway for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8315.75 ▲0.157.84 ▼1.3744.00 ▼3.47
Dashboard /wp-admin2,970 ▲395.93 ▼0.02140.64 ▼6.70112.84 ▼2.78
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0063.58 ▼3.9589.96 ▲2.74
Add New Post /wp-admin/post-new.php1,615 ▼25721.88 ▲2.82272.56 ▼87.52106.91 ▼0.42
Media Library /wp-admin/upload.php1,807 ▼35.04 ▲0.02142.54 ▼8.23114.27 ▼10.35

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

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 everything seems fine, this is not 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 fix the following
  • 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/woocomm-2co-dynamic-payment-gateway/gateway-2Checkout.php:11

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

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Add images for these screenshots: #1 (Plugin settings), #2 (Checkout page), #3 (Payment options)
The official readme.txt is a good inspiration

woocomm-2co-dynamic-payment-gateway/gateway-2Checkout.php 92% from 13 tests

The entry point to "2Checkout Dynamic Payment Gateway for WooCommerce" version 1.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woocomm-2co-dynamic-payment-gateway.php" instead of "gateway-2Checkout.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
Everything looks great! No dangerous files found in this plugin436 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP561122436

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity9.40
▷ Minimum class complexity1.00
▷ Maximum class complexity24.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods29
▷ Static methods413.79%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
tj-wc2co_icons.png17.66KB5.94KB▼ 66.35%
pm2co_icon.png11.89KB3.43KB▼ 71.18%