πŸ’Ž PREMIUM: WordPress/wordpress playground/issues/ - Uncensored 2025

Skip to content

Update runPHP blueprint example to use absolute path for wp-load.phpΒ #2686

@dhruvang21

Description

@dhruvang21

Prerequisites

  • I have carried out troubleshooting steps and I believe I have found a bug.
  • I have searched for similar bugs in both open and closed issues and cannot find a duplicate.

Describe the bug

When testing the RunPHPStep example and selecting Try it out, the step executes successfully but the browser console shows a warning about using a relative path to load wp-load.php. The example currently uses:

require_once 'wordpress/wp-load.php';

This works temporarily because Playground rewrites the path, but the warning states that path rewriting will be removed in the future.

Expected behavior

The example blueprint should use an absolute path so that it runs without console warnings and remains compatible with the updated Playground directory structure.

Actual behavior

The console shows this warning:

It looks like you're trying to load WordPress using a relative path 'wordpress/wp-load.php'.
Playground recently changed the working directory from '/' to '/wordpress' to better mimic
how real web servers work. This means relative paths that used to work may no longer
point to the correct location.

Playground automatically updated the path for you, but at one point path rewriting will be removed.
Please update your code to use an absolute path instead:

Instead of:  require_once 'wordpress/wp-load.php';
Use:         require_once '/wordpress/wp-load.php';

Steps to reproduce

  1. Go to the RunPHPStep documentation page.
  2. Click Try it out on the provided example.
  3. Observe the browser console – the code runs, but the warning appears about the relative path.
  4. Update the example blueprint to:
{
  "steps": [
    {
      "step": "runPHP",
      "code": "<?php require_once '/wordpress/wp-load.php'; wp_insert_post(array('post_title' => 'wp-load.php required for WP functionality', 'post_status' => 'publish')); ?>"
    }
  ]
}

This fixes the warning and ensures future compatibility.

Isolating the problem

  • I have deactivated other plugins and confirmed this bug occurs when only this plugin is active.
  • This bug happens with a default WordPress theme active.
  • I can reproduce this bug consistently using the steps above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions