84% ni-woocommerce-payment-gateway-charges

Code Review | Ni WooCommerce Payment Gateway Charges

WordPress plugin Ni WooCommerce Payment Gateway Charges scored84%from 54 tests.

About plugin

  • Plugin page: ni-woocommerce-pa...
  • Plugin version: 1.5.9
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 12, 2016
  • Latest release: Nov 23, 2023
  • Number of updates: 36
  • Update frequency: every 71.2 days
  • Top authors: anzia (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /6,500 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▲0.35ms] Passed 4 tests

This is a short check of server-side resources used by Ni WooCommerce Payment Gateway Charges
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0634.98 ▼7.70
Dashboard /wp-admin3.38 ▲0.0751.94 ▲5.17
Posts /wp-admin/edit.php3.50 ▲0.1351.34 ▲3.68
Add New Post /wp-admin/post-new.php5.96 ▲0.0790.34 ▲3.17
Media Library /wp-admin/upload.php3.30 ▲0.0736.13 ▲2.25
Other Plugins /wp-admin/admin.php?page=niwoopgc-other-plugins3.3034.40
Dashboard /wp-admin/admin.php?page=ni-payment-gateway-charges-dashboard3.5633.72
Setting /wp-admin/admin.php?page=ni-payment-gateway-charges-setting3.2732.22

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

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

Browser metrics Passed 4 tests

Ni WooCommerce Payment Gateway Charges: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,897 ▲13513.40 ▼0.957.42 ▲5.7136.23 ▼11.67
Dashboard /wp-admin2,206 ▲265.56 ▼0.1194.64 ▼2.7684.95 ▲38.70
Posts /wp-admin/edit.php2,123 ▲201.94 ▼0.0139.51 ▼3.4237.55 ▼1.70
Add New Post /wp-admin/post-new.php1,548 ▲2123.62 ▲0.34665.22 ▲44.4261.34 ▲3.36
Media Library /wp-admin/upload.php1,423 ▲234.16 ▲0.0199.94 ▼0.6370.39 ▲28.04
Other Plugins /wp-admin/admin.php?page=niwoopgc-other-plugins1,1252.1731.5577.11
Dashboard /wp-admin/admin.php?page=ni-payment-gateway-charges-dashboard1,3822.1615.6580.55
Setting /wp-admin/admin.php?page=ni-payment-gateway-charges-setting8602.0025.8823.91

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • recovery_mode_email_last_sent
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=ni-payment-gateway-charges-dashboard
    • > Error in wp-content/plugins/ni-woocommerce-payment-gateway-charges/include/ni-payment-gateway-charges-dashboard.php+271
    Uncaught Error: Call to undefined function wc_price() in wp-content/plugins/ni-woocommerce-payment-gateway-charges/include/ni-payment-gateway-charges-dashboard.php:271
    Stack trace:
    #0 wp-content/plugins/ni-woocommerce-payment-gateway-charges/include/ni-payment-gateway-charges-init.php(33): ni_payment_gateway_charges_dashboard->page_init()
    #1 wp-includes/class-wp-hook.php(310): ni_payment_gateway_charges_init->add_page()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Everything seems fine, however this is by no means an exhaustive test

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

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Checkout page your order section.), #2 (Payment gateway charges settings.), #3 (woocommerce settings checkout section for payemnt gateway extra charges setting.), #4 (woocommerce admin order product details section.), #5 (Payment Gateway Sales Report.)
You can take inspiration from this readme.txt

ni-woocommerce-payment-gateway-charges/ni-woocommerce-payment-gateway-charges.php 92% from 13 tests

The primary PHP file in "Ni WooCommerce Payment Gateway Charges" version 1.5.9 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 148 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected8,217 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
CSS4871083,814
SVG2002,678
PHP5261911,638
JavaScript801187

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity17.00
▷ Minimum class complexity1.00
▷ Maximum class complexity49.00
Average method complexity2.74
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods46
▷ Static methods12.17%
▷ Public methods46100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
9 PNG files occupy 0.17MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/i2con2.png0.59KB0.34KB▼ 42.57%
screenshot-4.png15.17KB7.52KB▼ 50.44%
images/icon21.png0.79KB1.05KB0.00%
screenshot-2.png13.88KB8.43KB▼ 39.25%
screenshot-6.png106.07KB40.27KB▼ 62.03%