83% blockbee-cryptocurrency-payment-gateway

Code Review | BlockBee Cryptocurrency Payment Gateway

WordPress plugin BlockBee Cryptocurrency Payment Gateway scored83%from 54 tests.

About plugin

  • Plugin page: blockbee-cryptocu...
  • Plugin version: 1.0.18
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5-6.3
  • WordPress version: 6.3.1
  • First release: Oct 18, 2022
  • Latest release: Aug 28, 2023
  • Number of updates: 21
  • Update frequency: every 15.1 days
  • Top authors: blockbee (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

70+ active /1,655 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.07ms] Passed 4 tests

An overview of server-side resources used by BlockBee Cryptocurrency Payment Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0339.95 ▼1.63
Dashboard /wp-admin3.33 ▲0.0350.30 ▼6.94
Posts /wp-admin/edit.php3.38 ▲0.0250.88 ▲4.31
Add New Post /wp-admin/post-new.php5.91 ▲0.0284.71 ▼11.70
Media Library /wp-admin/upload.php3.26 ▲0.0233.16 ▼4.01

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by BlockBee Cryptocurrency Payment Gateway
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3514.34 ▼0.021.77 ▲0.1244.63 ▼0.77
Dashboard /wp-admin2,202 ▲255.58 ▲0.0386.43 ▼12.4439.51 ▼6.99
Posts /wp-admin/edit.php2,107 ▲71.99 ▼0.0441.29 ▲2.1938.21 ▲1.17
Add New Post /wp-admin/post-new.php1,535 ▲923.15 ▲0.16718.62 ▲50.9765.01 ▲14.01
Media Library /wp-admin/upload.php1,407 ▲104.20 ▼0.03108.18 ▼10.8046.00 ▼1.67

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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 trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/blockbee-cryptocurrency-payment-gateway/controllers/BlockBee.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/blockbee-cryptocurrency-payment-gateway/define.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/blockbee-cryptocurrency-payment-gateway/define.php:4

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
  • Requires at least: Version not formatted correctly
The official readme.txt is a good inspiration

blockbee-cryptocurrency-payment-gateway/BlockBee.php 85% from 13 tests

This is the main PHP file of "BlockBee Cryptocurrency Payment Gateway" version 1.0.18, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Requires at least: Required version number should only contain digits separated by dots (ex. "7.0" instead of "5")
  • Main file name: The principal plugin file should be the same as the plugin slug ("blockbee-cryptocurrency-payment-gateway.php" instead of "BlockBee.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 plugin3,907 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP5301371,534
PO File44444741,473
CSS1920509
JavaScript1460178
Markdown1620151
SVG30062

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity90.50
▷ Minimum class complexity44.00
▷ Maximum class complexity137.00
Average method complexity5.59
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods39
▷ Static methods923.08%
▷ Public methods3692.31%
▷ Protected methods00.00%
▷ Private methods37.69%
Functions12
▷ Named functions1083.33%
▷ Anonymous functions216.67%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
static/files/blockbee_logo.png12.48KB6.40KB▼ 48.73%