78% aqpago

Code Review | AQPago Pagamentos para WooCommerce

WordPress plugin AQPago Pagamentos para WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: aqpago
  • Plugin version: 1.3.27
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.1
  • WordPress version: 6.3.1
  • First release: Mar 7, 2022
  • Latest release: Feb 1, 2023
  • Number of updates: 75
  • Update frequency: every 4.4 days
  • Top authors: aqbank (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,224 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.17MB] [CPU: ▼19.69ms] Passed 4 tests

Analyzing server-side resources used by AQPago Pagamentos para WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0034.61 ▼10.76
Dashboard /wp-admin3.20 ▼0.1131.46 ▼21.76
Posts /wp-admin/edit.php3.26 ▼0.0938.13 ▼14.73
Add New Post /wp-admin/post-new.php5.44 ▼0.4568.98 ▼31.50
Media Library /wp-admin/upload.php3.20 ▼0.0329.90 ▼8.45

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 298 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for AQPago Pagamentos para WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.30 ▼1.001.78 ▼0.0039.71 ▼3.88
Dashboard /wp-admin2,209 ▲215.85 ▲0.01109.56 ▼7.9942.29 ▼3.92
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0540.12 ▲3.7036.42 ▼0.27
Add New Post /wp-admin/post-new.php1,519 ▼1423.07 ▼0.36683.47 ▲10.3151.73 ▼13.14
Media Library /wp-admin/upload.php1,388 ▼04.25 ▲0.0499.63 ▼13.3041.77 ▼7.05

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 items
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/aqpago/templates/modal/first-card.php
    • > /wp-content/plugins/aqpago/templates/admin/order-info-ticket.php
    • > /wp-content/plugins/aqpago/templates/modal/second-card.php
    • > /wp-content/plugins/aqpago/templates/admin/order-info-credit.php
  • 125× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Picqer\\Barcode\\Types\\TypeStandard2of5' not found in wp-content/plugins/aqpago/includes/barcode-generator/Types/TypeStandard2of5Checksum.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_js() in wp-content/plugins/aqpago/templates/session.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/aqpago/templates/success/aqpago.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Picqer\\Barcode\\Types\\TypeEanUpcBase' not found in wp-content/plugins/aqpago/library/vendor/picqer/php-barcode-generator/src/Types/TypeUpcE.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/aqpago/templates/success/credit.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Aqbank\\Apiv2\\Aqpago\\Request\\AbstractRequest' not found in wp-content/plugins/aqpago/sdk/Aqpago/Request/Order/QueryOrderRequest.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Aqbank\\Apiv2\\Aqpago\\AqpagoSerializable' not found in wp-content/plugins/aqpago/sdk/Aqpago/Address.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Picqer\\Barcode\\Types\\TypePostnet' not found in wp-content/plugins/aqpago/library/vendor/picqer/php-barcode-generator/src/Types/TypePlanet.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Aqbank\\Apiv2\\Aqpago\\AqpagoSerializable' not found in wp-content/plugins/aqpago/sdk/Aqpago/Shipping.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/aqpago/library/vendor/picqer/php-barcode-generator/tests/BarcodeDynamicHtmlTest.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
3 plugin tags: payment, aqpago, woocommerce

aqpago/aqpago.php 92% from 13 tests

The principal PHP file in "AQPago Pagamentos para WooCommerce" v. 1.3.27 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 391 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin17,657 lines of code in 172 files:
LanguageFilesBlank linesComment linesLines of code
PHP1132,3422,07211,024
JavaScript56752252,913
SVG34102,302
CSS5435687
Markdown51510349
HTML400194
JSON300143
XML10023
YAML29022

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 402)
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity10.88
▷ Minimum class complexity1.00
▷ Maximum class complexity558.00
Average method complexity3.60
▷ Minimum method complexity1.00
▷ Maximum method complexity402.00
Code structure
Namespaces13
Interfaces5
Traits0
Classes133
▷ Abstract classes53.76%
▷ Concrete classes12896.24%
▷ Final classes00.00%
Methods532
▷ Static methods376.95%
▷ Public methods46787.78%
▷ Protected methods529.77%
▷ Private methods132.44%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants82
▷ Global constants33.66%
▷ Class constants7996.34%
▷ Public constants7797.47%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
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/images/visa.png19.26KB8.62KB▼ 55.22%
assets/images/aqpago-logo.png8.14KB4.57KB▼ 43.87%