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

Maintenance mode status #19

Closed CHadetz closed 10 months ago

CHadetz commented 3 years ago

Bug Report

Describe the current, buggy behavior

The internal check get_maintenance_mode_status() does not provide information about the status. It just checks if the .maintenance file exists. If you don't do a plugin update or something that actually removes the file, this is an issue.

Describe the solution you'd like

Either have a .maintenance file which does not outdate ($upgrading = time()), or add a date check to the function.

Describe how other contributors can replicate this bug

Reproduce:

Describe what you would expect as the correct outcome

The output would tell if the site is accessible or in maintenance mode.

Let us know what environment you are running this on

OS: Linux 4.19.76-linuxkit #1 SMP Tue May 26 11:42:35 UTC 2020 x86_64
Shell:
PHP binary: /usr/bin/php
PHP version:    7.3.21
php.ini used:   /etc/php.ini
WP-CLI root dir:    phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:  phar://wp-cli.phar/vendor
WP_CLI phar path:   /var/www/html
WP-CLI packages dir:
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.4.0
selul commented 2 years ago

I've started working on this 🚀

selul commented 2 years ago

I've added a PR that fixes this here https://github.com/wp-cli/maintenance-mode-command/pull/22 + behat test that adress this.