84% ni-woocommerce-order-delivery

Code Review | Ni WooCommerce Order Delivery

WordPress plugin Ni WooCommerce Order Delivery scored 84% from 54 tests.

About plugin

  • Plugin page: ni-woocommerce-or...
  • Plugin version: 1.2.8
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1.1
  • WordPress version: 6.3.1
  • First release: Apr 25, 2017
  • Latest release: Feb 19, 2023
  • Number of updates: 14
  • Update frequency: every 151.9 days
  • Top authors: anzia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,221 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼0.10ms] Passed 4 tests

Server-side resources used by Ni WooCommerce Order Delivery
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0837.67 ▼6.57
Dashboard /wp-admin3.38 ▲0.0848.35 ▲1.56
Posts /wp-admin/edit.php3.49 ▲0.1453.61 ▲3.51
Add New Post /wp-admin/post-new.php5.96 ▲0.08103.11 ▲15.65
Media Library /wp-admin/upload.php3.30 ▲0.0735.55 ▲1.10
Dashboard /wp-admin/admin.php?page=ni-order-delivary3.3134.05
Delivery Settings /wp-admin/admin.php?page=ni-order-delivery-settings3.2733.87
Order List /wp-admin/admin.php?page=ni-order-delivery-list3.3132.01

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 36 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
recovery_mode_email_last_sent
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ni WooCommerce Order Delivery
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲9214.44 ▲0.051.76 ▼0.2342.92 ▼9.97
Dashboard /wp-admin2,233 ▲484.84 ▼0.00103.71 ▲0.6639.95 ▼1.14
Posts /wp-admin/edit.php2,116 ▲272.01 ▼0.0440.62 ▼0.8634.30 ▼0.80
Add New Post /wp-admin/post-new.php1,564 ▲3118.50 ▼4.75606.40 ▼33.7354.71 ▲1.48
Media Library /wp-admin/upload.php1,415 ▲274.22 ▲0.0499.71 ▼2.2240.30 ▼2.37
Dashboard /wp-admin/admin.php?page=ni-order-delivary7281.536.4532.64
Delivery Settings /wp-admin/admin.php?page=ni-order-delivery-settings9622.0623.5825.15
Order List /wp-admin/admin.php?page=ni-order-delivery-list9241.7329.6326.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • recovery_mode_email_last_sent
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=ni-order-delivary
    • > Error in wp-content/plugins/ni-woocommerce-order-delivery/include/ni-order-delivery-dashboard.php+20
    Uncaught Error: Call to undefined function wc_price() in wp-content/plugins/ni-woocommerce-order-delivery/include/ni-order-delivery-dashboard.php:20
    Stack trace:
    #0 wp-content/plugins/ni-woocommerce-order-delivery/include/ni-order-delivery-init.php(52): Ni_Order_Delivery_Dashboard->page_init()
    #1 wp-includes/class-wp-hook.php(310): Ni_Order_Delivery_Init->add_menu_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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The SRP test was a success

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 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
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (Order delivery date on WooCommerce checkout page.), #2 (Order delivery date on WooCommerce order edit page), #3 (Order delivery date on WooCommerce email), #4 (Dashboard Sales Analysis), #5 (List of next order delivery order), #6 (Order list with filter and export option.), #7 (Ni woocommerce order delivery settings option)
You can look at the official readme.txt

ni-woocommerce-order-delivery/ni-order-delivery.php 92% from 13 tests

The main file in "Ni WooCommerce Order Delivery" v. 1.2.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ni-woocommerce-order-delivery.php" instead of "ni-order-delivery.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin7,523 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
CSS477853,834
SVG1002,671
PHP714084980
JavaScript3168138

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity13.86
▷ Minimum class complexity2.00
▷ Maximum class complexity31.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods47
▷ Static methods24.26%
▷ Public methods47100.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
15 PNG files occupy 0.17MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_454545_256x240.png6.91KB4.18KB▼ 39.44%
screenshot-7.png24.33KB14.99KB▼ 38.39%
screenshot-1.png30.91KB18.16KB▼ 41.23%
screenshot-3.png15.19KB7.92KB▼ 47.88%
css/images/ui-icons_777777_256x240.png3.19KB3.49KB0.00%