77% crypto-payments-woo

Code Review | Crypto Payments Woo - Bitcoin/FairCoin Gateway for WooCommerce

WordPress plugin Crypto Payments Woo - Bitcoin/FairCoin Gateway for WooCommerce scored 77% from 54 tests.

About plugin

  • Plugin page: crypto-payments-woo
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Jun 7, 2020
  • Latest release: Jun 25, 2020
  • Number of updates: 4
  • Update frequency: every 5.5 days
  • Top authors: idanneeman (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 522 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲1.03MB] [CPU: ▼131.35ms] Passed 4 tests

An overview of server-side resources used by Crypto Payments Woo - Bitcoin/FairCoin Gateway for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.9847.05 ▲11.32
Dashboard /wp-admin4.17 ▲1.1168.13 ▲20.06
Posts /wp-admin/edit.php4.23 ▲1.1166.42 ▲20.60
Add New Post /wp-admin/post-new.php6.45 ▲1.01104.39 ▼564.35
Media Library /wp-admin/upload.php4.03 ▲1.0342.35 ▲7.58
BTC Gateway Settings /wp-admin/admin.php?page=wcp-settings-btc4.0340.78
FAIR Gateway Settings /wp-admin/admin.php?page=wcp-settings-fair4.0351.06
General Settings /wp-admin/admin.php?page=wcp-settings4.0341.61

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 53 new files
Database: 2 new tables, 5 new options
New tables
New WordPress options

Browser metrics Passed 4 tests

Checking browser requirements for Crypto Payments Woo - Bitcoin/FairCoin Gateway for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,927 ▲34517.43 ▲1.528.19 ▼0.4850.78 ▼2.30
Dashboard /wp-admin3,206 ▲2758.12 ▲2.17173.02 ▲20.57141.08 ▲18.34
Posts /wp-admin/edit.php3,038 ▲3024.35 ▲1.6592.42 ▲24.48110.51 ▲12.52
Add New Post /wp-admin/post-new.php1,722 ▼1,98018.33 ▲3.14385.71 ▼82.26113.33 ▼2.54
Media Library /wp-admin/upload.php1,878 ▲684.88 ▼0.15124.57 ▼34.42143.42 ▲14.12
BTC Gateway Settings /wp-admin/admin.php?page=wcp-settings-btc1,3243.7070.8299.54
FAIR Gateway Settings /wp-admin/admin.php?page=wcp-settings-fair1,3243.8977.35114.49
General Settings /wp-admin/admin.php?page=wcp-settings1,3233.9074.52103.69

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 1 option in the database
    • WCP_api

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 15× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/crypto-payments-woo/wcp-admin.php
    • > /wp-content/plugins/crypto-payments-woo/wcp-woocommerce.php
    • > /wp-content/plugins/crypto-payments-woo/wcp-crypto-exchange-rate-apis.php
    • > /wp-content/plugins/crypto-payments-woo/wcp-include-all.php
    • > /wp-content/plugins/crypto-payments-woo/wcp-crypto-gateway-btc.php
    • > /wp-content/plugins/crypto-payments-woo/class-wp-osa.php
    • > /wp-content/plugins/crypto-payments-woo/__log.php
    • > /wp-content/plugins/crypto-payments-woo/wcp-utils.php
    • > /wp-content/plugins/crypto-payments-woo/wcp-crypto-blockchain-apis.php
    • > /wp-content/plugins/crypto-payments-woo/wcp-crypto-gateway-fair.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/crypto-payments-woo/wcp-checkout-template.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'CashAddr\\Exception\\Base32Exception' not found in wp-content/plugins/crypto-payments-woo/libs/cashaddr/Exception/InvalidChecksumException.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test


Plugin configuration 79% from 29 tests

readme.txt 75% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Requires at least: Invalid plugin version format
  • Tested up to: Invalid plugin version format
  • Requires php: Invalid plugin version format
  • Screenshots: No descriptions were found for these screenshots #6, #7 in crypto-payments-woo/assets to your readme.txt
You can take inspiration from this readme.txt

crypto-payments-woo/wcp-woocommerce.php 85% from 13 tests

The entry point to "Crypto Payments Woo - Bitcoin/FairCoin Gateway for WooCommerce" version 1.2 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("crypto-payments-woo.php" instead of "wcp-woocommerce.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 218 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected5,823 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PO File13537123

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity21.59
▷ Minimum class complexity1.00
▷ Maximum class complexity233.00
Average method complexity3.62
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
▷ Abstract classes617.65%
▷ Concrete classes2882.35%
▷ Final classes00.00%
▷ Static methods10636.81%
▷ Public methods24685.42%
▷ Protected methods3612.50%
▷ Private methods62.08%
▷ Named functions4097.56%
▷ Anonymous functions12.44%
▷ Global constants1372.22%
▷ Class constants527.78%
▷ Public constants5100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
16 PNG files occupy 1.05MB with 0.52MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/checkout-icons/fair/fair_logo.png3.02KB2.33KB▼ 22.77%
screenshots/screenshot-4.png165.39KB61.96KB▼ 62.54%
images/checkout-icons/btc/btc_logo.png6.96KB2.95KB▼ 57.60%
screenshots/banner-1544x500.png79.84KB34.02KB▼ 57.39%
screenshots/icon-128x128.png6.24KB3.15KB▼ 49.52%