84% woo-asaas

Code Review | Asaas Gateway for WooCommerce

WordPress plugin Asaas Gateway for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: woo-asaas
  • Plugin version: 2.1.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.2
  • WordPress version: 6.3.1
  • First release: Jun 5, 2018
  • Latest release: Aug 18, 2023
  • Number of updates: 116
  • Update frequency: every 16.4 days
  • Top authors: aztecweb (93.1%)asaas (7.76%)

Code review

54 tests

User reviews

8 reviews

Install metrics

6,000+ active /50,097 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼2.27ms] Passed 4 tests

Server-side resources used by Asaas Gateway for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0736.34 ▼5.29
Dashboard /wp-admin3.39 ▲0.0852.42 ▼0.78
Posts /wp-admin/edit.php3.50 ▲0.1454.61 ▲2.22
Add New Post /wp-admin/post-new.php5.97 ▲0.0892.38 ▼3.86
Media Library /wp-admin/upload.php3.31 ▲0.0836.77 ▲0.85

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Asaas Gateway for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲2814.73 ▲0.341.74 ▼0.4441.00 ▼6.34
Dashboard /wp-admin2,214 ▲375.62 ▲0.0597.53 ▲4.8849.01 ▲8.95
Posts /wp-admin/edit.php2,123 ▲262.14 ▲0.1337.23 ▼1.9234.39 ▼0.74
Add New Post /wp-admin/post-new.php1,561 ▲1222.89 ▼0.30660.64 ▼7.1655.83 ▼12.13
Media Library /wp-admin/upload.php1,422 ▲284.22 ▲0.07106.51 ▲2.9943.96 ▲2.54

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 34× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Asaas\\Api\\Client\\Client' not found in wp-content/plugins/woo-asaas/includes/api/client/class-collection-client.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Asaas\\Api\\Resources\\Resource' not found in wp-content/plugins/woo-asaas/includes/api/resources/class-credit-card.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Asaas\\Gateway\\Gateway' not found in wp-content/plugins/woo-asaas/includes/gateway/class-pix.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Asaas\\Checkout\\Form_Field\\Form_Field' not found in wp-content/plugins/woo-asaas/includes/checkout/form-field/class-card-security-code.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Asaas\\WC_Asaas' not found in wp-content/plugins/woo-asaas/templates/one-click-buy-option.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Asaas\\Api\\Response\\Response' not found in wp-content/plugins/woo-asaas/includes/api/response/class-error-response.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Asaas\\Billing_Type\\Billing_Type' not found in wp-content/plugins/woo-asaas/includes/billing-type/class-credit-card.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Asaas\\Log\\Logger' not found in wp-content/plugins/woo-asaas/includes/log/class-logger-legacy.php:15
    • > PHP Notice
      Undefined variable: expiration_period in wp-content/plugins/woo-asaas/templates/order/pix-thankyou-instructions.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Asaas\\Api\\Resources\\Resource' not found in wp-content/plugins/woo-asaas/includes/api/resources/class-subscriptions.php:17

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 97% 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
Please fix the following attributes:
  • Donate link: Invalid url: ""
You can take inspiration from this readme.txt

woo-asaas/woo-asaas.php Passed 13 tests

The main file in "Asaas Gateway for WooCommerce" v. 2.1.7 serves as a complement to information provided in readme.txt and as the entry point to the plugin
89 characters long description:
Take transparent credit card and bank ticket payment checkouts on your store using Asaas.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin9,094 lines of code in 93 files:
LanguageFilesBlank linesComment linesLines of code
PHP861,4754,0015,540
JavaScript39626362,936
PO File1219344558
CSS30060

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity9.82
▷ Minimum class complexity1.00
▷ Maximum class complexity79.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces27
Interfaces0
Traits0
Classes72
▷ Abstract classes68.33%
▷ Concrete classes6691.67%
▷ Final classes00.00%
Methods446
▷ Static methods255.61%
▷ Public methods35579.60%
▷ Protected methods92.02%
▷ Private methods8218.39%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants30
▷ Global constants00.00%
▷ Class constants30100.00%
▷ Public constants30100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/elo.png6.73KB4.18KB▼ 37.84%
assets/images/discover.png8.75KB4.41KB▼ 49.65%
assets/images/mastercard.png8.87KB5.09KB▼ 42.58%
assets/images/diners.png9.07KB4.60KB▼ 49.28%
assets/images/visa.png3.39KB2.71KB▼ 20.01%