🥾 A versatile, custom WordPress bootloader using SHORTINIT

Overview

Chelsea 🥾

A versatile, custom WordPress bootloader using SHORTINIT.


SHORTINIT is a PHP constant that WordPress looks for relatively early inside of wp-settings.php. When defined as truthy, WordPress will return false before the majority of files inside of wp-includes are required and after shutdown_action_hook() is registered as a shutdown function.

This is awesome if you only want to load some of a WordPress installation while skipping things like: plugins, themes, posts, taxonomies, comments, localization, blocks, sitemaps, REST API, etc...

Usage

  1. Copy chelsea.php into the root directory of your WordPress installation, naming it whatever you prefer.
  2. Customize this fancy new file until it is doing what you want it to do
  3. 💗

History

WordPress traditionally uses index.php in the root directory as the primary point of entry for server software like NGINX to route requests to:

location / {
    try_files $uri $uri/ /index.php?$args;
}

(Other files get accessed directly: wp-cron.php, wp-login.php, xmlrpc.php, etc... and Chelsea is conceptually similar.)

How

Add an NGINX directive to point a location to chelsea.php and restart NGINX:

location /app {
    try_files $uri $uri/ /chelsea.php?$args;
}

When NGINX sees someone visiting example.org/app it will try to serve that request using chelsea.php as the point of entry and pass along with it any of the arguments in the query string. Neat!

Why

You want all the power and flexibility of WordPress, but you do not want the entire set of user-facing features that it comes bundled with.

You are familiar with WordPress, and like it, and would totally build your next big thing with it – if only it weren't so bloated or slow or old or whatever other bad things people say about it.

With Chelsea, now you can! 🥫 @see: can

Includes

By default, Chelsea includes support for:

  • parsing requests
  • handling 404's
  • users
  • user roles & capabilities
  • user sessions
  • default constants
  • the $wp, $wp_query, $wp_the_query globals
  • the chelsea_do_parse_request_fatal_error_fixer() function will attempt to lazy-load some files if you have not manually included them, but only if you are using WordPress to parse the request and have not built your own parser

You are encouraged to fork/copy the contents of chelsea.php, modify them, and explore what is possible.

Caveats

Chelsea currently includes wp-load.php with SHORTINIT set. This means you are still stuck with some low-level configurations & features, like:

  • wp-config.php is included if it exists, and errors if it cannot be found by wp-load.php
  • The $wpdb global via the wpdb interface class, as well as the connection settings inside wp-config.php
  • Authentication keys and salts in wp-config.php
  • Any custom ini settings or constants in wp-config.php
  • error_reporting
  • object & output caching
  • fatal error recovery
  • maintenance mode
  • debug mode
  • formatting functions via formatting.php
  • a registered shutdown function that invokes the shutdown action and calls wp_cache_close() for you

If you do not want these things either, you will need to steal & strip what you want from wp-load.php, wp-config.php and wp-settings.php like it's a 90's Honda Civic, and bolt all the good stuff directly into chelsea.php.

This is totally doable, even though it feels a little weird. (Perhaps a future version of Chelsea could do this, too?)

Oh yeah

Issues and pull requests encouraged. Thank you for reading this far.

Happy booting 💜

You might also like...
A simple GitScrum plugin for Wordpress. You will be able to manage your projects without having to leave Wordpress.
A simple GitScrum plugin for Wordpress. You will be able to manage your projects without having to leave Wordpress.

GitScrum Plugin for Wordpress A simple GitScrum plugin for Wordpress. You will be able to manage your projects without having to leave Wordpress. GitS

Formcreator is a plugin which allow creation of custom forms of easy access
Formcreator is a plugin which allow creation of custom forms of easy access

Formcreator is a plugin which allow creation of custom forms of easy access. At the same time, the plugin allow the creation of one or more tickets when the form is filled.

Envbar allows you to differentiate between environments by adding a custom colored bar above the top navigation.
Envbar allows you to differentiate between environments by adding a custom colored bar above the top navigation.

Envbar Envbar allows you to differentiate between environments by adding a custom colored bar above the top navigation. This should help backend users

Custom boss plugin for PocketMine-MP.

Bosses Custom boss plugin for PocketMine-MP. What is this plugin? This plugin adds entities that they have so much things to configure! How to create

This plugin adds custom pets to game for PocketMine-MP!
This plugin adds custom pets to game for PocketMine-MP!

ComplexPets A plugin that adds pets to game made by OguzhanUmutlu for PocketMine-MP. Command Simply type /pets and summon your favorite animal! Featur

Add custom armors, tools and many items!

CustomThings This plugin was created for the new version of Hiroshima and allows you to add tools, armors and items! Informations Here are the differe

Simple custom chat bot developing framework for telegram, qq and more in PHP (the best language)
Simple custom chat bot developing framework for telegram, qq and more in PHP (the best language)

RinoBot RinoBot 是一个为统一聊天机器人扩展开发的框架,编写一份插件用于多种机器人协议。 简体中文 | English 🚧 开发中 🚧 暂不适用于生产环境 特性 插件扩展机制 一份代码运行于多平台多协议机器人 并减小开发难度 插件提供 Yaml 配置 供使用者修改 基于机器人 We

Custom CSS for Elementor

This plugin will provide an option to write CSS in any Elementor native widgets. You will get an option to write CSS for multiple screen devices. The option is placed on ADVANCED_TAB on any Elementor native widgets even third-party widgets.

Owner
John James Jacoby
@WordPress, @buddypress, @bbpress. Supporting, maintaining, and improving @awesomemotive products.
John James Jacoby
Glz custom fields - Unlimited Custom Fields for Textpattern

Unlimited custom fields for Textpattern This plugin sits under the Extensions tab in the back-end and gives your custom fields new life. You can final

Gerhard Lazu 21 Dec 1, 2019
Magento 2 custom extension to add custom attributes(longitude, latitude) to customer address

Magento 2 custom extension to add custom attributes(longitude, latitude) to customer address. Then save them to quote model and copy them from quote address to order address on bakend, frontend, rest api

MageArab 2 Jul 14, 2022
Coder Metabox for WordPress - Create Pages, Posts Custom Meta Fields options

Coder Metabox for WordPress Coder Metabox for WordPress - Create Pages, Posts Custom Meta Fields options. Step 1 call coder-metabox.php file in functi

Ashikur Rahman 3 Feb 19, 2022
BetterWPDB - Keeps you safe and sane when working with custom tables in WordPress.

BetterWPDB - Keeps you safe and sane when working with custom tables in WordPress.

Snicco 21 Dec 15, 2022
Sync Wordpress Pages and Posts (even custom post types + fields) from static Markdown + YAML files

Sync Markdown Files to WordPress Posts and Pages Static site generators let you use a revision-controlled tree of markdown files to make a site, but d

null 26 Sep 26, 2022
🎨 Free custom elements for the WordPress Theme Bricks Builder.

?? Custom Elements for Bricks Builder Free custom elements for Bricks, the visual site builder for WordPress. If you find the elements useful, click o

Simon Vidman 33 Dec 13, 2022
⚙️ A WordPress plugin to set WordPress options from a .env file.

dotenv A WordPress plugin to set WordPress options from a .env file. Any WPENV_ prefixed variables in the .env will be used to override the WordPress

Brad Parbs 13 Oct 6, 2022
WordPlate is a wrapper around WordPress. It makes developers life easier. It is just like building any other WordPress website with themes and plugins. Just with sprinkles on top.

WordPlate is simply a wrapper around WordPress. It makes developers life easier. It is just like building any other WordPress website with themes and plugins. Just with sprinkles on top.

WordPlate 1.7k Dec 24, 2022
Thirdweb-wp - A community WordPress plugin for thirdweb. Turn your WordPress website into Web3 instantly and easily with thirdweb. 💻🌏

Thirdweb WP ?? Nominate (@WarenGonzaga) as GitHub Star. If you appreciate his hardwork and dedication to open source. A community WordPress plugin for

Waren Gonzaga 8 Dec 19, 2022
Api.video-wordpress-plugin - The official api.video plugin for WordPress

api.video WordPress Plugin api.video is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managin

api.video 5 Oct 19, 2022