A code-based overview of the Optisleek WordPress plugin: purpose, architecture, capabilities, interfaces, operations, and current implementation status.
Optisleek connects a WooCommerce store to a remote optimization platform while keeping WordPress responsible for storefront rendering, catalog access, attribution, and merchandising order.
In one sentence: the plugin exports catalog data, captures shopping behavior and purchases, renders externally powered recommendation experiences, and applies product-ordering rules returned by the Optisleek service.
Front-end scripts collect product views, engagement, selected variations, cart context, and order outcomes. Recommendation and landing-page identifiers are retained through WooCommerce sessions and order metadata.
Catalog entities—brands, categories, attribute definitions, attribute values, products, variations, prices, stock, and images—are exposed for synchronization with the remote service.
Product pages can display “Related Products” and “Bought Together” modules powered by the remote products.js SDK, with a local mock mode for integration testing.
Category-specific product sequences are stored locally and applied to WooCommerce catalog queries. Rules can be managed in WordPress, through the REST API, or synchronized on a schedule.
Boundary of responsibility. This repository contains the WordPress integration layer. The recommendation and optimization algorithms themselves are provided by the external Optisleek platform rather than implemented inside the plugin.
The integration is bidirectional: WooCommerce sends catalog and behavioral context outward; Optisleek returns presentation assets and merchandising decisions.
{prefix}_optisleek_sorting → a WooCommerce query filter prioritizes the configured product IDs.The plugin is organized as a lightweight PHP module set with WordPress hooks, plus CSS and JavaScript assets for its admin and storefront surfaces.
| Component | Responsibility | Status |
|---|---|---|
optisleek.php | Plugin metadata, activation/deactivation hooks, and bootstrap. | Active |
class-optisleek.php | Loads modules and registers admin, storefront, widget, sorting, landing-page, and REST behavior. | Active |
class-admin-page.php | Five admin areas: general settings, product widgets, landing pages, sorting, and documentation. | Active |
class-product-export.php | Builds the WooCommerce catalog payload and serves the alternative /optisleek/api/ interface. | Active |
class-rest-api.php | Catalog, sorting CRUD, and remote cron-trigger routes with token checks where configured. | Active |
tracking-pixelV2.php | Detailed browser tracking, engagement, GUID attribution, checkout reporting, and fallback delivery. | Active |
class-tracking-core.php | Loads the primary remote tracking script when the integration is enabled and configured. | Active |
class-product-widget-base.php | Shared widget lifecycle, SDK loading, target placement, configuration, and test mode. | Active |
class-related-products-widget.php | Configuration for the Related Products experience. | Active |
class-bought-together-widget.php | Configuration for the Bought Together experience. | Active |
optisleek-landing-pages.php | Landing-page shortcode, widget bootstrapping, URL attribution, session/cookie state. | Active |
class-sorting.php | Rule persistence, scheduled synchronization, logging, and SQL-level WooCommerce ordering. | Active |
class-attribute-erp.php | Planned ERP code fields for WooCommerce attribute terms. Handlers remain placeholders and the module is not bootstrapped. | Dormant |
Dependencies. Runtime behavior uses WordPress and WooCommerce APIs only. Composer currently declares WordPress 7.1 and WooCommerce 11 stubs as development dependencies; they are not runtime libraries.
modified_after[optisleek_landing_page] shortcodeOperational dependency. Live tracking, widgets, landing-page results, and sorting synchronization depend on a reachable and correctly configured Optisleek service URL. Storefront features fail independently when their required configuration is missing.
| Method | Route | Purpose / access |
|---|---|---|
| GET | /wp-json/optisleek/products | Catalog payload. Public by design; supports page, per_page, and modified_after. |
| GET · POST | /wp-json/optisleek/sorting | List or create sorting rules. Requires the configured API token. |
| PUT · PATCH · DELETE | /wp-json/optisleek/sorting/{id} | Update or remove one sorting rule. Requires the configured API token. |
| GET | /wp-json/optisleek/cron-sync | Trigger a sorting synchronization. Requires the separate cron secret. |
/optisleek/api/?sync={resource} serves all-json, brands, categories, attributes-templates, attributes, or products. Product calls accept pg, per_page, and modified_after.
| Setting | Role |
|---|---|
optisleek_url | Base URL of the remote Optisleek service. |
optisleek_code | General tracking/pixel identifier and widget fallback identifier. |
api_token | Authenticates sorting APIs and remote synchronization requests. |
optisleek_shop_id | Identifies the WooCommerce shop to the remote service. |
optisleek_enabled | Master switch for front-end integration behavior. |
optisleek_color_attributeoptisleek_size_attribute | Maps WooCommerce attributes to the color and size concepts used in exports and tracking. |
Authentication behavior. Sorting routes accept the token through X-Api-Token or an api_token parameter. The cron route uses a distinct generated secret. WordPress admin operations are capability- and nonce-protected.
wp-content/plugins/optisleek.1. Enable test mode and the desired widget.
2. Confirm placement on a product page.
3. If the theme omits the standard WooCommerce hook, configure a CSS selector.
4. Disable test mode only after the live SDK URL and pixel are validated.
1. Confirm the remote service returns ranked product groups.
2. Run a manual synchronization and review its log.
3. Inspect rules before enabling storefront sorting.
4. Confirm WP-Cron runs reliably in the hosting environment.
| Area | Check | Expected result |
|---|---|---|
| Catalog | Request a small paginated export. | Valid JSON with store entities and published products. |
| Tracking | View a product, choose a variation, add to cart, and place a test order. | Browser requests complete and order GUID metadata is captured when applicable. |
| Widgets | Open a product with test mode enabled. | Mock recommendations render exactly once at the intended location. |
| Landing page | Render the shortcode with a token and visit an attributed URL. | The module loads and attribution persists through checkout. |
| Sorting | Sync, enable a rule, and open its category. | Ranked products appear first; remaining products retain stable ordering. |
The integration covers the complete operational loop, but several engineering improvements would reduce risk and make future releases easier to maintain.
| # | Priority | Recommendation |
|---|---|---|
| 1 | Transport security | Remove sslverify => false from sorting synchronization and resolve any certificate-chain issue at the environment level. |
| 2 | API hardening | Confirm public catalog exposure is intentional, prefer header-only credentials, use POST for state-changing cron triggers, add argument schemas, and rate-limit external calls. |
| 3 | Automated verification | Add unit/integration coverage for export payloads, REST authorization, attribution state, checkout reporting, and SQL ordering. |
| 4 | Maintainability | Split tracking-pixelV2.php into focused services and centralize remote HTTP behavior, error handling, and timeouts. |
| 5 | Data governance | Document retention, consent, cookie behavior, exported fields, and the handling of order-linked identifiers for production operators. |
| 6 | Release hygiene | Add an uninstall policy, version API routes, package only required files, and complete or remove the dormant ERP attribute feature. |
Review note. These priorities are based on static inspection of the repository. They are not a penetration test, privacy assessment, or verification against a running WordPress installation.
includes/
Administration, export, REST, tracking, widgets, landing pages, sorting, and the dormant attribute ERP scaffold.
assets/css/ · assets/js/
Admin styling and behavior, storefront widget styling, and a local recommendation-widget mock.
docs/
Bundled customer-facing documents displayed in WordPress. Files shipped here are publicly addressable if their URL is known.
composer.json · composer.lock
IDE/static-analysis stubs for current WordPress and WooCommerce APIs.
Optisleek v1.0.4 is a feature-rich WooCommerce connector with a coherent commercial purpose and a broad production surface. Its strongest qualities are the end-to-end data loop and practical storefront integration. The best next investment is hardening the network/API boundary and adding automated coverage around checkout attribution, catalog synchronization, and sorting.
Prepared from the repository contents available on 29 September 2026. No live WordPress instance, production configuration, or remote Optisleek service was exercised.
Technical overview rather than exhaustive API specification, compliance opinion, performance benchmark, or security audit.
Infinite optimization for ecommerce