67% woo-product-filter

Code Review | Product Filter by WBW

WordPress plugin Product Filter by WBW scored67%from 54 tests.

About plugin

  • Plugin page: woo-product-filter
  • Plugin version: 2.5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.1-6.4
  • WordPress version: 6.3.1
  • First release: Jun 21, 2018
  • Latest release: Nov 17, 2023
  • Number of updates: 142
  • Update frequency: every 13.9 days
  • Top authors: woobewoo (100%)

Code review

54 tests

User reviews

215 reviews

Install metrics

40,000+ active /1,187,007 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲3.42MB] [CPU: ▲20.11ms] Passed 4 tests

A check of server-side resources used by Product Filter by WBW
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /6.05 ▲2.5962.40 ▲23.33
Dashboard /wp-admin7.08 ▲3.7768.23 ▲11.53
Posts /wp-admin/edit.php7.21 ▲3.8575.28 ▲29.62
Add New Post /wp-admin/post-new.php9.37 ▲3.48109.22 ▲15.94
Media Library /wp-admin/upload.php7.14 ▲3.9265.07 ▲35.55
Overview /wp-admin/admin.php?page=wpf-filters&tab=overview7.1763.40
Show All Filters /wp-admin/admin.php?page=wpf-filters&tab=woofilters7.1759.46
Settings /wp-admin/admin.php?page=wpf-filters&tab=settings7.1758.94

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 375 new files
Database: 8 new tables, 13 new options
New tables
wp_wpf_usage_stat
wp_wpf_filters
wp_wpf_meta_values_bk
wp_wpf_modules
wp_wpf_modules_type
wp_wpf_meta_values
wp_wpf_meta_keys
wp_wpf_meta_data
New WordPress options
wpf_plugin_activation_errors
wp_wpf_db_installed
_overview_wpf
wpf_opts_data
wpf_plug_was_used
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_wpfwoofilterswidget
...

Browser metrics Passed 4 tests

A check of browser resources used by Product Filter by WBW
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,015 ▲22814.32 ▲0.1310.71 ▲8.6137.37 ▼8.38
Dashboard /wp-admin2,261 ▲815.77 ▲0.1195.43 ▲6.9642.68 ▲0.71
Posts /wp-admin/edit.php2,170 ▲702.25 ▲0.2739.61 ▼2.2538.08 ▲2.80
Add New Post /wp-admin/post-new.php1,589 ▲5423.09 ▼0.15720.54 ▲2.6835.75 ▼26.22
Media Library /wp-admin/upload.php1,479 ▲794.51 ▲0.35107.51 ▲4.3548.64 ▲6.58
Add New Filter /wp-admin/admin.php?page=wpf-filters&tab=woofilters#wpfadd1,9075.59128.7081.50
Overview /wp-admin/admin.php?page=wpf-filters&tab=overview1,7923.9780.7740.97
Show All Filters /wp-admin/admin.php?page=wpf-filters&tab=woofilters1,8575.3295.0241.44
Settings /wp-admin/admin.php?page=wpf-filters&tab=settings2,0064.4974.1440.90

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie tables detected upon uninstall: 4 tables
    • wp_wpf_meta_values
    • wp_wpf_meta_values_bk
    • wp_wpf_filters
    • wp_wpf_meta_keys
  • Zombie WordPress options detected upon uninstall: 11 options
    • _overview_wpf
    • wpf_plug_was_used
    • wpf_plugin_activation_errors
    • can_compress_scripts
    • wpf_opts_data
    • theysaidso_admin_options
    • db_upgraded
    • widget_wpfwoofilterswidget
    • widget_recent-comments
    • widget_theysaidso_widget
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 5× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/woo-product-filter/modules/woofilters_widget/views/tpl/widget.php
    • > /wp-content/plugins/woo-product-filter/modules/promo/views/tpl/overviewTabContent.php
    • > /wp-content/plugins/woo-product-filter/modules/promo/views/tpl/adminTour.php
    • > /wp-content/plugins/woo-product-filter/modules/promo/views/tpl/layeredStylePromo.php
    • > /wp-content/plugins/woo-product-filter/modules/promo/views/tpl/welcomePage.php
  • 101× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/woo-product-filter/modules/woofilters_widget/views/tpl/form.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/woo-product-filter/modules/woofilters/views/tpl/woofiltersEditAdmin.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'ModuleWpf' not found in wp-content/plugins/woo-product-filter/modules/overview/mod.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'ModuleWpf' not found in wp-content/plugins/woo-product-filter/modules/user/mod.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'HtmlWpf' not found in wp-content/plugins/woo-product-filter/modules/woofilters/views/tpl/woofiltersHtml.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'ModuleWpf' not found in wp-content/plugins/woo-product-filter/modules/admin_nav/mod.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'ModuleWpf' not found in wp-content/plugins/woo-product-filter/modules/woofilters/mod.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'TableWpf' not found in wp-content/plugins/woo-product-filter/classes/tables/tables.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/woo-product-filter/modules/woofilters/views/tpl/woofiltersEditTabCommonTitle.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/woo-product-filter/modules/woofilters/views/tpl/woofiltersEditTabFilters.php:2

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #8 (Product filter admin panel. Design tab) image not found
You can take inspiration from this readme.txt

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

"Product Filter by WBW" version 2.5.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.4.0" instead of "3.4.1")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected55,276 lines of code in 281 files:
LanguageFilesBlank linesComment linesLines of code
PHP1302,0082,57122,345
JavaScript1021,2572,15415,500
PO File54,0818,1089,692
CSS394702234,999
SVG5002,740

PHP code 0% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 1,041)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 139)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity50.04
▷ Minimum class complexity1.00
▷ Maximum class complexity1,041.00
Average method complexity4.69
▷ Minimum method complexity1.00
▷ Maximum method complexity139.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes82
▷ Abstract classes910.98%
▷ Concrete classes7389.02%
▷ Final classes00.00%
Methods1,057
▷ Static methods24623.27%
▷ Public methods96691.39%
▷ Protected methods615.77%
▷ Private methods302.84%
Functions32
▷ Named functions1959.38%
▷ Anonymous functions1340.62%
Constants73
▷ Global constants5980.82%
▷ Class constants1419.18%
▷ Public constants14100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
73 PNG files occupy 0.87MB with 0.37MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
modules/woofilters/img/ad/attributes_slider.png79.55KB27.28KB▼ 65.70%
css/images/ui-icons_f29a00_256x240.png4.44KB4.17KB▼ 6.02%
modules/woofilters/img/assets/bullets/circle_big_new.png0.90KB1.01KB0.00%
img/pointer-up.png1.15KB0.36KB▼ 68.53%
modules/woofilters/img/assets/close_btns/close-red.png1.25KB0.38KB▼ 69.92%