> For the complete documentation index, see [llms.txt](https://docs.turboload.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.turboload.ai/core-performance-features/theme-fixer-sandbox.md).

# Theme Fixer & Safe Sandbox

> **Zero-Risk Theme Remediation:** Automatically optimize theme code, eliminate render-blocking assets, and fix Core Web Vitals inside an isolated draft sandbox with 1-click live publishing.

The **Theme Fixer** is TurboLoad's flagship optimization capability. It moves beyond passive monitoring by directly and safely resolving performance defects inside your Shopify theme code.

![TurboLoad Theme Fixer Sandbox showing safe draft theme duplication, automated code optimization rules, and 1-click publishing](https://3104101331-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4kkyKWXlRlIIrT0xXLUz%2Fuploads%2Fgit-blob-575f290288a87c75cee0311f84910566c2b17447%2F03_theme_fixer.png?alt=media)

***

## Direct Answer: How does the TurboLoad Theme Fixer optimize code safely?

The TurboLoad Theme Fixer duplicates your published theme into an isolated draft sandbox (e.g. `[TurboLoad Remediation] <Theme Name>`). It then applies automated code enhancements—such as deferring render-blocking scripts, adding preconnect resource hints, and fixing layout shift attributes—completely away from live shoppers. Merchants preview the remediated theme in an interactive sandbox and publish live only when 100% satisfied.

***

## The Zero-Risk Safe Sandbox Guarantee

Merchants often fear speed optimizations because poorly written modifications can break cart buttons, navigation drawers, or third-party checkout flows.

TurboLoad eliminates this risk entirely with our **Safe Sandbox Guarantee**:

> **We NEVER edit your live published theme.**\
> When you run the Theme Fixer, TurboLoad creates an exact duplicate copy in your theme library named:\
> `[TurboLoad Remediation] <Your Theme Name>`\
> All automated code optimizations are executed inside this isolated draft theme. Your live store continues serving shoppers without a single millisecond of interruption or risk.

***

## Automated Theme Code Optimizations Performed

TurboLoad's intelligent optimization engine analyzes your theme templates and applies the following surgical fixes:

1. **Intelligent Script Deferral:**\
   Locates render-blocking scripts in your theme layout and sections, converting them to non-blocking execution patterns while strictly preserving functionality and execution order.
2. **Image Dimension & Lazy-Loading Enforcement:**\
   Detects images lacking explicit width and height attributes (the primary cause of layout shifts / CLS) and ensures below-the-fold images lazy load smoothly.
3. **Critical Resource Preconnecting:**\
   Pre-establishes early connections for essential assets, including your Shopify CDN and web fonts, so hero sections appear instantly.
4. **Theme Code Cleanup:**\
   Eliminates redundant conditionals and trims bloat in critical rendering paths.

***

## Step-by-Step Theme Remediation Workflow

```mermaid
flowchart TD
  A["Select Source Theme<br/>(Live or Unpublished)"] --> B["Clone to Isolated Draft Sandbox<br/>(Prefix: '[TurboLoad Remediation]')"]
  B --> C["Automated Optimization Rules<br/>(Script Deferral, LCP Preconnect, Image Hints)"]
  C --> D["Interactive Code Diff & Preview Link<br/>(Side-by-side file inspection)"]
  D --> E{"Merchant Decision"}
  E -->|Export Audit| F["Export Audit Report<br/>(Download .xlsx)"]
  E -->|Verify & Approve| G["1-Click Publish to Live<br/>(Replaces active theme safely)"]
  E -->|Reject Changes| H["Reversible Safe Rollback<br/>(Zero impact on live storefront)"]
```

### Step 1: Initiate a Fixer Job

1. Go to **Themes → Theme Fixer** (`/app/themes/fixer`).
2. Select the theme you wish to remediate.
3. Choose the optimization rules to apply (or select **All Recommended Optimizations**).
4. Click **Start Automated Remediation**.

### Step 2: Review the Interactive Code Diff

Once the job finishes (typically in 10–20 seconds):

* An interactive **Side-by-Side Diff Viewer** displays every file modified.
* Green highlighted lines show additions (e.g. `defer`, `loading="lazy"`).
* Red highlighted lines show eliminated bottlenecks.

### Step 3: Test with 1-Click Preview Link

1. Click the **Preview Draft Theme** button.
2. This opens your store using Shopify's official theme preview session (`?preview_theme_id=...`).
3. Browse your catalog, add products to cart, and test checkout to verify 100% visual and functional perfection.

### Step 4: Publish or Roll Back

* **Ready to launch?** Click **Publish Remediated Theme** to promote the optimized draft to your live storefront.
* **Want to revert?** Click **Discard / Rollback** to archive the draft theme without touching anything else.

***

## Exporting Fixer Evidence Reports

Need compliance proof or documentation for your development team?

* Click **Export Report** on any completed job to download:\
  `TurboLoad-FixerReport-<ThemeName>-<YYYY-MM-DD>.xlsx`
* Contains complete before/after file lists, optimization diffs, and timestamped evidence records.

***

## Remediation Credits & Credit Packs

To provide flexible access for both occasional optimizers and high-velocity agencies, TurboLoad uses an intuitive credit system for the Theme Fixer:

* **1 Credit = 1 Complete Theme Remediation Run:** Reserves when you initiate an automated remediation. Clones your theme into a draft sandbox, executes all code optimizations, generates the interactive side-by-side diff, and creates your live preview link.
* **Auditing & Previews are Free:** You can audit any theme in your library and preview remediated drafts as many times as you like without consuming credits.
* **Included Monthly Plan Allowances:**
  * **Free Plan:** 0 included credits (theme auditing is always free; on-demand credit packs available).
  * **Pro Plan ($29/mo):** **2 included credits per month** (refreshed each billing cycle).
  * **Business Plan ($99/mo):** **Unlimited theme remediations**.
* **On-Demand Add-On Packs (Shopify One-Time Purchase):**
  * **Starter Pack (3 Credits):** $9.99 ($3.33/run).
  * **Pro Pack (10 Credits):** $24.99 ($2.50/run — Most Popular).
  * **Agency Pack (25 Credits):** $49.99 ($2.00/run — Best Value).
  * *Unused on-demand credits never expire and roll over automatically.*

***

## Automated Integrity & Code Safety Validation

To ensure that no syntax errors or template incompatibilities ever reach your theme:

* **Pre-Compilation Verification:** Every modified Liquid file is checked for balanced tags (`{% if %}`, `{% endif %}`), valid HTML structures, and proper asset syntax before saving.
* **Fail-Safe Abort:** If any ambiguity or syntax conflict is detected during optimization, the automated engine aborts the change and flags the file for merchant review.
* **Total Rollback Protection:** Because optimizations exist in a draft theme, your published store remains 100% untouched until you explicitly click publish.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.turboload.ai/core-performance-features/theme-fixer-sandbox.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
