84% woocommerce-sort-by-stock

Code Review | WooCommerce Sort By Stock

WordPress plugin WooCommerce Sort By Stock scored 84% from 54 tests.

About plugin

  • Plugin page: woocommerce-sort-...
  • Plugin version: 2.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.6.1
  • WordPress version: 6.3.1
  • First release: Jun 19, 2015
  • Latest release: Nov 8, 2016
  • Number of updates: 9
  • Update frequency: every 56.9 days
  • Top authors: byanofsky (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

600+ active / 8,901 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
This plugin's installer ran successfully

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

A check of server-side resources used by WooCommerce Sort By Stock
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.70 ▼15.92
Dashboard /wp-admin3.32 ▲0.0146.60 ▼3.16
Posts /wp-admin/edit.php3.37 ▲0.0144.28 ▼4.23
Add New Post /wp-admin/post-new.php5.90 ▲0.0183.61 ▼10.06
Media Library /wp-admin/upload.php3.24 ▲0.0137.26 ▲0.89

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce Sort By Stock
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.83 ▲0.382.11 ▲0.2847.10 ▲3.59
Dashboard /wp-admin2,209 ▲215.87 ▲0.99109.98 ▲4.7740.77 ▼0.57
Posts /wp-admin/edit.php2,089 ▲32.06 ▲0.0236.34 ▼0.8330.44 ▼2.91
Add New Post /wp-admin/post-new.php1,528 ▼623.12 ▲0.07672.95 ▼5.1557.26 ▲6.97
Media Library /wp-admin/upload.php1,385 ▼34.28 ▲0.06102.35 ▼7.7344.48 ▼1.64

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 detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/woocommerce-sort-by-stock/wc-sort-by-stock.php

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
8 plugin tags: wordpress ecommerce, inventory, sales, e-commerce, ecommerce...

woocommerce-sort-by-stock/wc-sort-by-stock.php 85% from 13 tests

The main file in "WooCommerce Sort By Stock" v. 2.2.0 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 ("woocommerce-sort-by-stock.php" instead of "wc-sort-by-stock.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin38 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1203638

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected