Skip to content

Commit d94ee1f

Browse files
committed
Fixes
1 parent 30ae904 commit d94ee1f

7 files changed

Lines changed: 12 additions & 33 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Changes are organized by date, with the most recent changes listed first.
8787
- Kept the unified conditional extraction logic as the single source of truth for both `single_zip` and `two_file` import formats.
8888
- Fixed the import start log message in `scripts/functions/vhost/vhost-import.sh` to conditionally reference `SINGLE_ZIP_FILE` for `single_zip` format, `WP_ARCHIVE_FILE`/`DB_SOURCE_PATH` for `original` format, or a generic fallback for other formats, instead of always referencing the empty `WP_ARCHIVE_FILE`.
8989
- Removed leftover debug `echo` statements (`DEBUG: Attempting to set prefix` and `DEBUG: sed command exit status for prefix`) from production code in `scripts/functions/vhost/vhost-import.sh`.
90-
- Added cleanup logic to move `SINGLE_ZIP_FILE` to `BACKUP_DIR` when `IMPORT_FORMAT` is `single_zip`, matching the existing two-file cleanup behaviour.
90+
- Added cleanup logic to move `SINGLE_ZIP_FILE` to `BACKUP_DIR` when `IMPORT_FORMAT` is `single_zip`, matching the existing two-file cleanup behavior.
9191
- Fixed the site-verification failure message to reference `SINGLE_ZIP_FILE` instead of `DB_SOURCE_PATH` when `WP_ARCHIVE_FILE` is unset, correctly identifying the original import file for `single_zip` imports.
9292

9393
## 2026-04-08

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"scripts": {
6262
"test": "phpunit",
6363
"test:coverage": "phpunit --coverage-html coverage",
64-
"phpstan": "phpstan analyse",
64+
"phpstan": "phpstan analyze",
6565
"cs:check": "php-cs-fixer fix --dry-run --diff",
6666
"cs:fix": "php-cs-fixer fix",
6767
"phpcs": "phpcs --standard=PSR12 config/var/www/admin/",

config/var/www/admin/control-panel/classes/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Session
3030
*/
3131
public function get(string $key, mixed $default = null): mixed
3232
{
33-
// If the session has not been started, honour the documented contract and
33+
// If the session has not been started, honor the documented contract and
3434
// return the default value without touching $_SESSION.
3535
if (session_status() !== PHP_SESSION_ACTIVE) {
3636
return $default;

config/var/www/admin/control-panel/controllers/BaseController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ abstract class BaseController
7373
protected ApiResponse $response;
7474

7575
/**
76-
* Initialise shared dependencies.
76+
* Initialize shared dependencies.
7777
*
7878
* Child controllers that define their own constructor must call
7979
* parent::__construct() to ensure these properties are available.

scripts/functions/vhost/vhost-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ echo ""
7979
# - Only lowercase letters (a-z), digits (0-9), and hyphens (-) are permitted
8080
# - The label must not start or end with a hyphen (per RFC 952 / RFC 1123)
8181
#
82-
# This is intentional behaviour. Do not "fix" it to require at least two characters.
82+
# This is intentional behavior. Do not "fix" it to require at least two characters.
8383
while true; do
8484
read -p "Enter the domain name (e.g., 'wordpresstesting'): " DOMAIN_NAME
8585
if [[ "$DOMAIN_NAME" =~ ^[a-z0-9]([a-z0-9-]*[a-z0-9])?$ ]]; then

scripts/install/tools/system/amazon-s3-install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ if prompt_yes_no "Are you ready to continue with AWS configuration?" "y" 300; th
5656

5757
if ! aws configure; then
5858
echo ""
59-
echo "AWS configuration failed or was cancelled."
59+
echo "AWS configuration failed or was canceled."
6060
echo "You can run 'aws configure' manually later if needed."
6161
echo "Exiting installation script."
6262
exit 1
@@ -66,7 +66,7 @@ if prompt_yes_no "Are you ready to continue with AWS configuration?" "y" 300; th
6666
echo "AWS configuration completed successfully."
6767
else
6868
echo ""
69-
echo "AWS configuration cancelled by user."
69+
echo "AWS configuration canceled by user."
7070
echo "You can run this script again later or configure AWS manually with 'aws configure'."
7171
echo "Exiting installation script."
7272
exit 0

scripts/update/php-update.sh

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -130,31 +130,12 @@ set_php_permissions
130130
# Update Nginx configuration to use new PHP version
131131
echo "Updating Nginx configuration for PHP ${NEW_PHP_VER}..."
132132

133-
# Shared sed expressions for PHP version migrations in nginx configs.
134-
# These are printf-style templates: first %s = OLD_VER, second %s = NEW_PHP_VER.
135-
SOCKET_EXPR='s|(unix:/run/php/)php%s-fpm(\.sock)|\1php%s-fpm\2|g'
136-
FASTCGI_EXPR='s|(fastcgi_pass[[:space:]]+[^;]*php)%s(-fpm)|\1%s\2|g'
137-
138-
# Escape text for use in sed extended regex pattern fragments.
139-
sed_escape_ere() {
140-
local text="$1"
141-
printf '%s' "$text" | sed -e 's/[][(){}.^$*+?|\\]/\\&/g'
142-
}
143-
144-
# Escape text for use in sed replacement fragments.
145-
sed_escape_replacement() {
146-
local text="$1"
147-
printf '%s' "$text" | sed -e 's/[&\\]/\\&/g'
148-
}
149-
150133
# Update php-fpm.conf
151134
if [[ -f "/etc/nginx/globals/php-fpm.conf" ]]; then
152135
for OLD_VER in "${MIGRATION_SOURCE_PHP_VERS[@]}"; do
153-
OLD_VER_ERE="$(sed_escape_ere "$OLD_VER")"
154-
NEW_PHP_VER_REPL="$(sed_escape_replacement "$NEW_PHP_VER")"
155136
sed -E -i \
156-
-e "$(printf "$SOCKET_EXPR" "$OLD_VER_ERE" "$NEW_PHP_VER_REPL")" \
157-
-e "$(printf "$FASTCGI_EXPR" "$OLD_VER_ERE" "$NEW_PHP_VER_REPL")" \
137+
-e "s|(unix:/run/php/)php${OLD_VER//./\.}-fpm(\.sock)|\1php${NEW_PHP_VER}-fpm\2|g" \
138+
-e "s|(fastcgi_pass[[:space:]]+[^;]*php)${OLD_VER//./\.}(-fpm)|\1${NEW_PHP_VER}\2|g" \
158139
"/etc/nginx/globals/php-fpm.conf"
159140
done
160141
fi
@@ -163,9 +144,7 @@ fi
163144
for config_file in /etc/nginx/sites-available/*; do
164145
if [[ -f "$config_file" ]]; then
165146
for OLD_VER in "${MIGRATION_SOURCE_PHP_VERS[@]}"; do
166-
OLD_VER_ERE="$(sed_escape_ere "$OLD_VER")"
167-
NEW_PHP_VER_REPL="$(sed_escape_replacement "$NEW_PHP_VER")"
168-
sed -E -i -e "$(printf "$FASTCGI_EXPR" "$OLD_VER_ERE" "$NEW_PHP_VER_REPL")" "$config_file"
147+
sed -E -i -e "s|(fastcgi_pass[[:space:]]+[^;]*php)${OLD_VER//./\.}(-fpm)|\1${NEW_PHP_VER}\2|g" "$config_file"
169148
done
170149
fi
171150
done
@@ -174,15 +153,15 @@ done
174153
if [[ -f "/var/www/admin/tools/phpsysinfo/phpsysinfo.ini" ]]; then
175154
echo "Updating phpSysInfo configuration..."
176155
for OLD_VER in "${MIGRATION_SOURCE_PHP_VERS[@]}"; do
177-
sed -E -i "s|^([[:space:]]*[[:alnum:]_.-]+[[:space:]]*=[[:space:]]*.*)php${OLD_VER}(-fpm)?|\1php${NEW_PHP_VER}\2|g" "/var/www/admin/tools/phpsysinfo/phpsysinfo.ini"
156+
sed -E -i "s|^([[:space:]]*[[:alnum:]_.-]+[[:space:]]*=[[:space:]]*.*)php${OLD_VER//./\.}(-fpm)?|\1php${NEW_PHP_VER}\2|g" "/var/www/admin/tools/phpsysinfo/phpsysinfo.ini"
178157
done
179158
fi
180159

181160
# Update admin control panel API configuration
182161
if [[ -f "/var/www/admin/control-panel/api.php" ]]; then
183162
echo "Updating admin control panel API configuration..."
184163
for OLD_VER in "${MIGRATION_SOURCE_PHP_VERS[@]}"; do
185-
sed -E -i "/(php-fpm|fastcgi_pass|sock(et)?|service)/ s|(php)${OLD_VER}(-fpm)?|\1${NEW_PHP_VER}\2|g" "/var/www/admin/control-panel/api.php"
164+
sed -E -i "/(php-fpm|fastcgi_pass|sock(et)?|service)/ s|(php)${OLD_VER//./\.}(-fpm)?|\1${NEW_PHP_VER}\2|g" "/var/www/admin/control-panel/api.php"
186165
done
187166
fi
188167

0 commit comments

Comments
 (0)