84% highlight-search-terms

Code Review | Highlight Search Terms

WordPress plugin Highlight Search Terms scored 84% from 54 tests.

About plugin

  • Plugin page: highlight-search-...
  • Plugin version: 1.8.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-6.2
  • WordPress version: 6.3.1
  • First release: Apr 14, 2009
  • Latest release: Jul 3, 2023
  • Number of updates: 193
  • Update frequency: every 26.9 days
  • Top authors: RavanH (88.6%)deployer (11.92%)

Code review

54 tests

User reviews

38 reviews

Install metrics

9,000+ active / 157,775 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
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Highlight Search Terms
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0351.18 ▲3.54
Dashboard /wp-admin3.34 ▲0.0345.77 ▼2.13
Posts /wp-admin/edit.php3.39 ▲0.0345.29 ▼4.27
Add New Post /wp-admin/post-new.php5.92 ▲0.0394.89 ▲4.94
Media Library /wp-admin/upload.php3.26 ▲0.0335.91 ▲2.76

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Highlight Search Terms
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲5414.81 ▲0.392.12 ▲0.2542.81 ▲1.79
Dashboard /wp-admin2,206 ▲184.81 ▼0.29115.68 ▲4.6639.67 ▼1.55
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0135.28 ▼6.0935.49 ▼1.48
Add New Post /wp-admin/post-new.php1,537 ▲923.34 ▲4.93603.52 ▼21.5756.79 ▼2.98
Media Library /wp-admin/upload.php1,388 ▼04.19 ▲0.0296.31 ▼10.2442.96 ▼3.50

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • 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)
Good news, no errors were detected

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
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/highlight-search-terms/inc/woocommerce.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/highlight-search-terms/inc/search-filter-pro.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: search, highlight, term, hilite, terms...

highlight-search-terms/hlst.php 85% from 13 tests

This is the main PHP file of "Highlight Search Terms" version 1.8.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 416 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("highlight-search-terms.php" instead of "hlst.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
Everything looks great! No dangerous files found in this plugin1,395 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript4186951,246
PHP35085149

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods375.00%
▷ Public methods125.00%
▷ Protected methods00.00%
▷ Private methods375.00%
Functions7
▷ Named functions457.14%
▷ Anonymous functions342.86%
Constants5
▷ Global constants00.00%
▷ Class constants5100.00%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin