84% whws-display-in-stock-products-first-for-woocommerce

Code Review | WHWS Display In Stock Products First For WooCommerce

WordPress plugin WHWS Display In Stock Products First For WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: whws-display-in-s...
  • Plugin version: 0.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3.1
  • WordPress version: 6.3.1
  • First release: Nov 13, 2019
  • Latest release: Sep 16, 2023
  • Number of updates: 10
  • Update frequency: every 140.2 days
  • Top authors: davidmanch (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

400+ active /1,329 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
Install script ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼7.19ms] Passed 4 tests

This is a short check of server-side resources used by WHWS Display In Stock Products First For WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.88 ▼2.19
Dashboard /wp-admin3.32 ▼0.0348.06 ▼19.25
Posts /wp-admin/edit.php3.37 ▲0.0149.35 ▲0.03
Add New Post /wp-admin/post-new.php5.90 ▲0.0193.98 ▼7.35
Media Library /wp-admin/upload.php3.24 ▲0.0137.61 ▲0.71

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WHWS Display In Stock Products First For WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.72 ▲0.361.80 ▼0.1346.49 ▲2.91
Dashboard /wp-admin2,195 ▲215.65 ▼0.0391.79 ▲2.6742.65 ▲1.34
Posts /wp-admin/edit.php2,100 ▲31.97 ▼0.0341.40 ▲1.9936.64 ▼5.46
Add New Post /wp-admin/post-new.php1,554 ▲2818.11 ▲0.66615.19 ▼67.3051.64 ▼2.39
Media Library /wp-admin/upload.php1,400 ▼04.28 ▲0.0798.08 ▼22.6845.88 ▼4.42

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/whws-display-in-stock-products-first-for-woocommerce/whws-display-in-stock-products-first-for-woocommerce.php:16

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 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
8 plugin tags: order, outofstock, procucts, woocommerce, orderby...

whws-display-in-stock-products-first-for-woocommerce/whws-display-in-stock-products-first-for-woocommerce.php Passed 13 tests

This is the main PHP file of "WHWS Display In Stock Products First For WooCommerce" version 0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
124 characters long description:
Use this handy little plugin to change the default sort order and display in stock products first in your WooCommerce store.

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
There were no executable files found in this plugin26 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP121026

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity3.50
▷ Minimum method complexity2.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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 images were found in this plugin