78% search-with-typesense

Code Review | Search with Typesense

WordPress plugin Search with Typesense scored78%from 54 tests.

About plugin

  • Plugin page: search-with-types...
  • Plugin version: 1.9.5
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.3.1
  • WordPress version: 6.3.1
  • First release: Jan 4, 2022
  • Latest release: Sep 29, 2023
  • Number of updates: 153
  • Update frequency: every 4.1 days
  • Top authors: codemanas (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

100+ active /6,228 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.62MB] [CPU: ▲1.92ms] Passed 4 tests

A check of server-side resources used by Search with Typesense
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.42 ▲0.6948.54 ▲0.74
Dashboard /wp-admin4.20 ▲0.6354.20 ▲2.19
Posts /wp-admin/edit.php4.25 ▲0.5757.36 ▲1.82
Add New Post /wp-admin/post-new.php6.80 ▲0.6599.26 ▲2.94
Media Library /wp-admin/upload.php4.12 ▲0.6345.34 ▲5.63

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 73 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded
cm_typesense_plugin_activate
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Search with Typesense
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,970 ▲20915.05 ▲0.8127.82 ▲25.9337.89 ▼2.97
Dashboard /wp-admin2,211 ▲345.68 ▲0.0791.50 ▲0.3940.04 ▼6.37
Posts /wp-admin/edit.php2,116 ▲192.04 ▲0.0139.38 ▲3.1936.79 ▼2.61
Add New Post /wp-admin/post-new.php1,563 ▲1823.12 ▲0.07663.02 ▲3.6857.13 ▼18.26
Media Library /wp-admin/upload.php1,416 ▲164.23 ▲0.1096.23 ▼14.3943.63 ▼7.35

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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 detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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
  • 6× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/search-with-typesense/templates/instant-search/main-panel.php
    • > /wp-content/plugins/search-with-typesense/codemanas-typesense.php
    • > /wp-content/plugins/search-with-typesense/templates/autocomplete/header.php
    • > /wp-content/plugins/search-with-typesense/templates/instant-search/partials/sort-by.php
    • > /wp-content/plugins/search-with-typesense/templates/instant-search/partials/current-refinements.php
    • > /wp-content/plugins/search-with-typesense/templates/instant-search/partials/index-switcher.php
  • 27× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/search-with-typesense/includes/views/AdminArea/index.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Codemanas\\Typesense\\Backend\\Admin' not found in wp-content/plugins/search-with-typesense/templates/autocomplete.php:6
    • > PHP Warning
      require_once(CODEMANAS_TYPESENSE_ROOT_DIR_PATH/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/search-with-typesense/includes/Bootstrap.php on line 81
    • > PHP Notice
      Undefined index: post_types in wp-content/plugins/search-with-typesense/templates/instant-search/main-panel.php on line 13
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/search-with-typesense/templates/instant-search/partials/index-switcher.php on line 6
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/search-with-typesense/templates/instant-search/partials/sort-by.php on line 10
    • > PHP Notice
      Undefined index: filter in wp-content/plugins/search-with-typesense/templates/instant-search/filter-panel.php on line 8
    • > PHP Notice
      Undefined index: post_types in wp-content/plugins/search-with-typesense/templates/instant-search.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _wp_specialchars() in wp-content/plugins/search-with-typesense/templates/instant-search/search-header.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/search-with-typesense/templates/instant-search/partials/stats.php:2

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
5 plugin tags: typesense, search, instant search, autocomplete, lightning fast

search-with-typesense/codemanas-typesense.php 85% from 13 tests

The main file in "Search with Typesense" v. 1.9.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("6.2.0" instead of "6.2")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("search-with-typesense.php" instead of "codemanas-typesense.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin3,388 lines of code in 60 files:
LanguageFilesBlank linesComment linesLines of code
PHP486497183,225
JavaScript72429154
JSON1005
CSS4114

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity19.10
▷ Minimum class complexity1.00
▷ Maximum class complexity62.00
Average method complexity2.85
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces10
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes15.00%
Methods189
▷ Static methods3317.46%
▷ Public methods17492.06%
▷ Protected methods42.12%
▷ Private methods115.82%
Functions6
▷ Named functions233.33%
▷ Anonymous functions466.67%
Constants7
▷ Global constants571.43%
▷ Class constants228.57%
▷ Public constants2100.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
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo.png5.47KB2.37KB▼ 56.70%
assets/images/logo-ts.png8.36KB4.27KB▼ 48.97%