84% payments4g-4geeks-payments

Code Review | 4Geeks Payments for WooCommerce

WordPress plugin 4Geeks Payments for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: payments4g-4geeks...
  • Plugin version: 2.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-6.0
  • WordPress version: 6.3.1
  • First release: Nov 28, 2017
  • Latest release: Mar 19, 2023
  • Number of updates: 40
  • Update frequency: every 48.4 days
  • Top authors: alpocr (55%)sergiomonge10 (47.5%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active /2,835 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
Install script ran successfully

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

An overview of server-side resources used by 4Geeks Payments for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.56 ▼2.85
Dashboard /wp-admin3.31 ▼0.0343.76 ▼19.35
Posts /wp-admin/edit.php3.36 ▲0.0147.95 ▲6.00
Add New Post /wp-admin/post-new.php5.89 ▲0.0178.32 ▼16.90
Media Library /wp-admin/upload.php3.23 ▲0.0132.15 ▲0.48

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for 4Geeks Payments for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.48 ▲0.171.65 ▼0.0337.75 ▼4.18
Dashboard /wp-admin2,206 ▲185.09 ▲0.19113.73 ▲11.1142.70 ▲4.81
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0340.56 ▲2.6433.94 ▲5.52
Add New Post /wp-admin/post-new.php1,533 ▲1423.42 ▲0.07663.07 ▼16.9856.72 ▼9.43
Media Library /wp-admin/upload.php1,388 ▲34.25 ▼0.0395.62 ▼2.0642.89 ▲1.08

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

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
Good news, no errors were detected

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
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/payments4g-4geeks-payments/gpayments-connector-woocommerce-gateway.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/payments4g-4geeks-payments/gpayments-connector-woocommerce.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
9 plugin tags: payments, credit card, checkout, payment gateway, pasarela de pagos...

payments4g-4geeks-payments/gpayments-connector-woocommerce-gateway.php 92% from 13 tests

The principal PHP file in "4Geeks Payments for WooCommerce" v. 2.1.1 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("payments4g-4geeks-payments.php" instead of "gpayments-connector-woocommerce-gateway.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin207 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP23933207

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity3.17
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png8.69KB8.33KB▼ 4.11%
assets/banner-772x250.png21.47KB8.55KB▼ 60.20%