84% gp-paymentgateways

Code Review | WooCommerce Payment gateways

WordPress plugin WooCommerce Payment gateways scored84%from 54 tests.

About plugin

  • Plugin page: gp-paymentgateways
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.3
  • WordPress version: 6.3.1
  • First release: Nov 27, 2015
  • Latest release: Nov 27, 2015
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: renemanqueros (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,136 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.03MB] [CPU: ▲0.35ms] Passed 4 tests

A check of server-side resources used by WooCommerce Payment gateways
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0337.74 ▼0.81
Dashboard /wp-admin3.34 ▲0.0443.69 ▼2.33
Posts /wp-admin/edit.php3.39 ▲0.0345.87 ▲2.10
Add New Post /wp-admin/post-new.php5.92 ▲0.0390.06 ▲3.10
Media Library /wp-admin/upload.php3.26 ▲0.0337.33 ▲2.42

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 42 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Payment gateways
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.32 ▼1.064.67 ▲2.9939.76 ▼4.43
Dashboard /wp-admin2,206 ▲155.88 ▲0.86107.75 ▲7.2041.48 ▼0.30
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0440.38 ▲4.9635.42 ▲0.01
Add New Post /wp-admin/post-new.php1,542 ▲2317.80 ▼5.45677.55 ▲11.8951.83 ▼3.95
Media Library /wp-admin/upload.php1,388 ▼34.23 ▲0.08110.97 ▲11.3847.89 ▲4.37

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means 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
Please fix the following items
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'CommonRequestUtil' not found in wp-content/plugins/gp-paymentgateways/payu/PayU/util/PayUSubscriptionsRequestUtil.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/gp-paymentgateways/authorizenet.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'CommonRequestUtil' not found in wp-content/plugins/gp-paymentgateways/payu/PayU/util/RequestPaymentsUtil.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gp-paymentgateways/index.php:124
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/gp-paymentgateways/payu-online.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CommonRequestUtil' not found in wp-content/plugins/gp-paymentgateways/payu/PayU/util/PayUReportsRequestUtil.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CommonRequestUtil' not found in wp-content/plugins/gp-paymentgateways/payu/PayU/util/PayUTokensRequestUtil.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/gp-paymentgateways/payu-offline.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === gp-paymentgateways === )
The official readme.txt might help

gp-paymentgateways/index.php 92% from 13 tests

The entry point to "WooCommerce Payment gateways" version 2.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("gp-paymentgateways.php" instead of "index.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 plugin2,447 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
PHP409381,3892,433
Markdown18014

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity7.05
▷ Minimum class complexity1.00
▷ Maximum class complexity50.00
Average method complexity2.94
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes40
▷ Abstract classes12.50%
▷ Concrete classes3997.50%
▷ Final classes00.00%
Methods125
▷ Static methods10987.20%
▷ Public methods9878.40%
▷ Protected methods43.20%
▷ Private methods2318.40%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants241
▷ Global constants00.00%
▷ Class constants241100.00%
▷ Public constants241100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin