78% bittube-woocommerce-gateway

Code Review | WooCommerce BitTube payment gateway

WordPress plugin WooCommerce BitTube payment gateway scored 78% from 54 tests.

About plugin

  • Plugin page: bittube-woocommer...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.3.2
  • WordPress version: 5.9.2
  • First release: Oct 11, 2018
  • Latest release: Aug 21, 2020
  • Number of updates: 25
  • Update frequency: every 27.2 days
  • Top authors: bittube (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,754 total downloads

Benchmarks

Plugin footprint 83% 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.02MB] [CPU: ▼295.90ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce BitTube payment gateway
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.0558.20 ▲6.92
Dashboard /wp-admin3.46 ▲0.0434.38 ▲0.81
Posts /wp-admin/edit.php3.69 ▲0.0437.36 ▲1.61
Add New Post /wp-admin/post-new.php6.93 ▼0.0593.65 ▼1,184.26
Media Library /wp-admin/upload.php3.34 ▲0.0423.27 ▼1.75

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 41 new files
Database: 3 new tables, no new options
New tables
wp_bittube_gateway_quotes_txids
wp_bittube_gateway_live_rates
wp_bittube_gateway_quotes

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce BitTube payment gateway
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,785 ▲3215.93 ▲0.286.53 ▼0.062.86 ▲0.19
Dashboard /wp-admin2,892 ▲316.01 ▼0.09117.11 ▼21.56153.52 ▼10.15
Posts /wp-admin/edit.php2,685 ▼03.23 ▼0.0163.33 ▼1.22138.16 ▼8.20
Add New Post /wp-admin/post-new.php1,661 ▲616.52 ▼3.83403.53 ▼58.97159.09 ▲0.74
Media Library /wp-admin/upload.php1,698 ▼05.50 ▼0.01136.24 ▼9.95184.55 ▼7.99

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie tables detected upon uninstall: 3 tables
    • wp_bittube_gateway_quotes_txids
    • wp_bittube_gateway_quotes
    • wp_bittube_gateway_live_rates

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/bittube-woocommerce-gateway/templates/bittube-gateway/admin/settings-page.php
    • > /wp-content/plugins/bittube-woocommerce-gateway/templates/bittube-gateway/customer/order-email-error-block.php
    • > /wp-content/plugins/bittube-woocommerce-gateway/templates/bittube-gateway/customer/order-error-page.php
  • 37× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/bittube-woocommerce-gateway/templates/bittube-gateway/admin/settings-page.php on line 1
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/bittube-woocommerce-gateway/include/admin/class-bittube-admin-payments-list.php on line 9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/bittube-woocommerce-gateway/templates/bittube-gateway/customer/order-email-block.php on line 9
    • > PHP Notice
      Undefined variable: ajax_url in wp-content/plugins/bittube-woocommerce-gateway/templates/bittube-gateway/customer/order-page.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'BitTube_Gateway' not found in wp-content/plugins/bittube-woocommerce-gateway/templates/bittube-gateway/admin/order-history-page.php:20
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/bittube-woocommerce-gateway/templates/bittube-gateway/admin/order-history-page.php on line 8
    • > PHP Notice
      Undefined variable: details in wp-content/plugins/bittube-woocommerce-gateway/templates/bittube-gateway/customer/order-email-block.php on line 1
    • > PHP Notice
      Undefined variable: method_title in wp-content/plugins/bittube-woocommerce-gateway/templates/bittube-gateway/customer/order-email-error-block.php on line 2
    • > PHP Notice
      Undefined variable: details in wp-content/plugins/bittube-woocommerce-gateway/templates/bittube-gateway/customer/order-email-block.php on line 9
    • > PHP Notice
      Undefined variable: method_title in wp-content/plugins/bittube-woocommerce-gateway/templates/bittube-gateway/customer/order-page2.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: payment, cryptocurrency, accept tube, bittube, woocommerce...

bittube-woocommerce-gateway/bittube-woocommerce-gateway.php Passed 13 tests

"WooCommerce BitTube payment gateway" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
47 characters long description:
Extends WooCommerce by adding a BitTube Gateway

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin4,143 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP195034002,764
JavaScript52243161,191
CSS1110111
Markdown125064
HTML10013

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity34.44
▷ Minimum class complexity5.00
▷ Maximum class complexity93.00
Average method complexity3.18
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods131
▷ Static methods2619.85%
▷ Public methods10479.39%
▷ Protected methods1612.21%
▷ Private methods118.40%
Functions22
▷ Named functions2195.45%
▷ Anonymous functions14.55%
Constants23
▷ Global constants1252.17%
▷ Class constants1147.83%
▷ Public constants11100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
10 PNG files occupy 0.49MB with 0.38MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-772x250.png40.35KB19.74KB▼ 51.08%
assets/icon-256x256.fw.png65.08KB4.12KB▼ 93.67%
assets/icon-128x128.png65.84KB4.88KB▼ 92.58%
assets/icon-128x128.fw.png65.84KB4.88KB▼ 92.58%
templates/bittube-gateway/customer/bittube-accepted-here.png3.97KB1.88KB▼ 52.67%