84% sf-autosuggest-product-search

Code Review | SF Autosuggest Product Search

WordPress plugin SF Autosuggest Product Search scored84%from 54 tests.

About plugin

  • Plugin page: sf-autosuggest-pr...
  • Plugin version: 1.3.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Feb 23, 2023
  • Latest release: Sep 27, 2023
  • Number of updates: 10
  • Update frequency: every 23.0 days
  • Top authors: simonefontana (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /314 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼0.65ms] Passed 4 tests

Analyzing server-side resources used by SF Autosuggest Product Search
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1444.92 ▼0.26
Dashboard /wp-admin3.45 ▲0.1551.78 ▼1.24
Posts /wp-admin/edit.php3.57 ▲0.2149.76 ▲1.27
Add New Post /wp-admin/post-new.php6.05 ▲0.1789.23 ▼2.39
Media Library /wp-admin/upload.php3.38 ▲0.1541.90 ▲5.63

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

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

Browser metrics Passed 4 tests

SF Autosuggest Product Search: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲15113.46 ▼0.8910.22 ▲8.4542.96 ▼2.17
Dashboard /wp-admin2,226 ▲495.75 ▲0.1092.38 ▼12.7150.62 ▲6.16
Posts /wp-admin/edit.php2,142 ▲422.41 ▲0.3939.29 ▲0.9847.10 ▲11.64
Add New Post /wp-admin/post-new.php1,555 ▲2923.33 ▲0.31714.69 ▲31.5833.60 ▼27.96
Media Library /wp-admin/upload.php1,434 ▲374.40 ▲0.16113.34 ▲4.0745.80 ▼0.66

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
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 add_action() in wp-content/plugins/sf-autosuggest-product-search/classes/AdminClass.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sf-autosuggest-product-search/classes/FeedbackClass.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sf-autosuggest-product-search/sf_products_autosuggest.php:27

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: products, search, woocommerce, ecommerce, woocommerce search

sf-autosuggest-product-search/sf_products_autosuggest.php 85% from 13 tests

Analyzing the main PHP file in "SF Autosuggest Product Search" version 1.3.2
Please make the necessary changes and fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("3.8.8" instead of "3.0.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sf-autosuggest-product-search.php" instead of "sf_products_autosuggest.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
There were no executable files found in this plugin959 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP59619773
CSS2250117
JavaScript211469

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity15.75
▷ Minimum class complexity5.00
▷ Maximum class complexity27.00
Average method complexity3.27
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods2180.77%
▷ Protected methods00.00%
▷ Private methods519.23%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/search-example.png20.84KB7.43KB▼ 64.36%