88% paystand-for-woocommerce

Code Review | PayStand for WooCommerce

WordPress plugin PayStand for WooCommerce scored 88% from 54 tests.

About plugin

  • Plugin page: paystand-for-wooc...
  • Plugin version: 2.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.8.2
  • WordPress version: 5.9.2
  • First release: Jul 4, 2018
  • Latest release: Feb 11, 2022
  • Number of updates: 40
  • Update frequency: every 33.0 days
  • Top authors: obaqueiropaystand (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 1,344 total downloads

Benchmarks

Plugin footprint Passed 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.01MB] [CPU: ▼297.25ms] Passed 4 tests

A check of server-side resources used by PayStand for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0254.50 ▲4.51
Dashboard /wp-admin3.44 ▲0.0234.38 ▼0.66
Posts /wp-admin/edit.php3.66 ▲0.0238.84 ▲1.49
Add New Post /wp-admin/post-new.php6.90 ▼0.0797.05 ▼1,183.76
Media Library /wp-admin/upload.php3.31 ▲0.0123.15 ▼6.05

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 29 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for PayStand for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,806 ▲5216.33 ▲0.115.70 ▼1.2219.66 ▲16.74
Dashboard /wp-admin2,921 ▲376.41 ▼0.14133.83 ▼7.34161.92 ▲1.15
Posts /wp-admin/edit.php2,694 ▲93.43 ▲0.0062.33 ▼4.31140.07 ▼11.80
Add New Post /wp-admin/post-new.php1,659 ▼219.28 ▲1.93381.17 ▼57.34162.71 ▲4.53
Media Library /wp-admin/upload.php1,698 ▼05.74 ▲0.02140.82 ▼4.89189.54 ▲2.49

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 successfully, without leaving any zombie files or tables

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)
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/paystand-for-woocommerce/woocommerce-paystand.php
  • 11× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Httpful\\Handlers\\MimeHandlerAdapter' not found in wp-content/plugins/paystand-for-woocommerce/includes/Httpful/Handlers/JsonHandler.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/paystand-for-woocommerce/PaystandCheckout.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Httpful\\Handlers\\MimeHandlerAdapter' not found in wp-content/plugins/paystand-for-woocommerce/includes/Httpful/Handlers/CsvHandler.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Httpful\\Handlers\\MimeHandlerAdapter' not found in wp-content/plugins/paystand-for-woocommerce/includes/Httpful/Handlers/XHtmlHandler.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/paystand-for-woocommerce/PaystandCheckoutToken.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Httpful\\Handlers\\MimeHandlerAdapter' not found in wp-content/plugins/paystand-for-woocommerce/includes/Httpful/Handlers/XmlHandler.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Httpful\\Handlers\\MimeHandlerAdapter' not found in wp-content/plugins/paystand-for-woocommerce/includes/Httpful/Handlers/FormHandler.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/paystand-for-woocommerce/includes/bootstrap.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/paystand-for-woocommerce/PaystandCheckoutFactory.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/paystand-for-woocommerce/WCGatewayPaystand.php:4

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: paystand, echeck, bitcoin, payment, woocommerce...

paystand-for-woocommerce/woocommerce-paystand.php 92% from 13 tests

"PayStand for WooCommerce" version 2.4.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("paystand-for-woocommerce.php" instead of "woocommerce-paystand.php")

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
Success! There were no dangerous files found in this plugin2,164 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP243991,0162,108
Markdown18036
JSON10020

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity10.90
▷ Minimum class complexity1.00
▷ Maximum class complexity76.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes21
▷ Abstract classes14.76%
▷ Concrete classes2095.24%
▷ Final classes15.00%
Methods173
▷ Static methods3419.65%
▷ Public methods16092.49%
▷ Protected methods10.58%
▷ Private methods126.94%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants29
▷ Global constants13.45%
▷ Class constants2896.55%
▷ Public constants28100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.08MB with 0.06MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/paystand_logo_small_new.png10.14KB3.29KB▼ 67.54%
images/paystand_logo_banner_new.png76.74KB24.25KB▼ 68.40%