83% bitnob

Code Review | Bitnob - Accept Bitcoin Payments (On-chain & Lightning)

WordPress plugin Bitnob - Accept Bitcoin Payments (On-chain & Lightning) scored83%from 54 tests.

About plugin

  • Plugin page: bitnob
  • Plugin version: 1.1.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 23, 2021
  • Latest release: Nov 30, 2023
  • Number of updates: 2
  • Update frequency: every 151.5 days
  • Top authors: bitnobmail (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /487 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼5.12ms] Passed 4 tests

An overview of server-side resources used by Bitnob - Accept Bitcoin Payments (On-chain & Lightning)
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0533.98 ▼5.71
Dashboard /wp-admin3.36 ▲0.0552.16 ▲2.90
Posts /wp-admin/edit.php3.41 ▲0.0550.06 ▼1.41
Add New Post /wp-admin/post-new.php5.94 ▲0.0586.52 ▼11.67
Media Library /wp-admin/upload.php3.28 ▲0.0534.40 ▼1.70

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Bitnob - Accept Bitcoin Payments (On-chain & Lightning)
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.72 ▲0.371.76 ▲0.1336.97 ▼7.02
Dashboard /wp-admin2,195 ▲185.62 ▲0.0693.99 ▼6.0645.59 ▼0.84
Posts /wp-admin/edit.php2,100 ▲31.95 ▼0.0739.16 ▲3.3436.76 ▲1.67
Add New Post /wp-admin/post-new.php1,537 ▲1125.23 ▲2.06622.87 ▼4.1274.39 ▲20.32
Media Library /wp-admin/upload.php1,403 ▲34.15 ▼0.1296.30 ▲0.3841.70 ▼1.42

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% 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 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
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/bitnob/bitnob-payments.php:37

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 on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Please add an image for screenshot #2 (Eanble the plugin from WooCommerce Payments settings)
You can take inspiration from this readme.txt

bitnob/bitnob-payments.php 77% from 13 tests

The entry point to "Bitnob - Accept Bitcoin Payments (On-chain & Lightning)" version 1.1.4 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("bitnob.php" instead of "bitnob-payments.php")
  • Domain Path: The domain path folder does not exist ("/languages")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin411 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP141230241
JavaScript2220157
CSS10013

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/logo.png8.04KB4.55KB▼ 43.42%
assets/img/logo.png16.63KB7.93KB▼ 52.34%
assets/img/logo-old.png27.57KB10.30KB▼ 62.63%