83% commerce-coinbase-for-woocommerce

Code Review | Coinbase Commerce - Crypto Gateway for WooCommerce

WordPress plugin Coinbase Commerce - Crypto Gateway for WooCommerce scored 83% from 54 tests.

About plugin

  • Plugin page: commerce-coinbase...
  • Plugin version: 1.6.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3
  • WordPress version: 6.3.1
  • First release: Mar 2, 2021
  • Latest release: Aug 18, 2023
  • Number of updates: 84
  • Update frequency: every 10.7 days
  • Top authors: smusman98 (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

2,000+ active / 33,051 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.54MB] [CPU: ▼3.16ms] Passed 4 tests

Server-side resources used by Coinbase Commerce - Crypto Gateway for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.05 ▲0.5938.79 ▼0.68
Dashboard /wp-admin3.89 ▲0.5948.92 ▲1.16
Posts /wp-admin/edit.php3.94 ▲0.5947.35 ▲4.21
Add New Post /wp-admin/post-new.php6.44 ▲0.5584.13 ▼16.26
Media Library /wp-admin/upload.php3.66 ▲0.4340.13 ▲3.13
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius4.0037.60
Coinbase Commerce For WooCommerce /wp-admin/admin.php?page=coinbase-commerce-for-woocommerce3.8941.53

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Coinbase Commerce - Crypto Gateway for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲9813.27 ▼0.951.52 ▼0.1031.88 ▼13.64
Dashboard /wp-admin2,239 ▲515.80 ▲0.9695.68 ▼3.8038.13 ▼3.92
Posts /wp-admin/edit.php2,122 ▲302.03 ▲0.0435.09 ▼1.0636.37 ▲4.02
Add New Post /wp-admin/post-new.php1,534 ▼023.57 ▲0.51659.85 ▲10.5054.52 ▼4.10
Media Library /wp-admin/upload.php1,424 ▲364.24 ▲0.1194.94 ▼6.9544.85 ▼1.85
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0711.7724.1726.83
Coinbase Commerce For WooCommerce /wp-admin/admin.php?page=coinbase-commerce-for-woocommerce9821.7927.4556.19

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • fs_accounts
    • db_upgraded
    • widget_theysaidso_widget
    • fs_active_plugins
    • fs_debug_mode

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/commerce-coinbase-for-woocommerce/includes/webhook.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
  • Screenshots: No descriptions were found for these screenshots #1, #10, #2, #3, #4, #5, #6, #7, #8, #9 in commerce-coinbase-for-woocommerce/assets to your readme.txt
The official readme.txt is a good inspiration

commerce-coinbase-for-woocommerce/coinbase-gateway-for-woocommerce.php 92% from 13 tests

The main PHP script in "Coinbase Commerce - Crypto Gateway for WooCommerce" version 1.6.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("commerce-coinbase-for-woocommerce.php" instead of "coinbase-gateway-for-woocommerce.php")

Code Analysis 97% from 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 detected70,494 lines of code in 149 files:
LanguageFilesBlank linesComment linesLines of code
JSON20036,539
PHP1248,05617,34033,319
JavaScript75671309
Markdown2960293
Bourne Shell14321
CSS130013

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity87.80
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.53
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes51
▷ Abstract classes23.92%
▷ Concrete classes4996.08%
▷ Final classes12.04%
Methods1,283
▷ Static methods19715.35%
▷ Public methods89469.68%
▷ Protected methods171.33%
▷ Private methods37228.99%
Functions107
▷ Named functions10699.07%
▷ Anonymous functions10.93%
Constants154
▷ Global constants10769.48%
▷ Class constants4730.52%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/coinbase-commerce-for-woocommerce.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/images/icon.png27.70KB9.23KB▼ 66.66%