68% viapay-checkout-gateway

Code Review | Official Viapay Checkout Gateway

WordPress plugin Official Viapay Checkout Gateway scored68%from 54 tests.

About plugin

  • Plugin page: viapay-checkout-g...
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.9.3
  • WordPress version: 6.3.1
  • First release: Apr 1, 2022
  • Latest release: May 13, 2022
  • Number of updates: 4
  • Update frequency: every 19.7 days
  • Top authors: viabill (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /246 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼6.44ms] Passed 4 tests

Server-side resources used by Official Viapay Checkout Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.91 ▼1.38
Dashboard /wp-admin3.31 ▼0.0444.84 ▼12.17
Posts /wp-admin/edit.php3.36 ▲0.0046.97 ▼0.65
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.49 ▼11.54
Media Library /wp-admin/upload.php3.23 ▲0.0035.33 ▲0.10

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 79 new files
Database: no new tables, 7 new options
New WordPress options
woocommerce_viapay_version
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Official Viapay Checkout Gateway
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7014.45 ▼0.331.62 ▼0.1831.19 ▼10.28
Dashboard /wp-admin2,206 ▲215.89 ▲0.04106.57 ▲6.0143.21 ▼0.95
Posts /wp-admin/edit.php2,089 ▼02.15 ▲0.1140.99 ▲1.7734.79 ▲4.12
Add New Post /wp-admin/post-new.php1,533 ▲522.97 ▲4.57577.72 ▼31.8867.45 ▲13.32
Media Library /wp-admin/upload.php1,391 ▲34.22 ▼0.04100.99 ▲3.6541.74 ▲0.46

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/viapay-checkout-gateway/viapay-woocommerce-payment.php+184
    Non-static method WC_ViapayCheckout::delete_registration_data() should not be called statically
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • woocommerce_viapay_version
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means 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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/viapay-checkout-gateway/templates/admin/help-file.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/viapay-checkout-gateway/includes/class-wc-viapay-order-statuses.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: woocommerce, subscription, payment, viapay

viapay-checkout-gateway/viapay-woocommerce-payment.php 85% from 13 tests

Analyzing the main PHP file in "Official Viapay Checkout Gateway" version 1.0.2
It is important to fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("4.0" instead of "3.0.0")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("viapay-checkout-gateway.php" instead of "viapay-woocommerce-payment.php")

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
Success! There were no dangerous files found in this plugin15,560 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
PHP321,3782,1557,143
JSON2004,993
JavaScript994442,962
CSS3295171
PO File16781163
Sass1200115
Markdown16013

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity34.27
▷ Minimum class complexity1.00
▷ Maximum class complexity197.00
Average method complexity4.39
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes25
▷ Abstract classes28.00%
▷ Concrete classes2392.00%
▷ Final classes00.00%
Methods262
▷ Static methods5119.47%
▷ Public methods23288.55%
▷ Protected methods176.49%
▷ Private methods134.96%
Functions6
▷ Named functions00.00%
▷ Anonymous functions6100.00%
Constants22
▷ Global constants418.18%
▷ Class constants1881.82%
▷ Public constants18100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
27 PNG files occupy 0.15MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/discover.png4.06KB1.98KB▼ 51.22%
assets/images/googlepay.png12.26KB2.36KB▼ 80.76%
assets/images/mobilepay.png4.98KB2.50KB▼ 49.74%
assets/images/cup.png10.32KB4.62KB▼ 55.26%
assets/images/amex.png4.76KB2.36KB▼ 50.42%