Table of Contents

User's Guide: WP Code Integrator

Welcome to WP Code Integrator (WPCI). This tool provides a professional, IDE-grade development environment directly inside your WordPress dashboard. It allows you to edit themes and plugins safely using a Visual Studio Code-powered interface with integrated backups and difference comparisons.

1. The Interface

When you open Code Integrator, you are presented with a three-pane layout designed for safety and clarity.

2. File Management & Navigation

WPCI allows you to manage your file structure directly from the sidebar.

The Context Menu (Right-Click)

For the fastest workflow, Right-Click on any file or folder in the tree to access:

Creating & Managing Files

You can also use the icons in the sidebar toolbar:

Favorites System

You can favorite both Files and Folders.

3. Basic Workflow

Loading a File

  1. Use the File Tree to navigate to your theme or plugin folder.
  2. Click a file name (e.g., functions.php) to load it.
  3. The editor activates, and navigation buttons (“Jump To”, “Add Function”) become clickable.

Editing & Saving

WPCI uses a “Safe Save” flow to prevent accidents.

  1. Save Draft: Saves your changes to a temporary file on the server. This does not affect your live site. Use this to save work-in-progress safely.
  2. Integrate (Save): Overwrites the live file.
    1. Click Integrate (Save).
    2. The button will swap to a red “Confirm Save?” button.
    3. Click Confirm Save? to commit your changes.
    4. The system creates a backup automatically before writing.

4. Surgical Editing Tools

WPCI includes powerful tools to modify code without manually scrolling through thousands of lines.

Update Function

Replace an existing PHP function with a new version, regardless of its location in the file.

  1. Click Update Function.
  2. Paste your full new function code.
  3. Ensure Auto-indent Code is checked (recommended).
  4. Click Smart Replace. The system finds the old function, replaces it, and fixes indentation automatically.

Works with these PHP/JavaScript code grouping structures:

Add Function

Insert new code relative to existing structures.

  1. Click + Add Function.
  2. Select Target: Choose an existing Class or Function from the list.
  3. Position: Select Above or Below.
  4. Click Insert Code.

Jump To...

Click Jump To… to see an outline of the current file. Click any function or class name to immediately scroll to that location.

5. Backup & Restoration

Every time you “Integrate” (Save) a file, WPCI automatically creates a backup version before overwriting your live code.

Quick Restore (Single File)

If you make a mistake while editing a specific file, you can roll back immediately from the editor sidebar.

WCI Recovery Console (Bulk Management)

For deeper system management, use the included Recovery Console. This tool provides a centralized view of all backups created by Code Integrator across your entire WordPress installation.

6. Technical Architecture Overview

This section outlines the technical stack and security measures implemented in WP Code Integrator.

Component Specification
Frontend Editor Monaco Editor (Version 0.44 as of WPCI v11.13). Supports syntax highlighting, code folding, minimaps, and side-by-side diff views.
Backend Logic PHP 7.4+. Object-Oriented architecture. Uses WordPress AJAX API for all server communication.
Server Requirements WordPress 6.0+, PHP 7.4+. Access to ``ABSPATH`` (root directory) required for file operations.
Data Storage Filesystem: Direct manipulation of PHP/JS/CSS files.
Backups: Stored in ``wp-content/uploads/wci-backups/`` (protected by ``.htaccess``).
Favorites: Stored in User Meta (``wci_favorites``).

Security Protocols

Compatibility

Code Integrator is designed to run alongside standard WordPress caching plugins. Since it operates entirely within the Admin Dashboard (``is_admin()``), it does not impact frontend performance.