83% ajax-product-filter-for-woocommerce

Code Review | Ajax Product Filter for Woocommerce

WordPress plugin Ajax Product Filter for Woocommerce scored 83% from 54 tests.

About plugin

  • Plugin page: ajax-product-filt...
  • Plugin version: 2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-5.3
  • WordPress version: 6.3.1
  • First release: Aug 1, 2016
  • Latest release: Nov 19, 2019
  • Number of updates: 109
  • Update frequency: every 11.1 days
  • Top authors: phoeniixx (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

40+ active / 16,205 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
This plugin's installer ran successfully

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

This is a short check of server-side resources used by Ajax Product Filter for Woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0234.80 ▼2.11
Dashboard /wp-admin3.31 ▲0.0142.89 ▼6.21
Posts /wp-admin/edit.php3.36 ▲0.0044.25 ▼1.92
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.63 ▼5.34
Media Library /wp-admin/upload.php3.23 ▲0.0032.39 ▼1.40

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 48 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
phoe_Ajax_Product_Filter_value

Browser metrics Passed 4 tests

A check of browser resources used by Ajax Product Filter for Woocommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,033 ▲27614.76 ▲0.3617.47 ▲15.4540.07 ▼5.04
Dashboard /wp-admin2,206 ▲235.84 ▲0.88108.31 ▼0.8339.42 ▼2.55
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0138.43 ▼0.2734.85 ▲0.16
Add New Post /wp-admin/post-new.php1,519 ▼023.62 ▲0.53672.71 ▼39.9654.39 ▼5.97
Media Library /wp-admin/upload.php1,391 ▼04.22 ▼0.0295.77 ▼7.6241.27 ▼2.28

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • phoe_Ajax_Product_Filter_value
    • 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)
Everything seems fine, however this is by no means 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
Please take a closer look at the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/ajax-product-filter-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/ajax-product-filter-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/ajax-product-filter-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Tags: You are using too many tags: 32 tag instead of maximum 10
Please take inspiration from this readme.txt

ajax-product-filter-for-woocommerce/mainfilter.php 77% from 13 tests

The main file in "Ajax Product Filter for Woocommerce" v. 2.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.0" instead of "2.6.0")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ajax-product-filter-for-woocommerce.php" instead of "mainfilter.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin3,577 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP111,9811,6993,577

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity46.27
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity5.26
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods117
▷ Static methods54.27%
▷ Public methods9480.34%
▷ Protected methods2319.66%
▷ Private methods00.00%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants3100.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
20 PNG files occupy 0.47MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/image-frame-even.png0.67KB0.62KB▼ 8.42%
assets/images/display-type.png10.90KB4.31KB▼ 60.43%
assets/images/button2.png3.58KB2.59KB▼ 27.61%
assets/images/premium-btn.png5.72KB5.28KB▼ 7.69%
assets/images/tags.png83.81KB25.40KB▼ 69.69%