67% pwf-wc-product-filters

Code Review | PWF - Products Filter for WooCommerce

WordPress plugin PWF - Products Filter for WooCommerce scored67%from 54 tests.

About plugin

  • Plugin page: pwf-wc-product-fi...
  • Plugin version: 1.1.5
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6.0-6.1
  • WordPress version: 6.3.1
  • First release: Jun 25, 2021
  • Latest release: Apr 1, 2023
  • Number of updates: 41
  • Update frequency: every 15.7 days
  • Top authors: mostafaabd (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /3,601 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼2.30ms] Passed 4 tests

Analyzing server-side resources used by PWF - Products Filter for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0838.81 ▼2.33
Dashboard /wp-admin3.47 ▲0.1744.57 ▼14.22
Posts /wp-admin/edit.php3.52 ▲0.1745.50 ▲2.47
Add New Post /wp-admin/post-new.php6.04 ▲0.1595.10 ▲13.01
Media Library /wp-admin/upload.php3.33 ▲0.1036.64 ▲4.87
Add new /wp-admin/post-new.php?post_type=pwf_woofilter4.0144.10
Filters /wp-admin/edit.php?post_type=pwf_woofilter3.3736.32
Settings /wp-admin/edit.php?post_type=pwf_woofilter&page=pwf-settings3.3026.67
Anyalytics /wp-admin/edit.php?post_type=pwf_woofilter&page=pwf-anyalytics3.5180.78

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 162 new files
Database: 5 new tables, 9 new options
New tables
wp_wc_pwf_terms
wp_wc_pwf_filters_terms
wp_wc_pwf_range_sliders
wp_wc_pwf_filters
wp_wc_pwf_searches
New WordPress options
theysaidso_admin_options
pwf_woocommerce_free_version
pwf_woocommerce_free_version_update_message
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_pwf-woo-filter

Browser metrics Passed 4 tests

Checking browser requirements for PWF - Products Filter for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲11013.41 ▼0.971.76 ▼0.1246.92 ▼0.09
Dashboard /wp-admin2,241 ▲565.84 ▲0.02100.75 ▼4.9840.20 ▼3.71
Posts /wp-admin/edit.php2,123 ▲342.06 ▲0.0537.15 ▲0.9833.62 ▼2.20
Add New Post /wp-admin/post-new.php1,562 ▲2923.09 ▼0.01618.41 ▼61.9054.75 ▼1.05
Media Library /wp-admin/upload.php1,423 ▲324.23 ▲0.0597.82 ▼3.0041.98 ▼5.67
Add new /wp-admin/post-new.php?post_type=pwf_woofilter2,1345.08114.6653.01
Filters /wp-admin/edit.php?post_type=pwf_woofilter1,1121.9330.2530.35
Settings /wp-admin/edit.php?post_type=pwf_woofilter&page=pwf-settings9362.0622.6225.38
Anyalytics /wp-admin/edit.php?post_type=pwf_woofilter&page=pwf-anyalytics8682.7944.6937.23

Uninstaller [IO: ▲0.00MB] [DB: ▲0.08MB] 50% 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 tables were found after uninstall: 5 tables
    • wp_wc_pwf_filters_terms
    • wp_wc_pwf_filters
    • wp_wc_pwf_terms
    • wp_wc_pwf_searches
    • wp_wc_pwf_range_sliders
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_pwf-woo-filter
    • pwf_woocommerce_free_version_update_message
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • pwf_woocommerce_free_version
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=pwf_woofilter
    • > Notice in wp-content/plugins/pwf-wc-product-filters/includes/classes/admin/meta/class-pwf-meta-data.php+161
    Trying to get property 'term_id' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=pwf_woofilter
    • > Notice in wp-content/plugins/pwf-wc-product-filters/includes/classes/admin/meta/class-pwf-meta-data.php+162
    Trying to get property 'name' of non-object

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
Please take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pwf-wc-product-filters/includes/classes/class-pwf-autoloader.php:21

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)
No browser errors were detected

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed: You can look at the official readme.txt

pwf-wc-product-filters/pwfwoofilter.php 69% from 13 tests

The main PHP file in "PWF - Products Filter for WooCommerce" ver. 1.1.5 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("pwf-wc-product-filters.php" instead of "pwfwoofilter.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 142 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Requires at least: Required version must match the one declared in readme.txt ("4.7" instead of "5.6.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin30,739 lines of code in 130 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript773,6931,46716,998
PHP281,2329096,684
CSS223382085,135
PO File28542,3021,907
SVG10015

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity36.19
▷ Minimum class complexity1.00
▷ Maximum class complexity178.00
Average method complexity3.77
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes26
▷ Abstract classes00.00%
▷ Concrete classes26100.00%
▷ Final classes00.00%
Methods330
▷ Static methods5616.97%
▷ Public methods18756.67%
▷ Protected methods9428.48%
▷ Private methods4914.85%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants466.67%
▷ Class constants233.33%
▷ Public constants2100.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
6 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/frontend/jquery-ui/images/ui-icons_cc0000_256x240.png4.57KB4.18KB▼ 8.43%
assets/css/frontend/jquery-ui/images/ui-icons_555555_256x240.png6.91KB4.18KB▼ 39.47%
assets/css/frontend/jquery-ui/images/ui-icons_ffffff_256x240.png6.33KB4.18KB▼ 33.99%
assets/css/frontend/jquery-ui/images/ui-icons_444444_256x240.png6.92KB4.18KB▼ 39.61%
assets/css/frontend/jquery-ui/images/ui-icons_777777_256x240.png6.94KB4.18KB▼ 39.78%