89% goemerchant-gateway-for-woocommerce

Code Review | goEmerchant Payment Gateway Plugin for WooCommerce

WordPress plugin goEmerchant Payment Gateway Plugin for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: goemerchant-gatew...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.3-4.9.6
  • WordPress version: 6.3.1
  • First release: Dec 12, 2016
  • Latest release: Jun 20, 2018
  • Number of updates: 35
  • Update frequency: every 15.9 days
  • Top authors: kdemoura (77.14%)supportgoemerchant (25.71%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,726 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.49ms] Passed 4 tests

Analyzing server-side resources used by goEmerchant Payment Gateway Plugin for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0142.09 ▲2.96
Dashboard /wp-admin3.32 ▲0.0146.84 ▼5.32
Posts /wp-admin/edit.php3.37 ▲0.0147.68 ▼3.54
Add New Post /wp-admin/post-new.php5.90 ▲0.0192.14 ▼10.37
Media Library /wp-admin/upload.php3.24 ▲0.0138.51 ▲1.26

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by goEmerchant Payment Gateway Plugin for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.41 ▲0.051.83 ▲0.1343.47 ▼0.32
Dashboard /wp-admin2,195 ▲215.54 ▼0.1086.26 ▼3.3740.82 ▼1.42
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0734.90 ▼5.7438.22 ▲2.00
Add New Post /wp-admin/post-new.php1,526 ▼023.23 ▲0.19676.94 ▲25.6461.86 ▲6.17
Media Library /wp-admin/upload.php1,403 ▼04.21 ▲0.0294.83 ▼9.3943.66 ▼3.26

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
Everything seems fine, however this is by no means an exhaustive test

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 93% from 29 tests

readme.txt 94% 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 to be fixed: The official readme.txt is a good inspiration

goemerchant-gateway-for-woocommerce/goemerchant-gateway.php 92% from 13 tests

The primary PHP file in "goEmerchant Payment Gateway Plugin for WooCommerce" version 1.2.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("goemerchant-gateway-for-woocommerce.php" instead of "goemerchant-gateway.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected1,136 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP31562461,057
Markdown122048
JavaScript18531

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity41.33
▷ Minimum class complexity1.00
▷ Maximum class complexity142.00
Average method complexity5.40
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods55
▷ Static methods00.00%
▷ Public methods5498.18%
▷ Protected methods11.82%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants51
▷ Global constants00.00%
▷ Class constants51100.00%
▷ Public constants51100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.76MB with 0.48MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-1880x609.png311.90KB100.78KB▼ 67.69%
assets/screenshot-2.PNG43.77KB20.49KB▼ 53.19%
assets/screenshot-4.PNG272.92KB64.21KB▼ 76.47%
assets/screenshot-1.PNG46.30KB16.00KB▼ 65.45%
assets/screenshot-3.PNG104.24KB47.91KB▼ 54.04%