83% onpay-io-for-woocommerce

Code Review | OnPay.io for WooCommerce

WordPress plugin OnPay.io for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: onpay-io-for-wooc...
  • Plugin version: 1.0.36
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.3.1
  • WordPress version: 6.3.1
  • First release: Dec 11, 2019
  • Latest release: Sep 6, 2023
  • Number of updates: 49
  • Update frequency: every 27.9 days
  • Top authors: onpayio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /17,575 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.25MB] [CPU: ▼2.32ms] Passed 4 tests

Analyzing server-side resources used by OnPay.io for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2546.09 ▲1.58
Dashboard /wp-admin3.55 ▲0.2551.72 ▼9.70
Posts /wp-admin/edit.php3.67 ▲0.3155.01 ▲7.27
Add New Post /wp-admin/post-new.php6.13 ▲0.25102.39 ▼3.38
Media Library /wp-admin/upload.php3.47 ▲0.2538.06 ▲2.21

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 249 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for OnPay.io for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.45 ▲0.091.74 ▲0.1245.20 ▲9.03
Dashboard /wp-admin2,195 ▲185.60 ▼0.0290.59 ▼11.3442.60 ▼2.13
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0442.34 ▲2.3935.23 ▼1.16
Add New Post /wp-admin/post-new.php1,525 ▼122.88 ▼0.03618.50 ▼67.4657.43 ▼5.85
Media Library /wp-admin/upload.php1,403 ▲34.22 ▲0.0096.79 ▼19.6646.90 ▼4.48

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however 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
Please fix the following items
  • 89× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WoocommerceOnpay\\Psr\\Log\\AbstractLogger' not found in wp-content/plugins/onpay-io-for-woocommerce/build/vendor/onpayio/oauth2-client/src/ErrorLogger.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/onpay-io-for-woocommerce/classes/abstract-gateway.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'WoocommerceOnpay\\Psr\\Log\\LoggerInterface' not found in wp-content/plugins/onpay-io-for-woocommerce/build/vendor/psr/log/Psr/Log/AbstractLogger.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'WoocommerceOnpay\\fkooman\\OAuth\\Client\\TokenStorageInterface' not found in wp-content/plugins/onpay-io-for-woocommerce/build/vendor/onpayio/oauth2-client/src/PdoTokenStorage.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'WoocommerceOnpay\\PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/onpay-io-for-woocommerce/build/vendor/onpayio/oauth2-client/tests/Http/RequestTest.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'WoocommerceOnpay\\fkooman\\OAuth\\Client\\Exception\\OAuthException' not found in wp-content/plugins/onpay-io-for-woocommerce/build/vendor/onpayio/oauth2-client/src/Exception/AccessTokenException.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'WoocommerceOnpay\\OnPay\\API\\Util\\PaymentMethods\\Methods\\PaymentMethodAbstract' not found in wp-content/plugins/onpay-io-for-woocommerce/build/vendor/onpayio/php-sdk/src/API/Util/PaymentMethods/Methods/Vipps.php:10
    • > PHP Warning
      require_once(wp-content/plugins/onpay-io-for-woocommerce/build/vendor/paragonie/constant_time_encoding/tests/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/onpay-io-for-woocommerce/build/vendor/paragonie/constant_time_encoding/tests/autoload.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'WoocommerceOnpay\\fkooman\\OAuth\\Client\\Exception\\OAuthException' not found in wp-content/plugins/onpay-io-for-woocommerce/build/vendor/onpayio/oauth2-client/src/Exception/SessionException.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'WoocommerceOnpay\\OnPay\\API\\Transaction\\SimpleTransaction' not found in wp-content/plugins/onpay-io-for-woocommerce/build/vendor/onpayio/php-sdk/src/API/Transaction/DetailedTransaction.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed: Please take inspiration from this readme.txt

onpay-io-for-woocommerce/woocommerce-onpay.php 85% from 13 tests

"OnPay.io for WooCommerce" version 1.0.36's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("onpay-io-for-woocommerce.php" instead of "woocommerce-onpay.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin12,766 lines of code in 234 files:
LanguageFilesBlank linesComment linesLines of code
PHP1857836,3988,753
SVG1915132,007
JSON1000819
Markdown112260661
PO File1129135303
XML56097
JavaScript2131589
CSS173137

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity5.81
▷ Minimum class complexity1.00
▷ Maximum class complexity124.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces29
Interfaces9
Traits2
Classes155
▷ Abstract classes159.68%
▷ Concrete classes14090.32%
▷ Final classes1410.00%
Methods694
▷ Static methods11516.57%
▷ Public methods59285.30%
▷ Protected methods324.61%
▷ Private methods7010.09%
Functions39
▷ Named functions3076.92%
▷ Anonymous functions923.08%
Constants134
▷ Global constants85.97%
▷ Class constants12694.03%
▷ Public constants126100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected