73% payment-gateway-groups-for-woocommerce

Code Review | Payment Gateway Groups for WooCommerce

WordPress plugin Payment Gateway Groups for WooCommerce scored73%from 54 tests.

About plugin

  • Plugin page: payment-gateway-g...
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.1-5.9
  • WordPress version: 6.3.1
  • First release: Jul 12, 2019
  • Latest release: Apr 16, 2022
  • Number of updates: 7
  • Update frequency: every 144.0 days
  • Top authors: ivanchernyakov (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,021 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲4.52MB] [CPU: ▲13.02ms] Passed 4 tests

This is a short check of server-side resources used by Payment Gateway Groups for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /8.50 ▲5.0369.12 ▲29.82
Dashboard /wp-admin8.52 ▲5.2159.75 ▲5.52
Posts /wp-admin/edit.php8.52 ▲5.1668.21 ▲15.98
Add New Post /wp-admin/post-new.php8.56 ▲2.6899.23 ▲0.74
Media Library /wp-admin/upload.php8.52 ▲5.2966.43 ▲30.90
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.5259.67

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 186 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
fs_debug_mode
db_upgraded
fs_active_plugins
fs_accounts
widget_recent-posts
theysaidso_admin_options
fs_gdpr
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Payment Gateway Groups for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,896 ▲13513.44 ▼0.918.73 ▲6.8329.29 ▼17.53
Dashboard /wp-admin2,216 ▲365.54 ▼0.1391.79 ▼4.3244.78 ▲1.28
Posts /wp-admin/edit.php2,128 ▲282.00 ▲0.0237.43 ▲0.6640.03 ▲3.26
Add New Post /wp-admin/post-new.php1,538 ▲1223.12 ▼0.34677.10 ▲72.8555.58 ▲6.37
Media Library /wp-admin/upload.php1,424 ▲244.22 ▲0.0598.07 ▼2.3143.78 ▼0.01
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,0611.6925.2930.77

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/payment-gateway-groups-for-woocommerce/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 10 options in the database
    • widget_theysaidso_widget
    • fs_accounts
    • can_compress_scripts
    • fs_gdpr
    • theysaidso_admin_options
    • fs_active_plugins
    • fs_debug_mode
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

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)
The smoke test was a success, however most plugin functionality was not tested

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 items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Settings_Page' not found in wp-content/plugins/payment-gateway-groups-for-woocommerce/admin/partials/woo-pgg-admin-woocommerce-settings.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt might help

payment-gateway-groups-for-woocommerce/woo-pgg.php 92% from 13 tests

"Payment Gateway Groups for WooCommerce" version 1.1.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("payment-gateway-groups-for-woocommerce.php" instead of "woo-pgg.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin31,494 lines of code in 139 files:
LanguageFilesBlank linesComment linesLines of code
PHP1197,34816,63730,937
JavaScript54192256
Markdown1680214
CSS132960
JSON10027

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity77.08
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity4.56
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes53
▷ Abstract classes23.77%
▷ Concrete classes5196.23%
▷ Final classes00.00%
Methods1,164
▷ Static methods17515.03%
▷ Public methods81970.36%
▷ Protected methods151.29%
▷ Private methods33028.35%
Functions98
▷ Named functions98100.00%
▷ Anonymous functions00.00%
Constants124
▷ Global constants9979.84%
▷ Class constants2520.16%
▷ Public constants25100.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
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/woo-pgg.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%