83% woo-payment-gateway-officeguy

Code Review | WooCommerce Payment Gateway - SUMIT

WordPress plugin WooCommerce Payment Gateway - SUMIT scored83%from 54 tests.

About plugin

  • Plugin page: woo-payment-gatew...
  • Plugin version: 3.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Oct 23, 2017
  • Latest release: Nov 7, 2023
  • Number of updates: 233
  • Update frequency: every 9.5 days
  • Top authors: effyteva (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active /30,964 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.61MB] [CPU: ▲2.58ms] Passed 4 tests

A check of server-side resources used by WooCommerce Payment Gateway - SUMIT
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.11 ▲0.6545.02 ▲4.22
Dashboard /wp-admin3.95 ▲0.6548.49 ▼5.78
Posts /wp-admin/edit.php4.00 ▲0.6452.49 ▲7.96
Add New Post /wp-admin/post-new.php6.47 ▲0.5894.65 ▲8.49
Media Library /wp-admin/upload.php3.81 ▲0.5838.91 ▲3.91

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

WooCommerce Payment Gateway - SUMIT: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲8314.34 ▼0.001.73 ▼0.4043.97 ▼1.95
Dashboard /wp-admin2,247 ▲705.65 ▲0.0797.81 ▼5.8441.39 ▼2.77
Posts /wp-admin/edit.php2,109 ▲92.12 ▲0.1139.34 ▼1.7334.52 ▼0.32
Add New Post /wp-admin/post-new.php1,532 ▲623.35 ▲0.10666.65 ▼134.7457.71 ▲2.05
Media Library /wp-admin/upload.php1,409 ▲64.19 ▼0.0398.62 ▼7.0243.48 ▼2.15

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 16× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woo-payment-gateway-officeguy/includes/OfficeGuySubscriptions.php:292
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woo-payment-gateway-officeguy/includes/OfficeGuyWCFMMarketplace.php:110
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-payment-gateway-officeguy/includes/OfficeGuyDonation.php:76
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-payment-gateway-officeguy/includes/officeguybit_woocommerce_gateway.php:110
    • > PHP Warning
      require_once(ABSPATH/wp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/woo-payment-gateway-officeguy/includes/OfficeGuyMultiVendor.php on line 3
    • > PHP Warning
      require_once(ABSPATH/wp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/woo-payment-gateway-officeguy/includes/OfficeGuyCartFlow.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-payment-gateway-officeguy/includes/OfficeGuyWCVendorsMarketplace.php:108
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/woo-payment-gateway-officeguy/includes/OfficeGuyMultiVendor.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/woo-payment-gateway-officeguy/includes/OfficeGuyMultiVendor.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-payment-gateway-officeguy/includes/OfficeGuyPayment.php:1147

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: There are too many tags (13 tag instead of maximum 10)
Please take inspiration from this readme.txt

woo-payment-gateway-officeguy/officeguy-woo.php 77% from 13 tests

The primary PHP file in "WooCommerce Payment Gateway - SUMIT" version 3.2.4 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Description: Keep the plugin description shorter than 140 characters (currently 157 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-payment-gateway-officeguy.php" instead of "officeguy-woo.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
Good job! No executable or dangerous file extensions detected3,654 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP183611163,091
PO File1178118372
JavaScript1140151
CSS19040

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity29.76
▷ Minimum class complexity2.00
▷ Maximum class complexity212.00
Average method complexity4.71
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods132
▷ Static methods10881.82%
▷ Public methods13098.48%
▷ Protected methods00.00%
▷ Private methods21.52%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/cards.png2.11KB1.81KB▼ 14.01%
includes/images/bit.png3.26KB2.07KB▼ 36.49%