83% netgiro-payment-gateway-for-woocommerce

Code Review | Netgíró Payment Gateway for Woocommerce

WordPress plugin Netgíró Payment Gateway for Woocommerce scored83%from 54 tests.

About plugin

  • Plugin page: netgiro-payment-g...
  • Plugin version: 4.2.1
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.2.2
  • WordPress version: 6.3.1
  • First release: Nov 6, 2019
  • Latest release: Jun 21, 2023
  • Number of updates: 50
  • Update frequency: every 26.6 days
  • Top authors: netgiro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /3,198 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.40ms] Passed 4 tests

This is a short check of server-side resources used by Netgíró Payment Gateway for Woocommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0132.70 ▼5.29
Dashboard /wp-admin3.32 ▲0.0144.52 ▼1.40
Posts /wp-admin/edit.php3.37 ▲0.0146.14 ▼4.33
Add New Post /wp-admin/post-new.php5.90 ▲0.0188.19 ▼2.59
Media Library /wp-admin/upload.php3.24 ▲0.0133.50 ▲0.18

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Netgíró Payment Gateway for Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▼0.001.70 ▲0.1238.95 ▼0.78
Dashboard /wp-admin2,195 ▲185.61 ▼0.0689.21 ▲2.9741.18 ▲0.62
Posts /wp-admin/edit.php2,097 ▼31.96 ▼0.0539.04 ▲2.3034.32 ▼3.16
Add New Post /wp-admin/post-new.php1,526 ▼023.59 ▲0.69629.91 ▲8.5361.02 ▲7.00
Media Library /wp-admin/upload.php1,397 ▼34.20 ▲0.0497.61 ▲1.0042.86 ▼1.60

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Netgiro_Template' not found in wp-content/plugins/netgiro-payment-gateway-for-woocommerce/includes/class-netgiro-admin.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/netgiro-payment-gateway-for-woocommerce/assets/view/netgiro-admin-view.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Netgiro_Template' not found in wp-content/plugins/netgiro-payment-gateway-for-woocommerce/includes/class-netgiro-payment-call.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/netgiro-payment-gateway-for-woocommerce/assets/view/netgiro-payment-form-view.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/netgiro-payment-gateway-for-woocommerce/index.php:58
    • > PHP Fatal error
      Uncaught Error: Class 'Netgiro_Template' not found in wp-content/plugins/netgiro-payment-gateway-for-woocommerce/includes/class-netgiro-payment-form.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/netgiro-payment-gateway-for-woocommerce/includes/class-netgiro.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Netgiro_Template' not found in wp-content/plugins/netgiro-payment-gateway-for-woocommerce/includes/class-netgiro-refund.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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
These attributes need your attention:
  • Donate link: Please fix this invalid url: "-"
  • Screenshots: These screenshots require images: #1 (Login page for Netgíró checkout checkout_login.png), #2 (Actual Netgíró checkout page checkout_page1.png)
Please take inspiration from this readme.txt

netgiro-payment-gateway-for-woocommerce/index.php 92% from 13 tests

This is the main PHP file of "Netgíró Payment Gateway for Woocommerce" version 4.2.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("netgiro-payment-gateway-for-woocommerce.php" instead of "index.php")

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
There were no executable files found in this plugin530 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP994265521
Markdown1305
JavaScript1154

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity10.50
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity3.71
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods2095.24%
▷ Protected methods00.00%
▷ Private methods14.76%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo_x25.png2.28KB1.74KB▼ 23.67%