wp-cli / maintenance-mode-command

Activates, deactivates or checks the status of the maintenance mode of a site.
MIT License
9 stars 5 forks source link

Question about maintenance mode #14

Closed planetahuevo closed 1 year ago

planetahuevo commented 3 years ago

Hi! When using this command, it will create the .maintenance file. I think that is also created and deleted automatically after an update of a plugin. So my question is: If I run wp maintenance-mode activate and then wp plugin update --all

Will that deactivate the maintenance mode automatically after the update? thanks!

jcatello commented 2 years ago

@planetahuevo Yes it will.

[12:01][root@test public]# wp maintenance-mode status
Maintenance mode is not active.
[12:01][root@test  public]# wp maintenance-mode activate
Enabling Maintenance mode...
Success: Activated Maintenance mode.
[12:01][root@test  public]# wp maintenance-mode status
Maintenance mode is active.
[12:01][root@test  public]# wp plugin update --all 2>/dev/null
Enabling Maintenance mode...
Downloading update from http://leadbrite.appspot.com/service/leadpages/latest/...
Unpacking the update...
Installing the latest version...
Removing the old version of the plugin...
Plugin updated successfully.
Disabling Maintenance mode...
+-----------+-------------+-------------+---------+
| name      | old_version | new_version | status  |
+-----------+-------------+-------------+---------+
| leadpages | 1.2.0.3     | 1.2.0.5     | Updated |
+-----------+-------------+-------------+---------+
Success: Updated 1 of 1 plugins.
[12:01][root@test  public]# wp maintenance-mode status
Maintenance mode is not active.