10% woo-products-filter

Code Review | Woo Products Filter

WordPress plugin Woo Products Filter scored10%from 54 tests.

About plugin

  • Plugin page: woo-products-filter
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 30, 2016
  • Latest release: Jun 2, 2016
  • Number of updates: 14
  • Update frequency: every 24.2 days
  • Top authors: atif.sparx (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /7,753 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 did not install without errors
    • > Deprecated in wp-content/plugins/woo-products-filter/public/woopf-public.php+323
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

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

Server-side resources used by Woo Products Filter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.98 ▼1.85
Dashboard /wp-admin3.31 ▼0.0446.39 ▼10.10
Posts /wp-admin/edit.php3.36 ▲0.0044.36 ▲0.13
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.35 ▼2.57
Media Library /wp-admin/upload.php3.23 ▲0.0035.27 ▼1.21

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 39 new files
Database: no new tables, 7 new options
New WordPress options
widget_woopfshopwidgets
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Woo Products Filter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.48 ▲0.101.85 ▲0.0642.85 ▲4.64
Dashboard /wp-admin2,206 ▲144.84 ▼0.07100.20 ▼6.2440.05 ▼1.83
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0136.36 ▲2.2332.91 ▼2.86
Add New Post /wp-admin/post-new.php1,533 ▲723.41 ▲0.26604.41 ▼54.8549.12 ▼11.28
Media Library /wp-admin/upload.php1,391 ▲34.22 ▼0.0296.77 ▲0.5843.53 ▲1.79

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_woopfshopwidgets

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/woo-products-filter/public/woopf-orderby.php
    • > /wp-content/plugins/woo-products-filter/public/woopf-product-filter.php
  • 36× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/woo-products-filter/public/woopf-product-filter.php on line 1536
    • > PHP Warning
      Use of undefined constant WOOPF_PATH - assumed 'WOOPF_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/woo-products-filter/includes/woopf.php on line 11
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/woo-products-filter/public/woopf-product-filter.php on line 704
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/woo-products-filter/public/woopf-product-filter.php on line 946
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/woo-products-filter/public/woopf-product-filter.php on line 1173
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/woo-products-filter/public/woopf-product-filter.php on line 280
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/woo-products-filter/public/woopf-product-filter.php on line 1536
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/woo-products-filter/public/woopf-product-filter.php on line 946
    • > PHP Warning
      include_once(): Failed opening 'WOOPF_PATHpublic/woopf-shortcode.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/woo-products-filter/public/woopf-public.php on line 1326
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/woo-products-filter/public/woopf-product-filter.php on line 1122

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (16 tag instead of maximum 10)
  • Donate link: Please fix this invalid url: ""
  • Requires at least: The plugin version is formatted incorrectly
You can take inspiration from this readme.txt

woo-products-filter/woo-products-filter.php 92% from 13 tests

Analyzing the main PHP file in "Woo Products Filter" version 1.0.0
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin6,352 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP165474364,564
PO File1340467815
CSS25627541
SVG12010428
JavaScript32204

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 155)
Cyclomatic complexity
Average complexity per logical line of code0.68
Average class complexity84.71
▷ Minimum class complexity1.00
▷ Maximum class complexity332.00
Average method complexity10.02
▷ Minimum method complexity1.00
▷ Maximum method complexity155.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods65
▷ Static methods4163.08%
▷ Public methods65100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/filter.png0.70KB0.55KB▼ 21.11%
public/img/close.png3.05KB1.54KB▼ 49.55%
public/img/search.png1.24KB0.21KB▼ 83.32%