78% coinbarpay-payment-gateway

Code Review | CoinbarPay Payment Gateway

WordPress plugin CoinbarPay Payment Gateway scored78%from 54 tests.

About plugin

  • Plugin page: coinbarpay-paymen...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.1
  • WordPress version: 6.3.1
  • First release: Feb 27, 2023
  • Latest release: Mar 24, 2023
  • Number of updates: 39
  • Update frequency: every 0.7 days
  • Top authors: coinbarspa (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /282 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
Install script ran successfully

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

Analyzing server-side resources used by CoinbarPay Payment Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0048.15 ▲6.35
Dashboard /wp-admin3.31 ▼0.0445.08 ▼20.07
Posts /wp-admin/edit.php3.36 ▲0.0047.87 ▲2.86
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.03 ▼13.03
Media Library /wp-admin/upload.php3.23 ▲0.0038.84 ▲3.50

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 313 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by CoinbarPay Payment Gateway
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.18 ▼1.147.17 ▲5.3353.53 ▲10.13
Dashboard /wp-admin2,206 ▲185.77 ▲0.88100.10 ▼14.5039.31 ▼9.44
Posts /wp-admin/edit.php2,092 ▲62.02 ▼0.0239.75 ▲6.3334.96 ▼1.40
Add New Post /wp-admin/post-new.php1,533 ▲1423.07 ▼0.22665.44 ▼34.5347.60 ▼2.21
Media Library /wp-admin/upload.php1,388 ▲34.20 ▼0.02104.11 ▼2.7945.40 ▼0.72

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

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 | 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
Please fix the following
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/coinbarpay-payment-gateway/vendor/vendor/adamantic/crypto-payments-php/composer-setup.php
    • > /wp-content/plugins/coinbarpay-payment-gateway/config/admin_info_box.php
    • > /wp-content/plugins/coinbarpay-payment-gateway/vendor/adamantic/crypto-payments-php/composer-setup.php
    • > /wp-content/plugins/coinbarpay-payment-gateway/vendor/coinbar/coinbar-pay-php-sdk/composer-setup.php
    • > /wp-content/plugins/coinbarpay-payment-gateway/vendor/vendor/coinbar/coinbar-pay-php-sdk/composer-setup.php
  • 108× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'GrahamCampbell\\ResultType\\Result' not found in wp-content/plugins/coinbarpay-payment-gateway/vendor/vendor/graham-campbell/result-type/src/Error.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'GrahamCampbell\\ResultType\\Result' not found in wp-content/plugins/coinbarpay-payment-gateway/vendor/vendor/graham-campbell/result-type/src/Success.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Loader\\LoaderInterface' not found in wp-content/plugins/coinbarpay-payment-gateway/vendor/vlucas/phpdotenv/src/Loader/Loader.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Repository\\Adapter\\AdapterInterface' not found in wp-content/plugins/coinbarpay-payment-gateway/vendor/vlucas/phpdotenv/src/Repository/Adapter/EnvConstAdapter.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'CoinbarPay\\Sdk\\CoinbarPaymentGatewayConfig' not found in wp-content/plugins/coinbarpay-payment-gateway/vendor/vendor/coinbar/coinbar-pay-php-sdk/src/CoinbarPay/Sdk/CoinbarPaymentGatewayEnvConfig.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'Adamantic\\CryptoPayments\\Exceptions\\CryptoPaymentException' not found in wp-content/plugins/coinbarpay-payment-gateway/vendor/vendor/adamantic/crypto-payments-php/src/Adamantic/CryptoPayments/Exceptions/UnknownStatusException.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Store\\StoreInterface' not found in wp-content/plugins/coinbarpay-payment-gateway/vendor/vlucas/phpdotenv/src/Store/StringStore.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Brick\\Math\\BigNumber' not found in wp-content/plugins/coinbarpay-payment-gateway/vendor/brick/math/src/BigRational.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOption\\Option' not found in wp-content/plugins/coinbarpay-payment-gateway/vendor/vendor/phpoption/phpoption/src/PhpOption/LazyOption.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Repository\\Adapter\\ReaderInterface' not found in wp-content/plugins/coinbarpay-payment-gateway/vendor/vlucas/phpdotenv/src/Repository/Adapter/AdapterInterface.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Add an image for screenshot #1 (Watch example screens in https://pay.coinbar.io)
The official readme.txt is a good inspiration

coinbarpay-payment-gateway/woocommerce-coinbar-pay.php 92% from 13 tests

This is the main PHP file of "CoinbarPay Payment Gateway" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("coinbarpay-payment-gateway.php" instead of "woocommerce-coinbar-pay.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin12,978 lines of code in 141 files:
LanguageFilesBlank linesComment linesLines of code
PHP1232,2965,73411,653
JSON10001,003
Markdown61870299
YAML10015
XML1108

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity11.33
▷ Minimum class complexity1.00
▷ Maximum class complexity166.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces24
Interfaces24
Traits0
Classes197
▷ Abstract classes189.14%
▷ Concrete classes17990.86%
▷ Final classes9251.40%
Methods1,518
▷ Static methods38625.43%
▷ Public methods1,27383.86%
▷ Protected methods976.39%
▷ Private methods1489.75%
Functions411
▷ Named functions28368.86%
▷ Anonymous functions12831.14%
Constants124
▷ Global constants3024.19%
▷ Class constants9475.81%
▷ Public constants6872.34%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png2.76KB2.18KB▼ 21.17%