84% wphobby-woocommerce-product-filter

Code Review | WPHobby WooCommerce Product Filter

WordPress plugin WPHobby WooCommerce Product Filter scored84%from 54 tests.

About plugin

  • Plugin page: wphobby-woocommer...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: Jul 24, 2019
  • Latest release: Dec 13, 2019
  • Number of updates: 5
  • Update frequency: every 103.4 days
  • Top authors: darell (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /600 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

This is a short check of server-side resources used by WPHobby WooCommerce Product Filter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.51 ▼2.64
Dashboard /wp-admin3.32 ▲0.0147.69 ▼2.12
Posts /wp-admin/edit.php3.37 ▲0.0151.01 ▲3.65
Add New Post /wp-admin/post-new.php5.90 ▲0.0182.41 ▼17.08
Media Library /wp-admin/upload.php3.24 ▲0.0136.03 ▲4.59

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 33 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for WPHobby WooCommerce Product Filter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4913.28 ▼1.341.77 ▼0.5342.57 ▼0.02
Dashboard /wp-admin2,209 ▲214.86 ▼1.05108.01 ▼2.8542.76 ▼3.27
Posts /wp-admin/edit.php2,098 ▲92.01 ▲0.0138.43 ▲3.8636.15 ▲2.78
Add New Post /wp-admin/post-new.php1,520 ▼1917.50 ▼0.60603.91 ▼67.0954.91 ▲0.32
Media Library /wp-admin/upload.php1,397 ▲64.23 ▲0.0599.75 ▲1.8045.11 ▲3.46

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/wphobby-woocommerce-product-filter/includes/admin/sections/top.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/wphobby-woocommerce-product-filter/includes/admin/sections/tab-general.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wphobby-woocommerce-product-filter/includes/whpf_admin.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 30 tag instead of maximum 10
You can look at the official readme.txt

wphobby-woocommerce-product-filter/wphobby-woo-product-filter.php 92% from 13 tests

The principal PHP file in "WPHobby WooCommerce Product Filter" v. 1.0.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wphobby-woocommerce-product-filter.php" instead of "wphobby-woo-product-filter.php")

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
No dangerous file extensions were detected4,837 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
CSS91,882444,386
PHP8103149410
JavaScript29327
SVG10014

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity9.50
▷ Minimum class complexity5.00
▷ Maximum class complexity12.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
includes/admin/images/icon.png19.99KB0.88KB▼ 95.61%