84% woo-nimiq-gateway

Code Review | Cryptocurrency Checkout - Accept Bitcoin, Ethereum and Nimiq

WordPress plugin Cryptocurrency Checkout - Accept Bitcoin, Ethereum and Nimiq scored84%from 54 tests.

About plugin

  • Plugin page: woo-nimiq-gateway
  • Plugin version: 3.4.1
  • PHP compatiblity: 7.1.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.1
  • WordPress version: 6.3.1
  • First release: Jun 20, 2019
  • Latest release: Nov 23, 2022
  • Number of updates: 36
  • Update frequency: every 35.2 days
  • Top authors: nimiq (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /6,369 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.05MB] [CPU: ▼10.52ms] Passed 4 tests

A check of server-side resources used by Cryptocurrency Checkout - Accept Bitcoin, Ethereum and Nimiq
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1238.35 ▼3.88
Dashboard /wp-admin3.31 ▲0.0133.40 ▼16.09
Posts /wp-admin/edit.php3.38 ▲0.0241.62 ▼12.13
Add New Post /wp-admin/post-new.php5.55 ▼0.3381.69 ▼9.74
Media Library /wp-admin/upload.php3.32 ▲0.0932.42 ▼4.11

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 116 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Cryptocurrency Checkout - Accept Bitcoin, Ethereum and Nimiq: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.16 ▼1.261.73 ▼0.0440.13 ▼6.29
Dashboard /wp-admin2,206 ▲184.84 ▼0.07109.11 ▲7.0341.15 ▼0.13
Posts /wp-admin/edit.php2,089 ▼32.05 ▲0.0139.86 ▼4.1035.87 ▼0.58
Add New Post /wp-admin/post-new.php1,533 ▲1423.29 ▲0.05586.62 ▼70.9548.86 ▼9.65
Media Library /wp-admin/upload.php1,388 ▼04.19 ▼0.04100.87 ▼5.9744.24 ▼0.72

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 25× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: gateway in wp-content/plugins/woo-nimiq-gateway/validation_services/json_rpc_nim.php on line 303
    • > PHP Fatal error
      Uncaught Error: Class 'Elliptic\\Curve\\BaseCurve\\Point' not found in wp-content/plugins/woo-nimiq-gateway/nimiq-xpub/vendor/simplito/elliptic-php/lib/Curve/EdwardsCurve/Point.php:6
    • > PHP Notice
      Undefined variable: gateway in wp-content/plugins/woo-nimiq-gateway/validation_services/nimiq_watch.php on line 263
    • > PHP Fatal error
      Uncaught Error: Class 'Elliptic\\Curve\\BaseCurve\\Point' not found in wp-content/plugins/woo-nimiq-gateway/nimiq-xpub/vendor/simplito/elliptic-php/lib/Curve/MontCurve/Point.php:7
    • > PHP Notice
      Undefined variable: gateway in wp-content/plugins/woo-nimiq-gateway/validation_services/blockstream.php on line 288
    • > PHP Fatal error
      Uncaught Error: Interface 'StephenHill\\ServiceInterface' not found in wp-content/plugins/woo-nimiq-gateway/nimiq-xpub/vendor/stephenhill/base58/src/GMPService.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woo-nimiq-gateway/includes/bulk_actions.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Elliptic\\Curve\\BaseCurve\\Point' not found in wp-content/plugins/woo-nimiq-gateway/nimiq-xpub/vendor/simplito/elliptic-php/lib/Curve/ShortCurve/JPoint.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-nimiq-gateway/includes/webhook.php:7
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_option() on null in wp-content/plugins/woo-nimiq-gateway/validation_services/nimiq_watch.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
Please take inspiration from this readme.txt

woo-nimiq-gateway/woo-nimiq-gateway.php 92% from 13 tests

The main file in "Cryptocurrency Checkout - Accept Bitcoin, Ethereum and Nimiq" v. 3.4.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin15,750 lines of code in 100 files:
LanguageFilesBlank linesComment linesLines of code
PHP651,9951,57111,329
PO File89521,2533,017
JSON900558
Markdown132360552
JavaScript33835158
CSS2210136

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.36
Average class complexity25.38
▷ Minimum class complexity1.00
▷ Maximum class complexity149.00
Average method complexity2.81
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces18
Interfaces3
Traits0
Classes47
▷ Abstract classes24.26%
▷ Concrete classes4595.74%
▷ Final classes24.44%
Methods643
▷ Static methods10916.95%
▷ Public methods57789.74%
▷ Protected methods30.47%
▷ Private methods639.80%
Functions97
▷ Named functions7880.41%
▷ Anonymous functions1919.59%
Constants24
▷ Global constants520.83%
▷ Class constants1979.17%
▷ Public constants1684.21%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected