83% woocommerce-mercadopago

Code Review | Mercado Pago payments for WooCommerce

WordPress plugin Mercado Pago payments for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: woocommerce-merca...
  • Plugin version: 6.9.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.2
  • WordPress version: 6.3.1
  • First release: Nov 7, 2012
  • Latest release: Jul 13, 2023
  • Number of updates: 335
  • Update frequency: every 11.7 days
  • Top authors: mercadopago (80.3%)claudiosanches (17.61%)marcelohama (2.69%)

Code review

54 tests

User reviews

619 reviews

Install metrics

100,000+ active /2,383,561 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.33MB] [CPU: ▼9.19ms] Passed 4 tests

A check of server-side resources used by Mercado Pago payments for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2740.27 ▼1.58
Dashboard /wp-admin3.71 ▲0.3646.78 ▼13.06
Posts /wp-admin/edit.php3.76 ▲0.4052.78 ▲6.54
Add New Post /wp-admin/post-new.php6.23 ▲0.3484.45 ▼24.89
Media Library /wp-admin/upload.php3.57 ▲0.3437.60 ▲2.78

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 431 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Mercado Pago payments for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲9313.26 ▼1.471.59 ▼0.2345.90 ▲3.02
Dashboard /wp-admin2,245 ▲545.85 ▲0.8493.87 ▼12.8683.67 ▲39.80
Posts /wp-admin/edit.php2,128 ▲392.03 ▲0.0239.10 ▼2.7739.03 ▲0.46
Add New Post /wp-admin/post-new.php1,705 ▲16322.38 ▲4.06682.80 ▲64.5958.33 ▲10.84
Media Library /wp-admin/upload.php1,418 ▲274.21 ▼0.02104.50 ▲5.1145.83 ▼0.26

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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 fix the following
  • 55× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'MercadoPago\\PP\\Sdk\\Common\\AbstractEntity' not found in wp-content/plugins/woocommerce-mercadopago/packages/sdk/src/Entity/Payment/PointOfInteraction.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'MercadoPago\\PP\\Sdk\\Common\\AbstractEntity' not found in wp-content/plugins/woocommerce-mercadopago/packages/sdk/src/Entity/Payment/Payment.php:49
    • > PHP Fatal error
      Uncaught Error: Class 'MercadoPago\\PP\\Sdk\\Common\\AbstractCollection' not found in wp-content/plugins/woocommerce-mercadopago/packages/sdk/src/Entity/Preference/ItemList.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'MercadoPago\\PP\\Sdk\\Common\\AbstractEntity' not found in wp-content/plugins/woocommerce-mercadopago/packages/sdk/src/Entity/Preference/Track.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'MercadoPago\\PP\\Sdk\\Common\\AbstractEntity' not found in wp-content/plugins/woocommerce-mercadopago/packages/sdk/src/Entity/Payment/Tracking.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'MercadoPago\\PP\\Sdk\\Common\\AbstractCollection' not found in wp-content/plugins/woocommerce-mercadopago/packages/sdk/src/Entity/Preference/TrackList.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'MercadoPago\\PP\\Sdk\\Common\\AbstractEntity' not found in wp-content/plugins/woocommerce-mercadopago/packages/sdk/src/Entity/Preference/ExcludedPaymentMethod.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'MercadoPago\\PP\\Sdk\\Common\\AbstractEntity' not found in wp-content/plugins/woocommerce-mercadopago/packages/sdk/src/Entity/Payment/AdditionalInfoAddress.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'MercadoPago\\PP\\Sdk\\Common\\AbstractCollection' not found in wp-content/plugins/woocommerce-mercadopago/packages/sdk/src/Entity/Notification/PaymentDetailsList.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'MercadoPago\\PP\\Sdk\\Common\\AbstractEntity' not found in wp-content/plugins/woocommerce-mercadopago/packages/sdk/src/Entity/Preference/Phone.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Requires php: Invalid version format
You can look at the official readme.txt

woocommerce-mercadopago/woocommerce-mercadopago.php 92% from 13 tests

The main PHP script in "Mercado Pago payments for WooCommerce" version 6.9.3 is automatically included on every request by WordPress
The following require your attention:
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.6" instead of "5.9")

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 detected22,599 lines of code in 238 files:
LanguageFilesBlank linesComment linesLines of code
PHP1622,7497,58613,192
PO File21,5482,7333,309
JavaScript524182313,098
CSS20396222,955
JSON20045

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity12.64
▷ Minimum class complexity1.00
▷ Maximum class complexity87.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces10
Interfaces4
Traits0
Classes119
▷ Abstract classes54.20%
▷ Concrete classes11495.80%
▷ Final classes00.00%
Methods761
▷ Static methods12916.95%
▷ Public methods69791.59%
▷ Protected methods222.89%
▷ Private methods425.52%
Functions11
▷ Named functions00.00%
▷ Anonymous functions11100.00%
Constants52
▷ Global constants11.92%
▷ Class constants5198.08%
▷ Public constants51100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
108 PNG files occupy 1.32MB with 0.40MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/narciso/cho-pro-redirect.png2.54KB1.47KB▼ 42.27%
assets/images/narciso/pix-logo.png48.11KB14.44KB▼ 69.98%
assets/images/MLA/credit_card.png5.38KB5.27KB▼ 2.01%
assets/images/mercadopago-settings/icon-code.png0.28KB0.22KB▼ 22.03%
assets/images/credit_card.png0.49KB0.42KB▼ 13.94%