73% nowpayments-for-woocommerce

Code Review | NOWPayments For WooCommerce

WordPress plugin NOWPayments For WooCommerce scored73%from 54 tests.

About plugin

  • Plugin page: nowpayments-for-w...
  • Plugin version: 1.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3
  • WordPress version: 6.3.1
  • First release: Jul 27, 2022
  • Latest release: Aug 18, 2023
  • Number of updates: 39
  • Update frequency: every 9.9 days
  • Top authors: smusman98 (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

700+ active /4,956 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲4.97MB] [CPU: ▲24.68ms] Passed 4 tests

Analyzing server-side resources used by NOWPayments For WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /8.87 ▲5.4168.56 ▲28.50
Dashboard /wp-admin8.89 ▲5.5968.64 ▲19.49
Posts /wp-admin/edit.php8.89 ▲5.5476.93 ▲30.70
Add New Post /wp-admin/post-new.php9.24 ▲3.35105.89 ▲20.02
Media Library /wp-admin/upload.php8.89 ▲5.6765.38 ▲31.83
NOWPayments for WooCommerce /wp-admin/admin.php?page=nowpayments-for-woocommerce8.8962.54
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.8959.44

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 197 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
fs_debug_mode
widget_theysaidso_widget
fs_active_plugins
theysaidso_admin_options
fs_accounts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for NOWPayments For WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲8613.24 ▼1.051.74 ▼0.0532.64 ▼12.36
Dashboard /wp-admin2,238 ▲504.87 ▼0.00107.90 ▼8.4445.35 ▼2.55
Posts /wp-admin/edit.php2,121 ▲322.01 ▼0.0442.94 ▲4.4638.46 ▲3.64
Add New Post /wp-admin/post-new.php1,528 ▼1023.32 ▲0.18690.62 ▲32.4148.91 ▼2.51
Media Library /wp-admin/upload.php1,420 ▲294.29 ▲0.1095.59 ▼9.1346.23 ▼2.67
NOWPayments for WooCommerce /wp-admin/admin.php?page=nowpayments-for-woocommerce9731.7125.5659.39
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0652.2023.6628.29

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/nowpayments-for-woocommerce/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 9 options in the database
    • fs_debug_mode
    • widget_recent-comments
    • theysaidso_admin_options
    • fs_accounts
    • widget_recent-posts
    • can_compress_scripts
    • fs_active_plugins
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/nowpayments-for-woocommerce/includes/class-gateway.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
  • Screenshots: Add descriptions for screenshots #2, #3, #4, #5 in nowpayments-for-woocommerce/assets to your readme.txt
The official readme.txt might help

nowpayments-for-woocommerce/nowpayments-for-woocommerce.php Passed 13 tests

The principal PHP file in "NOWPayments For WooCommerce" v. 1.1 is loaded by WordPress automatically on each request
63 characters long description:
Allow WooCommerce user to checkout with 150+ crypto currencies.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected71,181 lines of code in 152 files:
LanguageFilesBlank linesComment linesLines of code
JSON30036,650
PHP1268,10817,50733,807
Markdown2910417
JavaScript74671273
Bourne Shell14321
CSS130013

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please tend to the following items
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity86.35
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.54
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes52
▷ Abstract classes23.85%
▷ Concrete classes5096.15%
▷ Final classes12.00%
Methods1,282
▷ Static methods19815.44%
▷ Public methods89269.58%
▷ Protected methods171.33%
▷ Private methods37329.10%
Functions101
▷ Named functions101100.00%
▷ Anonymous functions00.00%
Constants149
▷ Global constants10268.46%
▷ Class constants4731.54%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/nowpayments-for-woocommerce.png8.44KB2.76KB▼ 67.31%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/images/icon.png7.99KB4.25KB▼ 46.79%