84% pofily-woo-product-filters

Code Review | Pofily - WooCommerce Product Filters

WordPress plugin Pofily - WooCommerce Product Filters scored84%from 54 tests.

About plugin

  • Plugin page: pofily-woo-produc...
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.3.0
  • WordPress version: 6.3.1
  • First release: Nov 9, 2021
  • Latest release: Aug 23, 2023
  • Number of updates: 28
  • Update frequency: every 23.3 days
  • Top authors: dragonlord47 (92.86%)villatheme (10.71%)

Code review

54 tests

User reviews

4 reviews

Install metrics

800+ active /6,867 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
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼0.19ms] Passed 4 tests

Analyzing server-side resources used by Pofily - WooCommerce Product Filters
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0249.25 ▲5.24
Dashboard /wp-admin3.32 ▲0.0254.10 ▲2.78
Posts /wp-admin/edit.php3.43 ▲0.0847.80 ▼1.84
Add New Post /wp-admin/post-new.php5.90 ▲0.0292.70 ▼3.40
Media Library /wp-admin/upload.php3.24 ▲0.0137.21 ▲1.69

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 105 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
viwcpf_setting_params
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Pofily - WooCommerce Product Filters
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲6314.47 ▼0.152.12 ▲0.1642.89 ▼3.55
Dashboard /wp-admin2,215 ▲305.88 ▲0.06102.38 ▼13.6441.02 ▼1.54
Posts /wp-admin/edit.php2,101 ▲122.05 ▲0.0539.95 ▼1.4836.05 ▼0.83
Add New Post /wp-admin/post-new.php1,542 ▲923.13 ▲0.13636.68 ▼37.0063.26 ▲10.25
Media Library /wp-admin/upload.php1,397 ▲94.17 ▼0.0099.76 ▼11.3842.05 ▼3.81

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • can_compress_scripts
    • viwcpf_setting_params
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 12× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/pofily-woo-product-filters/public/partials/template/viwcpf-template-image.php:22
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/pofily-woo-product-filters/public/partials/template/viwcpf-template-dropdown.php:21
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/pofily-woo-product-filters/public/partials/template/viwcpf-template-range_slider.php:18
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/pofily-woo-product-filters/public/partials/template/viwcpf-template-color_swatches.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/pofily-woo-product-filters/admin/partials/widget/viwcpf.widget_menu_filter.php:5
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/pofily-woo-product-filters/public/partials/template/viwcpf-template-button.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/pofily-woo-product-filters/admin/partials/display-detail-filter-menu-page.php:8
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/pofily-woo-product-filters/public/partials/template/viwcpf-template-checkbox.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/pofily-woo-product-filters/admin/partials/display-detail-filter-block-page.php:8
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/pofily-woo-product-filters/public/partials/template/viwcpf-template-icon_star.php:22

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 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 14 tag instead of maximum 10
You can look at the official readme.txt

pofily-woo-product-filters/pofily-woo-product-filters.php 92% from 13 tests

The main PHP file in "Pofily - WooCommerce Product Filters" ver. 1.1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 158 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin21,623 lines of code in 79 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript191,6015428,510
PHP237831,1176,977
CSS304591573,103
SVG5041,938
Sass11092616
PO File1225303479

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity62.55
▷ Minimum class complexity1.00
▷ Maximum class complexity379.00
Average method complexity6.69
▷ Minimum method complexity1.00
▷ Maximum method complexity88.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods119
▷ Static methods21.68%
▷ Public methods9983.19%
▷ Protected methods1310.92%
▷ Private methods75.88%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/bottom-left.png0.82KB0.45KB▼ 44.79%
admin/images/filter-offcanvas.png0.89KB0.44KB▼ 50.16%
admin/images/top-left.png0.82KB0.46KB▼ 43.97%
admin/images/photos-placeholder.png6.47KB5.17KB▼ 20.05%
admin/images/top-right.png0.82KB0.46KB▼ 44.32%