84% better-search

Code Review | Better Search - Relevant search results for WordPress

WordPress plugin Better Search - Relevant search results for WordPress scored84%from 54 tests.

About plugin

  • Plugin page: better-search
  • Plugin version: 3.2.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: Mar 20, 2009
  • Latest release: Aug 22, 2023
  • Number of updates: 80
  • Update frequency: every 65.9 days
  • Top authors: Ajay (100%)

Code review

54 tests

User reviews

52 reviews

Install metrics

7,000+ active /222,903 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲1.00MB] [CPU: ▲2.96ms] Passed 4 tests

This is a short check of server-side resources used by Better Search - Relevant search results for WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.20 ▲0.7449.01 ▲1.30
Dashboard /wp-admin4.39 ▲1.0960.85 ▲10.76
Posts /wp-admin/edit.php4.44 ▲1.0957.79 ▲4.58
Add New Post /wp-admin/post-new.php6.99 ▲1.1097.24 ▼0.67
Media Library /wp-admin/upload.php4.31 ▲1.0844.52 ▲6.62
Settings /wp-admin/admin.php?page=bsearch_options_page4.2740.06
Daily Popular Searches /wp-admin/admin.php?page=bsearch_popular_searches&orderby=daily_count&order=desc4.2554.48
Tools /wp-admin/admin.php?page=bsearch_tools_page4.2538.66
Popular Searches /wp-admin/admin.php?page=bsearch_popular_searches4.2545.63

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 71 new files
Database: 2 new tables, 10 new options
New tables
wp_bsearch
wp_bsearch_daily
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
bsearch_db_version
bsearch_settings
widget_recent-comments
widget_bsearch_search_box
widget_theysaidso_widget
widget_widget_bsearch_pop
db_upgraded

Browser metrics Passed 4 tests

Better Search - Relevant search results for WordPress: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,917 ▲17113.38 ▼0.871.85 ▼0.1638.04 ▼8.00
Dashboard /wp-admin2,323 ▲1355.82 ▼0.07106.64 ▲1.2441.20 ▼4.93
Posts /wp-admin/edit.php2,124 ▲352.05 ▲0.0038.93 ▼0.7734.15 ▼4.40
Add New Post /wp-admin/post-new.php1,542 ▲1417.64 ▼0.62628.42 ▼23.3249.55 ▼14.24
Media Library /wp-admin/upload.php1,423 ▲354.22 ▲0.01101.54 ▼3.4943.43 ▲0.83
Settings /wp-admin/admin.php?page=bsearch_options_page2,1505.04138.7283.67
Daily Popular Searches /wp-admin/admin.php?page=bsearch_popular_searches&orderby=daily_count&order=desc1,3334.5685.5662.49
Tools /wp-admin/admin.php?page=bsearch_tools_page1,2574.3750.3871.52
Popular Searches /wp-admin/admin.php?page=bsearch_popular_searches1,3394.4949.9864.78

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_bsearch_search_box
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_widget_bsearch_pop
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 16× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/better-search/includes/template-redirect.php
    • > /wp-content/plugins/better-search/includes/main-functions.php
    • > /wp-content/plugins/better-search/includes/modules/tracker.php
    • > /wp-content/plugins/better-search/includes/modules/shortcode.php
    • > /wp-content/plugins/better-search/includes/activation.php
    • > /wp-content/plugins/better-search/includes/deprecated.php
    • > /wp-content/plugins/better-search/uninstall.php
    • > /wp-content/plugins/better-search/includes/general-template.php
    • > /wp-content/plugins/better-search/includes/l10n.php
    • > /wp-content/plugins/better-search/better-search.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
10 plugin tags: heatmap, relevant search, top searches, popular searches, contextual search...

better-search/better-search.php 92% from 13 tests

The main PHP script in "Better Search - Relevant search results for WordPress" version 3.2.2 is automatically included on every request by WordPress
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 146 characters long)

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
No dangerous file extensions were detected6,602 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PHP321,5313,4164,984
CSS43834694
PO File1230235619
JavaScript63513259
Markdown132046

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity29.00
▷ Minimum class complexity1.00
▷ Maximum class complexity120.00
Average method complexity4.43
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods49
▷ Static methods36.12%
▷ Public methods4795.92%
▷ Protected methods24.08%
▷ Private methods00.00%
Functions161
▷ Named functions16099.38%
▷ Anonymous functions10.62%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
12 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/admin/css/images/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%
includes/admin/css/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%
includes/admin/css/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
includes/admin/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.27KB0.18KB▼ 35.00%
includes/admin/css/images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%