pivvenit/wordpress-readonly

WordPress plugin that activates readonly mode

Installs: 12 246

Dependents: 0

Suggesters: 0

Security: 0

Stars: 9

Watchers: 3

Forks: 0

Open Issues: 12

Type:wordpress-plugin


README

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