Skip to content

Commit

Permalink
Merge pull request #71 from Automattic/release/0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryJones authored Jan 27, 2025
2 parents d2723be + 39f3376 commit 72c2ef2
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 10 deletions.
1 change: 1 addition & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
/package.json
/package-lock.json
/phpunit.xml.dist
/rector.php
/tests
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/.phpcs.xml.dist export-ignore
/CHANGELOG.md export-ignore
/phpunit.xml.dist export-ignore
/rector.php export-ignore

# Auto detect text files and perform LF normalization
# https://pablorsk.medium.com/be-a-git-ninja-the-gitattributes-file-e58c07c9e915
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ jobs:
- name: Start MySQL Service
run: sudo systemctl start mysql.service

- name: Install Subversion
run: |
sudo apt-get update
sudo apt-get install subversion
- name: Prepare environment for integration tests
run: composer prepare ${{ matrix.wordpress }}

Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.2] - 2025-01-27

### Fixed
* Don't load template twice by @cfaria in https://github.com/Automattic/maintenance-mode-wp/pull/70

### Maintenance
* Fix typos by @szepeviktor in https://github.com/Automattic/maintenance-mode-wp/pull/67
* Add Rector and rector command by @GaryJones in https://github.com/Automattic/maintenance-mode-wp/pull/68
* CI: Install subversion by @GaryJones in https://github.com/Automattic/maintenance-mode-wp/pull/69

## [0.3.1] - 2024-12-14

### Maintenance
Expand Down Expand Up @@ -93,6 +103,7 @@ Predominantly a maintenance release, though it does include a couple of added ch
## 0.1.0 - 2017-02-16
- Initial release.

[0.3.2]: https://github.com/automattic/maintenance-mode-wp/compare/0.3.1...0.3.2
[0.3.1]: https://github.com/automattic/maintenance-mode-wp/compare/0.3.0...0.3.1
[0.3.0]: https://github.com/automattic/maintenance-mode-wp/compare/0.2.2...0.3.0
[0.2.2]: https://github.com/automattic/maintenance-mode-wp/compare/0.2.1...0.2.2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Maintenance Mode

Stable tag: 0.3.1
Stable tag: 0.3.2
Requires at least: 5.9
Tested up to: 6.7
License: GPLv2 or later
Expand Down
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"php-parallel-lint/php-parallel-lint": "^1.0",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"phpunit/phpunit": "^9",
"rector/rector": "^1",
"wp-coding-standards/wpcs": "^3",
"yoast/phpunit-polyfills": "^1.1"
},
Expand All @@ -38,6 +39,9 @@
"prepare": [
"bash bin/install-wp-tests.sh wordpress_test root root localhost"
],
"rector": [
"@php ./vendor/bin/rector"
],
"test": [
"@php ./vendor/bin/phpunit --testsuite WP_Tests"
],
Expand Down
12 changes: 6 additions & 6 deletions maintenance-mode.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Maintenance Mode
* Plugin URI: https://github.com/Automattic/maintenance-mode-wp
* Description: Shut down your site for a little while and do some maintenance on it!
* Version: 0.3.1
* Version: 0.3.2
* Requires at least: 5.9
* Requires PHP: 7.4
* Author: WordPress VIP, Automattic
Expand Down Expand Up @@ -120,7 +120,7 @@ function vip_maintenance_mode_template_redirect(): void {
*/
$defaults = apply_filters( 'vip_maintenance_mode_template_args', $defaults );

if ( ! get_template_part( $defaults['slug'], $defaults['name'], $defaults['args'] ) ) {
if ( false === get_template_part( $defaults['slug'], $defaults['name'], $defaults['args'] ) ) {
include __DIR__ . '/template-maintenance-mode.php';
}

Expand All @@ -146,8 +146,8 @@ function vip_maintenance_mode_restrict_rest_api( $result ) {
return $result;
}

$error_message = apply_filters( 'vip_maintenance_mode_rest_api_error_message', __( 'REST API access is currently restricted while this site is undergoing maintenance.', 'maintenance-mode' ) );
$maintenace_rest_error = new WP_Error(
$error_message = apply_filters( 'vip_maintenance_mode_rest_api_error_message', __( 'REST API access is currently restricted while this site is undergoing maintenance.', 'maintenance-mode' ) );
$maintenance_rest_error = new WP_Error(
'vip_maintenance_mode_rest_error',
$error_message,
array(
Expand All @@ -156,11 +156,11 @@ function vip_maintenance_mode_restrict_rest_api( $result ) {
);

if ( ! is_user_logged_in() ) {
return $maintenace_rest_error;
return $maintenance_rest_error;
}

if ( ! vip_maintenance_mode_current_user_can_bypass() ) {
return $maintenace_rest_error;
return $maintenance_rest_error;
}

return $result;
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "maintenance-mode-wp",
"version": "0.3.1",
"version": "0.3.2",
"description": "Shut down your site for a little while and do some maintenance on it!",
"license": "GPL-2.0-or-later",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion vipgo-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* This function sets the filter response that Maintenance Mode uses to determine if it should set the 503 status header or not.
*
* @param bool $should_set_503 Whether Maintenance Mode should set a 503 header.
* @return bool Indiciate whether a Maintenance Mode sets a 503 header.
* @return bool Indicate whether a Maintenance Mode sets a 503 header.
*/
function vip_maintenance_mode_do_not_respond_503_for_services( $should_set_503 ): bool {
$user_agent = filter_input( INPUT_SERVER, 'HTTP_USER_AGENT', FILTER_SANITIZE_SPECIAL_CHARS );
Expand Down

0 comments on commit 72c2ef2

Please sign in to comment.