10% bitcoin-payments-for-wp-woocommerce

Code Review | Bitcoin Payments for WP WooCommerce

WordPress plugin Bitcoin Payments for WP WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: bitcoin-payments-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Dec 19, 2014
  • Latest release: Mar 3, 2015
  • Number of updates: 17
  • Update frequency: every 4.9 days
  • Top authors: webplanex (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /7,476 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
    • > Warning in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/bitcoinpayment.php+24
    Use of undefined constant page - assumed 'page' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.90MB] [CPU: ▼52.95ms] Passed 4 tests

An overview of server-side resources used by Bitcoin Payments for WP WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.385.68 ▼38.92
Dashboard /wp-admin2.11 ▼1.208.41 ▼38.56
Posts /wp-admin/edit.php2.11 ▼1.256.74 ▼41.54
Add New Post /wp-admin/post-new.php2.11 ▼3.786.40 ▼92.79
Media Library /wp-admin/upload.php2.11 ▼1.126.68 ▼26.92
Receive Transaction /wp-admin/admin.php?page=receivetransaction2.118.54
Send Transaction /wp-admin/admin.php?page=sendtransaction2.117.07
Withdraw /wp-admin/admin.php?page=withdraw2.117.19
Bitcoin Order /wp-admin/admin.php?page=manageorder2.116.69
Bitcoin Payment /wp-admin/admin.php?page=managebitcoin2.117.71

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 11 new options
New WordPress options
widget_theysaidso_widget
btc_bitcoinaddress
theysaidso_admin_options
btc_apipath
can_compress_scripts
btc_username
db_upgraded
widget_recent-posts
btc_password
btc_domainname
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Bitcoin Payments for WP WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,970 ▲22413.58 ▼0.807.91 ▲6.1539.35 ▼5.95
Dashboard /wp-admin2,258 ▲734.92 ▼1.04109.84 ▲11.0978.21 ▲37.47
Posts /wp-admin/edit.php2,143 ▲542.19 ▲0.1836.07 ▲2.2933.06 ▼4.34
Add New Post /wp-admin/post-new.php1,559 ▲3017.57 ▼0.77722.50 ▲113.6939.37 ▼23.52
Media Library /wp-admin/upload.php1,440 ▲554.25 ▲0.0395.86 ▼0.0969.65 ▲26.40
Receive Transaction /wp-admin/admin.php?page=receivetransaction8912.0724.3725.28
Send Transaction /wp-admin/admin.php?page=sendtransaction8882.0426.1624.73
Withdraw /wp-admin/admin.php?page=withdraw8701.7225.2424.57
Bitcoin Order /wp-admin/admin.php?page=manageorder8881.7126.4526.73
Bitcoin Payment /wp-admin/admin.php?page=managebitcoin8671.7025.3325.86

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mainfunction handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=managebitcoin
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mainfunction handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=managebitcoin
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the function handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 44 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=managebitcoin
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=manageorder
    • > Notice in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/manageorder.php+63
    Undefined index: s
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=manageorder
    • > Notice in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/manageorder.php+29
    Trying to access array offset on value of type bool
  • 21 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=managebitcoin
    • > Notice in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/adduserdetail.php+57
    Trying to access array offset on value of type null
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=manageorder
    • > Notice in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/manageorder.php+48
    Undefined variable: success
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=manageorder
    • > Notice in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/manageorder.php+53
    Undefined variable: error
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=managebitcoin
    • > Notice in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/adduserdetail.php+57
    Undefined variable: returndata
    • > GET request to /wp-admin/admin.php?page=managebitcoin
    • > Notice in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/adduserdetail.php+80
    Undefined index: apipath
    • > GET request to /wp-admin/admin.php?page=managebitcoin
    • > Notice in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/adduserdetail.php+88
    Undefined index: domainname
    • > GET request to /wp-admin/admin.php?page=managebitcoin
    • > Notice in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/adduserdetail.php+96
    Undefined index: username
    • > GET request to /wp-admin/admin.php?page=managebitcoin
    • > Notice in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/adduserdetail.php+106
    Undefined index: password

SRP 50% 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
  • 12× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/receivetransaction.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/bitcoinpayment.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/bitcoin_payment.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/adduserdetail.php:68
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/manageorder.php:17
    • > PHP Notice
      Undefined variable: returndata in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/adduserdetail.php on line 57
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Order' not found in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/getpaymentbutton.php:10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/adduserdetail.php on line 57
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/sendtransaction.php:17
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/bitcoin-payments-for-wp-woocommerce/adduserdetail.php on line 53

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Donate link: Invalid URI found ("")
You can look at the official readme.txt

bitcoin-payments-for-wp-woocommerce/bitcoinpayment.php 92% from 13 tests

The main PHP script in "Bitcoin Payments for WP WooCommerce" version 1.0 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("bitcoin-payments-for-wp-woocommerce.php" instead of "bitcoinpayment.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
There were no executable files found in this plugin1,038 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP11264292979
JavaScript22159

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity4.67
▷ Minimum class complexity3.00
▷ Maximum class complexity6.00
Average method complexity1.31
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods35
▷ Static methods00.00%
▷ Public methods3497.14%
▷ Protected methods00.00%
▷ Private methods12.86%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants990.00%
▷ Class constants110.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/bitcoin_wp.png3.59KB1.01KB▼ 71.76%