94% mangopay-woocommerce

Code Review | MANGOPAY WooCommerce

WordPress plugin MANGOPAY WooCommerce scored 94% from 54 tests.

About plugin

  • Plugin page: mangopay-woocommerce
  • Plugin version: 3.4.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.9
  • WordPress version: 5.9.2
  • First release: Apr 5, 2016
  • Latest release: Feb 10, 2022
  • Number of updates: 55
  • Update frequency: every 39.1 days
  • Top authors: ydubois (94.55%)mangopay (7.27%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active / 11,715 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.88MB] [CPU: ▼297.52ms] Passed 4 tests

Server-side resources used by MANGOPAY WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.81 ▲1.2928.07 ▼20.47
Dashboard /wp-admin5.48 ▲2.0747.00 ▲14.56
Posts /wp-admin/edit.php5.77 ▲2.1349.93 ▲13.35
Add New Post /wp-admin/post-new.php9.01 ▲2.04106.61 ▼1,195.78
Media Library /wp-admin/upload.php5.43 ▲2.1336.07 ▲12.83

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 225 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

MANGOPAY WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,315 ▼43915.93 ▲0.250.36 ▼5.4831.21 ▲28.60
Dashboard /wp-admin3,029 ▲1716.66 ▲0.48123.97 ▼11.96179.42 ▲22.99
Posts /wp-admin/edit.php2,736 ▲453.37 ▲0.0167.28 ▲2.02136.43 ▼12.97
Add New Post /wp-admin/post-new.php1,671 ▲1021.13 ▲5.65414.30 ▲5.80146.61 ▼2.31
Media Library /wp-admin/upload.php1,751 ▲535.94 ▲0.44126.60 ▼20.17203.49 ▲22.23

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
  • 118× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'MangoPay\\Libraries\\Dto' not found in wp-content/plugins/mangopay-woocommerce/sdk/MangoPay/FilterCards.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'MangoPay\\Libraries\\Document' not found in wp-content/plugins/mangopay-woocommerce/sdk/MangoPay/KycDocument.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'MangoPay\\Libraries\\Dto' not found in wp-content/plugins/mangopay-woocommerce/sdk/MangoPay/FilterBankAccounts.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'MangoPay\\Libraries\\EntityBase' not found in wp-content/plugins/mangopay-woocommerce/sdk/MangoPay/Mandate.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/mangopay-woocommerce/mangopay-woocommerce.php:174
    • > PHP Fatal error
      Uncaught Error: Class 'MangoPay\\Libraries\\ApiBase' not found in wp-content/plugins/mangopay-woocommerce/sdk/MangoPay/ApiDisputes.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/mangopay-woocommerce/inc/upgrades/set_legacy_users_mp_status.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'MangoPay\\Libraries\\Exception' not found in wp-content/plugins/mangopay-woocommerce/sdk/MangoPay/Libraries/ResponseException.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'MangoPay\\FilterBase' not found in wp-content/plugins/mangopay-woocommerce/sdk/MangoPay/FilterEvents.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'MangoPay\\Libraries\\EntityBase' not found in wp-content/plugins/mangopay-woocommerce/sdk/MangoPay/Client.php:8

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 Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
9 plugin tags: payment, marketplace, shop, multivendor, checkout...

mangopay-woocommerce/mangopay-woocommerce.php 85% from 13 tests

The entry point to "MANGOPAY WooCommerce" version 3.4.5 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Requires at least: Required version does not match the one declared in readme.txt ("4.4.0" instead of "4.4")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin16,398 lines of code in 205 files:
LanguageFilesBlank linesComment linesLines of code
PHP1903,0047,19513,312
JavaScript93014491,230
CSS34166863
PO File1367369747
Markdown1730222
JSON10024

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity10.47
▷ Minimum class complexity1.00
▷ Maximum class complexity521.00
Average method complexity4.44
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces3
Interfaces5
Traits0
Classes182
▷ Abstract classes73.85%
▷ Concrete classes17596.15%
▷ Final classes74.00%
Methods514
▷ Static methods91.75%
▷ Public methods43083.66%
▷ Protected methods112.14%
▷ Private methods7314.20%
Functions4
▷ Named functions00.00%
▷ Anonymous functions4100.00%
Constants266
▷ Global constants00.00%
▷ Class constants266100.00%
▷ Public constants266100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
15 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
css/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
img/mp-icon.png1.48KB0.86KB▼ 41.84%
css/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
css/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%