78% smart-woocommerce-search

Code Review | Smart WooCommerce Search

WordPress plugin Smart WooCommerce Search scored78%from 54 tests.

About plugin

  • Plugin page: smart-woocommerce...
  • Plugin version: 2.7.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Jan 12, 2017
  • Latest release: Nov 8, 2023
  • Number of updates: 136
  • Update frequency: every 18.3 days
  • Top authors: yummy-wp (100%)

Code review

54 tests

User reviews

22 reviews

Install metrics

10,000+ active /299,927 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼12.52ms] Passed 4 tests

An overview of server-side resources used by Smart WooCommerce Search
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0635.01 ▼1.52
Dashboard /wp-admin3.35 ▲0.0545.87 ▼2.19
Posts /wp-admin/edit.php3.41 ▲0.0549.31 ▲3.39
Add New Post /wp-admin/post-new.php5.94 ▲0.0589.83 ▼49.68
Media Library /wp-admin/upload.php3.28 ▲0.0535.75 ▲3.30
Synonyms /wp-admin/admin.php?page=smart-search-synonyms3.2731.14
Widgets /wp-admin/admin.php?page=smart-search3.3028.38
Stop Words /wp-admin/admin.php?page=smart-search-stop-words3.2731.90
Upgrade to Pro /wp-admin/admin.php?page=smart-search-update-to-pro3.2228.88
Add New /wp-admin/admin.php?page=smart-search-custom-new3.3437.92

Server storage [IO: ▲0.47MB] [DB: ▲0.31MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 74 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_ysm_search_widget
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Smart WooCommerce Search
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,915 ▲15313.80 ▼0.719.11 ▲7.5429.27 ▼13.22
Dashboard /wp-admin2,233 ▲535.63 ▼0.0393.35 ▼4.0543.16 ▼1.84
Posts /wp-admin/edit.php2,138 ▲381.95 ▼0.0640.76 ▲2.7443.50 ▲3.69
Add New Post /wp-admin/post-new.php1,557 ▲2123.34 ▲5.01622.53 ▼43.3459.40 ▼10.19
Media Library /wp-admin/upload.php1,432 ▲294.21 ▲0.06102.65 ▲5.2743.45 ▲1.00
Synonyms /wp-admin/admin.php?page=smart-search-synonyms9032.3541.8332.47
Widgets /wp-admin/admin.php?page=smart-search9792.3842.2235.64
Stop Words /wp-admin/admin.php?page=smart-search-stop-words8982.1232.9429.57
Upgrade to Pro /wp-admin/admin.php?page=smart-search-update-to-pro7031.126.8516.12
Add New /wp-admin/admin.php?page=smart-search-custom-new4,1933.26115.5355.46

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • widget_ysm_search_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=smart-search-update-to-pro
    • > Warning in wp-includes/pluggable.php+1438
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 19× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function YSM\\Rest\\add_action() in wp-content/plugins/smart-woocommerce-search/inc/custom/rest.php:4
    • > PHP Notice
      Undefined variable: w_id in wp-content/plugins/smart-woocommerce-search/templates/admin-tab-styling.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function YSWS\\Compat\\Elementor\\add_filter() in wp-content/plugins/smart-woocommerce-search/inc/compat/compat-elementor.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ysm_setting() in wp-content/plugins/smart-woocommerce-search/templates/admin-tab-spellcheck.php:6
    • > PHP Notice
      Undefined variable: w_id in wp-content/plugins/smart-woocommerce-search/templates/admin-tab-styling.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/smart-woocommerce-search/templates/admin-tab-general.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function YSM\\Hooks\\add_filter() in wp-content/plugins/smart-woocommerce-search/inc/custom/hooks.php:4
    • > PHP Notice
      Undefined variable: w_id in wp-content/plugins/smart-woocommerce-search/templates/admin-tab-general.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/smart-woocommerce-search/inc/compat/class-module-elementor.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/smart-woocommerce-search/inc/custom/class-ysm-search-widget.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 52 tag instead of maximum 10
Please take inspiration from this readme.txt

smart-woocommerce-search/index.php 85% from 13 tests

"Smart WooCommerce Search" version 2.7.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("5.4" instead of "4.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("smart-woocommerce-search.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin5,939 lines of code in 64 files:
LanguageFilesBlank linesComment linesLines of code
PHP396858083,179
JavaScript84184631,900
Sass131385845
SVG10012
CSS3003

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity28.00
▷ Minimum class complexity6.00
▷ Maximum class complexity100.00
Average method complexity3.70
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces8
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods100
▷ Static methods6666.00%
▷ Public methods8181.00%
▷ Protected methods77.00%
▷ Private methods1212.00%
Functions44
▷ Named functions44100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/search-icon.png3.06KB2.40KB▼ 21.40%