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

Evaluate `$upgrading` numeric value when checking if maintenance mode is active #22

Closed selul closed 10 months ago

selul commented 2 years ago

Attempt to fix #19 by checking the upgrading value when seeing if the site is in maintenance mode or not. Re-use the logic that core uses -> https://github.com/WordPress/WordPress/blob/master/wp-includes/load.php#L310-L314

selul commented 10 months ago

Hey guys,

Thanks for the feedback; I thought to give it another try by adding the warning when the value is a non-numeric one.

Also, I've changed the regex to account for when space might be missing between the = or before ; and tried to add a few tests to cover this.

danielbachhuber commented 10 months ago

@selul It's looking great! Just a few small things to fix up, and then this should be good to land. You'll want to make sure all of the tests are passing too.

selul commented 10 months ago

Thanks for the feedback @danielbachhuber 🚀 !

I've applied the changes.

selul commented 10 months ago

Thanks for the feedback, @danielbachhuber! I've made the changes!