78% wc-paymongo-payment-gateway

Code Review | Payments via PayMongo for WooCommerce

WordPress plugin Payments via PayMongo for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: wc-paymongo-payme...
  • Plugin version: 1.13.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3.2-6.3.2
  • WordPress version: 6.3.1
  • First release: Jun 17, 2020
  • Latest release: Nov 30, 2023
  • Number of updates: 64
  • Update frequency: every 19.7 days
  • Top authors: cynderpaymongo (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

2,000+ active /30,225 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.15MB] [CPU: ▼3.04ms] Passed 4 tests

Server-side resources used by Payments via PayMongo for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1637.32 ▼5.23
Dashboard /wp-admin3.47 ▲0.1253.37 ▼8.31
Posts /wp-admin/edit.php3.58 ▲0.2249.35 ▲4.47
Add New Post /wp-admin/post-new.php6.05 ▲0.1694.46 ▼2.31
Media Library /wp-admin/upload.php3.39 ▲0.1637.19 ▲3.68

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 256 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Payments via PayMongo for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲7514.14 ▼0.571.86 ▲0.1736.55 ▼9.20
Dashboard /wp-admin2,202 ▲285.60 ▲0.0693.43 ▼6.2143.07 ▼4.87
Posts /wp-admin/edit.php2,107 ▲101.94 ▼0.0439.33 ▲5.1737.77 ▲2.36
Add New Post /wp-admin/post-new.php1,533 ▲423.15 ▼0.06674.49 ▲72.2454.94 ▼0.16
Media Library /wp-admin/upload.php1,401 ▲14.20 ▲0.04101.53 ▲5.2745.53 ▲5.87

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wc-paymongo-payment-gateway/classes/cc-fields.php
  • 86× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function it() in wp-content/plugins/wc-paymongo-payment-gateway/vendor/micahbule/phaymongo/tests/PaymongoUtilsTest.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/wc-paymongo-payment-gateway/vendor/guzzlehttp/promises/src/RejectedPromise.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UploadedFileInterface' not found in wp-content/plugins/wc-paymongo-payment-gateway/vendor/guzzlehttp/psr7/src/UploadedFile.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\TaskQueueInterface' not found in wp-content/plugins/wc-paymongo-payment-gateway/vendor/guzzlehttp/promises/src/TaskQueue.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Paymongo\\Phaymongo\\PaymongoClient' not found in wp-content/plugins/wc-paymongo-payment-gateway/vendor/micahbule/phaymongo/src/PaymentMethod.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wc-paymongo-payment-gateway/vendor/guzzlehttp/psr7/src/LazyOpenStream.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function it() in wp-content/plugins/wc-paymongo-payment-gateway/vendor/micahbule/phaymongo/tests/PaymentIntentTest.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UriInterface' not found in wp-content/plugins/wc-paymongo-payment-gateway/vendor/guzzlehttp/psr7/src/Uri.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wc-paymongo-payment-gateway/vendor/guzzlehttp/psr7/src/InflateStream.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function it() in wp-content/plugins/wc-paymongo-payment-gateway/vendor/micahbule/phaymongo/tests/LinkTest.php:7

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 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
4 plugin tags: payments, grabpay, credit card, gcash

wc-paymongo-payment-gateway/payments-paymongo-woocommerce.php 85% from 13 tests

The main PHP script in "Payments via PayMongo for WooCommerce" version 1.13.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.0" instead of "5.3.2")
  • Main file name: Name the main plugin file the same as the plugin slug ("wc-paymongo-payment-gateway.php" instead of "payments-paymongo-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin20,922 lines of code in 230 files:
LanguageFilesBlank linesComment linesLines of code
PHP1803,0856,87114,836
Markdown211,35903,977
JSON12001,194
JavaScript512015539
CSS2254184
YAML517288
XML32061
make17031
SVG10012

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity11.20
▷ Minimum class complexity1.00
▷ Maximum class complexity88.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces16
Interfaces26
Traits4
Classes120
▷ Abstract classes32.50%
▷ Concrete classes11797.50%
▷ Final classes3529.91%
Methods984
▷ Static methods15615.85%
▷ Public methods84986.28%
▷ Protected methods90.91%
▷ Private methods12612.80%
Functions208
▷ Named functions4421.15%
▷ Anonymous functions16478.85%
Constants86
▷ Global constants55.81%
▷ Class constants8194.19%
▷ Public constants6985.19%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 0.79MB with 0.47MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/security_bank.png20.01KB9.53KB▼ 52.38%
assets/images/paymongo_unionbank.png105.28KB26.44KB▼ 74.89%
assets/images/aub.png131.77KB58.76KB▼ 55.41%
assets/images/paymongo.png17.22KB8.31KB▼ 51.72%
assets/images/paymongo_paymaya.png187.18KB63.07KB▼ 66.30%