Skip to content

WordPress plugin that provides WP-CLI commands to make it readonly

License

Notifications You must be signed in to change notification settings

pivvenit/wordpress-readonly

Repository files navigation

WordPress Readonly

Packagist Packagist Dependabot

A WordPress plugin that makes WordPress readonly. It's main use case is blue/green deployments, in which the active application slot requires a (short) readonly window to sync the database to the other slot.

Features:

  • WP-CLI commands to enable and disable the readonly mode
  • Notify logged-in users (in the admin) of upcoming readonly phase using notification.
  • Disable login for all users during both prepare and readonly phase.
  • Drop all POST requests during readonly phase with a 503 Service Unavailable.
  • Refreshes admin pages for logged-in users once readonly mode is disabled.

Installation

This plugin is designed for WordPress websites that use Composer, such as Bedrock.

composer require pivvenit/wordpress-readonly

Usage

Enable readonly mode

./vendor/bin/wp readonly enable

Disable readonly mode

./vendor/bin/wp readonly disable

About

WordPress plugin that provides WP-CLI commands to make it readonly

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •