10% blockonomics-bitcoin-payments

Code Review | Wordpress Bitcoin Payments - Blockonomics

WordPress plugin Wordpress Bitcoin Payments - Blockonomics scored10%from 54 tests.

About plugin

  • Plugin page: blockonomics-bitc...
  • Plugin version: 3.6.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3.1
  • WordPress version: 6.3.1
  • First release: Mar 9, 2017
  • Latest release: Nov 8, 2023
  • Number of updates: 180
  • Update frequency: every 13.5 days
  • Top authors: blockonomics (100%)

Code review

54 tests

User reviews

33 reviews

Install metrics

4,000+ active /156,278 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • The plugin cannot be installed
    • > User error in wp-content/plugins/blockonomics-bitcoin-payments/blockonomics-woocommerce.php+619
    Wordpress Bitcoin Payments - Blockonomics requires WooCommerce plugin to be installed and active.

Server metrics [RAM: ▲0.00MB] [CPU: ▼9.01ms] Passed 4 tests

This is a short check of server-side resources used by Wordpress Bitcoin Payments - Blockonomics
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.36 ▼11.22
Dashboard /wp-admin3.30 ▲0.0048.18 ▼5.84
Posts /wp-admin/edit.php3.36 ▲0.0049.88 ▼1.55
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.00 ▼17.44
Media Library /wp-admin/upload.php3.23 ▲0.0034.19 ▼0.67

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 32 new files
Database: 1 new table, 7 new options
New tables
wp_blockonomics_payments
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
blockonomics_db_version
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Wordpress Bitcoin Payments - Blockonomics
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.35 ▲0.031.80 ▼0.2344.67 ▼9.74
Dashboard /wp-admin2,198 ▲245.61 ▼0.0289.56 ▼11.6239.86 ▼3.73
Posts /wp-admin/edit.php2,100 ▼01.94 ▼0.0439.49 ▼1.7337.15 ▲2.28
Add New Post /wp-admin/post-new.php1,526 ▼123.06 ▼0.12702.73 ▲8.6957.00 ▼9.28
Media Library /wp-admin/upload.php1,400 ▲34.21 ▲0.0198.96 ▲0.4640.27 ▼2.77

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

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
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/blockonomics-bitcoin-payments/templates/blockonomics_no_crypto_selected.php
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/blockonomics-bitcoin-payments/templates/blockonomics_nojs_checkout.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Blockonomics' not found in wp-content/plugins/blockonomics-bitcoin-payments/templates/blockonomics_crypto_options.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/blockonomics-bitcoin-payments/templates/blockonomics_nojs_payment_confirmation.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/blockonomics-bitcoin-payments/php/WC_Gateway_Blockonomics.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/blockonomics-bitcoin-payments/templates/blockonomics_error.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/blockonomics-bitcoin-payments/templates/blockonomics_nojs_crypto_options.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/blockonomics-bitcoin-payments/templates/blockonomics_checkout.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: accept bitcoin, bitcoin wordpress plugin, bitcoin woocommerce, bitcoin, bitcoin payments

blockonomics-bitcoin-payments/blockonomics-woocommerce.php 92% from 13 tests

"Wordpress Bitcoin Payments - Blockonomics" version 3.6.9's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("blockonomics-bitcoin-payments.php" instead of "blockonomics-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected6,544 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP121,0028325,241
JavaScript10130377813
CSS212112490

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity36.30
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity3.97
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes00.00%
Methods238
▷ Static methods6928.99%
▷ Public methods20887.39%
▷ Protected methods239.66%
▷ Private methods72.94%
Functions35
▷ Named functions3394.29%
▷ Anonymous functions25.71%
Constants45
▷ Global constants3373.33%
▷ Class constants1226.67%
▷ Public constants12100.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
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
blockonomics.png6.34KB3.88KB▼ 38.87%
img/bitcoin-icon.png2.11KB1.30KB▼ 38.43%
img/bch-icon.png1.46KB1.28KB▼ 12.40%
img/bitcoin-bch-icon.png1.86KB1.58KB▼ 14.87%