83% veritaspay-hosted-checkout

Code Review | VeritasPay Hosted Checkout Payment for WooCommerce

WordPress plugin VeritasPay Hosted Checkout Payment for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: veritaspay-hosted...
  • Plugin version: 1.0.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1.1-6.2.2
  • WordPress version: 6.3.1
  • First release: Mar 28, 2023
  • Latest release: Aug 24, 2023
  • Number of updates: 31
  • Update frequency: every 5.2 days
  • Top authors: princeeugenio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /367 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
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.53ms] Passed 4 tests

Server-side resources used by VeritasPay Hosted Checkout Payment for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.97 ▼3.74
Dashboard /wp-admin3.33 ▼0.0149.21 ▼24.92
Posts /wp-admin/edit.php3.45 ▲0.0955.14 ▲9.41
Add New Post /wp-admin/post-new.php5.91 ▲0.0398.57 ▲10.12
Media Library /wp-admin/upload.php3.26 ▲0.0338.65 ▲1.13

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 25 new files
Database: 1 new table, 6 new options
New tables
veritaspay_payment_transaction
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

VeritasPay Hosted Checkout Payment for WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6213.24 ▼1.391.75 ▼0.0940.28 ▼4.77
Dashboard /wp-admin2,208 ▲235.82 ▼0.05100.89 ▼13.9539.14 ▼8.56
Posts /wp-admin/edit.php2,096 ▲42.00 ▼0.0139.74 ▲1.3736.89 ▲1.70
Add New Post /wp-admin/post-new.php1,541 ▲2222.99 ▼0.17619.02 ▼39.0160.66 ▲3.92
Media Library /wp-admin/upload.php1,393 ▲24.21 ▼0.07100.83 ▲1.4543.88 ▼7.08

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • 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 no errors were found, this is by no means 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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'VeritasPay\\HostedCheckout\\Veritaspay_Configuration_Settings' not found in wp-content/plugins/veritaspay-hosted-checkout/classes/configuration-settings/veritaspay-hosted-payment-settings.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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
8 plugin tags: unionpay, payments, ecpay, grabpay, credit card...

veritaspay-hosted-checkout/veritaspay-gateway-plugin.php 77% from 13 tests

This is the main PHP file of "VeritasPay Hosted Checkout Payment for WooCommerce" version 1.0.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("veritaspay-hosted-checkout.php" instead of "veritaspay-gateway-plugin.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("6.0" instead of "6.1.1")

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
Good job! No executable or dangerous file extensions detected8,626 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP102033498,536
XML50088
Markdown1102

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity13.00
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.52
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes125.00%
▷ Concrete classes375.00%
▷ Final classes00.00%
Methods33
▷ Static methods39.09%
▷ Public methods1854.55%
▷ Protected methods13.03%
▷ Private methods1442.42%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants150.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.34MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/gcash.png134.80KB61.81KB▼ 54.15%
assets/images/wechat.png141.79KB56.97KB▼ 59.82%
assets/images/alipay.png36.27KB14.87KB▼ 58.99%
assets/images/grabpay.png17.76KB7.76KB▼ 56.29%
assets/images/cards.png17.22KB8.31KB▼ 51.72%