Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OmniSuggest AI — Custom WooCommerce AI Plugin

A custom WordPress plugin built by Hung Cao / Cao-Tech LLC that connects AI-assisted product search, conversational assistance, and behavior-based suggestions to a WooCommerce catalog.

OmniSuggest supports OpenAI, Google Gemini and OpenRouter (one key for models such as Qwen, GPT, Claude and Gemini), with WordPress administration for provider credentials, assistant tone, business information, policies, search options, and reporting. The plugin combines frontend JavaScript, REST endpoints, catalog lookup tools, and PHP service integrations.

Project integration: Evolve Vapor uses OmniSuggest for its AI product search. Evolve supplies the custom Elementor search interface; OmniSuggest supplies the search ranking endpoint behind it.

My contribution

I built the plugin's PHP architecture, AI provider integration, WooCommerce lookup tools, REST handlers, frontend interfaces, settings screens, and reporting features. I also connected OmniSuggest to Evolve Vapor's custom Elementor Header Search widget so customer search wording could be matched against catalog products and displayed within the site's own design.

The implementation keeps the AI engine, event tracking and request handling, administration, and frontend presentation in identifiable modules. This allows a site-specific interface such as Evolve's to reuse the plugin's search service.

AI features

AI product search

OmniSuggest ranks catalog candidates against the customer's search wording and returns product IDs with short match explanations. Candidate context includes product titles, categories, and tags, giving the model more information than a title alone.

The implemented search pipeline:

  1. Retrieve visible, published catalog candidates using WordPress search.
  2. If that search has no candidates, retrieve recent in-stock products as a broader fallback pool.
  3. Ask the configured AI provider to rank the supplied candidates against the query.
  4. Validate returned IDs against the candidate list and load product details for display.
  5. Cache the result for ten minutes by search term and requested result count.

If AI ranking is unavailable or returns no usable matches, the endpoint falls back to the candidate ordering. This is candidate-based AI ranking; the plugin does not maintain a separate vector index of the entire catalog.

Conversational assistant

The plugin includes a chat interface and provider-specific request handling. Its tool definitions allow the assistant to:

  • Search WooCommerce products by keyword.
  • Retrieve details for a product ID.
  • Check current inventory for a product ID.
  • Read published site-page content for store information and policies.

Configurable business details, policy fields, and tone settings provide additional context. Conversation history and session context are passed through the chat implementation.

Behavior-based suggestions

Frontend tracking and REST handlers record product views, scroll activity, clicks, and exit-intent events. The AI engine includes suggestion and abandonment-suggestion methods, along with attribute-pattern detection across viewed products.

These modules use browsing context to inform suggestions. They are separate from the explicit search-query flow, which starts with text entered by the visitor.

Evolve Vapor integration

Evolve Vapor demonstrates OmniSuggest as a reusable backend for a custom Elementor interface.

Evolve Elementor Header Search
        |
        v
Evolve Core search handler
        |
        v
GET /omnisuggest/v1/search-suggest
        |
        v
Catalog candidates -> AI ranking -> Product details and reasons
        |
        v
Evolve's branded search result cards

Evolve's handler checks whether OmniSuggest is available and whether AI search is enabled in the widget. It dispatches an internal WordPress REST request, maps the returned matches into its own card layout, and displays the match reasons. If the integration is unavailable or returns no results, Evolve falls back to local product search.

Evolve's questionnaire-based matching is implemented in its separate evolve-ai-vape-match plugin. OmniSuggest powers the AI search integration described here.

WordPress and Elementor integration

OmniSuggest exposes the [omnisuggest_search] shortcode for placing a search-assistance anchor in Elementor, Gutenberg, or shortcode-compatible content. Its frontend search helper also includes automatic placement and autocomplete behavior.

Custom interfaces can consume the REST endpoints directly. OmniSuggest does not require a dedicated Elementor widget of its own; Evolve's widget is an example of an independently implemented consumer.

Administration and reporting

  • Provider configuration: OpenAI, Gemini or OpenRouter selection, credential settings, and the OpenRouter model (checked against OpenRouter's catalog for tool-call support; reasoning switched off where optional).
  • Assistant configuration: personality, intent sensitivity, business context, tone notes, and policy text.
  • Search configuration: enable/disable controls, autocomplete, and result-count settings.
  • Statistics: event-backed reports for suggestions, interactions, product activity, and attributed cart additions, plus a WordPress dashboard widget.
  • License management: activation, validation, expiry checks, and Pro-status handling.
  • Update integration: plugin update checks against a separate Cao-Tech service.

Licensing and update-server implementations are not included in this repository. Their endpoints and client-side integration are present in the plugin.

Architecture

File Responsibility
omnisuggest-ai.php Bootstrap, constants, event-table setup, admin screens, statistics, licensing, and update integration.
class-omni-ai-engine.php Provider requests, tool definitions, catalog lookup, chat, suggestion generation, search ranking, and credential encryption helpers.
class-omni-tracker.php Sessions, REST routes, event logging, request handlers, search candidates, and frontend asset configuration.
class-omni-admin.php Settings registration, input sanitization, setup guidance, and configuration UI.
view.js Visitor interaction tracking and assistant interface behavior.
search-helper.js Search-assistance interface and autocomplete behavior.
assets/css/ Frontend and administration styles.

REST surface

Routes use the /wp-json/omnisuggest/v1 namespace.

Route Method Purpose
/track POST Record supported visitor interaction events.
/suggest POST Request a context-based suggestion.
/chat POST Send an assistant message.
/add-to-cart POST Handle a cart action from the plugin interface.
/search-suggest GET Return ranked search matches and display data.

The handlers include permission callbacks and input validation. API credentials and runtime settings belong to the WordPress installation; the repository contains no configured provider credentials or exported visitor event records.

Technology and setup

WordPress · WooCommerce · PHP · JavaScript · CSS · WordPress REST API · OpenAI · Google Gemini · OpenRouter

The plugin header declares WordPress 5.8+, PHP 7.4+, and WooCommerce 6.0+. These are declared minimums, not a compatibility matrix verified during this portfolio upload.

  1. Install WordPress and WooCommerce in a development environment.
  2. Place this repository's plugin files in wp-content/plugins/omnisuggest-ai/, or upload the included deployment ZIP.
  3. Activate OmniSuggest AI and configure the provider and assistant settings in its WordPress administration screens.
  4. Supply your own service credentials and any license required for the intended feature set.
  5. For the Evolve integration, install the Evolve project separately and configure its Header Search widget to use OmniSuggest AI.

The deployment archive contains the plugin source and assets. The production database, customer records, provider accounts, licensing backend, and Evolve theme/plugins are separate.

Author

Hung Cao — Cao-Tech LLC

Custom WordPress plugins, WooCommerce integrations, AI-backed application features, and Elementor development.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages