78% eupago-gateway-for-woocommerce

Code Review | Eupago Gateway For Woocommerce

WordPress plugin Eupago Gateway For Woocommerce scored78%from 54 tests.

About plugin

  • Plugin page: eupago-gateway-fo...
  • Plugin version: 3.1.13
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3.2
  • WordPress version: 6.3.1
  • First release: Dec 30, 2021
  • Latest release: Nov 8, 2023
  • Number of updates: 46
  • Update frequency: every 14.9 days
  • Top authors: eupagoip (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /6,166 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼5.27ms] Passed 4 tests

An overview of server-side resources used by Eupago Gateway For Woocommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0437.99 ▼5.94
Dashboard /wp-admin3.35 ▲0.0444.11 ▼3.15
Posts /wp-admin/edit.php3.40 ▲0.0445.75 ▼2.49
Add New Post /wp-admin/post-new.php5.95 ▲0.0684.55 ▼9.51
Media Library /wp-admin/upload.php3.27 ▲0.0435.09 ▼2.15

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 41 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Eupago Gateway For Woocommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲1614.54 ▲0.201.63 ▼0.4639.59 ▼3.12
Dashboard /wp-admin2,208 ▲275.56 ▼0.1287.02 ▼20.4840.45 ▲2.79
Posts /wp-admin/edit.php2,116 ▲162.00 ▲0.0538.16 ▼0.0434.44 ▼4.42
Add New Post /wp-admin/post-new.php1,539 ▲1323.39 ▲0.25651.32 ▼44.9550.52 ▼9.57
Media Library /wp-admin/upload.php1,413 ▲134.26 ▲0.1094.58 ▼8.6641.65 ▼3.72

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% 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)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/eupago-gateway-for-woocommerce/includes/views/callback-script.php
    • > /wp-content/plugins/eupago-gateway-for-woocommerce/templates/emails/plain-instructions.php
  • 11× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/eupago-gateway-for-woocommerce/includes/hooks/hooks-refund.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/eupago-gateway-for-woocommerce/includes/views/eupago-admin-page.php:43
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/eupago-gateway-for-woocommerce/includes/views/html-admin-page.php:4
    • > PHP Notice
      Undefined index: callback_api_key in wp-content/plugins/eupago-gateway-for-woocommerce/includes/views/callback-script.php on line 7
    • > PHP Notice
      Undefined index: callback_url in wp-content/plugins/eupago-gateway-for-woocommerce/includes/views/callback-script.php on line 8
    • > PHP Notice
      Undefined index: client_secret in wp-content/plugins/eupago-gateway-for-woocommerce/includes/views/callback-script.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/eupago-gateway-for-woocommerce/includes/hooks/hooks-sms.php:85
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Integration' not found in wp-content/plugins/eupago-gateway-for-woocommerce/includes/class-wc-eupago-integration.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Order' not found in wp-content/plugins/eupago-gateway-for-woocommerce/includes/views/order-meta-box.php:2
    • > PHP Notice
      Undefined index: client_id in wp-content/plugins/eupago-gateway-for-woocommerce/includes/views/callback-script.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (17 tag instead of maximum 10)
Please take inspiration from this readme.txt

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

"Eupago Gateway For Woocommerce" version 3.1.13's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 148 characters long)

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
No dangerous file extensions were detected3,962 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP195636393,372
PO File1151304403
CSS1278118
JavaScript171369

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity38.20
▷ Minimum class complexity2.00
▷ Maximum class complexity68.00
Average method complexity3.86
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods130
▷ Static methods21.54%
▷ Public methods12898.46%
▷ Protected methods10.77%
▷ Private methods10.77%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
15 PNG files occupy 0.13MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/eupago_logo.png2.36KB2.64KB0.00%
assets/images/pagaqui_banner.png10.14KB3.88KB▼ 61.78%
assets/images/multibanco_banner.png2.24KB1.31KB▼ 41.45%
assets/images/eupago.png17.70KB7.46KB▼ 57.83%
assets/images/payshop_banner.png13.44KB3.70KB▼ 72.49%