Skip to content

Commit 5c09dba

Browse files
authored
Fixes
1 parent 8480f00 commit 5c09dba

8 files changed

Lines changed: 15 additions & 56 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to EngineScript will be documented in this file.
44

55
Changes are organized by date, with the most recent changes listed first.
66

7+
## 2026-04-10
8+
9+
### 🐛 VHOST IMPORT EXTRACTION FLOW FIX
10+
11+
- Removed a duplicate WordPress extraction block in `scripts/functions/vhost/vhost-import.sh` that re-ran archive extraction and wp-config path detection after those steps had already completed.
12+
- Prevented a single-zip import failure path where the duplicate block referenced `${WP_ARCHIVE_FILE}` (only populated in the two-file flow), which could trigger an unrecognized archive error.
13+
- Kept the unified conditional extraction logic as the single source of truth for both `single_zip` and `two_file` import formats.
14+
715
## 2026-04-08
816

917
### 🧹 NGINX MIME AND COMPRESSION CLEANUP

config/var/www/admin/control-panel/external-services/external-services.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class ExternalServicesManager {
6565
* @returns {Promise<void>}
6666
*/
6767
async loadExternalServices() {
68-
try { // codacy:ignore - Try/catch required for service loading
68+
try { // codacy:ignore - Top-level UI orchestration boundary: DOM/rendering and service-processing steps may throw; catch here to log once and show renderErrorState instead of leaving a partially rendered dashboard.
6969
this.container.replaceChildren();
7070

7171
// Get service definitions and preferences
@@ -1025,7 +1025,7 @@ export class ExternalServicesManager {
10251025
applyStatusDataToCard(serviceKey, serviceDef, data, isFeed) {
10261026
const serviceCard = this.getServiceCardElement(serviceKey, serviceDef);
10271027
if (!serviceCard) return;
1028-
const { statusClass, statusIcon, statusColor } = this.getStatusDisplayValues(data.status.indicator, isFeed); // codacy:ignore - Destructuring assignment
1028+
const { statusClass, statusIcon, statusColor } = this.getStatusDisplayValues(data.status.indicator, isFeed);
10291029
this.updateServiceCardStatus(serviceCard, data.status.description, statusClass, statusIcon, statusColor);
10301030
}
10311031

@@ -1545,11 +1545,11 @@ export class ExternalServicesManager {
15451545
}
15461546

15471547
/**
1548-
* Announce message to screen readers via live region
1548+
* Announce message to screen readers via live region.
1549+
* Uses a dedicated live region for accessibility announcements in this module.
15491550
* @param {string} message - Message to announce
15501551
* @returns {void}
15511552
*/
1552-
// Uses a dedicated live region for accessibility announcements in this module.
15531553
announceToScreenReader(message) {
15541554
if (!this.liveRegion) {
15551555
this.liveRegion = document.createElement('div');

scripts/ci/run-install-step.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if [ "$SCRIPT_EXIT_CODE" -ne 0 ]; then
5151
fi
5252
echo "Script end time: $(date)" >> "$LOG_PATH"
5353
echo "Last 50 lines of output:"
54-
tail -50 "$LOG_PATH" 2>/dev/null || echo "Unable to read log file: $LOG_PATH"
54+
tail -50 "$LOG_PATH" || echo "Failed to display log file contents: $LOG_PATH"
5555

5656
exit 1
5757
fi

scripts/functions/server-tools/analyze-tables.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ source /usr/local/bin/enginescript/scripts/functions/shared/enginescript-common.
1818
#----------------------------------------------------------------------------------
1919
# Start Main Script
2020

21-
source /usr/local/bin/enginescript/enginescript-variables.txt || { echo "Error: Failed to source /usr/local/bin/enginescript/enginescript-variables.txt" >&2; exit 1; }
22-
source /home/EngineScript/enginescript-install-options.txt || { echo "Error: Failed to source /home/EngineScript/enginescript-install-options.txt" >&2; exit 1; }
23-
2421
RUN_SQL=/tmp/analyze_all_tables.sql
2522
RUN_LOG=/tmp/analyze_all_tables.log
2623

scripts/functions/vhost/vhost-import.sh

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -253,51 +253,6 @@ echo "PASSED: Determined table prefix from database: ${PREFIX}"
253253
# --- End Prefix Extraction ---
254254

255255

256-
# --- Extract WordPress Archive ---
257-
echo "Extracting WordPress archive..."
258-
# Clean up any previous extraction attempt
259-
rm -rf "${WP_EXTRACTED_PATH}"
260-
mkdir -p "${WP_EXTRACTED_PATH}"
261-
262-
if [[ "${WP_ARCHIVE_FILE}" == *.zip ]]; then
263-
unzip -q "${WP_ARCHIVE_FILE}" -d "${WP_EXTRACTED_PATH}"
264-
EXTRACT_STATUS=$?
265-
elif [[ "${WP_ARCHIVE_FILE}" == *.tar.gz || "${WP_ARCHIVE_FILE}" == *.tgz ]]; then
266-
tar -zxf "${WP_ARCHIVE_FILE}" -C "${WP_EXTRACTED_PATH}"
267-
EXTRACT_STATUS=$?
268-
else
269-
echo "FAILED: Unrecognized archive format for ${WP_ARCHIVE_FILE}"
270-
exit 1
271-
fi
272-
273-
if [[ $EXTRACT_STATUS -ne 0 ]]; then
274-
echo "FAILED: Could not extract archive file ${WP_ARCHIVE_FILE}"
275-
rm -rf "${WP_EXTRACTED_PATH}" # Clean up failed extraction
276-
exit 1
277-
fi
278-
279-
# Check for wp-config.php within the extracted directory
280-
# Handle cases where tar/zip might create a subdirectory
281-
# Find wp-config.php within the extracted path, potentially in a subdirectory
282-
WP_CONFIG_REL_PATH=$(find "${WP_EXTRACTED_PATH}" -name "wp-config.php" -printf "%P\n" | head -n 1)
283-
if [[ -z "$WP_CONFIG_REL_PATH" ]]; then
284-
echo "FAILED: wp-config.php not found within the extracted archive content in ${WP_EXTRACTED_PATH}"
285-
rm -rf "${WP_EXTRACTED_PATH}" # Clean up
286-
exit 1
287-
fi
288-
289-
# Determine the actual source path (could be WP_EXTRACTED_PATH or a subdirectory within it)
290-
if [[ "$WP_CONFIG_REL_PATH" == "wp-config.php" ]]; then
291-
# wp-config.php is directly in WP_EXTRACTED_PATH
292-
WP_FILES_SOURCE_PATH="${WP_EXTRACTED_PATH}"
293-
else
294-
# wp-config.php is in a subdirectory, adjust the source path
295-
SUBDIR=$(dirname "$WP_CONFIG_REL_PATH")
296-
WP_FILES_SOURCE_PATH="${WP_EXTRACTED_PATH}/${SUBDIR}"
297-
fi
298-
echo "PASSED: Archive extracted. WordPress source path set to: ${WP_FILES_SOURCE_PATH}"
299-
300-
301256
# --- Extract Information from wp-config.php ---
302257
echo "Extracting site information from wp-config.php..."
303258
WP_CONFIG_PATH="${WP_FILES_SOURCE_PATH}/wp-config.php" # Use the determined source path

scripts/install/openssl/openssl-install.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env bash
2-
#!/usr/bin/env bash
32
#----------------------------------------------------------------------------------
43
# EngineScript - A High-Performance WordPress Server Built on Ubuntu and Cloudflare
54
#----------------------------------------------------------------------------------

scripts/install/tools/security/maldet.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ source /usr/local/bin/enginescript/scripts/functions/shared/enginescript-common.
2121
# Maldet Install
2222
cd /usr/local/src
2323
download_and_extract "https://www.rfxn.com/downloads/maldetect-current.tar.gz" "/usr/local/src/maldetect-current.tar.gz" "/usr/local/src"
24-
cd maldetect-1.6.4/
24+
cd /usr/local/src/maldetect-*/ || { echo "Error: Failed to locate extracted maldetect directory in /usr/local/src" >&2; exit 1; }
2525
./install.sh
2626
echo "/sys" >> /usr/local/maldetect/ignore_paths
2727

scripts/install/tools/security/wpscan.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ source /usr/local/bin/enginescript/scripts/functions/shared/enginescript-common.
1919
# Start Main Script
2020

2121
# WPScan
22-
gem install wpscan
22+
gem install wpscan || { echo "Error: Failed to install WPScan via gem" >&2; exit 1; }
2323

2424
print_install_banner "WPScan"

0 commit comments

Comments
 (0)