84% relevanssi

Code Review | Relevanssi - A Better Search

WordPress plugin Relevanssi - A Better Search scored84%from 54 tests.

About plugin

  • Plugin page: relevanssi
  • Plugin version: 4.21.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3
  • WordPress version: 6.3.1
  • First release: Jun 30, 2009
  • Latest release: Sep 13, 2023
  • Number of updates: 356
  • Update frequency: every 14.6 days
  • Top authors: msaari (98.31%)deployer (1.97%)

Code review

54 tests

User reviews

376 reviews

Install metrics

100,000+ active /6,091,724 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲1.53MB] [CPU: ▲6.23ms] Passed 4 tests

Analyzing server-side resources used by Relevanssi - A Better Search
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.99 ▲1.5249.45 ▲10.13
Dashboard /wp-admin4.85 ▲1.5454.00 ▲4.32
Posts /wp-admin/edit.php4.96 ▲1.6055.52 ▲3.67
Add New Post /wp-admin/post-new.php7.43 ▲1.54108.19 ▲7.35
Media Library /wp-admin/upload.php4.77 ▲1.5346.26 ▲9.59
Relevanssi /wp-admin/options-general.php?page=relevanssi/relevanssi.php4.8142.89
User searches /wp-admin/index.php?page=relevanssi/relevanssi.php4.7443.23
Admin search /wp-admin/index.php?page=relevanssi_admin_search4.7542.93

Server storage [IO: ▲1.01MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 90 new files
Database: 3 new tables, 61 new options
New tables
wp_relevanssi_stopwords
wp_relevanssi_log
wp_relevanssi
New WordPress options
relevanssi_throttle_limit
relevanssi_wpml_only_current
relevanssi_highlight_docs
relevanssi_css
relevanssi_index_author
relevanssi_excerpt_custom_fields
relevanssi_implicit_operator
relevanssi_index_taxonomies_list
relevanssi_index_post_types
relevanssi_cat
...

Browser metrics Passed 4 tests

A check of browser resources used by Relevanssi - A Better Search
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲6614.80 ▲0.391.77 ▲0.1239.07 ▲1.99
Dashboard /wp-admin2,221 ▲305.79 ▲0.89104.33 ▲6.2737.70 ▼7.71
Posts /wp-admin/edit.php2,101 ▲92.00 ▼0.0333.44 ▼2.6636.17 ▲3.69
Add New Post /wp-admin/post-new.php1,545 ▲2423.14 ▼0.14598.70 ▼83.2252.50 ▼11.79
Media Library /wp-admin/upload.php1,403 ▲154.18 ▲0.0096.07 ▼1.9343.04 ▼3.48
Relevanssi /wp-admin/options-general.php?page=relevanssi/relevanssi.php1,3832.0632.0731.18
User searches /wp-admin/index.php?page=relevanssi/relevanssi.php8162.5730.7723.77
Admin search /wp-admin/index.php?page=relevanssi_admin_search9392.5234.3728.36

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 39× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/relevanssi/lib/compatibility/members.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/relevanssi/lib/compatibility/bricks.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/relevanssi/lib/compatibility/wp-file-download.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/relevanssi/lib/compatibility/elementor.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/relevanssi/lib/compatibility/wp-search-suggest.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/relevanssi/lib/compatibility/aioseo.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/relevanssi/lib/compatibility/tablepress.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/relevanssi/lib/init.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/relevanssi/lib/compatibility/paidmembershippro.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/relevanssi/lib/compatibility/woocommerce.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
5 plugin tags: product search, search, woocommerce search, relevance, better search

relevanssi/relevanssi.php Passed 13 tests

The entry point to "Relevanssi - A Better Search" version 4.21.1 is a PHP file that has certain tags in its header comment area
70 characters long description:
This plugin replaces WordPress search with a relevance-sorting search.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin15,494 lines of code in 73 files:
LanguageFilesBlank linesComment linesLines of code
PHP681,7716,18812,497
PO File27268992,377
JavaScript25712524
CSS122096

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity5.00
▷ Minimum method complexity5.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods1
▷ Static methods00.00%
▷ Public methods1100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions410
▷ Named functions37892.20%
▷ Anonymous functions327.80%
Constants2
▷ Global constants2100.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 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
delete.png0.70KB0.72KB0.00%