89% duecom-e-commerce-payment-gateway

Code Review | Due.com E-Commerce Payment Gateway

WordPress plugin Due.com E-Commerce Payment Gateway scored89%from 54 tests.

About plugin

  • Plugin page: duecom-e-commerce...
  • Plugin version: 1.4.4
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 1, 2016
  • Latest release: Oct 10, 2018
  • Number of updates: 43
  • Update frequency: every 16.5 days
  • Top authors: due (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,682 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.00MB] [CPU: ▼11.83ms] Passed 4 tests

Server-side resources used by Due.com E-Commerce Payment Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.66 ▼3.13
Dashboard /wp-admin3.31 ▼0.0349.75 ▼12.99
Posts /wp-admin/edit.php3.36 ▲0.0144.32 ▲1.49
Add New Post /wp-admin/post-new.php5.89 ▲0.0181.14 ▼23.35
Media Library /wp-admin/upload.php3.23 ▲0.0133.73 ▼7.85

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Due.com E-Commerce Payment Gateway
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲5514.10 ▼0.181.84 ▲0.1444.12 ▼2.71
Dashboard /wp-admin2,195 ▲155.54 ▼0.1283.79 ▼12.9340.73 ▼3.37
Posts /wp-admin/edit.php2,100 ▼32.02 ▼0.0133.88 ▼7.9633.00 ▼2.82
Add New Post /wp-admin/post-new.php1,526 ▼023.25 ▲0.19674.36 ▲44.2759.08 ▲7.56
Media Library /wp-admin/upload.php1,400 ▼04.31 ▲0.04104.88 ▼12.8347.33 ▼1.92

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
The SRP test was a success

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% 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 (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Tested up to: Invalid plugin version format
  • Requires at least: Invalid plugin version format
Please take inspiration from this readme.txt

duecom-e-commerce-payment-gateway/woocommerce-gateway-duecom.php 92% from 13 tests

The entry point to "Due.com E-Commerce Payment Gateway" version 1.4.4 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("duecom-e-commerce-payment-gateway.php" instead of "woocommerce-gateway-duecom.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin1,751 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP192497651,562
JavaScript12014100
JSON30086
CSS1003

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity19.83
▷ Minimum class complexity1.00
▷ Maximum class complexity116.00
Average method complexity3.46
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods91
▷ Static methods4347.25%
▷ Public methods8593.41%
▷ Protected methods55.49%
▷ Private methods11.10%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/due.png5.08KB1.97KB▼ 61.28%