89% wc-bitpay-gateway

Code Review | BitPay Gateway for WooCommerce

WordPress plugin BitPay Gateway for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: wc-bitpay-gateway
  • Plugin version: 4.1.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 6.3.1
  • First release: Aug 25, 2021
  • Latest release: Oct 26, 2023
  • Number of updates: 3
  • Update frequency: every 264.3 days
  • Top authors: bitpayir (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /852 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼1.49ms] Passed 4 tests

Server-side resources used by BitPay Gateway for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0936.13 ▼1.66
Dashboard /wp-admin3.40 ▲0.0946.68 ▼0.30
Posts /wp-admin/edit.php3.45 ▲0.0945.62 ▼3.80
Add New Post /wp-admin/post-new.php5.98 ▲0.0982.00 ▲0.23
Media Library /wp-admin/upload.php3.32 ▲0.0933.95 ▼0.19

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

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

Browser metrics Passed 4 tests

BitPay Gateway for WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.35 ▼0.381.66 ▼0.1736.66 ▼3.38
Dashboard /wp-admin2,198 ▲215.63 ▲0.0395.69 ▲7.5242.16 ▲1.10
Posts /wp-admin/edit.php2,097 ▼32.03 ▲0.0234.93 ▼1.5235.31 ▼0.23
Add New Post /wp-admin/post-new.php1,526 ▼023.08 ▼0.06675.79 ▼10.4353.50 ▼1.75
Media Library /wp-admin/upload.php1,397 ▼04.21 ▲0.02100.76 ▲4.3744.96 ▲1.26

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests Passed 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 Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

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

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
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (Settings page), #2 (payment page)
  • Tags: Please delete some tags, you are using 15 tag instead of maximum 10
The official readme.txt is a good inspiration

wc-bitpay-gateway/index.php 92% from 13 tests

Analyzing the main PHP file in "BitPay Gateway for WooCommerce" version 4.1.3
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wc-bitpay-gateway.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin464 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP211414464

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity81.00
▷ Minimum class complexity81.00
▷ Maximum class complexity81.00
Average method complexity9.89
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods111.11%
▷ Public methods777.78%
▷ Protected methods00.00%
▷ Private methods222.22%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
12 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo_7.png1.00KB0.81KB▼ 18.96%
assets/images/logo_3.png3.83KB1.96KB▼ 48.67%
assets/images/logo_6.png2.56KB1.68KB▼ 34.27%
(invalid) assets/images/logo2.png1.12KB0.00KB▼ 100.00%
assets/images/logo.png3.17KB2.18KB▼ 31.11%