84% woo-admin-filter-by-stock

Code Review | Woo Admin Filter By Stock

WordPress plugin Woo Admin Filter By Stock scored84%from 54 tests.

About plugin

  • Plugin page: woo-admin-filter-...
  • Plugin version: 1.0.6
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.6
  • WordPress version: 6.3.1
  • First release: Aug 14, 2019
  • Latest release: Nov 30, 2020
  • Number of updates: 10
  • Update frequency: every 49.3 days
  • Top authors: extremeidea (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /730 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
Installer ran successfully

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

Analyzing server-side resources used by Woo Admin Filter By Stock
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.63 ▼9.23
Dashboard /wp-admin3.31 ▼0.0447.59 ▼18.48
Posts /wp-admin/edit.php3.36 ▲0.0052.74 ▲2.26
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.50 ▼12.18
Media Library /wp-admin/upload.php3.23 ▲0.0032.34 ▼4.89

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Woo Admin Filter By Stock
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.22 ▼1.451.69 ▼0.1442.84 ▼4.25
Dashboard /wp-admin2,206 ▲185.94 ▲0.06106.23 ▼0.6039.86 ▲0.64
Posts /wp-admin/edit.php2,086 ▼31.99 ▼0.0238.23 ▼0.0134.72 ▲0.69
Add New Post /wp-admin/post-new.php1,519 ▲522.98 ▲5.42664.33 ▲1.3651.13 ▼7.45
Media Library /wp-admin/upload.php1,379 ▼64.18 ▲0.0499.50 ▼7.7142.60 ▼2.14

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
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 Com\\ExtremeIdea\\Woocommerce\\AdminFilterByStock\\add_action() in wp-content/plugins/woo-admin-filter-by-stock/woo-admin-filter-by-stock.php:30

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 Passed 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
1 plugin tags: filter products by stock q-ty

woo-admin-filter-by-stock/woo-admin-filter-by-stock.php Passed 13 tests

The main PHP script in "Woo Admin Filter By Stock" version 1.0.6 is automatically included on every request by WordPress
45 characters long description:
Plugin helps you to filter products by stock.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected422 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP892221396
Markdown213016
JSON20010

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity16.25
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity3.10
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods30
▷ Static methods516.67%
▷ Public methods2790.00%
▷ Protected methods13.33%
▷ Private methods26.67%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.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