10% bitpay-checkout-for-easy-digital-downloads

Code Review | BitPay Checkout for Easy Digital Downloads

WordPress plugin BitPay Checkout for Easy Digital Downloads scored10%from 54 tests.

About plugin

  • Plugin page: bitpay-checkout-f...
  • Plugin version: 2.0.0
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-6.2.2
  • WordPress version: 6.3.1
  • First release: Apr 19, 2019
  • Latest release: Aug 16, 2023
  • Number of updates: 16
  • Update frequency: every 98.7 days
  • Top authors: bitpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,691 total downloads

Benchmarks

Plugin footprint 58% 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
Please fix the following installer errors
  • Install procedure had errors
    • > User error in wp-content/plugins/bitpay-checkout-for-easy-digital-downloads/vendor/composer/platform_check.php+24
    Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.16.

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

A check of server-side resources used by BitPay Checkout for Easy Digital Downloads
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.48 ▼3.33
Dashboard /wp-admin3.31 ▲0.0045.93 ▼6.61
Posts /wp-admin/edit.php3.36 ▲0.0051.24 ▼0.56
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.21 ▼9.94
Media Library /wp-admin/upload.php3.23 ▲0.0040.34 ▼0.90

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 2,552 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for BitPay Checkout for Easy Digital Downloads
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.25 ▼0.112.05 ▲0.0544.03 ▲2.35
Dashboard /wp-admin2,189 ▲95.51 ▼0.1385.27 ▼10.7541.14 ▲3.76
Posts /wp-admin/edit.php2,100 ▼32.02 ▲0.0333.74 ▼5.1637.70 ▲2.20
Add New Post /wp-admin/post-new.php1,528 ▲223.31 ▲0.22693.31 ▲2.7463.05 ▼0.29
Media Library /wp-admin/upload.php1,400 ▼04.26 ▲0.0196.04 ▼18.8642.65 ▼6.92

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

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 fix the following items
  • 925× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Sniffs\\AbstractScopeSniff' not found in wp-content/plugins/bitpay-checkout-for-easy-digital-downloads/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'BitPaySDK\\Exceptions\\BitPayException' not found in wp-content/plugins/bitpay-checkout-for-easy-digital-downloads/vendor/bitpay/sdk/src/BitPaySDK/Exceptions/SettlementException.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/bitpay-checkout-for-easy-digital-downloads/vendor/bitpay/sdk/test/unit/BitPaySDK/Model/Invoice/ItemizedDetailsTest.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Handler\\CurlFactoryInterface' not found in wp-content/plugins/bitpay-checkout-for-easy-digital-downloads/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/bitpay-checkout-for-easy-digital-downloads/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/bitpay-checkout-for-easy-digital-downloads/vendor/squizlabs/php_codesniffer/tests/Core/Autoloader/DetermineLoadedClassTest.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Standards\\AbstractSniffUnitTest' not found in wp-content/plugins/bitpay-checkout-for-easy-digital-downloads/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'BitPaySDK\\Exceptions\\RateException' not found in wp-content/plugins/bitpay-checkout-for-easy-digital-downloads/vendor/bitpay/sdk/src/BitPaySDK/Exceptions/RateQueryException.php:13
    • > PHP Fatal error
      Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.16. in wp-content/plugins/bitpay-checkout-for-easy-digital-downloads/vendor/composer/platform_check.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Standards\\AbstractSniffUnitTest' not found in wp-content/plugins/bitpay-checkout-for-easy-digital-downloads/vendor/squizlabs/php_codesniffer/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: bitpay, payments, payment gateway, bitcoin, cryptocurrency...

bitpay-checkout-for-easy-digital-downloads/index.php 77% from 13 tests

"BitPay Checkout for Easy Digital Downloads" version 2.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 178 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("bitpay-checkout-for-easy-digital-downloads.php" instead of "index.php")
  • Git Repository: Please remove the Git repository from this plugin

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Almost there! Just fix the following issues
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/bitpay-checkout-for-easy-digital-downloads/vendor/squizlabs/php_codesniffer/bin/phpcbf.bat
      • wp-content/plugins/bitpay-checkout-for-easy-digital-downloads/vendor/squizlabs/php_codesniffer/bin/phpcs.bat
296,287 lines of code in 2,110 files:
LanguageFilesBlank linesComment linesLines of code
HTML24138,5770131,408
PHP1,30029,76759,242123,432
JavaScript6079089911,120
XML2385669358,182
Markdown332,58407,558
Pascal1303,2317,1186,576
JSON59005,541
CSS374802672,123
YAML8268198
XSD160130
DOS Batch241010
reStructuredText1409

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 478)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity14.41
▷ Minimum class complexity1.00
▷ Maximum class complexity724.00
Average method complexity3.76
▷ Minimum method complexity1.00
▷ Maximum method complexity478.00
Code structure
Namespaces235
Interfaces42
Traits9
Classes1,087
▷ Abstract classes191.75%
▷ Concrete classes1,06898.25%
▷ Final classes19217.98%
Methods5,478
▷ Static methods4858.85%
▷ Public methods4,77587.17%
▷ Protected methods2624.78%
▷ Private methods4418.05%
Functions149
▷ Named functions3523.49%
▷ Anonymous functions11476.51%
Constants542
▷ Global constants11521.22%
▷ Class constants42778.78%
▷ Public constants40494.61%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
16 PNG files occupy 4.37MB with 3.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png591.93KB134.17KB▼ 77.33%
assets/screenshot-3.png331.45KB93.56KB▼ 71.77%
assets/screenshot-12.png173.53KB50.77KB▼ 70.74%
assets/banner-772x250.png159.55KB47.01KB▼ 70.54%
assets/screenshot-4.png324.29KB102.14KB▼ 68.50%