72% decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce

Code Review | Decentralized Bitcoin CryptoDEC Payment Gateway for WooCommerce

WordPress plugin Decentralized Bitcoin CryptoDEC Payment Gateway for WooCommerce scored72%from 54 tests.

About plugin

  • Plugin page: decentralized-bit...
  • Plugin version: 2.0.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8
  • WordPress version: 6.3.1
  • First release: Jan 30, 2021
  • Latest release: Aug 30, 2021
  • Number of updates: 16
  • Update frequency: every 13.3 days
  • Top authors: infinitools (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /651 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
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Decentralized Bitcoin CryptoDEC Payment Gateway for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.25 ▼6.28
Dashboard /wp-admin3.31 ▲0.0051.02 ▼8.57
Posts /wp-admin/edit.php3.36 ▲0.0049.39 ▼0.07
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.41 ▼18.44
Media Library /wp-admin/upload.php3.23 ▲0.0040.69 ▲6.59
Reset Settings /wp-admin/admin.php?page=itls-cryptodecpaymentgateway-reset-options3.0023.22
General Settings /wp-admin/admin.php?page=itls-cryptodecpaymentgateway-options-page3.0025.69

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 622 new files
Database: 1 new table, 7 new options
New tables
wp_cryptodec_payments
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
itls_cryptodecpaymentgateway4
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Decentralized Bitcoin CryptoDEC Payment Gateway for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.20 ▼1.091.67 ▼0.7242.27 ▲0.43
Dashboard /wp-admin2,203 ▲125.79 ▼0.15141.29 ▲35.3149.94 ▲7.23
Posts /wp-admin/edit.php2,086 ▼32.00 ▲0.0137.50 ▼15.6634.50 ▼0.43
Add New Post /wp-admin/post-new.php1,533 ▲1923.64 ▲6.18648.46 ▼34.2278.75 ▲7.99
Media Library /wp-admin/upload.php1,388 ▼04.28 ▲0.07100.09 ▼11.5144.76 ▼0.65
Reset Settings /wp-admin/admin.php?page=itls-cryptodecpaymentgateway-reset-options280.440.095.85
General Settings /wp-admin/admin.php?page=itls-cryptodecpaymentgateway-options-page280.440.084.26

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • itls_cryptodecpaymentgateway4

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=itls-cryptodecpaymentgateway-options-page
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+204
    Undefined offset: 0
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=itls-cryptodecpaymentgateway-options-page
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+205
    Trying to get property 'guid' of non-object
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=itls-cryptodecpaymentgateway-options-page
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+221
    Trying to get property 'ID' of non-object
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=itls-cryptodecpaymentgateway-options-page
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+222
    Trying to get property 'post_title' of non-object

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 298× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/lib/btclib/pleonasm/merkle-tree/tests/Pleo/Merkle/FixedSizeTreeTest.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'FG\\ASN1\\Universal\\Sequence' not found in wp-content/plugins/decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/lib/btclib/fgrosse/phpasn1/lib/ASN1/Universal/Set.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'BitWasp\\Bitcoin\etwork\etwork' not found in wp-content/plugins/decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/lib/btclib/bitwasp/bitcoin/src/Network/Networks/Viacoin.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'FG\\ASN1\\Universal\\Sequence' not found in wp-content/plugins/decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/lib/btclib/fgrosse/phpasn1/lib/ASN1/Composite/AttributeTypeAndValue.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'BitWasp\\Buffertools\\Types\\AbstractType' not found in wp-content/plugins/decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/lib/btclib/bitwasp/buffertools/src/Buffertools/Types/Vector.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'BitWasp\\Buffertools\\Types\\AbstractSignedInt' not found in wp-content/plugins/decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/lib/btclib/bitwasp/buffertools/src/Buffertools/Types/Int256.php:7
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/lib/qrlib/chillerlan/php-qrcode/examples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/lib/qrlib/chillerlan/php-qrcode/examples/imageWithLogo.php on line 15
    • > PHP Fatal error
      Uncaught Error: Interface 'BitWasp\\Buffertools\\Types\\TypeInterface' not found in wp-content/plugins/decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/lib/btclib/bitwasp/buffertools/src/Buffertools/Types/AbstractType.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'FG\\ASN1\\ASNObject' not found in wp-content/plugins/decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/lib/btclib/fgrosse/phpasn1/lib/ASN1/Universal/NullObject.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'chillerlan\\QRCodeTest\\Output\\QROutputTestAbstract' not found in wp-content/plugins/decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/lib/qrlib/chillerlan/php-qrcode/tests/Output/QRFpdfTest.php:24

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=itls-cryptodecpaymentgateway-reset-options
    • > Network (severe)
    wp-admin/admin.php?page=itls-cryptodecpaymentgateway-reset-options - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=itls-cryptodecpaymentgateway-options-page
    • > Network (severe)
    wp-admin/admin.php?page=itls-cryptodecpaymentgateway-options-page - Failed to load resource: the server responded with a status of 403 (Forbidden)

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
9 plugin tags: bitcoin payment, crypto, woocommerce gateway, bitcoin, payment gateway...

decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/cryptodec-payment-gateway.php 92% from 13 tests

The principal PHP file in "Decentralized Bitcoin CryptoDEC Payment Gateway for WooCommerce" v. 2.0.2 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce.php" instead of "cryptodec-payment-gateway.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin31,619 lines of code in 578 files:
LanguageFilesBlank linesComment linesLines of code
PHP5318,02920,31728,978
JSON910980
Markdown112350659
YAML128315366
XML830234
CSS2401203
HTML1260137
make114041
Bourne Shell22011
Dockerfile15210

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 204)
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity6.67
▷ Minimum class complexity1.00
▷ Maximum class complexity266.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity204.00
Code structure
Namespaces124
Interfaces70
Traits4
Classes424
▷ Abstract classes286.60%
▷ Concrete classes39693.40%
▷ Final classes164.04%
Methods2,600
▷ Static methods26210.08%
▷ Public methods2,36190.81%
▷ Protected methods1465.62%
▷ Private methods933.58%
Functions116
▷ Named functions5950.86%
▷ Anonymous functions5749.14%
Constants394
▷ Global constants51.27%
▷ Class constants38998.73%
▷ Public constants38298.20%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
8 PNG files occupy 0.17MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/qrlib/chillerlan/php-qrcode/examples/example_image.png2.23KB1.09KB▼ 50.94%
assets/images/logox.png111.44KB41.74KB▼ 62.54%
assets/images/logo-gw.png14.94KB3.71KB▼ 75.19%
assets/images/btc-logo-3.png9.26KB1.13KB▼ 87.77%
assets/images/btc-logo-2.png14.94KB3.71KB▼ 75.19%