Backend only WordPress 01

Exploring the idea to use WordPress for the backend only.


As the introduction says I’d like to explore the possibilities of using WordPress for the backend only. I love WordPress and the way it allows extending its backend but I think this little project might help me to better understand what goes on when a page request is made to a WordPress site.
The testing part of me has the upper hand here and wants to disassemble things for the sake of knowledge.

Setting up a test environment

I’ve grown fond of Rarst’s Composer stack for WordPress site development and have used it for the latest client projects. It allows for a quick and maintainable deployment that works well for small site projects (I do not have experience with big ones).
I’ve modified the original composer.json file to my own needs and tastes and that’s the starting point of this research of mine:

    "name": "name/project-slug",
    "description": "Project description",
    "authors": [
            "name": "theAverageDev (Luca Tumedei)",
            "email": "",
            "homepage": "http://theaveragedev.local"
    "type": "project",
    "repositories": [
            "type": "composer",
            "url": ""
    "config": {
        "vendor-dir": "vendor"
    "require": {
        "johnpbloch/wordpress": ">=3.9",
        "xrstf/composer-php52": "*",
        "wpackagist-plugin/debug-bar": "*",
        "wpackagist-plugin/debug-bar-cron" : "*",
        "wpackagist-plugin/debug-bar-actions-and-filters-addon": "*",
        "wpackagist-plugin/debug-bar-screen-info": "*",
        "wpackagist-plugin/debug-bar-transients": "*",
        "wpackagist-plugin/debug-bar-query-count-alert": "*"
    "require-dev": {
        "lucatume/function-mocker": "~0.2",
        "badcow/lorem-ipsum": "dev-master",
        "lucatume/wp-browser": "~1.5"
    "extra": {
        "wordpress-install-dir": "wp"
    "scripts": {
        "post-install-cmd": [
        "post-update-cmd": [
        "post-autoload-dump": [

create a composer.json file in the website root folder and init the Composer project

composer install --prefer-dist

and after some time (depending on the connection) everything will be at its place. File structure after composer install After some virtual machine or MAMP setup pointing to the project root (in my case aliased to the http://test.local domain) browsing to the folder will yield in either a 404 or a 403 error depending on your server configuration.

Hello world!

To honor a testing tradition I add an index.php file in the root of the project and simply return the traditional string

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <title>Hello world</title>
   <p>Hello world!</p> 

that was the easy part. Hello world


Configuring WordPress for the unusual environment.