78% trusty-woo-products-filter

Code Review | Shop Products Filter

WordPress plugin Shop Products Filter scored78%from 54 tests.

About plugin

  • Plugin page: trusty-woo-produc...
  • Plugin version: 1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.1
  • WordPress version: 6.3.1
  • First release: Jan 13, 2022
  • Latest release: Mar 22, 2023
  • Number of updates: 32
  • Update frequency: every 13.6 days
  • Top authors: trustyplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,123 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by Shop Products Filter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0143.25 ▼2.45
Dashboard /wp-admin3.32 ▲0.0151.37 ▲1.30
Posts /wp-admin/edit.php3.37 ▲0.0156.14 ▼1.20
Add New Post /wp-admin/post-new.php5.90 ▲0.01100.05 ▼4.32
Media Library /wp-admin/upload.php3.24 ▲0.0143.69 ▲4.99

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 98 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
trusty_woo_filter_plugin_version
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Shop Products Filter
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2914.81 ▲0.251.99 ▼0.1048.63 ▲2.78
Dashboard /wp-admin2,209 ▲244.87 ▼0.07102.61 ▼1.6539.66 ▼2.79
Posts /wp-admin/edit.php2,092 ▲32.01 ▼0.0043.32 ▲1.1034.69 ▼4.18
Add New Post /wp-admin/post-new.php1,535 ▼023.30 ▲0.29677.55 ▲1.4650.50 ▼14.49
Media Library /wp-admin/upload.php1,391 ▲34.21 ▼0.09105.00 ▼13.1144.39 ▼6.13

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
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • trusty_woo_filter_plugin_version
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • 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 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
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/trusty-woo-products-filter/includes/filters/layouts/types/twf_Product_cat.php
    • > /wp-content/plugins/trusty-woo-products-filter/includes/filters/layouts/classic-design.php
    • > /wp-content/plugins/trusty-woo-products-filter/includes/filters/layouts/types/twf_Product_tag.php
    • > /wp-content/plugins/trusty-woo-products-filter/trusty-woo-products-filter.php
  • 41× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: twf_filter_sec_color2 in wp-content/plugins/trusty-woo-products-filter/includes/filters/layouts/classic-design.php on line 23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/trusty-woo-products-filter/admin/functions.php:451
    • > PHP Notice
      Undefined variable: twf_filter_cat_label_font in wp-content/plugins/trusty-woo-products-filter/includes/filters/layouts/classic-design.php on line 21
    • > PHP Notice
      Undefined variable: twf_filter_tax_label_size in wp-content/plugins/trusty-woo-products-filter/includes/filters/layouts/classic-design.php on line 23
    • > PHP Notice
      Undefined variable: twf_filter_cat_label_trans in wp-content/plugins/trusty-woo-products-filter/includes/filters/layouts/classic-design.php on line 21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/trusty-woo-products-filter/includes/functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/trusty-woo-products-filter/admin/tabs/appearance.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/trusty-woo-products-filter/admin/tabs/typography.php:4
    • > PHP Warning
      Use of undefined constant TRUSTY_WOO_FILTER_PATH - assumed 'TRUSTY_WOO_FILTER_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/trusty-woo-products-filter/admin/admin.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/trusty-woo-products-filter/includes/manage-front.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% 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
Attributes that need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (screenshot-1.png), #2 (screenshot-2.png), #3 (screenshot-3.png), #4 (screenshot-4.png)
The official readme.txt might help

trusty-woo-products-filter/trusty-woo-products-filter.php Passed 13 tests

The primary PHP file in "Shop Products Filter" version 1.2 is used by WordPress to initiate all plugin functionality
93 characters long description:
Filter woocommerce shop products with price slider, categories, tags and specific attributes.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin31,858 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
CSS211,59917118,285
JavaScript62,1031,7408,348
SVG1002,671
PHP252321322,553
JSON1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity11.11
▷ Minimum class complexity1.00
▷ Maximum class complexity38.00
Average method complexity4.14
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/images/full-logo.png11.71KB4.58KB▼ 60.90%