83% custom-status-for-wc-orders

Code Review | Custom Status for WooCommerce Orders

WordPress plugin Custom Status for WooCommerce Orders scored83%from 54 tests.

About plugin

  • Plugin page: custom-status-for...
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 6.3.1
  • First release: Dec 8, 2021
  • Latest release: Dec 8, 2021
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: charlestsmith (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /454 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼8.03ms] Passed 4 tests

Analyzing server-side resources used by Custom Status for WooCommerce Orders
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.56 ▼3.64
Dashboard /wp-admin3.33 ▼0.0246.94 ▼18.35
Posts /wp-admin/edit.php3.38 ▲0.0252.28 ▼1.82
Add New Post /wp-admin/post-new.php5.91 ▲0.0289.51 ▼8.32
Media Library /wp-admin/upload.php3.25 ▲0.0235.44 ▲1.54
Add custom status /wp-admin/admin.php?page=WCS_add_menu_page3.2235.15

Server storage [IO: ▲0.16MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Just a few items left to fix
  • Illegal file modification detected: 1 file (4.00KB) outside of "wp-content/plugins/custom-status-for-wc-orders/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Custom Status for WooCommerce Orders
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲9413.24 ▼0.901.87 ▲0.1140.15 ▼3.51
Dashboard /wp-admin2,221 ▲185.90 ▼0.14108.90 ▲8.9041.08 ▼4.84
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0240.26 ▼0.2936.80 ▲3.59
Add New Post /wp-admin/post-new.php1,554 ▼018.36 ▲0.32672.69 ▲18.5250.04 ▼18.50
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.02101.61 ▼1.2344.06 ▲0.22
Add custom status /wp-admin/admin.php?page=WCS_add_menu_page8162.0225.2626.85

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/custom-status-for-wc-orders/index.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: woocommerce orders, orders status, custom status

custom-status-for-wc-orders/index.php 85% from 13 tests

The entry point to "Custom Status for WooCommerce Orders" version 1.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("custom-status-for-wc-orders.php" instead of "index.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("5.5" instead of "5.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin302 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP43718144
CSS1200142
JavaScript14016

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity9.00
▷ Minimum class complexity7.00
▷ Maximum class complexity11.00
Average method complexity2.60
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
3 PNG files occupy 0.15MB with 0.08MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png50.28KB25.38KB▼ 49.53%
assets/screenshot-2.png64.24KB31.08KB▼ 51.62%
assets/screenshot-1.png38.89KB17.99KB▼ 53.75%