73% premmerce-woocommerce-product-filter

Code Review | Premmerce Product Filter for WooCommerce

WordPress plugin Premmerce Product Filter for WooCommerce scored73%from 54 tests.

About plugin

  • Plugin page: premmerce-woocomm...
  • Plugin version: 3.7.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 7, 2017
  • Latest release: Aug 11, 2023
  • Number of updates: 57
  • Update frequency: every 36.9 days
  • Top authors: premmerce (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

3,000+ active /94,677 total downloads

Benchmarks

Plugin footprint 65% 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: ▲5.44MB] [CPU: ▲28.81ms] 75% from 4 tests

Server-side resources used by Premmerce Product Filter for WooCommerce
Please fix the following
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.44MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.25 ▲5.7963.20 ▲27.45
Dashboard /wp-admin9.27 ▲5.9773.65 ▲27.39
Posts /wp-admin/edit.php9.27 ▲5.9170.98 ▲24.98
Add New Post /wp-admin/post-new.php9.98 ▲4.09119.59 ▲35.43
Media Library /wp-admin/upload.php9.27 ▲6.0468.83 ▲37.92
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2756.88

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 334 new files
Database: no new tables, 10 new options
New WordPress options
can_compress_scripts
fs_debug_mode
db_upgraded
fs_accounts
fs_active_plugins
premmerce_filter_settings
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Premmerce Product Filter for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5414.26 ▼0.091.66 ▼0.2127.87 ▼12.58
Dashboard /wp-admin2,216 ▲415.56 ▼0.1382.18 ▼20.9343.50 ▲4.92
Posts /wp-admin/edit.php2,124 ▲242.11 ▲0.1539.39 ▲2.5440.80 ▲3.81
Add New Post /wp-admin/post-new.php6,217 ▲4,69121.51 ▼1.52843.96 ▲172.7868.49 ▲13.43
Media Library /wp-admin/upload.php1,427 ▲304.17 ▼0.0392.29 ▼11.3644.26 ▲3.13
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0851.7023.2927.50

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/premmerce-woocommerce-product-filter/src/FilterPlugin.php+216
    rmdir(wp-content/uploads/cache/premmerce_filter/): No such file or directory
  • This plugin does not fully uninstall, leaving 10 options in the database
    • premmerce_filter_settings
    • fs_active_plugins
    • theysaidso_admin_options
    • fs_accounts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • fs_debug_mode
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 25× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/premmerce-woocommerce-product-filter/src/Widget/ActiveFilterWidget.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Premmerce\\SDK\\V2\\Plugin\\PluginInterface' not found in wp-content/plugins/premmerce-woocommerce-product-filter/src/FilterPlugin.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Premmerce\\Filter\\Admin\\Tabs\\Base\\BaseSettings' not found in wp-content/plugins/premmerce-woocommerce-product-filter/src/Admin/Tabs/PermalinkSettings.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Premmerce\\Filter\\Seo\\Query' not found in wp-content/plugins/premmerce-woocommerce-product-filter/src/Seo/SeoTermModel.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'Premmerce\\Filter\\Admin\\Tabs\\Base\\TabInterface' not found in wp-content/plugins/premmerce-woocommerce-product-filter/src/Admin/Tabs/Cache.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Premmerce\\Filter\\Filter\\Items\\Types\\BaseFilter' not found in wp-content/plugins/premmerce-woocommerce-product-filter/src/Filter/Items/Types/TaxonomyFilter.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Premmerce\\Filter\\Seo\\Query' not found in wp-content/plugins/premmerce-woocommerce-product-filter/src/Seo/SeoModel.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'Premmerce\\Filter\\Ajax\\Strategy\\ThemeStrategyInterface' not found in wp-content/plugins/premmerce-woocommerce-product-filter/src/Ajax/Strategy/WidgetsStrategy.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'Premmerce\\Filter\\Admin\\Tabs\\Base\\TabInterface' not found in wp-content/plugins/premmerce-woocommerce-product-filter/src/Admin/Tabs/SimpleTab.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Premmerce\\Filter\\Admin\\Tabs\\Base\\SortableListTab' not found in wp-content/plugins/premmerce-woocommerce-product-filter/src/Admin/Tabs/Attributes.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: product filter, woocommerce product filter, woocommerce filter, attributes filter, premmerce

premmerce-woocommerce-product-filter/premmerce-filter.php 77% from 13 tests

"Premmerce Product Filter for WooCommerce" version 3.7.2'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:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("premmerce-woocommerce-product-filter.php" instead of "premmerce-filter.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.8" instead of "3.6.0")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin56,697 lines of code in 249 files:
LanguageFilesBlank linesComment linesLines of code
PHP2079,37320,24540,848
CSS211,28117410,668
PO File51,1621,3253,267
JavaScript102711641,152
SVG302628
Markdown153070
JSON20064

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity51.92
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.08
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces21
Interfaces4
Traits0
Classes96
▷ Abstract classes55.21%
▷ Concrete classes9194.79%
▷ Final classes00.00%
Methods1,712
▷ Static methods24014.02%
▷ Public methods1,25873.48%
▷ Protected methods422.45%
▷ Private methods41224.07%
Functions132
▷ Named functions10579.55%
▷ Anonymous functions2720.45%
Constants177
▷ Global constants9855.37%
▷ Class constants7944.63%
▷ Public constants79100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
27 PNG files occupy 0.28MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/admin/js/pricing-page/7ed6583271437ad6bb095fb6552a3d6b.png11.69KB5.26KB▼ 54.97%
assets/admin/img/permalink.png25.02KB9.05KB▼ 63.85%
assets/admin/img/wp.png13.26KB3.58KB▼ 72.97%
assets/admin/img/premmerce.png4.85KB3.02KB▼ 37.59%
assets/admin/js/pricing-page/f3aac72a8e63997d6bb888f816457e9b.png5.90KB3.16KB▼ 46.47%