73% btcpaywall

Code Review | BTCPayWall

WordPress plugin BTCPayWall scored73%from 54 tests.

About plugin

  • Plugin page: btcpaywall
  • Plugin version: 1.1.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.2
  • WordPress version: 6.3.1
  • First release: Dec 23, 2021
  • Latest release: Oct 5, 2023
  • Number of updates: 49
  • Update frequency: every 13.3 days
  • Top authors: coincharge (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /6,118 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲2.98MB] [CPU: ▲14.39ms] Passed 4 tests

A check of server-side resources used by BTCPayWall
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /6.20 ▲2.7457.94 ▲18.62
Dashboard /wp-admin6.37 ▲3.0774.55 ▲22.45
Posts /wp-admin/edit.php6.42 ▲3.0767.25 ▲16.26
Add New Post /wp-admin/post-new.php9.03 ▲3.15104.43 ▲0.24
Media Library /wp-admin/upload.php6.27 ▲3.0461.70 ▲27.00
Download Store /wp-admin/admin.php?page=btcpw_download_store6.2956.47
Pay-per -> All templates /wp-admin/admin.php?page=btcpw_pay_per_shortcode_list6.2858.76
Download Store -> All Products /wp-admin/edit.php?post_type=digital_download6.3461.24
Pay-per -> Add template /wp-admin/admin.php?page=btcpw_pay_per_shortcode_generator6.2755.99
Settings /wp-admin/admin.php?page=btcpw_general_settings6.3055.29
Donation -> All Forms /wp-admin/edit.php?post_type=btcpw_donation6.3452.10
Donation -> Add Form /wp-admin/post-new.php?post_type=btcpw_donation6.40170.87
Pay-per-shortcode /wp-admin/admin.php?page=btcpw_pay_per_shortcode6.4157.89
Download Store -> Add Product /wp-admin/post-new.php?post_type=digital_download6.4374.03
Payments /wp-admin/admin.php?page=btcpw_payments6.3059.76

Server storage [IO: ▲3.99MB] [DB: ▲0.09MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 161 new files
Database: 6 new tables, 11 new options
New tables
wp_btcpaywall_tippers
wp_btcpaywall_pay_per_shortcodes
wp_btcpaywall_forms
wp_btcpaywall_payments
wp_btcpaywall_tippings
wp_btcpaywall_customers
New WordPress options
widget_tipping-box
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
btcpw_success_page
db_upgraded
widget_recent-posts
widget_tipping-banner-high
widget_tipping-banner-wide
widget_recent-comments
...

Browser metrics Passed 4 tests

Checking browser requirements for BTCPayWall
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,170 ▲38415.64 ▲1.2312.88 ▲10.8943.60 ▲4.24
Dashboard /wp-admin2,419 ▲2456.43 ▲0.76113.05 ▲26.0447.56 ▲1.58
Posts /wp-admin/edit.php2,347 ▲2473.74 ▲1.7355.89 ▲18.4531.98 ▼10.62
Add New Post /wp-admin/post-new.php6,440 ▲4,90629.24 ▲6.28916.89 ▲252.2037.62 ▼12.83
Media Library /wp-admin/upload.php1,484 ▲814.35 ▲0.0184.03 ▼19.2748.19 ▲4.21
Download Store /wp-admin/admin.php?page=btcpw_download_store1,4323.4958.0245.46
Pay-per -> All templates /wp-admin/admin.php?page=btcpw_pay_per_shortcode_list1,2343.3641.0227.62
Download Store -> All Products /wp-admin/edit.php?post_type=digital_download1,3553.7947.1830.40
Pay-per -> Add template /wp-admin/admin.php?page=btcpw_pay_per_shortcode_generator1,0973.3239.2127.12
Settings /wp-admin/admin.php?page=btcpw_general_settings1,5193.4042.5231.45
Donation -> All Forms /wp-admin/edit.php?post_type=btcpw_donation1,3213.5647.3830.17
Donation -> Add Form /wp-admin/post-new.php?post_type=btcpw_donation3,8195.76137.66107.05
Pay-per-shortcode /wp-admin/admin.php?page=btcpw_pay_per_shortcode2,4985.1293.0637.08
Download Store -> Add Product /wp-admin/post-new.php?post_type=digital_download3,1949.36204.3587.31
Payments /wp-admin/admin.php?page=btcpw_payments1,1953.3341.0027.61

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie tables detected upon uninstall: 6 tables
    • wp_btcpaywall_tippers
    • wp_btcpaywall_customers
    • wp_btcpaywall_payments
    • wp_btcpaywall_forms
    • wp_btcpaywall_pay_per_shortcodes
    • wp_btcpaywall_tippings
  • Zombie WordPress options detected upon uninstall: 11 options
    • can_compress_scripts
    • btcpw_checkout_page
    • widget_tipping-banner-wide
    • widget_recent-comments
    • widget_tipping-box
    • db_upgraded
    • widget_tipping-banner-high
    • theysaidso_admin_options
    • btcpw_success_page
    • widget_theysaidso_widget
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'BTCPayWall_Payment' not found in wp-content/plugins/btcpaywall/templates/emails/email-customer.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'BTCPayWall_Payment' not found in wp-content/plugins/btcpaywall/templates/emails/email-notify-admin.php:14

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 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

btcpaywall/btcpaywall.php 85% from 13 tests

"BTCPayWall" version 1.1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Domain Path: The domain path should use only dashes and lowercase characters ("languages")
  • Domain Path: Please prefix the domain path with a forward slash character ("/languages")

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
Success! There were no dangerous files found in this plugin78,762 lines of code in 148 files:
LanguageFilesBlank linesComment linesLines of code
JSON20035,349
PHP1032,6362,41623,026
JavaScript342969017,372
CSS2369412,176
SVG500658
Bourne Shell12311147
Markdown118034

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity19.09
▷ Minimum class complexity1.00
▷ Maximum class complexity152.00
Average method complexity3.37
▷ Minimum method complexity1.00
▷ Maximum method complexity75.00
Code structure
Namespaces0
Interfaces0
Traits1
Classes44
▷ Abstract classes24.55%
▷ Concrete classes4295.45%
▷ Final classes12.38%
Methods345
▷ Static methods102.90%
▷ Public methods28482.32%
▷ Protected methods4312.46%
▷ Private methods185.22%
Functions158
▷ Named functions15396.84%
▷ Anonymous functions53.16%
Constants7
▷ Global constants457.14%
▷ Class constants342.86%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
7 PNG files occupy 0.22MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/dist/img/preview.png20.39KB11.72KB▼ 42.50%
assets/dist/img/Tipping-banner-wide.png40.15KB16.77KB▼ 58.22%
assets/src/img/BTCPayWall_logo.png25.32KB9.41KB▼ 62.83%
assets/dist/img/BTCPayWall_logo.png25.32KB9.41KB▼ 62.83%
assets/dist/img/Tipping-banner-high.png21.00KB7.02KB▼ 66.56%