84% woo-order-splitter

Code Review | Order Splitter for WooCommerce

WordPress plugin Order Splitter for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: woo-order-splitter
  • Plugin version: 4.9.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.4
  • WordPress version: 6.3.1
  • First release: Jul 24, 2017
  • Latest release: Nov 9, 2023
  • Number of updates: 376
  • Update frequency: every 6.1 days
  • Top authors: fahadmahmood (100%)

Code review

54 tests

User reviews

64 reviews

Install metrics

600+ active /86,176 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.21ms] Passed 4 tests

Server-side resources used by Order Splitter for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1735.86 ▼5.22
Dashboard /wp-admin3.32 ▲0.0244.70 ▼3.20
Posts /wp-admin/edit.php3.37 ▲0.0246.97 ▲3.28
Add New Post /wp-admin/post-new.php5.90 ▲0.0287.65 ▼12.64
Media Library /wp-admin/upload.php3.25 ▲0.0234.75 ▲0.22

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 87 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Order Splitter for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.20 ▼0.031.61 ▲0.0343.21 ▼1.90
Dashboard /wp-admin2,198 ▲175.60 ▼0.0892.87 ▼22.9237.86 ▼4.84
Posts /wp-admin/edit.php2,103 ▲32.01 ▲0.0539.75 ▲1.1936.08 ▲2.64
Add New Post /wp-admin/post-new.php1,526 ▼923.26 ▼1.84682.75 ▲46.3947.71 ▼16.66
Media Library /wp-admin/upload.php1,400 ▲34.15 ▼0.0497.50 ▼9.4440.75 ▼4.78

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • 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 everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 36× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/woo-order-splitter/inc/sections/customization.php:1
    • > PHP Notice
      Undefined variable: current in wp-content/plugins/woo-order-splitter/inc/sections/wc_os_pagination.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-order-splitter/inc/wos-taxonomies.php:47
    • > PHP Notice
      Undefined variable: wc_os_settings in wp-content/plugins/woo-order-splitter/inc/settings/general-settings.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/woo-order-splitter/inc/wos_mailer.php:10
    • > PHP Warning
      in_array() expects parameter 2 to be array, null given in wp-content/plugins/woo-order-splitter/inc/settings/general-settings.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woo-order-splitter/inc/wos-emails.php:1155
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/woo-order-splitter/inc/settings/cat-qty-split-settings.php:1
    • > PHP Notice
      Undefined variable: wc_os_per_page in wp-content/plugins/woo-order-splitter/inc/settings/groups_by_meta.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/woo-order-splitter/inc/settings/general-settings.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
8 plugin tags: split orders, orders, preorder, duplicate, split...

woo-order-splitter/index.php 92% from 13 tests

The main file in "Order Splitter for WooCommerce" v. 4.9.4 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: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woo-order-splitter.php" instead of "index.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected36,884 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
PHP299,75962614,951
SVG3009,546
PO File42,5133,1796,243
JavaScript81,2234353,248
CSS8278762,896

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 461)
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity243.60
▷ Minimum class complexity3.00
▷ Maximum class complexity902.00
Average method complexity11.70
▷ Minimum method complexity1.00
▷ Maximum method complexity461.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods106
▷ Static methods10.94%
▷ Public methods9791.51%
▷ Protected methods00.00%
▷ Private methods98.49%
Functions235
▷ Named functions22595.74%
▷ Anonymous functions104.26%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.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
17 PNG files occupy 0.43MB with 0.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/mailbox.png3.64KB2.14KB▼ 41.26%
img/shipping-class-1.png20.79KB9.63KB▼ 53.67%
img/cbqse-2.png92.57KB26.40KB▼ 71.48%
img/cbqse-1.png61.53KB20.94KB▼ 65.97%
img/premium.png6.20KB3.67KB▼ 40.68%