78% annasta-woocommerce-product-filters

Code Review | annasta Woocommerce Product Filters

WordPress plugin annasta Woocommerce Product Filters scored78%from 54 tests.

About plugin

  • Plugin page: annasta-woocommer...
  • Plugin version: 1.7.0
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-6.4
  • WordPress version: 6.3.1
  • First release: Mar 15, 2019
  • Latest release: Nov 29, 2023
  • Number of updates: 91
  • Update frequency: every 19.0 days
  • Top authors: annastaa (100%)

Code review

54 tests

User reviews

36 reviews

Install metrics

2,000+ active /37,976 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

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

Server-side resources used by annasta Woocommerce Product Filters
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.30 ▼2.04
Dashboard /wp-admin3.31 ▼0.0445.33 ▼17.10
Posts /wp-admin/edit.php3.36 ▲0.0049.76 ▲1.70
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.67 ▼12.40
Media Library /wp-admin/upload.php3.23 ▲0.0033.47 ▼3.30

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 305 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
fs_debug_mode
widget_recent-comments
can_compress_scripts
fs_active_plugins
fs_accounts
widget_theysaidso_widget

Browser metrics Passed 4 tests

annasta Woocommerce Product Filters: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.72 ▲0.441.84 ▲0.1845.37 ▲2.47
Dashboard /wp-admin2,195 ▲185.63 ▼0.0491.07 ▼9.3438.62 ▼4.19
Posts /wp-admin/edit.php2,103 ▲32.01 ▲0.0433.54 ▼5.4635.60 ▲0.57
Add New Post /wp-admin/post-new.php1,526 ▼923.48 ▼1.56587.29 ▼5.5858.43 ▼7.17
Media Library /wp-admin/upload.php1,403 ▼04.22 ▲0.0498.05 ▲2.6743.31 ▼1.63

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_recent-comments
    • theysaidso_admin_options
    • fs_accounts
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • fs_debug_mode
    • widget_theysaidso_widget
    • fs_active_plugins

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 19× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/annasta-woocommerce-product-filters/code/class-a-w-f-frontend.php
    • > /wp-content/plugins/annasta-woocommerce-product-filters/code/class-a-w-f-admin.php
    • > /wp-content/plugins/annasta-woocommerce-product-filters/code/themes-support/ecommerce-gem.php
    • > /wp-content/plugins/annasta-woocommerce-product-filters/code/themes-support/flatsome.php
    • > /wp-content/plugins/annasta-woocommerce-product-filters/code/class-a-w-f-settings.php
    • > /wp-content/plugins/annasta-woocommerce-product-filters/code/themes-support/astra.php
    • > /wp-content/plugins/annasta-woocommerce-product-filters/code/class-a-w-f-widget.php
    • > /wp-content/plugins/annasta-woocommerce-product-filters/code/compatibility-support.php
    • > /wp-content/plugins/annasta-woocommerce-product-filters/code/class-a-w-f-preset-frontend.php
    • > /wp-content/plugins/annasta-woocommerce-product-filters/code/class-a-w-f-preset.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Control' not found in wp-content/plugins/annasta-woocommerce-product-filters/code/customizer-controls/class-a-w-f-customizer-alpha-color-picker.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: woocommerce filter, ajax filter, product filter, woocommerce products filter, woocommerce product filter

annasta-woocommerce-product-filters/annasta-woocommerce-product-filters.php 85% from 13 tests

"annasta Woocommerce Product Filters" version 1.7.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.7" instead of "3.3")
  • 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 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin77,827 lines of code in 225 files:
LanguageFilesBlank linesComment linesLines of code
PHP16811,06817,69345,177
JavaScript222,4221,15513,138
CSS303,06023611,203
SVG2005,835
PO File18159462,423
XML10027
JSON10024

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity98.94
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.84
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes66
▷ Abstract classes23.03%
▷ Concrete classes6496.97%
▷ Final classes00.00%
Methods1,622
▷ Static methods23414.43%
▷ Public methods1,12269.17%
▷ Protected methods945.80%
▷ Private methods40625.03%
Functions134
▷ Named functions10175.37%
▷ Anonymous functions3324.63%
Constants149
▷ Global constants10268.46%
▷ Class constants4731.54%
▷ Public constants47100.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
16 PNG files occupy 0.09MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
styles/images/display-mode-visible-on-s.png4.73KB3.11KB▼ 34.39%
styles/images/transparency-grid.png2.58KB2.80KB0.00%
styles/images/display-mode-togglable-on-s-L.png1.85KB1.48KB▼ 20.01%
styles/images/display-mode-togglable-on-s.png7.59KB4.54KB▼ 40.16%
styles/images/display-mode-visible.png7.11KB4.27KB▼ 40.00%