Tag: WP Staging

  • Cowboys Code in Production: The Staging Protocol

    It is Friday at 4:30 PM.

    You want to make a “small tweak” to your checkout page CSS. You edit the file directly in the WordPress dashboard or via FTP.

    You hit “Save.”

    Suddenly, the screen goes white. Critical Error.

    Your online store stops processing orders. You scramble to undo the change, but you don’t remember exactly what line you deleted.

    This is called “Cowboy Coding.” It is shooting from the hip in a live environment. It is unprofessional, dangerous, and strictly forbidden in the AgilePress philosophy.

    Errors should happen in private, not in public. That is why you need a Staging Environment.

    What is Staging?

    A Staging Site is an exact clone of your live website. It lives in a private URL (e.g., staging.yoursite.com).

    • It has the same plugins.
    • It has the same content.
    • It has the same server configuration.

    But it is disconnected from the public. You can update plugins, switch themes, or break the code entirely. If it breaks, nobody sees it. You fix it, test it, and then copy it to the live site.

    Here are the four levels of Staging, ranked from “AgilePress Standard” to “Avoid.”

    Level 1: The Gold Standard (Server-Level Staging)

    This is the best option because it happens at the server infrastructure level.

    Providers: Cloudways, Kinsta, WPEngine, SiteGround.

    • How it works: You log into your hosting panel and click “Create Staging.” The server duplicates the entire application in minutes.
    • The Deploy: When you are happy with the changes, you click “Push to Live.”
    • Why it wins: It guarantees the server environment (PHP version, Caching rules) is identical. If it works on Staging, it will work on Live.

    Level 2: The Developer’s Lab (LocalWP)

    This is where code is born.

    Tool: LocalWP (Free).

    • How it works: You run the website on your own computer (offline).
    • Use Case: Ideal for building a new site from scratch or doing heavy custom coding (creating a custom plugin).
    • The Limitation: It is hard for clients to approve changes since the site is on your laptop. You usually need to push it to a Staging server for final approval.

    Level 3: The “Guerrilla” Solution (Staging Plugins)

    What if you are stuck on a cheap shared hosting plan (cPanel) that doesn’t offer Staging? You use a plugin.

    Tool: WP Staging (Pro recommended).

    • How it works: It creates a clone of your site inside a subfolder (e.g., yoursite.com/staging) and disconnects it from the main database.
    • The AgilePress Warning:
      • Bloat: It duplicates your database tables (using prefixes like wpstg_) and doubles your file usage.
      • Performance: It uses the same server resources as your live site. Heavy testing on staging might slow down the live site.
      • Verdict: Use this only if you cannot upgrade to better hosting.

    Level 4: The “Old School” (Manual Subdomains)

    Method: Creating a subdomain dev.site.com, creating a new FTP folder, copying files, exporting the database, finding and replacing URLs…

    Verdict: AVOID.

    Why? Because friction kills discipline. If creating a staging site takes 1 hour, you won’t do it for a small plugin update. You will take the risk. Automation is the key to safety.

    The Danger Zone: The “Time Travel” Problem

    This is the most critical part of this article. Read this carefully if you run a WooCommerce store or a Membership site.

    The Scenario:

    1. Monday: You create a Staging copy.
    2. Tuesday: You are working on the design in Staging. Meanwhile, 5 customers buy products on the Live site.
    3. Wednesday: You finish the design and click “Push to Live” (overwriting the database).

    The Result:

    You just deleted the 5 orders from Tuesday. You overwrote the Live database with the Staging database (which is from Monday). Those orders are gone forever.

    The AgilePress Rule for Dynamic Sites:

    • Code (Files, Plugins, Themes) flows UP: Staging -> Production.
    • Data (Orders, Users, Posts) flows DOWN: Production -> Staging.

    How to handle it:

    If you are on a server-level staging (Level 1), most hosts allow you to “Push Files Only” and skip the database.

    If you need to push database changes (e.g., you created a new page), you must put the Live site in Maintenance Mode while you work, so no new orders come in.

    Conclusion: Professional Peace of Mind

    An “Update Failed” message on a Tuesday morning can ruin your week.

    A white screen during a Black Friday sale can ruin your business.

    Staging is not a luxury tool for big agencies. It is the seatbelt for your website.

    1. Check if your host offers Staging (Level 1).
    2. If not, use WP Staging (Level 3).
    3. Never edit code on a live site.

    Amateurs hack the live site. Professionals deploy from Staging.