78% plug-payments-gateway

Code Review | Plug Pagamentos

WordPress plugin Plug Pagamentos scored 78% from 54 tests.

About plugin

  • Plugin page: plug-payments-gat...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.9
  • WordPress version: 6.3.1
  • First release: Jan 26, 2022
  • Latest release: Jan 26, 2022
  • Number of updates: 7
  • Update frequency: every 0.9 days
  • Top authors: plugpayments (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 322 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.71ms] Passed 4 tests

An overview of server-side resources used by Plug Pagamentos
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.27 ▼1.44
Dashboard /wp-admin3.32 ▲0.0248.94 ▲0.19
Posts /wp-admin/edit.php3.37 ▲0.0248.84 ▼1.99
Add New Post /wp-admin/post-new.php5.90 ▲0.0295.45 ▼5.93
Media Library /wp-admin/upload.php3.24 ▲0.0136.77 ▼1.47

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 34 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Plug Pagamentos
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲7713.61 ▼0.741.75 ▲0.0344.06 ▲3.90
Dashboard /wp-admin2,221 ▲304.86 ▼0.01102.35 ▲0.0940.04 ▼2.00
Posts /wp-admin/edit.php2,101 ▲122.02 ▼0.0034.34 ▼10.3335.10 ▼2.08
Add New Post /wp-admin/post-new.php1,554 ▲3518.38 ▼4.89590.06 ▼89.0051.38 ▼3.80
Media Library /wp-admin/upload.php1,400 ▲124.25 ▲0.0594.60 ▲1.0940.52 ▼1.88

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/plug-payments-gateway/templates/payment-types/pix.php
    • > /wp-content/plugins/plug-payments-gateway/templates/payment-types/boleto.php
  • 10× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/plug-payments-gateway/templates/receipt/boleto.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/plug-payments-gateway/templates/payment-types/credit.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/plug-payments-gateway/templates/admin-page.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/plug-payments-gateway/includes/poedit.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/plug-payments-gateway/templates/notice/missing-ecfb.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/plug-payments-gateway/templates/notice/missing-clientId.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/plug-payments-gateway/includes/configs/boleto.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/plug-payments-gateway/templates/notice/missing-token.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/plug-payments-gateway/templates/receipt/pix.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/plug-payments-gateway/templates/notice/missing-merchant.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed: The official readme.txt might help

plug-payments-gateway/woocommerce-plug-payments.php 92% from 13 tests

The main PHP file in "Plug Pagamentos" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("plug-payments-gateway.php" instead of "woocommerce-plug-payments.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
Good job! No executable or dangerous file extensions detected1,118 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP2013324831
PO File17180168
Markdown235061
LESS11041
JavaScript23016
CSS1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity12.20
▷ Minimum class complexity2.00
▷ Maximum class complexity40.00
Average method complexity2.70
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods33
▷ Static methods515.15%
▷ Public methods2987.88%
▷ Protected methods13.03%
▷ Private methods39.09%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/plug-50x23.png1.17KB0.57KB▼ 50.92%
assets/images/poweredbyplug.png2.19KB1.13KB▼ 48.64%
assets/images/transparent-checkout-icons.png14.57KB7.22KB▼ 50.42%