84% tinkl-it-woocommerce-payment-gateway

Code Review | Accept Bitcoin & Lightning Network with tinkl.it

WordPress plugin Accept Bitcoin & Lightning Network with tinkl.it scored84%from 54 tests.

About plugin

  • Plugin page: tinkl-it-woocomme...
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: May 3, 2019
  • Latest release: May 31, 2022
  • Number of updates: 18
  • Update frequency: every 62.6 days
  • Top authors: tinklit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /644 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.13MB] [CPU: ▼14.31ms] Passed 4 tests

Server-side resources used by Accept Bitcoin & Lightning Network with tinkl.it
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▼0.0335.37 ▼19.39
Dashboard /wp-admin3.31 ▲0.0048.75 ▼6.41
Posts /wp-admin/edit.php3.36 ▼0.4947.62 ▼6.22
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.85 ▼25.23
Media Library /wp-admin/upload.php3.23 ▲0.0035.27 ▲1.95

Server storage [IO: ▲0.03MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Accept Bitcoin & Lightning Network with tinkl.it
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.23 ▲0.121.62 ▼0.1740.34 ▼4.78
Dashboard /wp-admin2,198 ▲275.64 ▲0.0494.23 ▼5.5739.17 ▼6.56
Posts /wp-admin/edit.php2,097 ▼31.99 ▲0.0436.77 ▲3.4233.57 ▼3.73
Add New Post /wp-admin/post-new.php1,526 ▼523.38 ▲0.45675.24 ▲45.2366.88 ▲6.76
Media Library /wp-admin/upload.php1,397 ▼34.18 ▼0.0497.89 ▲1.0043.59 ▲1.63

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

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)
Everything seems fine, however 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
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tinkl-it-woocommerce-payment-gateway/tinklit.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Tinklit\\Merchant' not found in wp-content/plugins/tinkl-it-woocommerce-payment-gateway/lib/tinklit/lib/Merchant/Invoice.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
You can take inspiration from this readme.txt

tinkl-it-woocommerce-payment-gateway/tinklit.php 92% from 13 tests

Analyzing the main PHP file in "Accept Bitcoin & Lightning Network with tinkl.it" version 1.3.1
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("tinkl-it-woocommerce-payment-gateway.php" instead of "tinklit.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected526 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP711030499
Markdown126027

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity4.29
▷ Minimum class complexity1.00
▷ Maximum class complexity42.00
Average method complexity4.43
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes24
▷ Abstract classes00.00%
▷ Concrete classes24100.00%
▷ Final classes00.00%
Methods23
▷ Static methods834.78%
▷ Public methods2086.96%
▷ Protected methods00.00%
▷ Private methods313.04%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants466.67%
▷ Class constants233.33%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/bitcoin.png3.06KB2.06KB▼ 32.77%