10% split-back-order

Code Review | Split Backorder for Woocommerce

WordPress plugin Split Backorder for Woocommerce scored10%from 54 tests.

About plugin

  • Plugin page: split-back-order
  • Plugin version: 1.0.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Oct 22, 2020
  • Latest release: Apr 25, 2023
  • Number of updates: 25
  • Update frequency: every 36.6 days
  • Top authors: sunarc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /915 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/split-back-order/split_back-order.php+33
    Undefined variable: option_name

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.44ms] Passed 4 tests

This is a short check of server-side resources used by Split Backorder for Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1634.78 ▼2.82
Dashboard /wp-admin3.33 ▲0.0344.00 ▼7.81
Posts /wp-admin/edit.php3.38 ▲0.0348.09 ▲2.14
Add New Post /wp-admin/post-new.php5.93 ▲0.0579.90 ▼6.60
Media Library /wp-admin/upload.php3.25 ▲0.0332.29 ▼0.53
Split By Back Order /wp-admin/admin.php?page=split-back-order3.2627.70

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 10 new options
New WordPress options
split_back_order_salable
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
split_back_order_instock
db_upgraded
enable_split_back_order
theysaidso_admin_options
split_back_order

Browser metrics Passed 4 tests

A check of browser resources used by Split Backorder for Woocommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.62 ▼0.761.75 ▼0.0541.32 ▼1.74
Dashboard /wp-admin2,207 ▲194.88 ▼0.0496.96 ▼20.1137.03 ▼5.99
Posts /wp-admin/edit.php2,096 ▲102.04 ▼0.0240.20 ▲3.1136.17 ▲3.89
Add New Post /wp-admin/post-new.php1,518 ▼1523.23 ▼0.03605.23 ▼71.6961.57 ▲6.82
Media Library /wp-admin/upload.php1,389 ▲14.18 ▲0.0394.40 ▼3.9543.57 ▼2.25
Split By Back Order /wp-admin/admin.php?page=split-back-order7942.0524.1823.44

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • This plugin does not fully uninstall, leaving 10 options in the database
    • enable_split_back_order
    • theysaidso_admin_options
    • can_compress_scripts
    • split_back_order_salable
    • db_upgraded
    • split_back_order_instock
    • widget_theysaidso_widget
    • widget_recent-posts
    • split_back_order
    • widget_recent-comments

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/split-back-order/include/mail.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/split-back-order/include/setting.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: split backorder, woocommerce, split, order

split-back-order/split_back-order.php 85% from 13 tests

The main PHP file in "Split Backorder for Woocommerce" ver. 1.0.6 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("split-back-order.php" instead of "split_back-order.php")

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
There were no executable files found in this plugin1,035 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP6177431,023
JavaScript10012

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity35.00
▷ Minimum class complexity34.00
▷ Maximum class complexity36.00
Average method complexity5.25
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected