🥾 A versatile, custom WordPress bootloader using SHORTINIT

Last update: Jun 29, 2022

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 💜

GitHub

https://github.com/JJJ/chelsea
You might also like...

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

Feb 8, 2022

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

Aug 12, 2021

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

Oct 16, 2021

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

Apr 18, 2022

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.

Apr 9, 2022

Plug-and-Play Custom Enchants Plugin For PocketMine-PMP

Plug-and-Play Custom Enchants Plugin For PocketMine-PMP

DEVELOPER'S NOTE: I can tell you right now this plugin hasn't been tested. I haven't even checked to see if it loads without crashing yet. Half of thi

Oct 23, 2021

Plug-and-Play Custom Enchants Plugin For PocketMine-PMP

Plug-and-Play Custom Enchants Plugin For PocketMine-PMP

DEVELOPER'S NOTE: I can tell you right now this plugin hasn't been tested. I haven't even checked to see if it loads without crashing yet. Half of thi

Oct 23, 2021

Custom NPC for pocket-mine servers

Custom NPC for pocket-mine servers

[Description] Click on above picture to see tutorial video of the plugin. This is an NPC plugin with super easy customization for pocket-mine. Note: W

May 1, 2022

Matplotlib. Pyplot written in PHP. Graphs charts, scatter, plot, lines, custom graphs

Matplotlib. Pyplot written in PHP. Graphs charts, scatter, plot, lines, custom graphs

php-libplot. Written in PHP. Graphs charts, scatter, plot, lines, custom graphs Matplotlib. Pyplot written in PHP. Graphs charts, scatter, plot, lines

Oct 30, 2021
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

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

Mar 20, 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

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.

Jun 24, 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

Oct 6, 2021
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 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.

Jun 28, 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

May 4, 2022
Api.video-wordpress-plugin - The official api.video plugin for WordPress
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

May 24, 2022
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.

Jun 22, 2022
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

Apr 10, 2022