84% wc-moldovaagroindbank

Code Review | WooCommerce maib Moldova Agroindbank Payment Gateway

WordPress plugin WooCommerce maib Moldova Agroindbank Payment Gateway scored84%from 54 tests.

About plugin

  • Plugin page: wc-moldovaagroind...
  • Plugin version: 1.3.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.3.2
  • WordPress version: 6.3.1
  • First release: Feb 28, 2018
  • Latest release: Oct 20, 2023
  • Number of updates: 29
  • Update frequency: every 71.1 days
  • Top authors: alexminza (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /2,728 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
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.71ms] Passed 4 tests

A check of server-side resources used by WooCommerce maib Moldova Agroindbank Payment Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.56 ▼0.71
Dashboard /wp-admin3.31 ▲0.0045.72 ▲0.06
Posts /wp-admin/edit.php3.36 ▲0.0043.66 ▼9.04
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.72 ▼9.15
Media Library /wp-admin/upload.php3.23 ▲0.0032.88 ▲1.36

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 406 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce maib Moldova Agroindbank Payment Gateway
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▼0.011.61 ▲0.0535.42 ▼7.41
Dashboard /wp-admin2,195 ▲215.62 ▲0.0489.24 ▲2.6136.55 ▼6.90
Posts /wp-admin/edit.php2,100 ▼01.99 ▲0.0134.15 ▼8.5232.99 ▼5.32
Add New Post /wp-admin/post-new.php1,526 ▼923.17 ▲5.20680.37 ▲89.2161.12 ▲1.25
Media Library /wp-admin/upload.php1,403 ▲34.17 ▼0.0298.54 ▼14.9844.29 ▼0.71

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 201× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Formatter\ormalizerFormatter' not found in wp-content/plugins/wc-moldovaagroindbank/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/wc-moldovaagroindbank/vendor/guzzlehttp/promises/src/EachPromise.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Command\\ToArrayInterface' not found in wp-content/plugins/wc-moldovaagroindbank/vendor/guzzlehttp/guzzle-services/src/Operation.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/wc-moldovaagroindbank/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/wc-moldovaagroindbank/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php:73
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wc-moldovaagroindbank/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/ReasonPhraseLocationTest.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Command\\Guzzle\\Description' not found in wp-content/plugins/wc-moldovaagroindbank/vendor/maib/maibapi/src/MaibApi/MaibDescription.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/wc-moldovaagroindbank/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/wc-moldovaagroindbank/vendor/guzzlehttp/command/src/Exception/CommandException.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wc-moldovaagroindbank/vendor/guzzlehttp/guzzle-services/tests/ParameterTest.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 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
10 plugin tags: payment, moldova, woocommerce, maib, visa...

wc-moldovaagroindbank/wc-moldovaagroindbank.php Passed 13 tests

The main PHP file in "WooCommerce maib Moldova Agroindbank Payment Gateway" ver. 1.3.2 adds more information about the plugin and also serves as the entry point for this plugin
116 characters long description:
Accept Visa and Mastercard directly on your store with the maib Moldova Agroindbank payment gateway for WooCommerce.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin50,724 lines of code in 378 files:
LanguageFilesBlank linesComment linesLines of code
PHP3265,50214,22943,449
Markdown231,70904,992
JSON15001,642
PO File2172176489
YAML6243107
XML10014
Dockerfile18010
make15010
HTML1109
SVG2002

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity11.60
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces41
Interfaces33
Traits8
Classes253
▷ Abstract classes103.95%
▷ Concrete classes24396.05%
▷ Final classes2711.11%
Methods1,889
▷ Static methods23312.33%
▷ Public methods1,43175.75%
▷ Protected methods22712.02%
▷ Private methods23112.23%
Functions198
▷ Named functions7437.37%
▷ Anonymous functions12462.63%
Constants296
▷ Global constants7625.68%
▷ Class constants22074.32%
▷ Public constants19387.73%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/maib.png2.74KB1.52KB▼ 44.47%
assets/img/paymentsystems.png5.16KB2.90KB▼ 43.86%
assets/img/card-visa.png0.82KB0.85KB0.00%
assets/img/card-mastercard.png3.87KB2.16KB▼ 44.22%