Changeset 3809656
- Timestamp:
- 11/18/2026 03:32:10 PM (less than one hour ago)
- Location:
- backupino
- Files:
-
- 2 added
- 4 deleted
- 33 edited
- 1 copied
-
assets/icon.svg (modified) (4 diffs)
-
tags/1.1.0 (copied) (copied from backupino/trunk )
-
tags/1.1.0/assets/css/installer.css (modified) (1 diff)
-
tags/1.1.0/assets/js/installer.js (modified) (11 diffs)
-
tags/1.1.0/backupino.php (modified) (2 diffs)
-
tags/1.1.0/languages/backupino-fa_IR.mo (deleted)
-
tags/1.1.0/languages/backupino-fa_IR.po (deleted)
-
tags/1.1.0/languages/backupino.pot (modified) (1 diff)
-
tags/1.1.0/readme.txt (modified) (4 diffs)
-
tags/1.1.0/src/Backup/InstallerBuilder.php (modified) (3 diffs)
-
tags/1.1.0/src/Backup/Stages/FinalizeStage.php (modified) (2 diffs)
-
tags/1.1.0/src/Core/Compatibility.php (modified) (2 diffs)
-
tags/1.1.0/src/Core/Paths.php (modified) (2 diffs)
-
tags/1.1.0/src/Download/PublicDownload.php (modified) (1 diff)
-
tags/1.1.0/src/Installer/AdminCreator.php (added)
-
tags/1.1.0/src/Installer/State.php (modified) (8 diffs)
-
tags/1.1.0/src/Installer/installer-template.php (modified) (27 diffs)
-
tags/1.1.0/src/Support/Fs.php (modified) (1 diff)
-
tags/1.1.0/templates/dashboard.php (modified) (1 diff)
-
tags/1.1.0/templates/settings.php (modified) (5 diffs)
-
tags/1.1.0/uninstall.php (modified) (1 diff)
-
trunk/assets/css/installer.css (modified) (1 diff)
-
trunk/assets/js/installer.js (modified) (11 diffs)
-
trunk/backupino.php (modified) (2 diffs)
-
trunk/languages/backupino-fa_IR.mo (deleted)
-
trunk/languages/backupino-fa_IR.po (deleted)
-
trunk/languages/backupino.pot (modified) (1 diff)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/src/Backup/InstallerBuilder.php (modified) (3 diffs)
-
trunk/src/Backup/Stages/FinalizeStage.php (modified) (2 diffs)
-
trunk/src/Core/Compatibility.php (modified) (2 diffs)
-
trunk/src/Core/Paths.php (modified) (2 diffs)
-
trunk/src/Download/PublicDownload.php (modified) (1 diff)
-
trunk/src/Installer/AdminCreator.php (added)
-
trunk/src/Installer/State.php (modified) (8 diffs)
-
trunk/src/Installer/installer-template.php (modified) (27 diffs)
-
trunk/src/Support/Fs.php (modified) (1 diff)
-
trunk/templates/dashboard.php (modified) (1 diff)
-
trunk/templates/settings.php (modified) (5 diffs)
-
trunk/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
backupino/assets/icon.svg
r3800361 r3809656 43 43 44 44 <!-- Breathing Core Halo --> 45 <circle cx="128" cy="128" r="96" fill="url(#coreGlow)" opacity="0.85"/> 45 <circle cx="128" cy="128" r="96" fill="url(#coreGlow)"> 46 <animate attributeName="r" values="88;102;88" dur="3.2s" repeatCount="indefinite"/> 47 <animate attributeName="opacity" values="0.75;1;0.75" dur="3.2s" repeatCount="indefinite"/> 48 </circle> 46 49 47 50 <!-- Outer Resumable Checkpoint Track --> … … 51 54 <g> 52 55 <circle cx="128" cy="128" r="74" fill="none" stroke="#38bdf8" stroke-opacity="0.22" stroke-width="2.5" stroke-dasharray="16 26" stroke-linecap="round"/> 56 <animateTransform attributeName="transform" type="rotate" from="360 128 128" to="0 128 128" dur="9s" repeatCount="indefinite"/> 53 57 </g> 54 58 55 <!-- Primary Backup & Restore Orbit -->59 <!-- Primary Rotating Backup & Restore Orbit --> 56 60 <g> 57 61 <!-- Concentric 231-deg Orbital Sweep on r=94 --> … … 59 63 <!-- Tangential Arrowhead --> 60 64 <path d="M 141 34 L 118 21 L 124 34 L 118 47 Z" fill="#e0f2fe"/> 61 <!-- Checkpoint Data Node --> 62 <circle cx="217.4" cy="98.95" r="4.5" fill="#38bdf8" opacity="0.9"/> 65 <!-- Pulsing Checkpoint Data Node --> 66 <circle cx="217.4" cy="98.95" r="4.5" fill="#38bdf8"> 67 <animate attributeName="opacity" values="0.35;1;0.35" dur="1.6s" repeatCount="indefinite"/> 68 </circle> 69 <animateTransform attributeName="transform" type="rotate" from="0 128 128" to="360 128 128" dur="3.2s" repeatCount="indefinite"/> 63 70 </g> 64 71 … … 88 95 89 96 <!-- Fast-Recovery Stem Chevron --> 90 <polygon points="88,115 108,128 88,141" fill="url(#boltGrad)" opacity="0.9"/> 97 <polygon points="88,115 108,128 88,141" fill="url(#boltGrad)"> 98 <animate attributeName="opacity" values="0.7;1;0.7" dur="1.6s" repeatCount="indefinite"/> 99 </polygon> 91 100 </g> 92 101 </svg> -
backupino/tags/1.1.0/assets/css/installer.css
r3800274 r3809656 253 253 font-size: 12.5px; 254 254 } 255 .admin-box { 256 background: #f8fafc; 257 border: 1px solid var(--line); 258 border-radius: 8px; 259 padding: 12px 14px; 260 margin-top: 14px; 261 } 262 .pass-wrap { 263 position: relative; 264 display: flex; 265 align-items: center; 266 } 267 .pass-wrap input { 268 padding-inline-end: 65px; 269 } 270 .pass-toggle-btn { 271 position: absolute; 272 inset-inline-end: 6px; 273 top: 50%; 274 transform: translateY(-50%); 275 margin: 0; 276 padding: 4px 10px; 277 font-size: 11px; 278 background: #e2e8f0; 279 color: #334155; 280 border-radius: 4px; 281 border: 0; 282 cursor: pointer; 283 } 284 .pass-toggle-btn:hover { 285 background: #cbd5e1; 286 } -
backupino/tags/1.1.0/assets/js/installer.js
r3800274 r3809656 37 37 open_admin: "Open wp-login.php →", 38 38 empty_db_lbl: "Empty existing database tables before import (Recommended)", 39 create_admin_opt: "Create a new WordPress Administrator account (Optional)", 40 admin_user_lbl: "Administrator Username", 41 admin_email_lbl: "Administrator Email", 42 admin_pass_lbl: "Administrator Password", 43 admin_created_title: "✓ New Administrator Account Created:", 44 show_btn: "Show", 45 hide_btn: "Hide", 39 46 ext_files: "Extracting files", 40 47 imp_db: "Importing database", … … 74 81 open_admin: "ورود مستقیم به wp-login.php ←", 75 82 empty_db_lbl: "پاکسازی و حذف جداول موجود در دیتابیس قبل از درونریزی (پیشنهادی)", 83 create_admin_opt: "ایجاد حساب کاربری مدیر کل جدید در وردپرس (اختیاری)", 84 admin_user_lbl: "نام کاربری مدیر", 85 admin_email_lbl: "ایمیل مدیر", 86 admin_pass_lbl: "رمز عبور مدیر", 87 admin_created_title: "✓ حساب کاربری مدیر کل جدید با موفقیت ایجاد شد:", 88 show_btn: "نمایش", 89 hide_btn: "مخفی", 76 90 ext_files: "در حال استخراج فایلها", 77 91 imp_db: "در حال درونریزی دیتابیس", … … 153 167 var title = document.getElementById("progress-title"); 154 168 var busy = false; 169 var completed = false; 170 var runHandle = ""; 171 172 function sendAbort(useBeacon) { 173 var token = getToken(); 174 if (!token) { return; } 175 var fields = { action: "abort", token: token }; 176 if (runHandle) { 177 fields.run_handle = runHandle; 178 } 179 var body = new URLSearchParams(fields); 180 runHandle = ""; 181 if (useBeacon && typeof navigator !== "undefined" && typeof navigator.sendBeacon === "function") { 182 try { 183 navigator.sendBeacon(window.location.pathname, body); 184 return; 185 } catch (e) {} 186 } 187 try { 188 fetch(window.location.pathname, { 189 method: "POST", 190 body: body, 191 credentials: "same-origin", 192 keepalive: true, 193 headers: { "Content-Type": "application/x-www-form-urlencoded" } 194 }).catch(function () {}); 195 } catch (e) {} 196 } 197 198 window.addEventListener("pagehide", function () { 199 if (busy && !completed) { 200 sendAbort(true); 201 } 202 }); 155 203 156 204 function api(action, data) { 157 var params = Object.assign({ action: action, token: getToken() }, data || {}); 205 var base = { action: action, token: getToken() }; 206 if (runHandle) { 207 base.run_handle = runHandle; 208 } 209 var params = Object.assign(base, data || {}); 158 210 var body = new URLSearchParams(params); 159 211 return fetch(window.location.pathname, { … … 187 239 188 240 function fail(message, field) { 189 var el = document.getElementById(field || "error3"); 241 var targetField = field || "error3"; 242 var el = document.getElementById(targetField); 190 243 if (el) { 191 244 el.textContent = message; … … 199 252 if (bar) { 200 253 bar.style.background = "#dc2626"; 254 } 255 if (targetField === "error3" && !completed) { 256 sendAbort(false); 201 257 } 202 258 busy = false; … … 278 334 prefix: getVal("prefix"), 279 335 new_url: getVal("new_url"), 280 empty_db: getChecked("empty_db") 336 empty_db: getChecked("empty_db"), 337 create_admin: getChecked("create_admin"), 338 admin_user: getVal("admin_user"), 339 admin_email: getVal("admin_email"), 340 admin_pass: getVal("admin_pass") 281 341 }; 282 342 … … 288 348 return; 289 349 } 350 if (res.run_handle) { 351 runHandle = String(res.run_handle); 352 } 353 var dbPassEl = document.getElementById("db_pass"); 354 if (dbPassEl) { dbPassEl.value = ""; } 355 var adminPassEl = document.getElementById("admin_pass"); 356 if (adminPassEl) { adminPassEl.value = ""; } 290 357 show("step3"); 291 358 updateStepNav(3); … … 305 372 api("config").then(function (final) { 306 373 if (!final.ok) { fail(final.error || "Configuration failed."); return; } 374 completed = true; 375 busy = false; 307 376 show("step4"); 308 377 var siteUrl = final.url || ""; … … 317 386 var doneUrlEl = document.getElementById("done-url"); 318 387 if (doneUrlEl) { doneUrlEl.textContent = siteUrl; } 319 }); 388 if (final.admin_created) { 389 var adminBox = document.getElementById("admin-created-box"); 390 var adminName = document.getElementById("admin-created-name"); 391 if (adminBox && adminName) { 392 adminName.textContent = final.admin_created; 393 adminBox.classList.remove("hidden"); 394 } 395 } 396 }).catch(function (err) { fail(String(err)); }); 320 397 }); 321 398 }); … … 334 411 api("cleanup").then(function (res) { 335 412 if (!res.ok) { fail(res.error || "Cleanup failed.", "error4"); btn.disabled = false; return; } 413 runHandle = ""; 336 414 btn.textContent = (I18N[currentLang] && I18N[currentLang].cleaned) ? I18N[currentLang].cleaned : "Installer files deleted."; 337 415 window.setTimeout(function () { … … 344 422 }); 345 423 } 424 var createAdminCb = document.getElementById("create_admin"); 425 var adminFields = document.getElementById("admin-fields"); 426 if (createAdminCb && adminFields) { 427 createAdminCb.addEventListener("change", function () { 428 if (createAdminCb.checked) { 429 adminFields.classList.remove("hidden"); 430 } else { 431 adminFields.classList.add("hidden"); 432 } 433 }); 434 } 435 436 var togglePassBtn = document.getElementById("toggle_admin_pass"); 437 var adminPassInput = document.getElementById("admin_pass"); 438 if (togglePassBtn && adminPassInput) { 439 togglePassBtn.addEventListener("click", function () { 440 if (adminPassInput.type === "password") { 441 adminPassInput.type = "text"; 442 togglePassBtn.textContent = (I18N[currentLang] && I18N[currentLang].hide_btn) ? I18N[currentLang].hide_btn : "Hide"; 443 } else { 444 adminPassInput.type = "password"; 445 togglePassBtn.textContent = (I18N[currentLang] && I18N[currentLang].show_btn) ? I18N[currentLang].show_btn : "Show"; 446 } 447 }); 448 } 346 449 })(); -
backupino/tags/1.1.0/backupino.php
r3800363 r3809656 4 4 * Plugin URI: https://github.com/Backupino/documents 5 5 * Description: Fast, resumable WordPress backups, cloning and migration with a self-contained installer. 6 * Version: 1. 0.56 * Version: 1.1.0 7 7 * Requires at least: 6.0 8 8 * Requires PHP: 7.4 … … 19 19 defined( 'ABSPATH' ) || exit; 20 20 21 define( 'BACKUPINO_VERSION', '1. 0.5' );21 define( 'BACKUPINO_VERSION', '1.1.0' ); 22 22 define( 'BACKUPINO_FILE', __FILE__ ); 23 23 define( 'BACKUPINO_DIR', plugin_dir_path( __FILE__ ) ); -
backupino/tags/1.1.0/languages/backupino.pot
r3800363 r3809656 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Backupino 1. 0.5\n"5 "Project-Id-Version: Backupino 1.1.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/backupino\n" 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"8 "Language-Team: LANGUAGE <LL@li.org>\n"7 "Last-Translator: Backupino Team <support@backupino.com>\n" 8 "Language-Team: English <support@backupino.com>\n" 9 9 "MIME-Version: 1.0\n" 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2026-11-1 3T12:22:16+00:00\n"12 "POT-Creation-Date: 2026-11-18T13:11:27+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2.12.0\n"14 "X-Generator: Backupino i18n build tool\n" 15 15 "X-Domain: backupino\n" 16 16 17 #. Plugin Name of the plugin 18 #. Author of the plugin 19 #: backupino.php 20 #: src/Admin/Admin.php:48 21 #: templates/dashboard.php:34 22 #: templates/settings.php:64 17 #: free/src/Backup/Stages/ScanStage.php:86 18 msgid "%1$s files found (%2$s)." 19 msgstr "" 20 21 #: free/src/Backup/Stages/DatabaseStage.php:99 22 msgid "%1$s rows from %2$s tables (%3$s)." 23 msgstr "" 24 25 #: free/backupino.php:1 26 msgid "%d message is waiting to be resent on the next scheduled run." 27 msgstr "" 28 29 #: free/src/Notify/Notifier.php:241 30 msgid "%s messenger is not enabled or not fully configured." 31 msgstr "" 32 33 #: free/templates/settings.php:681 34 msgid "100% privacy-compliant: zero tracking, zero telemetry, strictly optional notifications." 35 msgstr "" 36 37 #: free/backupino.php:1 38 msgid "A new version of Backupino is available (%s)." 39 msgstr "" 40 41 #: free/backupino.php:1 42 msgid "A valid administrator email address is required." 43 msgstr "" 44 45 #: free/backupino.php:1 46 msgid "API token provided by Telegram @BotFather or Bale Bot platform." 47 msgstr "" 48 49 #: free/templates/dashboard.php:305 50 msgid "Actions" 51 msgstr "" 52 53 #: free/templates/settings.php:199 54 msgid "Active" 55 msgstr "" 56 57 #: free/templates/settings.php:397 58 msgid "Add this directive inside your Nginx server { } block:" 59 msgstr "" 60 61 #: free/templates/settings.php:576 62 msgid "Admin Login URL" 63 msgstr "" 64 65 #: free/backupino.php:1 66 msgid "Administrator Email" 67 msgstr "" 68 69 #: free/backupino.php:1 70 msgid "Administrator Password" 71 msgstr "" 72 73 #: free/backupino.php:1 74 msgid "Administrator Username" 75 msgstr "" 76 77 #: free/backupino.php:1 78 msgid "Administrator password is required." 79 msgstr "" 80 81 #: free/backupino.php:1 82 msgid "Administrator username is required." 83 msgstr "" 84 85 #: free/templates/settings.php:423 86 msgid "After adding the rule, test with `nginx -t` and reload Nginx. Authorized downloads through Backupino admin or the permanent download link continue to work normally through PHP." 87 msgstr "" 88 89 #: free/backupino.php:1 90 msgid "Archive" 91 msgstr "" 92 93 #: free/templates/settings.php:20 94 #: free/templates/settings.php:289 95 msgid "Archive & Exclusions" 96 msgstr "" 97 98 #: free/src/Installer/Env.php:77 99 msgid "Archive checksum" 100 msgstr "" 101 102 #: free/src/Installer/Env.php:70 103 msgid "Archive file" 104 msgstr "" 105 106 #: free/src/Installer/Env.php:50 107 msgid "Archive support" 108 msgstr "" 109 110 #: free/src/Backup/Stages/FilesStage.php:40 111 msgid "Archiving files" 112 msgstr "" 113 114 #: free/templates/settings.php:609 115 msgid "Automatic recurring backups trigger via WordPress cron. In Persian locale, monthly schedules automatically align with the start of the Jalali month." 116 msgstr "" 117 118 #: free/templates/settings.php:540 119 #: free/templates/settings.php:572 120 msgid "Available tags:" 121 msgstr "" 122 123 #: free/backupino.php:1 124 msgid "Back to backups" 125 msgstr "" 126 127 #: free/templates/settings.php:543 128 msgid "Backup Contents" 129 msgstr "" 130 131 #: free/templates/settings.php:545 132 msgid "Backup Date" 133 msgstr "" 134 135 #: free/templates/dashboard.php:409 136 msgid "Backup Details & Log" 137 msgstr "" 138 139 #: free/src/Admin/Admin.php:116 140 msgid "Backup Job" 141 msgstr "" 142 143 #: free/templates/settings.php:526 144 msgid "Backup Message Template" 145 msgstr "" 146 147 #: free/templates/settings.php:544 148 msgid "Backup Size" 149 msgstr "" 150 151 #: free/templates/settings.php:209 152 msgid "Backup Storage Destination" 153 msgstr "" 154 155 #: free/backupino.php:1 156 msgid "Backup archives and standalone installers are stored locally in a secure, protected directory on your server." 157 msgstr "" 158 159 #: free/templates/settings.php:335 160 msgid "Backup archives are stored locally on your server and served to administrators through Backupino authenticated download endpoints." 161 msgstr "" 162 163 #: free/src/Admin/Admin.php:118 164 msgid "Backup cancelled." 165 msgstr "" 166 167 #: free/templates/dashboard.php:218 168 msgid "Backup in Progress" 169 msgstr "" 170 171 #: free/src/Admin/Admin.php:48 172 #: free/templates/dashboard.php:34 173 #: free/templates/settings.php:64 23 174 msgid "Backupino" 24 175 msgstr "" 25 176 26 #. Plugin URI of the plugin 27 #: backupino.php 28 msgid "https://github.com/Backupino/documents" 29 msgstr "" 30 31 #. Description of the plugin 32 #: backupino.php 33 msgid "Fast, resumable WordPress backups, cloning and migration with a self-contained installer." 34 msgstr "" 35 36 #. Author URI of the plugin 37 #: backupino.php 38 msgid "https://profiles.wordpress.org/backupino/" 39 msgstr "" 40 41 #: src/Admin/Admin.php:47 177 #: free/backupino.php:1 178 msgid "Backupino - Free WordPress Backup & Migration" 179 msgstr "" 180 181 #: free/src/Admin/Admin.php:47 42 182 msgid "Backupino - WordPress Backup & Migration" 43 183 msgstr "" 44 184 45 #: src/Admin/Admin.php:58 46 #: src/Admin/Admin.php:59 47 #: templates/dashboard.php:43 48 #: templates/settings.php:73 185 #: free/templates/dashboard.php:40 186 #: free/templates/settings.php:70 187 msgid "Backupino Navigation" 188 msgstr "" 189 190 #: free/backupino.php:1 191 msgid "Backupino Verified Package" 192 msgstr "" 193 194 #: free/templates/settings.php:379 195 msgid "Backupino automatically creates .htaccess (for Apache/LiteSpeed) and web.config (for Microsoft IIS) files inside the storage directory to block direct HTTP requests. An index.html file is also placed to hide directory browsing, but it cannot prevent direct downloads if an attacker knows or guesses the file name." 196 msgstr "" 197 198 #: free/backupino.php:1 199 msgid "Backupino can announce every finished backup, with the permanent download link, in Telegram or Bale. The bot belongs to you: create one with @BotFather, then paste its token and your chat id here." 200 msgstr "" 201 202 #: free/templates/settings.php:437 203 msgid "Backupino can announce every finished backup, with the permanent download link, in Telegram or Bale. You can enable either or both messengers simultaneously." 204 msgstr "" 205 206 #: free/templates/dashboard.php:63 207 msgid "Backupino cannot automatically alter or reload Nginx configuration. Direct HTTP access is not blocked until your server administrator applies the server rule." 208 msgstr "" 209 210 #: free/src/Plugin.php:190 211 msgid "Backupino cannot run on this server:" 212 msgstr "" 213 214 #: free/backupino.php:1 215 msgid "Backupino is up to date. You are running the latest version (%s)." 216 msgstr "" 217 218 #: free/templates/settings.php:359 219 msgid "Backupino places .htaccess (Apache/LiteSpeed), web.config (IIS), and index.html (hides directory listing only) in this directory. Nginx ignores .htaccess and web.config; direct HTTP access is NOT guaranteed to be blocked on Nginx until you add a server-level deny rule." 220 msgstr "" 221 222 #: free/src/Core/Compatibility.php:49 223 msgid "Backupino requires PHP %1$s or newer. This server runs PHP %2$s." 224 msgstr "" 225 226 #: free/backupino.php:1 227 msgid "Backupino settings" 228 msgstr "" 229 230 #: free/src/Admin/Admin.php:185 231 msgid "Backupino — Site Migration Completed!" 232 msgstr "" 233 234 #: free/backupino.php:1 235 msgid "Backupino — backup finished: %s" 236 msgstr "" 237 238 #: free/backupino.php:1 239 msgid "Backupino — test message from %s" 240 msgstr "" 241 242 #: free/src/Core/Activator.php:45 243 #: free/src/Cron/Scheduler.php:62 244 msgid "Backupino: every minute" 245 msgstr "" 246 247 #: free/src/Admin/Admin.php:58 248 #: free/src/Admin/Admin.php:59 249 #: free/templates/dashboard.php:43 250 #: free/templates/settings.php:73 49 251 msgid "Backups" 50 252 msgstr "" 51 253 52 #: src/Admin/Admin.php:67 53 #: src/Admin/Admin.php:68 54 #: src/Admin/Admin.php:160 55 #: templates/dashboard.php:47 56 #: templates/settings.php:77 254 #: free/src/Notify/ChannelFactory.php:37 255 msgid "Bale" 256 msgstr "" 257 258 #: free/templates/settings.php:496 259 msgid "Bale Bot Token" 260 msgstr "" 261 262 #: free/templates/settings.php:505 263 msgid "Bale Chat ID" 264 msgstr "" 265 266 #: free/templates/settings.php:486 267 msgid "Bale Notification" 268 msgstr "" 269 270 #: free/templates/settings.php:506 271 msgid "Bale numeric chat or channel ID." 272 msgstr "" 273 274 #: free/templates/settings.php:319 275 msgid "Batch size for slicing file packing per tick. Default 1000 files ensures fast backup on modern systems." 276 msgstr "" 277 278 #: free/backupino.php:1 279 msgid "Batch size for slicing file packing per tick. Default 250 files is balanced for shared hosting." 280 msgstr "" 281 282 #: free/templates/dashboard.php:195 283 msgid "Before updating plugins" 284 msgstr "" 285 286 #: free/templates/settings.php:28 287 #: free/templates/settings.php:434 288 msgid "Bot Notifications" 289 msgstr "" 290 291 #: free/backupino.php:1 292 msgid "Bot token" 293 msgstr "" 294 295 #: free/templates/settings.php:497 296 msgid "Bot token obtained from Bale @BotFather." 297 msgstr "" 298 299 #: free/templates/settings.php:456 300 msgid "Bot token obtained from Telegram @BotFather." 301 msgstr "" 302 303 #: free/templates/dashboard.php:224 304 msgid "Cancel" 305 msgstr "" 306 307 #: free/templates/dashboard.php:222 308 msgid "Cancel backup job" 309 msgstr "" 310 311 #: free/src/Admin/Admin.php:117 312 msgid "Cancel the current backup job?" 313 msgstr "" 314 315 #: free/src/Jobs/JobStatus.php:62 316 msgid "Cancelled" 317 msgstr "" 318 319 #: free/src/Jobs/JobRunner.php:308 320 msgid "Cancelled by the user." 321 msgstr "" 322 323 #: free/templates/dashboard.php:233 324 msgid "Cataloging" 325 msgstr "" 326 327 #: free/backupino.php:1 328 msgid "Chat id" 329 msgstr "" 330 331 #: free/backupino.php:1 332 msgid "Check GitHub releases for the latest version and updates." 333 msgstr "" 334 335 #: free/backupino.php:1 336 msgid "Check for updates" 337 msgstr "" 338 339 #: free/backupino.php:1 340 msgid "Checking for updates…" 341 msgstr "" 342 343 #: free/templates/dashboard.php:335 344 msgid "Click to view log and details" 345 msgstr "" 346 347 #: free/templates/dashboard.php:411 348 #: free/templates/dashboard.php:459 349 msgid "Close" 350 msgstr "" 351 352 #: free/templates/settings.php:156 353 msgid "Compatible" 354 msgstr "" 355 356 #: free/src/Jobs/JobStatus.php:58 357 msgid "Completed" 358 msgstr "" 359 360 #: free/templates/settings.php:649 361 msgid "Configure preset credentials for the standalone migration installer generated with each backup." 362 msgstr "" 363 364 #: free/templates/settings.php:292 365 msgid "Configure which files, folders, or sizes should be skipped during backup creation to save disk space and maximize speed." 366 msgstr "" 367 368 #: free/backupino.php:1 369 msgid "Contents: %s" 370 msgstr "" 371 372 #: free/templates/dashboard.php:99 373 msgid "Copy link" 374 msgstr "" 375 376 #: free/src/Backup/Stages/DatabaseStage.php:40 377 msgid "Copying the database" 378 msgstr "" 379 380 #: free/src/Backup/ZipArchiveWriter.php:109 381 msgid "Could not add file to archive: %s" 382 msgstr "" 383 384 #: free/backupino.php:1 385 msgid "Could not check for updates. Please try again later." 386 msgstr "" 387 388 #: free/src/Admin/RestController.php:237 389 msgid "Could not create backup job in database." 390 msgstr "" 391 392 #: free/src/Backup/ZipArchiveWriter.php:73 393 msgid "Could not open the archive (error %d)." 394 msgstr "" 395 396 #: free/src/Storage/LocalStorage.php:97 397 msgid "Could not read the package file." 398 msgstr "" 399 400 #: free/src/Storage/LocalStorage.php:104 401 msgid "Could not write the package file." 402 msgstr "" 403 404 #: free/templates/dashboard.php:165 405 msgid "Create a backup" 406 msgstr "" 407 408 #: free/backupino.php:1 409 msgid "Create a new WordPress Administrator account (Optional)" 410 msgstr "" 411 412 #: free/templates/dashboard.php:201 413 msgid "Create backup" 414 msgstr "" 415 416 #: free/templates/dashboard.php:300 417 msgid "Created" 418 msgstr "" 419 420 #: free/src/Download/PublicDownload.php:289 421 msgid "Created Date" 422 msgstr "" 423 424 #: free/templates/settings.php:691 425 msgid "Current Version:" 426 msgstr "" 427 428 #: free/templates/dashboard.php:237 429 msgid "Database" 430 msgstr "" 431 432 #: free/templates/settings.php:189 433 msgid "Database Driver" 434 msgstr "" 435 436 #: free/src/Backup/Stages/DatabaseStage.php:61 437 msgid "Database dump disabled." 438 msgstr "" 439 440 #: free/templates/dashboard.php:424 441 msgid "Date" 442 msgstr "" 443 444 #: free/backupino.php:1 445 msgid "Date: %s" 446 msgstr "" 447 448 #: free/templates/settings.php:663 449 msgid "Default new URL (optional)" 450 msgstr "" 451 452 #: free/templates/dashboard.php:390 453 msgid "Delete" 454 msgstr "" 455 456 #: free/backupino.php:1 457 msgid "Delete backup" 458 msgstr "" 459 460 #: free/templates/dashboard.php:389 461 msgid "Delete backup package" 462 msgstr "" 463 464 #: free/src/Admin/Admin.php:112 465 msgid "Delete this package permanently?" 466 msgstr "" 467 468 #: free/backupino.php:1 469 msgid "Description of the plugin" 470 msgstr "" 471 472 #: free/templates/dashboard.php:115 473 msgid "Destination" 474 msgstr "" 475 476 #: free/backupino.php:1 477 msgid "Diagnostic information about active server extensions and write permissions." 478 msgstr "" 479 480 #: free/templates/settings.php:390 481 msgid "Direct HTTP access to backup package URLs is NOT guaranteed to be blocked on Nginx until your server administrator adds the deny rule below inside your Nginx server { } block and reloads Nginx. Merely viewing this rule in the admin panel does not activate it." 482 msgstr "" 483 484 #: free/templates/dashboard.php:89 485 msgid "Direct link that always serves the newest completed backup. Requires administrator login before download." 486 msgstr "" 487 488 #: free/backupino.php:1 489 msgid "Disabled" 490 msgstr "" 491 492 #: free/backupino.php:1 493 msgid "Download" 494 msgstr "" 495 496 #: free/backupino.php:1 497 msgid "Download (sign in as an administrator):" 498 msgstr "" 499 500 #: free/templates/dashboard.php:367 501 msgid "Download Archive" 502 msgstr "" 503 504 #: free/templates/dashboard.php:366 505 #: free/templates/dashboard.php:440 506 msgid "Download Archive (.zip)" 507 msgstr "" 508 509 #: free/src/Download/PublicDownload.php:297 510 msgid "Download Archive + Installer (Both)" 511 msgstr "" 512 513 #: free/templates/dashboard.php:382 514 msgid "Download Archive and Installer simultaneously" 515 msgstr "" 516 517 #: free/src/Download/PublicDownload.php:301 518 msgid "Download Backup Archive (.zip)" 519 msgstr "" 520 521 #: free/src/Download/PublicDownload.php:267 522 #: free/src/Download/PublicDownload.php:276 523 msgid "Download Backup Package" 524 msgstr "" 525 526 #: free/templates/dashboard.php:383 527 msgid "Download Both" 528 msgstr "" 529 530 #: free/templates/dashboard.php:374 531 msgid "Download Installer" 532 msgstr "" 533 534 #: free/templates/dashboard.php:443 535 msgid "Download Installer (.php)" 536 msgstr "" 537 538 #: free/src/Download/PublicDownload.php:305 539 #: free/templates/dashboard.php:373 540 msgid "Download Installer (installer.php)" 541 msgstr "" 542 543 #: free/templates/settings.php:546 544 msgid "Download Link" 545 msgstr "" 546 547 #: free/backupino.php:1 548 msgid "Download ZIP" 549 msgstr "" 550 551 #: free/templates/dashboard.php:186 552 msgid "Dumps all WordPress database tables into pure standard SQL without relying on mysqldump." 553 msgstr "" 554 555 #: free/templates/dashboard.php:153 556 msgid "Each backup includes installer.php alongside the archive zip. You can copy both files to an empty domain or localhost and run installer.php in your browser to restore the entire website in 3 steps without pre-installing WordPress." 557 msgstr "" 558 559 #: free/templates/settings.php:490 560 msgid "Enable Bale" 561 msgstr "" 562 563 #: free/templates/settings.php:449 564 msgid "Enable Telegram" 565 msgstr "" 566 567 #: free/templates/settings.php:181 568 msgid "Enabled" 569 msgstr "" 570 571 #: free/templates/settings.php:615 572 msgid "Enables recurring background backup jobs using WordPress built-in WP-Cron scheduler." 573 msgstr "" 574 575 #: free/templates/settings.php:201 576 msgid "Encrypted" 577 msgstr "" 578 579 #: free/templates/settings.php:111 580 msgid "Environment" 581 msgstr "" 582 583 #: free/templates/dashboard.php:169 584 msgid "Everything is packed into one archive plus a standalone installer that rebuilds the site on any empty server." 585 msgstr "" 586 587 #: free/templates/settings.php:302 588 msgid "Examples: wp-content/uploads/2022/, *.mp4, node_modules/. Cache and backup folders are always skipped automatically." 589 msgstr "" 590 591 #: free/backupino.php:1 592 msgid "Examples: wp-content/uploads/2022/, *.mp4, node_modules/. Cache and backup folders are always skipped." 593 msgstr "" 594 595 #: free/templates/settings.php:297 596 msgid "Excluded paths and patterns (one per line)" 597 msgstr "" 598 599 #: free/src/Storage/LocalStorage.php:75 600 msgid "Executable files cannot be stored in backup storage." 601 msgstr "" 602 603 #: free/templates/dashboard.php:450 604 msgid "Execution Log" 605 msgstr "" 606 607 #: free/templates/settings.php:171 608 msgid "Execution Timeout" 609 msgstr "" 610 611 #: free/src/Jobs/JobStatus.php:60 612 msgid "Failed" 613 msgstr "" 614 615 #: free/src/Download/PublicDownload.php:285 616 msgid "File Size" 617 msgstr "" 618 619 #: free/src/Backup/Stages/FilesStage.php:77 620 msgid "File archiving disabled." 621 msgstr "" 622 623 #: free/src/Backup/ZipArchiveWriter.php:99 624 msgid "File is not readable: %s" 625 msgstr "" 626 627 #: free/templates/dashboard.php:241 628 msgid "Files" 629 msgstr "" 630 631 #: free/templates/settings.php:310 632 msgid "Files exceeding this size threshold will be skipped to keep backups fast and reliable. Enter 0 for no limit." 633 msgstr "" 634 635 #: free/templates/settings.php:318 636 msgid "Files packed per request" 637 msgstr "" 638 639 #: free/src/Backup/Stages/FinalizeStage.php:43 640 msgid "Finalizing the package" 641 msgstr "" 642 643 #: free/templates/settings.php:298 644 msgid "Folders or file patterns that will be excluded from the backup archive (e.g. wp-content/cache/, *.mp4)." 645 msgstr "" 646 647 #: free/backupino.php:1 648 msgid "Free" 649 msgstr "" 650 651 #: free/src/Installer/Env.php:90 652 msgid "Free disk space" 653 msgstr "" 654 655 #: free/templates/settings.php:621 656 msgid "Frequency" 657 msgstr "" 658 659 #: free/templates/settings.php:549 660 #: free/templates/settings.php:580 661 msgid "HTML formatting tags such as <b>bold</b> and <a href=\"...\">links</a> are supported." 662 msgstr "" 663 664 #: free/backupino.php:1 665 msgid "Hide" 666 msgstr "" 667 668 #: free/src/Download/PublicDownload.php:310 669 msgid "How to restore or migrate:" 670 msgstr "" 671 672 #: free/backupino.php:1 673 msgid "In Free edition, monthly execution triggers on the 1st of each Persian/Gregorian month based on site language." 674 msgstr "" 675 676 #: free/templates/settings.php:199 677 msgid "Inactive" 678 msgstr "" 679 680 #: free/templates/dashboard.php:185 681 msgid "Include database" 682 msgstr "" 683 684 #: free/templates/dashboard.php:180 685 msgid "Include files" 686 msgstr "" 687 688 #: free/templates/dashboard.php:181 689 msgid "Includes WordPress core files, active themes, plugins, and uploads media library." 690 msgstr "" 691 692 #: free/templates/dashboard.php:262 693 msgid "Initializing backup job…" 694 msgstr "" 695 696 #: free/templates/dashboard.php:245 697 msgid "Installer" 698 msgstr "" 699 700 #: free/src/Download/PublicDownload.php:140 701 msgid "Installer file not found." 702 msgstr "" 703 704 #: free/templates/settings.php:655 705 msgid "Installer password (optional)" 706 msgstr "" 707 708 #: free/src/Admin/DownloadHandler.php:56 709 msgid "Invalid file name." 710 msgstr "" 711 712 #: free/backupino.php:1 713 msgid "Isolated, protected path used to safely store archive files away from public access:" 714 msgstr "" 715 716 #: free/templates/dashboard.php:173 717 msgid "JavaScript is required to build backups." 718 msgstr "" 719 720 #: free/templates/settings.php:633 721 msgid "Keep at most (backups)" 722 msgstr "" 723 724 #: free/templates/dashboard.php:192 725 msgid "Label (optional)" 726 msgstr "" 727 728 #: free/src/Admin/Admin.php:114 729 msgid "Link copied to the clipboard." 730 msgstr "" 731 732 #: free/templates/dashboard.php:274 733 msgid "Live Activity Feed" 734 msgstr "" 735 736 #: free/templates/settings.php:145 737 msgid "Live diagnostic health report of active server extensions, filesystem permissions, and system stability." 738 msgstr "" 739 740 #: free/templates/dashboard.php:453 741 msgid "Loading logs…" 742 msgstr "" 743 744 #: free/backupino.php:1 745 msgid "Loading…" 746 msgstr "" 747 748 #: free/templates/settings.php:212 749 msgid "Local directory used to store backup archives. Guarded with .htaccess (Apache/LiteSpeed), web.config (IIS), and index.html (directory listing). On Nginx, direct HTTP access is NOT guaranteed to be blocked until a server-level deny rule is configured." 750 msgstr "" 751 752 #: free/backupino.php:1 753 msgid "Local folder: %s" 754 msgstr "" 755 756 #: free/templates/settings.php:403 757 msgid "Manual Nginx Rule Configuration Required" 758 msgstr "" 759 760 #: free/templates/settings.php:634 761 msgid "Maximum number of recent backups to keep on disk. Older packages are automatically pruned to save space." 762 msgstr "" 763 764 #: free/templates/dashboard.php:123 765 #: free/templates/settings.php:120 766 #: free/templates/settings.php:162 767 msgid "Memory Limit" 768 msgstr "" 769 770 #: free/templates/dashboard.php:428 771 msgid "Message" 772 msgstr "" 773 774 #: free/templates/settings.php:529 775 msgid "Message template sent to messengers when a backup finishes." 776 msgstr "" 777 778 #: free/templates/settings.php:561 779 msgid "Message template sent to messengers when the site is restored using the installer." 780 msgstr "" 781 782 #: free/backupino.php:1 783 msgid "Messenger" 784 msgstr "" 785 786 #: free/backupino.php:1 787 msgid "Messenger Platform" 788 msgstr "" 789 790 #: free/templates/settings.php:626 791 msgid "Monthly (first day of the month)" 792 msgstr "" 793 794 #: free/templates/settings.php:622 795 msgid "Monthly execution triggers on the 1st of each Persian/Gregorian month based on site language." 796 msgstr "" 797 798 #: free/src/Installer/Env.php:56 799 msgid "MySQL driver" 800 msgstr "" 801 802 #: free/src/Core/Compatibility.php:66 803 msgid "Neither the Zip extension nor PclZip is available, so archives cannot be created." 804 msgstr "" 805 806 #: free/backupino.php:1 807 msgid "New Administrator Account Created:" 808 msgstr "" 809 810 #: free/templates/settings.php:575 811 msgid "New Site URL" 812 msgstr "" 813 814 #: free/templates/settings.php:382 815 msgid "Nginx & Reverse Proxy Limitations:" 816 msgstr "" 817 818 #: free/templates/dashboard.php:62 819 msgid "Nginx Server Configuration Note:" 820 msgstr "" 821 822 #: free/templates/settings.php:366 823 msgid "Nginx Server Detected — Action Required to Block Direct Access:" 824 msgstr "" 825 826 #: free/templates/settings.php:383 827 msgid "Nginx completely ignores .htaccess and web.config files. Because reverse proxies or front-end caches may sit in front of Apache or PHP-FPM, automated web server detection is best-effort and cannot be guaranteed in every architecture. Backupino cannot automatically modify or reload Nginx configuration files." 828 msgstr "" 829 830 #: free/templates/settings.php:225 831 msgid "Nginx detected — manual server configuration required:" 832 msgstr "" 833 834 #: free/templates/settings.php:367 835 msgid "Nginx does not enforce .htaccess or web.config rules, and index.html only conceals directory listings. Action is required by your server administrator to prevent direct HTTP downloads of backup files." 836 msgstr "" 837 838 #: free/templates/settings.php:226 839 msgid "Nginx ignores .htaccess and web.config. Backupino cannot automatically alter or reload Nginx configuration. Direct HTTP downloads of package URLs are not guaranteed to be blocked until your server administrator adds the rule below inside your Nginx server { } block and reloads Nginx." 840 msgstr "" 841 842 #: free/src/Core/Compatibility.php:108 843 msgid "Nginx web server detected: Nginx ignores .htaccess and web.config files, and index.html only hides directory listing. Direct HTTP access to backup files is NOT guaranteed to be blocked until your server administrator adds the server-level Nginx deny rule in Backupino -> Settings -> Storage Destination and reloads Nginx. Backupino cannot automatically alter or reload Nginx configuration." 844 msgstr "" 845 846 #: free/templates/dashboard.php:312 847 msgid "No backups yet." 848 msgstr "" 849 850 #: free/src/Notify/Notifier.php:251 851 msgid "No messenger is configured." 852 msgstr "" 853 854 #: free/templates/settings.php:266 855 msgid "No recent log entries found." 856 msgstr "" 857 858 #: free/src/Installer/Env.php:92 859 msgid "Not restricted / host managed" 860 msgstr "" 861 862 #: free/backupino.php:1 863 msgid "Notifications" 864 msgstr "" 865 866 #: free/backupino.php:1 867 msgid "Notifications are working. Backups will be announced here." 868 msgstr "" 869 870 #: free/backupino.php:1 871 msgid "Numeric chat or channel ID where notifications should be posted." 872 msgstr "" 873 874 #: free/templates/settings.php:165 875 #: free/templates/settings.php:174 876 msgid "OK" 877 msgstr "" 878 879 #: free/src/Cron/Scheduler.php:69 880 msgid "Once monthly (first day of the month)" 881 msgstr "" 882 883 #: free/backupino.php:1 884 msgid "Once weekly" 885 msgstr "" 886 887 #: free/src/Download/PublicDownload.php:313 888 msgid "Open installer.php in your web browser and follow the on-screen steps." 889 msgstr "" 890 891 #: free/templates/settings.php:198 892 msgid "OpenSSL" 893 msgstr "" 894 895 #: free/src/Core/Compatibility.php:100 896 msgid "OpenSSL extension is missing: secure HTTPS communications will be unavailable." 897 msgstr "" 898 899 #: free/backupino.php:1 900 msgid "OpenSSL is missing: S3 uploads that require HTTPS signatures and encrypted packages will be unavailable." 901 msgstr "" 902 903 #: free/templates/dashboard.php:193 904 msgid "Optional note to identify why this backup was created (e.g. before updating WooCommerce)." 905 msgstr "" 906 907 #: free/templates/dashboard.php:119 908 #: free/templates/settings.php:116 909 #: free/templates/settings.php:153 910 msgid "PHP Version" 911 msgstr "" 912 913 #: free/src/Installer/Env.php:40 914 msgid "PHP extension: %s" 915 msgstr "" 916 917 #: free/src/Core/Compatibility.php:84 918 msgid "PHP memory limit is %s. Backups will run in small chunks, but 128M or more is recommended." 919 msgstr "" 920 921 #: free/src/Installer/Env.php:33 922 msgid "PHP version" 923 msgstr "" 924 925 #: free/templates/dashboard.php:435 926 msgid "Package" 927 msgstr "" 928 929 #: free/src/Backup/Stages/FinalizeStage.php:130 930 msgid "Package %1$s is ready (%2$s)." 931 msgstr "" 932 933 #: free/src/Download/PublicDownload.php:281 934 msgid "Package Name" 935 msgstr "" 936 937 #: free/templates/dashboard.php:303 938 msgid "Package name" 939 msgstr "" 940 941 #: free/src/Storage/LocalStorage.php:119 942 msgid "Package not found." 943 msgstr "" 944 945 #: free/backupino.php:1 946 msgid "Packages are stored on: %s" 947 msgstr "" 948 949 #: free/templates/dashboard.php:249 950 msgid "Packaging" 951 msgstr "" 952 953 #: free/src/Backup/Stages/FilesStage.php:155 954 msgid "Packed %1$s of %2$s files (%3$s skipped, %4$s)." 955 msgstr "" 956 957 #: free/templates/settings.php:656 958 msgid "Password protecting installer.php when accessed via browser during migration or restoration." 959 msgstr "" 960 961 #: free/templates/settings.php:181 962 msgid "PclZip fallback" 963 msgstr "" 964 965 #: free/templates/dashboard.php:88 966 msgid "Permanent download link" 967 msgstr "" 968 969 #: free/backupino.php:1 970 msgid "Plugin Name of the plugin" 971 msgstr "" 972 973 #: free/templates/settings.php:692 974 msgid "Plugin updates are delivered securely through the official WordPress repository." 975 msgstr "" 976 977 #: free/templates/settings.php:664 978 msgid "Preset target URL for search & replace when migrating to a known new domain." 979 msgstr "" 980 981 #: free/templates/settings.php:340 982 msgid "Primary Destination Driver" 983 msgstr "" 984 985 #: free/templates/settings.php:341 986 msgid "Primary storage destination for completed packages." 987 msgstr "" 988 989 #: free/backupino.php:1 990 msgid "Primary storage destination for completed packages. In the Free edition, local protected storage is used." 991 msgstr "" 992 993 #: free/templates/dashboard.php:302 994 #: free/templates/dashboard.php:420 995 msgid "Progress" 996 msgstr "" 997 998 #: free/templates/settings.php:126 999 msgid "Protected" 1000 msgstr "" 1001 1002 #: free/backupino.php:1 1003 msgid "Protected Directory Path" 1004 msgstr "" 1005 1006 #: free/src/Jobs/JobStatus.php:54 1007 msgid "Queued" 1008 msgstr "" 1009 1010 #: free/backupino.php:1 1011 msgid "Quick Navigation" 1012 msgstr "" 1013 1014 #: free/templates/dashboard.php:275 1015 msgid "RUNNING" 1016 msgstr "" 1017 1018 #: free/templates/settings.php:183 1019 msgid "Ready" 1020 msgstr "" 1021 1022 #: free/templates/dashboard.php:278 1023 msgid "Ready to start backup..." 1024 msgstr "" 1025 1026 #: free/templates/settings.php:680 1027 msgid "Receive critical security notices, product updates, and roadmap announcements (opt-in)." 1028 msgstr "" 1029 1030 #: free/templates/dashboard.php:294 1031 msgid "Recent backups" 1032 msgstr "" 1033 1034 #: free/templates/settings.php:32 1035 #: free/templates/settings.php:606 1036 msgid "Recurring Schedule" 1037 msgstr "" 1038 1039 #: free/templates/settings.php:248 1040 msgid "Refresh" 1041 msgstr "" 1042 1043 #: free/templates/dashboard.php:67 1044 msgid "Required Nginx server configuration (add inside your server { } block and reload Nginx):" 1045 msgstr "" 1046 1047 #: free/templates/settings.php:577 1048 msgid "Restoration Date" 1049 msgstr "" 1050 1051 #: free/templates/settings.php:558 1052 msgid "Restoration Message Template" 1053 msgstr "" 1054 1055 #: free/templates/settings.php:218 1056 msgid "Run Storage Write Test" 1057 msgstr "" 1058 1059 #: free/templates/settings.php:614 1060 msgid "Run automatic backups" 1061 msgstr "" 1062 1063 #: free/src/Jobs/JobStatus.php:56 1064 msgid "Running" 1065 msgstr "" 1066 1067 #: free/templates/settings.php:703 1068 msgid "Save settings" 1069 msgstr "" 1070 1071 #: free/src/Backup/Stages/ScanStage.php:39 1072 msgid "Scanning files" 1073 msgstr "" 1074 1075 #: free/backupino.php:1 1076 msgid "Schedule" 1077 msgstr "" 1078 1079 #: free/src/Cron/Scheduler.php:115 1080 msgid "Scheduled backup" 1081 msgstr "" 1082 1083 #: free/src/Backup/Stages/FinalizeStage.php:78 1084 msgid "Sealing the archive…" 1085 msgstr "" 1086 1087 #: free/backupino.php:1 1088 msgid "Select which messaging platform to send backup completion or failure alerts to." 1089 msgstr "" 1090 1091 #: free/backupino.php:1 1092 msgid "Send test message" 1093 msgstr "" 1094 1095 #: free/templates/settings.php:387 1096 msgid "Server Administrator Nginx Configuration" 1097 msgstr "" 1098 1099 #: free/src/Admin/Admin.php:67 1100 #: free/src/Admin/Admin.php:68 1101 #: free/src/Admin/Admin.php:160 1102 #: free/templates/dashboard.php:47 1103 #: free/templates/settings.php:77 57 1104 msgid "Settings" 58 1105 msgstr "" 59 1106 60 #: src/Admin/Admin.php:109 1107 #: free/templates/settings.php:90 1108 msgid "Settings Navigation" 1109 msgstr "" 1110 1111 #: free/src/Admin/Admin.php:113 1112 msgid "Settings saved." 1113 msgstr "" 1114 1115 #: free/backupino.php:1 1116 msgid "Show" 1117 msgstr "" 1118 1119 #: free/templates/settings.php:542 1120 #: free/templates/settings.php:574 1121 msgid "Site Name" 1122 msgstr "" 1123 1124 #: free/templates/dashboard.php:304 1125 #: free/templates/dashboard.php:436 1126 msgid "Size" 1127 msgstr "" 1128 1129 #: free/backupino.php:1 1130 msgid "Size: %s" 1131 msgstr "" 1132 1133 #: free/templates/settings.php:309 1134 msgid "Skip files larger than (MB, 0 = no limit)" 1135 msgstr "" 1136 1137 #: free/src/Installer/Extractor.php:136 1138 msgid "Skipped unsafe entry: %s" 1139 msgstr "" 1140 1141 #: free/templates/settings.php:36 1142 #: free/templates/settings.php:646 1143 msgid "Standalone Installer" 1144 msgstr "" 1145 1146 #: free/templates/dashboard.php:149 1147 msgid "Standalone Restore" 1148 msgstr "" 1149 1150 #: free/src/Admin/Admin.php:109 61 1151 msgid "Starting…" 62 1152 msgstr "" 63 1153 64 #: src/Admin/Admin.php:110 1154 #: free/templates/dashboard.php:301 1155 #: free/templates/dashboard.php:416 1156 msgid "Status" 1157 msgstr "" 1158 1159 #: free/backupino.php:1 1160 msgid "Storage" 1161 msgstr "" 1162 1163 #: free/templates/dashboard.php:110 1164 msgid "Storage & Environment" 1165 msgstr "" 1166 1167 #: free/templates/settings.php:24 1168 #: free/templates/settings.php:332 1169 msgid "Storage Destination" 1170 msgstr "" 1171 1172 #: free/templates/settings.php:355 1173 msgid "Storage Directory Path" 1174 msgstr "" 1175 1176 #: free/templates/settings.php:124 1177 msgid "Storage Status" 1178 msgstr "" 1179 1180 #: free/templates/dashboard.php:133 1181 msgid "Storage folder:" 1182 msgstr "" 1183 1184 #: free/src/Admin/RestController.php:455 1185 msgid "Storage is writable." 1186 msgstr "" 1187 1188 #: free/templates/settings.php:192 1189 msgid "Streaming" 1190 msgstr "" 1191 1192 #: free/templates/settings.php:244 1193 msgid "System & Activity Log Stream" 1194 msgstr "" 1195 1196 #: free/templates/settings.php:258 1197 msgid "System Activity Log (Last 100 entries)" 1198 msgstr "" 1199 1200 #: free/templates/settings.php:40 1201 msgid "System Status" 1202 msgstr "" 1203 1204 #: free/templates/settings.php:141 1205 msgid "System Status & Diagnostics" 1206 msgstr "" 1207 1208 #: free/backupino.php:1 1209 msgid "System status" 1210 msgstr "" 1211 1212 #: free/templates/settings.php:417 1213 msgid "Target filesystem path: %s" 1214 msgstr "" 1215 1216 #: free/src/Notify/ChannelFactory.php:36 1217 msgid "Telegram" 1218 msgstr "" 1219 1220 #: free/templates/settings.php:455 1221 msgid "Telegram Bot Token" 1222 msgstr "" 1223 1224 #: free/templates/settings.php:464 1225 msgid "Telegram Chat ID" 1226 msgstr "" 1227 1228 #: free/templates/settings.php:445 1229 msgid "Telegram Notification" 1230 msgstr "" 1231 1232 #: free/templates/settings.php:465 1233 msgid "Telegram numeric chat or channel ID." 1234 msgstr "" 1235 1236 #: free/templates/settings.php:516 1237 msgid "Test Bale" 1238 msgstr "" 1239 1240 #: free/templates/settings.php:475 1241 msgid "Test Telegram" 1242 msgstr "" 1243 1244 #: free/src/Admin/Admin.php:115 1245 msgid "Test message sent." 1246 msgstr "" 1247 1248 #: free/templates/dashboard.php:139 1249 msgid "Test storage" 1250 msgstr "" 1251 1252 #: free/src/Core/Compatibility.php:59 1253 msgid "The PHP extension \"%s\" is required but not loaded." 1254 msgstr "" 1255 1256 #: free/src/Backup/Stages/DatabaseStage.php:77 1257 msgid "The SQL dump file could not be opened." 1258 msgstr "" 1259 1260 #: free/src/Installer/Extractor.php:74 1261 msgid "The Zip extension is not available on this server." 1262 msgstr "" 1263 1264 #: free/src/Backup/ZipArchiveWriter.php:60 1265 msgid "The Zip extension is not available." 1266 msgstr "" 1267 1268 #: free/src/Installer/Extractor.php:88 1269 msgid "The archive cannot be opened. Is it complete?" 1270 msgstr "" 1271 1272 #: free/src/Backup/ZipArchiveWriter.php:182 1273 msgid "The archive could not be finalized (%s)." 1274 msgstr "" 1275 1276 #: free/src/Backup/ZipArchiveWriter.php:182 1277 msgid "The archive could not be finalized." 1278 msgstr "" 1279 1280 #: free/src/Backup/Stages/FinalizeStage.php:85 1281 msgid "The archive could not be hashed." 1282 msgstr "" 1283 1284 #: free/src/Installer/Extractor.php:80 1285 msgid "The archive file is missing." 1286 msgstr "" 1287 1288 #: free/src/Backup/ZipArchiveWriter.php:89 1289 #: free/src/Backup/ZipArchiveWriter.php:132 1290 msgid "The archive is not open." 1291 msgstr "" 1292 1293 #: free/templates/dashboard.php:285 1294 msgid "The backup process is running in the background. Please keep this browser window open until the operation finishes completely." 1295 msgstr "" 1296 1297 #: free/templates/settings.php:410 1298 msgid "The backup storage directory is located outside standard web root or uses a custom path mapping. Your server administrator must manually configure an Nginx rule denying direct access based on your web server configuration." 1299 msgstr "" 1300 1301 #: free/src/Notify/BotApi.php:191 1302 msgid "The bot token or chat id is missing." 1303 msgstr "" 1304 1305 #: free/src/Installer/ConnectionManager.php:74 1306 msgid "The database could not be created: %s" 1307 msgstr "" 1308 1309 #: free/templates/settings.php:232 1310 msgid "The exact Nginx location block cannot be determined automatically (e.g. external CDN or custom mapping). Please visit Backupino -> Settings -> Storage Destination to view manual configuration guidance." 1311 msgstr "" 1312 1313 #: free/backupino.php:1 1314 msgid "The installer file could not be generated." 1315 msgstr "" 1316 1317 #: free/src/Admin/Admin.php:111 1318 msgid "The job failed." 1319 msgstr "" 1320 1321 #: free/src/Notify/BotApi.php:251 1322 msgid "The messenger answered with HTTP %d." 1323 msgstr "" 1324 1325 #: free/src/Notify/BotApi.php:259 1326 msgid "The messenger rejected the message." 1327 msgstr "" 1328 1329 #: free/src/Backup/Stages/FinalizeStage.php:99 1330 msgid "The package metadata could not be generated." 1331 msgstr "" 1332 1333 #: free/src/Support/Fs.php:281 1334 msgid "The requested file does not exist." 1335 msgstr "" 1336 1337 #: free/templates/dashboard.php:72 1338 msgid "The storage path cannot be resolved to an automatic Nginx location (for example, due to an external CDN, custom domain, or path outside webroot). Please see Backupino -> Settings -> Storage Destination to manually determine the rule for your server." 1339 msgstr "" 1340 1341 #: free/src/Download/PublicDownload.php:101 1342 msgid "There is no backup ready to download yet." 1343 msgstr "" 1344 1345 #: free/src/Notify/BotApi.php:197 1346 msgid "There is nothing to send." 1347 msgstr "" 1348 1349 #: free/src/Download/PublicDownload.php:93 1350 msgid "This download link is not valid." 1351 msgstr "" 1352 1353 #: free/templates/dashboard.php:93 1354 msgid "This link always points at the newest backup. It never expires, but the visitor must be signed in as an administrator before the download starts." 1355 msgstr "" 1356 1357 #: free/backupino.php:1 1358 msgid "This location contains an .htaccess file blocking direct HTTP requests and indexing for maximum security." 1359 msgstr "" 1360 1361 #: free/src/Admin/DownloadHandler.php:77 1362 #: free/src/Admin/DownloadHandler.php:81 1363 msgid "This package no longer exists on the server." 1364 msgstr "" 1365 1366 #: free/src/Storage/LocalStorage.php:55 1367 msgid "This server" 1368 msgstr "" 1369 1370 #: free/templates/dashboard.php:127 1371 msgid "Time Limit" 1372 msgstr "" 1373 1374 #: free/src/Download/PublicDownload.php:65 1375 msgid "Too Many Requests" 1376 msgstr "" 1377 1378 #: free/src/Download/PublicDownload.php:64 1379 msgid "Too many failed download attempts. Please try again in 10 minutes." 1380 msgstr "" 1381 1382 #: free/src/Jobs/JobRunner.php:172 1383 msgid "Unknown pipeline stage." 1384 msgstr "" 1385 1386 #: free/backupino.php:1 1387 msgid "Update Now" 1388 msgstr "" 1389 1390 #: free/backupino.php:1 1391 msgid "Updates & Community" 1392 msgstr "" 1393 1394 #: free/templates/settings.php:44 1395 #: free/templates/settings.php:676 1396 msgid "Updates & Privacy" 1397 msgstr "" 1398 1399 #: free/src/Download/PublicDownload.php:312 1400 msgid "Upload both the .zip archive and installer.php into an empty directory on your destination server." 1401 msgstr "" 1402 1403 #: free/src/Backup/Stages/FinalizeStage.php:260 1404 msgid "Upload failed: %s" 1405 msgstr "" 1406 1407 #: free/src/Download/PublicDownload.php:274 1408 msgid "Verified Backup Package" 1409 msgstr "" 1410 1411 #: free/backupino.php:1 1412 msgid "View Release Notes" 1413 msgstr "" 1414 1415 #: free/templates/settings.php:684 1416 msgid "We respect your privacy. No telemetry or personal data is collected or sent without your explicit consent." 1417 msgstr "" 1418 1419 #: free/templates/settings.php:376 1420 msgid "Web Server Direct Access Protection & Nginx Guidance" 1421 msgstr "" 1422 1423 #: free/src/Admin/Admin.php:110 65 1424 msgid "Working…" 66 1425 msgstr "" 67 1426 68 #: src/Admin/Admin.php:111 69 msgid "The job failed." 70 msgstr "" 71 72 #: src/Admin/Admin.php:112 73 msgid "Delete this package permanently?" 74 msgstr "" 75 76 #: src/Admin/Admin.php:113 77 msgid "Settings saved." 78 msgstr "" 79 80 #: src/Admin/Admin.php:114 81 msgid "Link copied to the clipboard." 82 msgstr "" 83 84 #: src/Admin/Admin.php:115 85 msgid "Test message sent." 86 msgstr "" 87 88 #: src/Admin/Admin.php:116 89 msgid "Backup Job" 90 msgstr "" 91 92 #: src/Admin/Admin.php:117 93 msgid "Cancel the current backup job?" 94 msgstr "" 95 96 #: src/Admin/Admin.php:118 97 msgid "Backup cancelled." 98 msgstr "" 99 100 #: src/Admin/Admin.php:131 101 #: src/Admin/Admin.php:144 1427 #: free/templates/settings.php:126 1428 msgid "Writable" 1429 msgstr "" 1430 1431 #: free/src/Installer/Env.php:62 1432 msgid "Writable directory" 1433 msgstr "" 1434 1435 #: free/src/Admin/DownloadHandler.php:50 1436 msgid "You are not allowed to download backups." 1437 msgstr "" 1438 1439 #: free/src/Admin/Admin.php:131 1440 #: free/src/Admin/Admin.php:144 102 1441 msgid "You are not allowed to manage backups." 103 1442 msgstr "" 104 1443 105 #: src/Admin/Admin.php:185 106 msgid "Backupino — Site Migration Completed!" 107 msgstr "" 108 109 #: src/Admin/Admin.php:187 1444 #: free/backupino.php:1 1445 msgid "You do not have permission to check for updates." 1446 msgstr "" 1447 1448 #: free/templates/settings.php:408 1449 msgid "Your WordPress uploads directory uses an external CDN or separate domain. The exact public Nginx location cannot be determined automatically. Your server administrator must manually create an Nginx location block matching your origin server URL mapping." 1450 msgstr "" 1451 1452 #: free/src/Admin/Admin.php:187 110 1453 msgid "Your website has been successfully restored and migrated to this location. Installer files and temporary data have been cleaned up." 111 1454 msgstr "" 112 1455 113 #: src/Admin/DownloadHandler.php:50 114 msgid "You are not allowed to download backups." 115 msgstr "" 116 117 #: src/Admin/DownloadHandler.php:56 118 msgid "Invalid file name." 119 msgstr "" 120 121 #: src/Admin/DownloadHandler.php:77 122 #: src/Admin/DownloadHandler.php:81 123 msgid "This package no longer exists on the server." 124 msgstr "" 125 126 #: src/Admin/RestController.php:237 127 msgid "Could not create backup job in database." 128 msgstr "" 129 130 #: src/Admin/RestController.php:455 131 msgid "Storage is writable." 132 msgstr "" 133 134 #: src/Backup/Stages/DatabaseStage.php:40 135 msgid "Copying the database" 136 msgstr "" 137 138 #: src/Backup/Stages/DatabaseStage.php:61 139 msgid "Database dump disabled." 140 msgstr "" 141 142 #: src/Backup/Stages/DatabaseStage.php:77 143 msgid "The SQL dump file could not be opened." 144 msgstr "" 145 146 #. translators: 1: number of rows, 2: number of tables, 3: dumped size. 147 #: src/Backup/Stages/DatabaseStage.php:99 148 #, php-format 149 msgid "%1$s rows from %2$s tables (%3$s)." 150 msgstr "" 151 152 #: src/Backup/Stages/FilesStage.php:40 153 msgid "Archiving files" 154 msgstr "" 155 156 #: src/Backup/Stages/FilesStage.php:77 157 msgid "File archiving disabled." 158 msgstr "" 159 160 #. translators: 1: packed files, 2: total files, 3: skipped files, 4: archive size. 161 #: src/Backup/Stages/FilesStage.php:155 162 #, php-format 163 msgid "Packed %1$s of %2$s files (%3$s skipped, %4$s)." 164 msgstr "" 165 166 #: src/Backup/Stages/FinalizeStage.php:43 167 msgid "Finalizing the package" 168 msgstr "" 169 170 #: src/Backup/Stages/FinalizeStage.php:78 171 msgid "Sealing the archive…" 172 msgstr "" 173 174 #: src/Backup/Stages/FinalizeStage.php:85 175 msgid "The archive could not be hashed." 176 msgstr "" 177 178 #: src/Backup/Stages/FinalizeStage.php:99 179 msgid "The package metadata could not be generated." 180 msgstr "" 181 182 #. translators: 1: package name, 2: package size. 183 #: src/Backup/Stages/FinalizeStage.php:130 184 #, php-format 185 msgid "Package %1$s is ready (%2$s)." 186 msgstr "" 187 188 #. translators: %s: storage error. 189 #: src/Backup/Stages/FinalizeStage.php:260 190 #, php-format 191 msgid "Upload failed: %s" 192 msgstr "" 193 194 #: src/Backup/Stages/ScanStage.php:39 195 msgid "Scanning files" 196 msgstr "" 197 198 #. translators: 1: number of files, 2: total size. 199 #: src/Backup/Stages/ScanStage.php:86 200 #, php-format 201 msgid "%1$s files found (%2$s)." 202 msgstr "" 203 204 #: src/Backup/ZipArchiveWriter.php:60 205 msgid "The Zip extension is not available." 206 msgstr "" 207 208 #. translators: %d: ZipArchive error code. 209 #: src/Backup/ZipArchiveWriter.php:73 210 #, php-format 211 msgid "Could not open the archive (error %d)." 212 msgstr "" 213 214 #: src/Backup/ZipArchiveWriter.php:89 215 #: src/Backup/ZipArchiveWriter.php:132 216 msgid "The archive is not open." 217 msgstr "" 218 219 #. translators: %s: file path. 220 #: src/Backup/ZipArchiveWriter.php:99 221 #, php-format 222 msgid "File is not readable: %s" 223 msgstr "" 224 225 #. translators: %s: file path. 226 #: src/Backup/ZipArchiveWriter.php:109 227 #, php-format 228 msgid "Could not add file to archive: %s" 229 msgstr "" 230 231 #. translators: %s: status description. 232 #: src/Backup/ZipArchiveWriter.php:182 233 #, php-format 234 msgid "The archive could not be finalized (%s)." 235 msgstr "" 236 237 #. translators: %s: status description. 238 #: src/Backup/ZipArchiveWriter.php:182 239 msgid "The archive could not be finalized." 240 msgstr "" 241 242 #: src/Core/Activator.php:45 243 #: src/Cron/Scheduler.php:62 244 msgid "Backupino: every minute" 245 msgstr "" 246 247 #. translators: 1: required PHP version, 2: current PHP version. 248 #: src/Core/Compatibility.php:49 249 #, php-format 250 msgid "Backupino requires PHP %1$s or newer. This server runs PHP %2$s." 251 msgstr "" 252 253 #. translators: %s: PHP extension name. 254 #: src/Core/Compatibility.php:59 255 #, php-format 256 msgid "The PHP extension \"%s\" is required but not loaded." 257 msgstr "" 258 259 #: src/Core/Compatibility.php:66 260 msgid "Neither the Zip extension nor PclZip is available, so archives cannot be created." 261 msgstr "" 262 263 #. translators: %s: current memory limit. 264 #: src/Core/Compatibility.php:84 265 #, php-format 266 msgid "PHP memory limit is %s. Backups will run in small chunks, but 128M or more is recommended." 267 msgstr "" 268 269 #. translators: %d: seconds. 270 #: src/Core/Compatibility.php:94 271 #, php-format 1456 #: free/templates/settings.php:180 1457 msgid "ZipArchive" 1458 msgstr "" 1459 1460 #: free/src/Installer/Env.php:52 1461 msgid "ZipArchive available" 1462 msgstr "" 1463 1464 #: free/src/Installer/Env.php:52 1465 msgid "ZipArchive missing" 1466 msgstr "" 1467 1468 #: free/src/Notify/Notifier.php:185 1469 msgid "database only" 1470 msgstr "" 1471 1472 #: free/src/Notify/Notifier.php:183 1473 msgid "files and database" 1474 msgstr "" 1475 1476 #: free/src/Notify/Notifier.php:187 1477 msgid "files only" 1478 msgstr "" 1479 1480 #: free/src/Installer/Env.php:42 1481 msgid "loaded" 1482 msgstr "" 1483 1484 #: free/src/Core/Compatibility.php:94 272 1485 msgid "max_execution_time is %d seconds. Long steps will be split automatically." 273 1486 msgstr "" 274 1487 275 #: src/Core/Compatibility.php:100 276 msgid "OpenSSL extension is missing: secure HTTPS communications will be unavailable." 277 msgstr "" 278 279 #: src/Core/Compatibility.php:104 1488 #: free/src/Core/Compatibility.php:104 280 1489 msgid "mbstring is missing: multibyte site titles may be truncated on URL replacement." 281 1490 msgstr "" 282 1491 283 #: src/Cron/Scheduler.php:69 284 msgid "Once monthly (first day of the month)" 285 msgstr "" 286 287 #: src/Cron/Scheduler.php:115 288 msgid "Scheduled backup" 289 msgstr "" 290 291 #: src/Download/PublicDownload.php:64 292 msgid "Too many failed download attempts. Please try again in 10 minutes." 293 msgstr "" 294 295 #: src/Download/PublicDownload.php:65 296 msgid "Too Many Requests" 297 msgstr "" 298 299 #: src/Download/PublicDownload.php:93 300 msgid "This download link is not valid." 301 msgstr "" 302 303 #: src/Download/PublicDownload.php:101 304 msgid "There is no backup ready to download yet." 305 msgstr "" 306 307 #: src/Download/PublicDownload.php:140 308 msgid "Installer file not found." 309 msgstr "" 310 311 #: src/Download/PublicDownload.php:267 312 #: src/Download/PublicDownload.php:276 313 msgid "Download Backup Package" 314 msgstr "" 315 316 #: src/Download/PublicDownload.php:274 317 msgid "Verified Backup Package" 318 msgstr "" 319 320 #: src/Download/PublicDownload.php:281 321 msgid "Package Name" 322 msgstr "" 323 324 #: src/Download/PublicDownload.php:285 325 msgid "File Size" 326 msgstr "" 327 328 #: src/Download/PublicDownload.php:289 329 msgid "Created Date" 330 msgstr "" 331 332 #: src/Download/PublicDownload.php:297 333 msgid "Download Archive + Installer (Both)" 334 msgstr "" 335 336 #: src/Download/PublicDownload.php:301 337 msgid "Download Backup Archive (.zip)" 338 msgstr "" 339 340 #: src/Download/PublicDownload.php:305 341 #: templates/dashboard.php:356 342 msgid "Download Installer (installer.php)" 343 msgstr "" 344 345 #: src/Download/PublicDownload.php:310 346 msgid "How to restore or migrate:" 347 msgstr "" 348 349 #: src/Download/PublicDownload.php:312 350 msgid "Upload both the .zip archive and installer.php into an empty directory on your destination server." 351 msgstr "" 352 353 #: src/Download/PublicDownload.php:313 354 msgid "Open installer.php in your web browser and follow the on-screen steps." 355 msgstr "" 356 357 #. translators: %s: driver error. 358 #: src/Installer/ConnectionManager.php:74 359 #, php-format 360 msgid "The database could not be created: %s" 361 msgstr "" 362 363 #: src/Installer/Env.php:33 364 msgid "PHP version" 365 msgstr "" 366 367 #. translators: %s: extension name. 368 #: src/Installer/Env.php:40 369 #, php-format 370 msgid "PHP extension: %s" 371 msgstr "" 372 373 #: src/Installer/Env.php:42 374 msgid "loaded" 375 msgstr "" 376 377 #: src/Installer/Env.php:42 1492 #: free/src/Installer/Env.php:42 378 1493 msgid "missing" 379 1494 msgstr "" 380 1495 381 #: src/Installer/Env.php:50 382 msgid "Archive support" 383 msgstr "" 384 385 #: src/Installer/Env.php:52 386 msgid "ZipArchive available" 387 msgstr "" 388 389 #: src/Installer/Env.php:52 390 msgid "ZipArchive missing" 391 msgstr "" 392 393 #: src/Installer/Env.php:56 394 msgid "MySQL driver" 395 msgstr "" 396 397 #: src/Installer/Env.php:58 1496 #: free/src/Installer/Env.php:92 1497 msgid "needed" 1498 msgstr "" 1499 1500 #: free/backupino.php:1 1501 msgid "none" 1502 msgstr "" 1503 1504 #: free/src/Installer/Env.php:72 1505 msgid "not found: %s" 1506 msgstr "" 1507 1508 #: free/src/Installer/Env.php:58 398 1509 msgid "pdo_mysql missing" 399 1510 msgstr "" 400 1511 401 #: src/Installer/Env.php:62 402 msgid "Writable directory" 403 msgstr "" 404 405 #: src/Installer/Env.php:70 406 msgid "Archive file" 407 msgstr "" 408 409 #. translators: %s: file name. 410 #: src/Installer/Env.php:72 411 #, php-format 412 msgid "not found: %s" 413 msgstr "" 414 415 #: src/Installer/Env.php:77 416 msgid "Archive checksum" 417 msgstr "" 418 419 #: src/Installer/Env.php:79 1512 #: free/backupino.php:1 1513 msgid "unknown" 1514 msgstr "" 1515 1516 #: free/src/Installer/Env.php:79 420 1517 msgid "verified against the package manifest" 421 1518 msgstr "" 422 1519 423 #: src/Installer/Env.php:90424 msgid "Free disk space"425 msgstr ""426 427 #: src/Installer/Env.php:92428 msgid "Not restricted / host managed"429 msgstr ""430 431 #: src/Installer/Env.php:92432 msgid "needed"433 msgstr ""434 435 #: src/Installer/Extractor.php:74436 msgid "The Zip extension is not available on this server."437 msgstr ""438 439 #: src/Installer/Extractor.php:80440 msgid "The archive file is missing."441 msgstr ""442 443 #: src/Installer/Extractor.php:88444 msgid "The archive cannot be opened. Is it complete?"445 msgstr ""446 447 #. translators: %s: archive entry name.448 #: src/Installer/Extractor.php:136449 #, php-format450 msgid "Skipped unsafe entry: %s"451 msgstr ""452 453 #: src/Jobs/JobRunner.php:172454 msgid "Unknown pipeline stage."455 msgstr ""456 457 #: src/Jobs/JobRunner.php:308458 msgid "Cancelled by the user."459 msgstr ""460 461 #: src/Jobs/JobStatus.php:54462 msgid "Queued"463 msgstr ""464 465 #: src/Jobs/JobStatus.php:56466 msgid "Running"467 msgstr ""468 469 #: src/Jobs/JobStatus.php:58470 msgid "Completed"471 msgstr ""472 473 #: src/Jobs/JobStatus.php:60474 msgid "Failed"475 msgstr ""476 477 #: src/Jobs/JobStatus.php:62478 msgid "Cancelled"479 msgstr ""480 481 #: src/Notify/BotApi.php:191482 msgid "The bot token or chat id is missing."483 msgstr ""484 485 #: src/Notify/BotApi.php:197486 msgid "There is nothing to send."487 msgstr ""488 489 #. translators: %d: HTTP status code.490 #: src/Notify/BotApi.php:251491 #, php-format492 msgid "The messenger answered with HTTP %d."493 msgstr ""494 495 #: src/Notify/BotApi.php:259496 msgid "The messenger rejected the message."497 msgstr ""498 499 #: src/Notify/ChannelFactory.php:36500 msgid "Telegram"501 msgstr ""502 503 #: src/Notify/ChannelFactory.php:37504 msgid "Bale"505 msgstr ""506 507 #: src/Notify/Notifier.php:183508 msgid "files and database"509 msgstr ""510 511 #: src/Notify/Notifier.php:185512 msgid "database only"513 msgstr ""514 515 #: src/Notify/Notifier.php:187516 msgid "files only"517 msgstr ""518 519 #. translators: %s: messenger service name.520 #: src/Notify/Notifier.php:241521 #, php-format522 msgid "%s messenger is not enabled or not fully configured."523 msgstr ""524 525 #: src/Notify/Notifier.php:251526 msgid "No messenger is configured."527 msgstr ""528 529 #: src/Plugin.php:190530 msgid "Backupino cannot run on this server:"531 msgstr ""532 533 #: src/Storage/LocalStorage.php:55534 msgid "This server"535 msgstr ""536 537 #: src/Storage/LocalStorage.php:75538 msgid "Executable files cannot be stored in backup storage."539 msgstr ""540 541 #: src/Storage/LocalStorage.php:97542 msgid "Could not read the package file."543 msgstr ""544 545 #: src/Storage/LocalStorage.php:104546 msgid "Could not write the package file."547 msgstr ""548 549 #: src/Storage/LocalStorage.php:119550 msgid "Package not found."551 msgstr ""552 553 #: src/Support/Fs.php:281554 msgid "The requested file does not exist."555 msgstr ""556 557 #: templates/dashboard.php:40558 #: templates/settings.php:70559 msgid "Backupino Navigation"560 msgstr ""561 562 #: templates/dashboard.php:71563 msgid "Permanent download link"564 msgstr ""565 566 #: templates/dashboard.php:72567 msgid "Direct link that always serves the newest completed backup. Requires administrator login before download."568 msgstr ""569 570 #: templates/dashboard.php:76571 msgid "This link always points at the newest backup. It never expires, but the visitor must be signed in as an administrator before the download starts."572 msgstr ""573 574 #: templates/dashboard.php:82575 msgid "Copy link"576 msgstr ""577 578 #: templates/dashboard.php:93579 msgid "Storage & Environment"580 msgstr ""581 582 #: templates/dashboard.php:98583 msgid "Destination"584 msgstr ""585 586 #: templates/dashboard.php:102587 #: templates/settings.php:116588 #: templates/settings.php:153589 msgid "PHP Version"590 msgstr ""591 592 #: templates/dashboard.php:106593 #: templates/settings.php:120594 #: templates/settings.php:162595 msgid "Memory Limit"596 msgstr ""597 598 #: templates/dashboard.php:110599 msgid "Time Limit"600 msgstr ""601 602 #: templates/dashboard.php:116603 msgid "Storage folder:"604 msgstr ""605 606 #: templates/dashboard.php:122607 msgid "Test storage"608 msgstr ""609 610 #: templates/dashboard.php:132611 msgid "Standalone Restore"612 msgstr ""613 614 #: templates/dashboard.php:136615 msgid "Each backup includes installer.php alongside the archive zip. You can copy both files to an empty domain or localhost and run installer.php in your browser to restore the entire website in 3 steps without pre-installing WordPress."616 msgstr ""617 618 #: templates/dashboard.php:148619 msgid "Create a backup"620 msgstr ""621 622 #: templates/dashboard.php:152623 msgid "Everything is packed into one archive plus a standalone installer that rebuilds the site on any empty server."624 msgstr ""625 626 #: templates/dashboard.php:156627 msgid "JavaScript is required to build backups."628 msgstr ""629 630 #: templates/dashboard.php:163631 msgid "Include files"632 msgstr ""633 634 #: templates/dashboard.php:164635 msgid "Includes WordPress core files, active themes, plugins, and uploads media library."636 msgstr ""637 638 #: templates/dashboard.php:168639 msgid "Include database"640 msgstr ""641 642 #: templates/dashboard.php:169643 msgid "Dumps all WordPress database tables into pure standard SQL without relying on mysqldump."644 msgstr ""645 646 #: templates/dashboard.php:175647 msgid "Label (optional)"648 msgstr ""649 650 #: templates/dashboard.php:176651 msgid "Optional note to identify why this backup was created (e.g. before updating WooCommerce)."652 msgstr ""653 654 #: templates/dashboard.php:178655 msgid "Before updating plugins"656 msgstr ""657 658 #: templates/dashboard.php:184659 msgid "Create backup"660 msgstr ""661 662 #: templates/dashboard.php:201663 msgid "Backup in Progress"664 msgstr ""665 666 #: templates/dashboard.php:205667 msgid "Cancel backup job"668 msgstr ""669 670 #: templates/dashboard.php:207671 msgid "Cancel"672 msgstr ""673 674 #: templates/dashboard.php:216675 msgid "Cataloging"676 msgstr ""677 678 #: templates/dashboard.php:220679 msgid "Database"680 msgstr ""681 682 #: templates/dashboard.php:224683 msgid "Files"684 msgstr ""685 686 #: templates/dashboard.php:228687 msgid "Installer"688 msgstr ""689 690 #: templates/dashboard.php:232691 msgid "Packaging"692 msgstr ""693 694 #: templates/dashboard.php:245695 msgid "Initializing backup job…"696 msgstr ""697 698 #: templates/dashboard.php:257699 msgid "Live Activity Feed"700 msgstr ""701 702 #: templates/dashboard.php:258703 msgid "RUNNING"704 msgstr ""705 706 #: templates/dashboard.php:261707 msgid "Ready to start backup..."708 msgstr ""709 710 #: templates/dashboard.php:268711 msgid "The backup process is running in the background. Please keep this browser window open until the operation finishes completely."712 msgstr ""713 714 #: templates/dashboard.php:277715 msgid "Recent backups"716 msgstr ""717 718 #: templates/dashboard.php:283719 msgid "Created"720 msgstr ""721 722 #: templates/dashboard.php:284723 #: templates/dashboard.php:399724 msgid "Status"725 msgstr ""726 727 #: templates/dashboard.php:285728 #: templates/dashboard.php:403729 msgid "Progress"730 msgstr ""731 732 #: templates/dashboard.php:286733 msgid "Package name"734 msgstr ""735 736 #: templates/dashboard.php:287737 #: templates/dashboard.php:419738 msgid "Size"739 msgstr ""740 741 #: templates/dashboard.php:288742 msgid "Actions"743 msgstr ""744 745 #: templates/dashboard.php:295746 msgid "No backups yet."747 msgstr ""748 749 #: templates/dashboard.php:318750 msgid "Click to view log and details"751 msgstr ""752 753 #: templates/dashboard.php:349754 #: templates/dashboard.php:423755 msgid "Download Archive (.zip)"756 msgstr ""757 758 #: templates/dashboard.php:350759 msgid "Download Archive"760 msgstr ""761 762 #: templates/dashboard.php:357763 msgid "Download Installer"764 msgstr ""765 766 #: templates/dashboard.php:365767 msgid "Download Archive and Installer simultaneously"768 msgstr ""769 770 #: templates/dashboard.php:366771 msgid "Download Both"772 msgstr ""773 774 #: templates/dashboard.php:372775 msgid "Delete backup package"776 msgstr ""777 778 #: templates/dashboard.php:373779 msgid "Delete"780 msgstr ""781 782 #: templates/dashboard.php:392783 msgid "Backup Details & Log"784 msgstr ""785 786 #: templates/dashboard.php:394787 #: templates/dashboard.php:442788 msgid "Close"789 msgstr ""790 791 #: templates/dashboard.php:407792 msgid "Date"793 msgstr ""794 795 #: templates/dashboard.php:411796 msgid "Message"797 msgstr ""798 799 #: templates/dashboard.php:418800 msgid "Package"801 msgstr ""802 803 #: templates/dashboard.php:426804 msgid "Download Installer (.php)"805 msgstr ""806 807 #: templates/dashboard.php:433808 msgid "Execution Log"809 msgstr ""810 811 #: templates/dashboard.php:436812 msgid "Loading logs…"813 msgstr ""814 815 #: templates/settings.php:20816 #: templates/settings.php:274817 msgid "Archive & Exclusions"818 msgstr ""819 820 #: templates/settings.php:24821 #: templates/settings.php:317822 msgid "Storage Destination"823 msgstr ""824 825 #: templates/settings.php:28826 #: templates/settings.php:354827 msgid "Bot Notifications"828 msgstr ""829 830 #: templates/settings.php:32831 #: templates/settings.php:526832 msgid "Recurring Schedule"833 msgstr ""834 835 #: templates/settings.php:36836 #: templates/settings.php:566837 msgid "Standalone Installer"838 msgstr ""839 840 #: templates/settings.php:40841 msgid "System Status"842 msgstr ""843 844 #: templates/settings.php:44845 #: templates/settings.php:596846 msgid "Updates & Privacy"847 msgstr ""848 849 #: templates/settings.php:90850 msgid "Settings Navigation"851 msgstr ""852 853 #: templates/settings.php:111854 msgid "Environment"855 msgstr ""856 857 #: templates/settings.php:124858 msgid "Storage Status"859 msgstr ""860 861 #: templates/settings.php:126862 msgid "Writable"863 msgstr ""864 865 #: templates/settings.php:126866 msgid "Protected"867 msgstr ""868 869 #: templates/settings.php:141870 msgid "System Status & Diagnostics"871 msgstr ""872 873 #: templates/settings.php:145874 msgid "Live diagnostic health report of active server extensions, filesystem permissions, and system stability."875 msgstr ""876 877 #: templates/settings.php:156878 msgid "Compatible"879 msgstr ""880 881 #: templates/settings.php:165882 #: templates/settings.php:174883 msgid "OK"884 msgstr ""885 886 #: templates/settings.php:171887 msgid "Execution Timeout"888 msgstr ""889 890 #: templates/settings.php:180891 msgid "ZipArchive"892 msgstr ""893 894 #: templates/settings.php:181895 msgid "Enabled"896 msgstr ""897 898 #: templates/settings.php:181899 msgid "PclZip fallback"900 msgstr ""901 902 #: templates/settings.php:183903 msgid "Ready"904 msgstr ""905 906 #: templates/settings.php:189907 msgid "Database Driver"908 msgstr ""909 910 #: templates/settings.php:192911 msgid "Streaming"912 msgstr ""913 914 #: templates/settings.php:198915 msgid "OpenSSL"916 msgstr ""917 918 #: templates/settings.php:199919 msgid "Active"920 msgstr ""921 922 #: templates/settings.php:199923 msgid "Inactive"924 msgstr ""925 926 #: templates/settings.php:201927 msgid "Encrypted"928 msgstr ""929 930 #: templates/settings.php:209931 msgid "Backup Storage Destination"932 msgstr ""933 934 #: templates/settings.php:212935 msgid "Isolated, protected path used to safely store archive files away from public access:"936 msgstr ""937 938 #: templates/settings.php:218939 msgid "Run Storage Write Test"940 msgstr ""941 942 #: templates/settings.php:229943 msgid "System & Activity Log Stream"944 msgstr ""945 946 #: templates/settings.php:233947 msgid "Refresh"948 msgstr ""949 950 #: templates/settings.php:243951 msgid "System Activity Log (Last 100 entries)"952 msgstr ""953 954 #: templates/settings.php:251955 msgid "No recent log entries found."956 msgstr ""957 958 #: templates/settings.php:277959 msgid "Configure which files, folders, or sizes should be skipped during backup creation to save disk space and maximize speed."960 msgstr ""961 962 #: templates/settings.php:282963 msgid "Excluded paths and patterns (one per line)"964 msgstr ""965 966 #: templates/settings.php:283967 msgid "Folders or file patterns that will be excluded from the backup archive (e.g. wp-content/cache/, *.mp4)."968 msgstr ""969 970 #: templates/settings.php:287971 msgid "Examples: wp-content/uploads/2022/, *.mp4, node_modules/. Cache and backup folders are always skipped automatically."972 msgstr ""973 974 #: templates/settings.php:294975 msgid "Skip files larger than (MB, 0 = no limit)"976 msgstr ""977 978 #: templates/settings.php:295979 msgid "Files exceeding this size threshold will be skipped to keep backups fast and reliable. Enter 0 for no limit."980 msgstr ""981 982 #: templates/settings.php:303983 msgid "Files packed per request"984 msgstr ""985 986 #: templates/settings.php:304987 msgid "Batch size for slicing file packing per tick. Default 1000 files ensures fast backup on modern systems."988 msgstr ""989 990 #: templates/settings.php:320991 msgid "Backup archives and standalone installers are stored locally in a secure, protected directory on your server."992 msgstr ""993 994 #: templates/settings.php:325995 msgid "Primary Destination Driver"996 msgstr ""997 998 #: templates/settings.php:326999 msgid "Primary storage destination for completed packages. Local protected storage is used."1000 msgstr ""1001 1002 #: templates/settings.php:3401003 msgid "Protected Directory Path"1004 msgstr ""1005 1006 #: templates/settings.php:3441007 msgid "This location contains an .htaccess file blocking direct HTTP requests and indexing for maximum security."1008 msgstr ""1009 1010 #: templates/settings.php:3571011 msgid "Backupino can announce every finished backup, with the permanent download link, in Telegram or Bale. You can enable either or both messengers simultaneously."1012 msgstr ""1013 1014 #: templates/settings.php:3651015 msgid "Telegram Notification"1016 msgstr ""1017 1018 #: templates/settings.php:3691019 msgid "Enable Telegram"1020 msgstr ""1021 1022 #: templates/settings.php:3751023 msgid "Telegram Bot Token"1024 msgstr ""1025 1026 #: templates/settings.php:3761027 msgid "Bot token obtained from Telegram @BotFather."1028 msgstr ""1029 1030 #: templates/settings.php:3841031 msgid "Telegram Chat ID"1032 msgstr ""1033 1034 #: templates/settings.php:3851035 msgid "Telegram numeric chat or channel ID."1036 msgstr ""1037 1038 #: templates/settings.php:3951039 msgid "Test Telegram"1040 msgstr ""1041 1042 #: templates/settings.php:4061043 msgid "Bale Notification"1044 msgstr ""1045 1046 #: templates/settings.php:4101047 msgid "Enable Bale"1048 msgstr ""1049 1050 #: templates/settings.php:4161051 msgid "Bale Bot Token"1052 msgstr ""1053 1054 #: templates/settings.php:4171055 msgid "Bot token obtained from Bale @BotFather."1056 msgstr ""1057 1058 #: templates/settings.php:4251059 msgid "Bale Chat ID"1060 msgstr ""1061 1062 #: templates/settings.php:4261063 msgid "Bale numeric chat or channel ID."1064 msgstr ""1065 1066 #: templates/settings.php:4361067 msgid "Test Bale"1068 msgstr ""1069 1070 #: templates/settings.php:4461071 msgid "Backup Message Template"1072 msgstr ""1073 1074 #: templates/settings.php:4491075 msgid "Message template sent to messengers when a backup finishes."1076 msgstr ""1077 1078 #: templates/settings.php:4601079 #: templates/settings.php:4921080 msgid "Available tags:"1081 msgstr ""1082 1083 #: templates/settings.php:4621084 #: templates/settings.php:4941085 msgid "Site Name"1086 msgstr ""1087 1088 #: templates/settings.php:4631089 msgid "Backup Contents"1090 msgstr ""1091 1092 #: templates/settings.php:4641093 msgid "Backup Size"1094 msgstr ""1095 1096 #: templates/settings.php:4651097 msgid "Backup Date"1098 msgstr ""1099 1100 #: templates/settings.php:4661101 msgid "Download Link"1102 msgstr ""1103 1104 #: templates/settings.php:4691105 #: templates/settings.php:5001106 msgid "HTML formatting tags such as <b>bold</b> and <a href=\"...\">links</a> are supported."1107 msgstr ""1108 1109 #: templates/settings.php:4781110 msgid "Restoration Message Template"1111 msgstr ""1112 1113 #: templates/settings.php:4811114 msgid "Message template sent to messengers when the site is restored using the installer."1115 msgstr ""1116 1117 #: templates/settings.php:4951118 msgid "New Site URL"1119 msgstr ""1120 1121 #: templates/settings.php:4961122 msgid "Admin Login URL"1123 msgstr ""1124 1125 #: templates/settings.php:4971126 msgid "Restoration Date"1127 msgstr ""1128 1129 #. translators: %d: number of queued messages.1130 #: templates/settings.php:5121131 #, php-format1132 msgid "%d message is waiting to be resent on the next scheduled run."1133 msgid_plural "%d messages are waiting to be resent on the next scheduled run."1134 msgstr[0] ""1135 msgstr[1] ""1136 1137 #: templates/settings.php:5291138 msgid "Automatic recurring backups trigger via WordPress cron. In Persian locale, monthly schedules automatically align with the start of the Jalali month."1139 msgstr ""1140 1141 #: templates/settings.php:5341142 msgid "Run automatic backups"1143 msgstr ""1144 1145 #: templates/settings.php:5351146 msgid "Enables recurring background backup jobs using WordPress built-in WP-Cron scheduler."1147 msgstr ""1148 1149 #: templates/settings.php:5411150 msgid "Frequency"1151 msgstr ""1152 1153 #: templates/settings.php:5421154 msgid "Monthly execution triggers on the 1st of each Persian/Gregorian month based on site language."1155 msgstr ""1156 1157 #: templates/settings.php:5461158 msgid "Monthly (first day of the month)"1159 msgstr ""1160 1161 #: templates/settings.php:5531162 msgid "Keep at most (backups)"1163 msgstr ""1164 1165 #: templates/settings.php:5541166 msgid "Maximum number of recent backups to keep on disk. Older packages are automatically pruned to save space."1167 msgstr ""1168 1169 #: templates/settings.php:5691170 msgid "Configure preset credentials for the standalone migration installer generated with each backup."1171 msgstr ""1172 1173 #: templates/settings.php:5751174 msgid "Installer password (optional)"1175 msgstr ""1176 1177 #: templates/settings.php:5761178 msgid "Password protecting installer.php when accessed via browser during migration or restoration."1179 msgstr ""1180 1181 #: templates/settings.php:5831182 msgid "Default new URL (optional)"1183 msgstr ""1184 1185 #: templates/settings.php:5841186 msgid "Preset target URL for search & replace when migrating to a known new domain."1187 msgstr ""1188 1189 #: templates/settings.php:6001190 msgid "Receive critical security notices, product updates, and roadmap announcements (opt-in)."1191 msgstr ""1192 1193 #: templates/settings.php:6011194 msgid "100% privacy-compliant: zero tracking, zero telemetry, strictly optional notifications."1195 msgstr ""1196 1197 #: templates/settings.php:6041198 msgid "We respect your privacy. No telemetry or personal data is collected or sent without your explicit consent."1199 msgstr ""1200 1201 #: templates/settings.php:6111202 msgid "Current Version:"1203 msgstr ""1204 1205 #: templates/settings.php:6121206 msgid "Plugin updates are delivered securely through the official WordPress repository."1207 msgstr ""1208 1209 #: templates/settings.php:6231210 msgid "Save settings"1211 msgstr "" -
backupino/tags/1.1.0/readme.txt
r3800361 r3809656 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1. 0.57 Stable tag: 1.1.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 76 76 77 77 = Where are backup packages stored? = 78 Packages are stored locally in `/wp-content/backupino/packages/` (outside of the public uploads directory for enhanced security and isolation). The directory is secured with `.htaccess`, `web.config`, and empty `index.php` guards to prevent direct public file browsing and execution. 78 Packages are stored locally in `backupino/packages/` inside your site's configured WordPress uploads directory (`basedir` returned by `wp_upload_dir()`, which is typically under `wp-content/uploads/backupino/packages/` on default installations, though the full path may vary on sites with a custom uploads directory). If `wp_upload_dir()` does not return a `basedir`, Backupino falls back to `backupino/packages/` inside `WP_CONTENT_DIR`. 79 80 Backupino writes `.htaccess` (for Apache/LiteSpeed), `web.config` (for IIS), and `index.html` (which only prevents directory listing) inside its storage directories. **Important for Nginx:** Nginx ignores `.htaccess` and `web.config`, and `index.html` does not block direct requests to a known package URL. On Nginx (or Nginx reverse proxies serving static files), direct HTTP access to backup files is **not guaranteed to be blocked** until you add a server-level deny rule inside your Nginx `server { }` block (adjusting the path if your uploads directory is customized) and reload Nginx: 81 82 `location ^~ /wp-content/uploads/backupino/ { deny all; return 403; }` 83 84 Authorized downloads through Backupino's WordPress admin screen and permanent download link are streamed via PHP and continue working normally with this rule enabled. 79 85 80 86 = Does the permanent download link ever expire? = … … 101 107 == Upgrade Notice == 102 108 109 = 1.1.0 = 110 Feature and enhancement release. Adds optional WordPress administrator account creation during standalone restore, restores animated plugin icon, hands off translations to GlotPress, and updates translation catalog. 111 103 112 = 1.0.5 = 104 113 Bundled full Persian (fa_IR) localization, static PNG/SVG directory icons, and clean .distignore distribution packaging. 105 114 106 115 = 1.0.4 = 107 Security , compliance, and platform hardening release addressing WordPress.org directory requirements.116 Security and compliance update. Eliminates unconsented public attributions, replaces error_reporting and raw cURL with WordPress-standard mechanisms, replaces mysqli with PDO prepared statements, quarantines web server configs, and heals table prefix casing. 108 117 109 118 = 1.0.3 = … … 120 129 121 130 == Changelog == 131 132 = 1.1.0 = 133 * Feature: Added optional new WordPress Administrator account creation during restoration in the standalone installer with secure password hashing and capability assignment. 134 * UI: Restored SMIL animated SVG plugin icon for enhanced branding while maintaining crisp high-resolution display. 135 * i18n: Removed bundled local Persian .po/.mo translation files in favor of official WordPress.org GlotPress language packs (translate.wordpress.org). 136 * i18n: Updated backupino.pot catalog with all newly introduced installer strings. 122 137 123 138 = 1.0.5 = -
backupino/tags/1.1.0/src/Backup/InstallerBuilder.php
r3800274 r3809656 40 40 'UrlRewrite.php', 41 41 'ConfigWriter.php', 42 'AdminCreator.php', 42 43 'View.php', 43 44 ); … … 113 114 114 115 $template = (string) file_get_contents( $template_path ); // phpcs:ignore WordPress.WP.AlternativeFunctions 116 117 // Ensure an independent server-only secret for state encryption and session signing 118 // that is never derived from or equal to the browser-facing CSRF token. 119 $existing_secret = isset( $payload['state_secret'] ) ? (string) $payload['state_secret'] : ''; 120 $public_token = isset( $payload['token'] ) ? (string) $payload['token'] : ''; 121 if ( strlen( $existing_secret ) < 32 || ( '' !== $public_token && hash_equals( $public_token, $existing_secret ) ) ) { 122 $payload['state_secret'] = bin2hex( random_bytes( 32 ) ); 123 } 115 124 116 125 $json = function_exists( 'wp_json_encode' ) ? wp_json_encode( $payload ) : json_encode( $payload ); … … 178 187 179 188 $defaults = array( 180 'version' => defined( 'BACKUPINO_VERSION' ) ? BACKUPINO_VERSION : '1. 0.4',189 'version' => defined( 'BACKUPINO_VERSION' ) ? BACKUPINO_VERSION : '1.1.0', 181 190 'name' => $name, 182 191 'token' => \Backupino\Support\Str::random( 16 ), -
backupino/tags/1.1.0/src/Backup/Stages/FinalizeStage.php
r3800274 r3809656 176 176 $meta = array( 177 177 'generator' => 'Backupino', 178 'version' => defined( 'BACKUPINO_VERSION' ) ? BACKUPINO_VERSION : '1. 0.0',178 'version' => defined( 'BACKUPINO_VERSION' ) ? BACKUPINO_VERSION : '1.1.0', 179 179 'created' => $context->clock()->now_mysql(), 180 180 'site_url' => home_url(), … … 207 207 208 208 $payload = array( 209 'version' => defined( 'BACKUPINO_VERSION' ) ? BACKUPINO_VERSION : '1. 0.4',209 'version' => defined( 'BACKUPINO_VERSION' ) ? BACKUPINO_VERSION : '1.1.0', 210 210 'name' => $name, 211 211 'token' => Str::random( 16 ), -
backupino/tags/1.1.0/src/Core/Compatibility.php
r3800274 r3809656 105 105 } 106 106 107 if ( self::is_nginx() ) { 108 $warnings[] = __( 'Nginx web server detected: Nginx ignores .htaccess and web.config files, and index.html only hides directory listing. Direct HTTP access to backup files is NOT guaranteed to be blocked until your server administrator adds the server-level Nginx deny rule in Backupino -> Settings -> Storage Destination and reloads Nginx. Backupino cannot automatically alter or reload Nginx configuration.', 'backupino' ); 109 } 110 107 111 return $warnings; 112 } 113 114 /** 115 * Detect whether the current request is served behind Nginx (best-effort). 116 * 117 * Note: Detection is purely informational and best-effort. Reverse proxies 118 * or caching servers sitting in front of Apache or PHP-FPM might not advertise 119 * Nginx in SERVER_SOFTWARE. User-controlled request headers (such as HTTP_X_*) 120 * are intentionally NOT trusted for security reasons. 121 * 122 * @param string|null $server_software Optional SERVER_SOFTWARE override for testing. 123 * @return bool 124 */ 125 public static function is_nginx( ?string $server_software = null ): bool { 126 if ( null === $server_software ) { 127 if ( isset( $GLOBALS['is_nginx'] ) && true === $GLOBALS['is_nginx'] ) { 128 return true; 129 } 130 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.ValidatedSanitizedInput.MissingUnslash -- Read-only server banner check. 131 $server_software = isset( $_SERVER['SERVER_SOFTWARE'] ) ? (string) wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) : ''; 132 } 133 134 return false !== stripos( $server_software, 'nginx' ); 135 } 136 137 /** 138 * Extract canonical origin components (scheme, host, effective port) from an absolute URL. 139 * 140 * Returns null if the URL is relative, protocol-relative, invalid, or has an unsupported scheme. 141 * 142 * @param string $url URL to parse. 143 * @return array{scheme: string, host: string, port: int}|null 144 */ 145 public static function extract_origin( string $url ): ?array { 146 $trimmed = trim( $url ); 147 if ( '' === $trimmed || 0 === strpos( $trimmed, '//' ) ) { 148 return null; 149 } 150 151 $parts = wp_parse_url( $trimmed ); 152 if ( false === $parts || ! is_array( $parts ) ) { 153 return null; 154 } 155 156 $scheme = isset( $parts['scheme'] ) ? strtolower( (string) $parts['scheme'] ) : ''; 157 $host = isset( $parts['host'] ) ? strtolower( (string) $parts['host'] ) : ''; 158 159 if ( '' === $scheme || '' === $host || ! in_array( $scheme, array( 'http', 'https' ), true ) ) { 160 return null; 161 } 162 163 if ( isset( $parts['port'] ) ) { 164 if ( ! is_int( $parts['port'] ) && ! ctype_digit( (string) $parts['port'] ) ) { 165 return null; 166 } 167 $port = (int) $parts['port']; 168 if ( $port < 1 || $port > 65535 ) { 169 return null; 170 } 171 } else { 172 $port = 'https' === $scheme ? 443 : 80; 173 } 174 175 return array( 176 'scheme' => $scheme, 177 'host' => $host, 178 'port' => $port, 179 ); 180 } 181 182 /** 183 * Detailed inspection of Nginx storage protection and location block generation. 184 * 185 * Only generates a concrete `location ^~` directive when the storage web path can be 186 * reliably and safely determined relative to ABSPATH or the site/home URL (same-origin). 187 * If uploads point to an external CDN, a different host, or an indeterminate path, 188 * status is set to 'manual' to prevent displaying inaccurate or misleading Nginx rules. 189 * 190 * Output paths are strictly sanitized to prevent directive injection, newlines, and traversal. 191 * 192 * @param Paths $paths Storage layout. 193 * @return array{status: string, rule: string, web_path: string, fs_path: string, reason: string} 194 */ 195 public static function nginx_storage_info( Paths $paths ): array { 196 $base = rtrim( str_replace( '\\', '/', $paths->base() ), '/' ); 197 $root = rtrim( str_replace( '\\', '/', $paths->root() ), '/' ); 198 $fs_path = $paths->packages(); 199 200 $uploads_baseurl = ''; 201 $uploads_basedir = ''; 202 if ( function_exists( 'wp_upload_dir' ) ) { 203 $uploads = wp_upload_dir( null, false ); 204 $uploads_baseurl = isset( $uploads['baseurl'] ) ? (string) $uploads['baseurl'] : ''; 205 $uploads_basedir = isset( $uploads['basedir'] ) ? rtrim( str_replace( '\\', '/', (string) $uploads['basedir'] ), '/' ) : ''; 206 } 207 208 $candidate_path = ''; 209 210 // 1. Primary resolution: If base is inside wp_upload_dir basedir, map through baseurl. 211 $is_inside_uploads = '' !== $uploads_basedir && ( $base === $uploads_basedir || 0 === strpos( $base, $uploads_basedir . '/' ) ); 212 if ( $is_inside_uploads ) { 213 $trimmed_baseurl = trim( $uploads_baseurl ); 214 if ( '' === $trimmed_baseurl ) { 215 return array( 216 'status' => 'manual', 217 'rule' => '', 218 'web_path' => '', 219 'fs_path' => $fs_path, 220 'reason' => 'invalid_baseurl', 221 ); 222 } 223 224 // Reject protocol-relative URLs (e.g. //cdn.example.org/uploads). 225 if ( 0 === strpos( $trimmed_baseurl, '//' ) ) { 226 return array( 227 'status' => 'manual', 228 'rule' => '', 229 'web_path' => '', 230 'fs_path' => $fs_path, 231 'reason' => 'protocol_relative', 232 ); 233 } 234 235 $parsed_baseurl = wp_parse_url( $trimmed_baseurl ); 236 if ( false === $parsed_baseurl || ! is_array( $parsed_baseurl ) ) { 237 return array( 238 'status' => 'manual', 239 'rule' => '', 240 'web_path' => '', 241 'fs_path' => $fs_path, 242 'reason' => 'malformed_baseurl', 243 ); 244 } 245 246 // Reject unexpected query, fragment, or user credentials in baseurl. 247 if ( isset( $parsed_baseurl['query'] ) || isset( $parsed_baseurl['fragment'] ) || isset( $parsed_baseurl['user'] ) || isset( $parsed_baseurl['pass'] ) ) { 248 return array( 249 'status' => 'manual', 250 'rule' => '', 251 'web_path' => '', 252 'fs_path' => $fs_path, 253 'reason' => 'unexpected_url_components', 254 ); 255 } 256 257 $upload_path = isset( $parsed_baseurl['path'] ) ? (string) $parsed_baseurl['path'] : ''; 258 $is_absolute = isset( $parsed_baseurl['scheme'] ) || isset( $parsed_baseurl['host'] ); 259 260 if ( $is_absolute ) { 261 $upload_origin = self::extract_origin( $trimmed_baseurl ); 262 if ( null === $upload_origin ) { 263 return array( 264 'status' => 'manual', 265 'rule' => '', 266 'web_path' => '', 267 'fs_path' => $fs_path, 268 'reason' => 'invalid_origin', 269 ); 270 } 271 272 // Resolve expected site origins from home_url() and site_url(). 273 $home_url = function_exists( 'home_url' ) ? (string) home_url() : ''; 274 $site_url = function_exists( 'site_url' ) ? (string) site_url() : ''; 275 $home_origin = '' !== $home_url ? self::extract_origin( $home_url ) : null; 276 $site_origin = '' !== $site_url ? self::extract_origin( $site_url ) : null; 277 278 // Fail closed if neither home_url nor site_url provides a valid origin to verify against. 279 if ( null === $home_origin && null === $site_origin ) { 280 return array( 281 'status' => 'manual', 282 'rule' => '', 283 'web_path' => '', 284 'fs_path' => $fs_path, 285 'reason' => 'missing_expected_origin', 286 ); 287 } 288 289 // Check exact same-origin match (scheme, hostname, effective port). 290 $matches_home = null !== $home_origin && 291 $upload_origin['scheme'] === $home_origin['scheme'] && 292 $upload_origin['host'] === $home_origin['host'] && 293 $upload_origin['port'] === $home_origin['port']; 294 295 $matches_site = null !== $site_origin && 296 $upload_origin['scheme'] === $site_origin['scheme'] && 297 $upload_origin['host'] === $site_origin['host'] && 298 $upload_origin['port'] === $site_origin['port']; 299 300 if ( ! $matches_home && ! $matches_site ) { 301 return array( 302 'status' => 'manual', 303 'rule' => '', 304 'web_path' => '', 305 'fs_path' => $fs_path, 306 'reason' => 'origin_mismatch', 307 ); 308 } 309 } else { 310 // Relative URL: must start strictly with '/' and not contain scheme markers or traversal. 311 if ( '' === $upload_path || 0 !== strpos( $upload_path, '/' ) ) { 312 return array( 313 'status' => 'manual', 314 'rule' => '', 315 'web_path' => '', 316 'fs_path' => $fs_path, 317 'reason' => 'invalid_relative_path', 318 ); 319 } 320 } 321 322 if ( '' === trim( $upload_path ) ) { 323 return array( 324 'status' => 'manual', 325 'rule' => '', 326 'web_path' => '', 327 'fs_path' => $fs_path, 328 'reason' => 'invalid_path', 329 ); 330 } 331 332 $rel_to_upload = substr( $base, strlen( $uploads_basedir ) ); 333 $candidate_path = rtrim( $upload_path, '/' ) . '/' . ltrim( $rel_to_upload, '/' ); 334 } elseif ( '' !== $root && ( $base === $root || 0 === strpos( $base, $root . '/' ) ) ) { 335 // 2. Fallback resolution: If base is directly inside ABSPATH / root. 336 $rel_to_root = substr( $base, strlen( $root ) ); 337 $site_ref = function_exists( 'site_url' ) && '' !== (string) site_url() 338 ? (string) site_url() 339 : ( function_exists( 'home_url' ) ? (string) home_url() : '' ); 340 $site_path = (string) wp_parse_url( $site_ref, PHP_URL_PATH ); 341 $site_path = '/' . trim( $site_path, '/' ); 342 343 if ( '/' !== $site_path && '' !== $site_path && 0 !== strpos( $rel_to_root, $site_path . '/' ) ) { 344 $candidate_path = rtrim( $site_path, '/' ) . '/' . ltrim( $rel_to_root, '/' ); 345 } else { 346 $candidate_path = '/' . ltrim( $rel_to_root, '/' ); 347 } 348 } 349 350 // If candidate path cannot be determined or resolved relative to webroot, require manual configuration. 351 if ( '' === $candidate_path ) { 352 return array( 353 'status' => 'manual', 354 'rule' => '', 355 'web_path' => '', 356 'fs_path' => $fs_path, 357 'reason' => 'outside_root', 358 ); 359 } 360 361 // 3. Strict security validation: reject control characters, newlines, NUL bytes, directive injection, and traversal. 362 if ( false !== strpos( $candidate_path, "\n" ) || 363 false !== strpos( $candidate_path, "\r" ) || 364 false !== strpos( $candidate_path, "\0" ) || 365 false !== strpos( $candidate_path, ';' ) || 366 false !== strpos( $candidate_path, '{' ) || 367 false !== strpos( $candidate_path, '}' ) ) { 368 return array( 369 'status' => 'manual', 370 'rule' => '', 371 'web_path' => '', 372 'fs_path' => $fs_path, 373 'reason' => 'unsafe_chars', 374 ); 375 } 376 377 // Reject any path segment containing '.' or '..' traversal, or empty segments. 378 $segments = explode( '/', trim( $candidate_path, '/' ) ); 379 foreach ( $segments as $seg ) { 380 if ( '' === $seg || '.' === $seg || '..' === $seg ) { 381 return array( 382 'status' => 'manual', 383 'rule' => '', 384 'web_path' => '', 385 'fs_path' => $fs_path, 386 'reason' => 'traversal', 387 ); 388 } 389 } 390 391 // Strictly validate characters: Never mutate or strip characters silently. 392 // If the candidate path contains any characters outside [A-Za-z0-9/_.-] (such as %20, spaces, etc.), 393 // refuse to generate a misleading rule and fail closed to manual status. 394 if ( 1 !== preg_match( '#^[A-Za-z0-9/_.\-]+$#', $candidate_path ) ) { 395 return array( 396 'status' => 'manual', 397 'rule' => '', 398 'web_path' => '', 399 'fs_path' => $fs_path, 400 'reason' => 'disallowed_chars', 401 ); 402 } 403 404 $trimmed = trim( $candidate_path, '/' ); 405 406 // Prevent matching the entire document root or invalid short paths. 407 if ( '' === $trimmed || strlen( $trimmed ) < 2 ) { 408 return array( 409 'status' => 'manual', 410 'rule' => '', 411 'web_path' => '', 412 'fs_path' => $fs_path, 413 'reason' => 'root_path', 414 ); 415 } 416 417 $web_path = '/' . $trimmed . '/'; 418 $rule = "location ^~ {$web_path} {\n deny all;\n return 403;\n}"; 419 420 return array( 421 'status' => 'exact', 422 'rule' => $rule, 423 'web_path' => $web_path, 424 'fs_path' => $fs_path, 425 'reason' => 'ok', 426 ); 427 } 428 429 /** 430 * Build an Nginx server-block location rule denying direct HTTP access to the 431 * Backupino storage directory. Uses `^~` so static-file regex rules cannot bypass it. 432 * 433 * Returns empty string if the web path cannot be reliably determined (e.g. external CDN or custom mapping). 434 * 435 * @param Paths $paths Storage layout. 436 * @return string 437 */ 438 public static function nginx_storage_rule( Paths $paths ): string { 439 $info = self::nginx_storage_info( $paths ); 440 return $info['rule']; 108 441 } 109 442 … … 115 448 */ 116 449 public static function snapshot( Paths $paths ): array { 450 $nginx_info = self::nginx_storage_info( $paths ); 451 117 452 return array( 118 'php_version' => PHP_VERSION, 119 'wp_version' => function_exists( 'get_bloginfo' ) ? get_bloginfo( 'version' ) : '', 120 'memory_limit' => (string) ini_get( 'memory_limit' ), 121 'max_execution' => (int) ini_get( 'max_execution_time' ), 122 'post_max_size' => (string) ini_get( 'post_max_size' ), 123 'disk_free' => Fs::free_space( $paths->base() ), 124 'zip' => class_exists( 'ZipArchive' ), 125 'openssl' => extension_loaded( 'openssl' ), 126 'curl' => extension_loaded( 'curl' ), 127 'suhosin' => extension_loaded( 'suhosin' ), 128 'storage_writable' => Fs::is_writable_dir( $paths->base() ), 129 'storage_path' => $paths->base(), 130 'blocking' => self::blocking_issues(), 131 'warnings' => self::warnings(), 453 'php_version' => PHP_VERSION, 454 'wp_version' => function_exists( 'get_bloginfo' ) ? get_bloginfo( 'version' ) : '', 455 'memory_limit' => (string) ini_get( 'memory_limit' ), 456 'max_execution' => (int) ini_get( 'max_execution_time' ), 457 'post_max_size' => (string) ini_get( 'post_max_size' ), 458 'disk_free' => Fs::free_space( $paths->base() ), 459 'zip' => class_exists( 'ZipArchive' ), 460 'openssl' => extension_loaded( 'openssl' ), 461 'curl' => extension_loaded( 'curl' ), 462 'suhosin' => extension_loaded( 'suhosin' ), 463 'is_nginx' => self::is_nginx(), 464 'nginx_rule' => $nginx_info['rule'], 465 'nginx_storage_info' => $nginx_info, 466 'storage_writable' => Fs::is_writable_dir( $paths->base() ), 467 'storage_path' => $paths->base(), 468 'blocking' => self::blocking_issues(), 469 'warnings' => self::warnings(), 132 470 ); 133 471 } -
backupino/tags/1.1.0/src/Core/Paths.php
r3800274 r3809656 23 23 24 24 /** 25 * Storage root (`wp-content/backupino` by default). 25 * Storage root (`backupino` under the configured WordPress uploads `basedir`, 26 * or `WP_CONTENT_DIR/backupino` if `basedir` is unavailable). 26 27 * 27 28 * @var string … … 50 51 * Build from the current WordPress environment. 51 52 * 52 * Uses wp-content/backupino outside of public uploads for enhanced security and isolation, 53 * with automatic fallback to uploads directory if wp-content is not writable. 53 * Resolves the storage root to `<basedir>/backupino` using `wp_upload_dir()` 54 * whenever a non-empty `basedir` is returned, falling back to 55 * `WP_CONTENT_DIR . '/backupino'` (or `ABSPATH . 'wp-content/backupino'`) 56 * when `wp_upload_dir()` is unavailable or returns an empty `basedir`. 54 57 * 55 58 * @return self -
backupino/tags/1.1.0/src/Download/PublicDownload.php
r3800274 r3809656 249 249 : plugins_url( 'assets/js/public-download.js', dirname( dirname( __DIR__ ) ) . '/backupino.php' ); 250 250 251 wp_register_style( 'backupino-public-download', $css_url, array(), defined( 'BACKUPINO_VERSION' ) ? BACKUPINO_VERSION : '1. 0.4' );251 wp_register_style( 'backupino-public-download', $css_url, array(), defined( 'BACKUPINO_VERSION' ) ? BACKUPINO_VERSION : '1.1.0' ); 252 252 $inline_css = ':root { ' . $css_vars . ' } ' . $custom_styles; 253 253 wp_add_inline_style( 'backupino-public-download', $inline_css ); 254 254 wp_enqueue_style( 'backupino-public-download' ); 255 255 256 wp_register_script( 'backupino-public-download', $js_url, array(), defined( 'BACKUPINO_VERSION' ) ? BACKUPINO_VERSION : '1. 0.4', true );256 wp_register_script( 'backupino-public-download', $js_url, array(), defined( 'BACKUPINO_VERSION' ) ? BACKUPINO_VERSION : '1.1.0', true ); 257 257 wp_enqueue_script( 'backupino-public-download' ); 258 258 -
backupino/tags/1.1.0/src/Installer/State.php
r3800274 r3809656 13 13 14 14 // phpcs:disable WordPress.WP.AlternativeFunctions -- Standalone installer running outside WordPress environment. 15 // phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Offline standalone installer exceptions. 15 16 16 17 /** 17 * Stores wizard progress between AJAX requests. 18 * Stores wizard progress between AJAX requests inside a per-run private `0700` 19 * directory strictly outside the web document root, wrapped in an executable 20 * PHP 403 guard and authenticated encryption using a server-only secret. 18 21 */ 19 22 final class State { 20 23 21 24 /** 25 * Executable PHP guard prepended to every state file so direct HTTP access 26 * fails closed even on misconfigured web servers (Apache, Nginx, IIS). 27 * 28 * @var string 29 */ 30 public const GUARD_PREFIX = "<?php http_response_code( 403 ); exit; ?>\n"; 31 32 /** 33 * Prefix for per-run private state directories. 34 * 35 * @var string 36 */ 37 public const RUN_DIR_PREFIX = 'backupino-run-'; 38 39 /** 40 * Filename of the state file inside a private run directory. 41 * 42 * @var string 43 */ 44 public const STATE_FILENAME = 'state.php'; 45 46 /** 22 47 * Absolute path of the state file. 23 48 * … … 27 52 28 53 /** 54 * Absolute path of the private per-run directory (when managed as a private run). 55 * 56 * @var string 57 */ 58 private $run_dir; 59 60 /** 61 * Opaque signed run handle (nonce.hmac) referencing the private run directory. 62 * 63 * @var string 64 */ 65 private $run_handle; 66 67 /** 68 * Server-only secret key used for authenticated encryption at rest. 69 * 70 * @var string 71 */ 72 private $secret; 73 74 /** 75 * When true, corrupted, tampered, or undecryptable state fails closed by throwing. 76 * 77 * @var bool 78 */ 79 private $strict; 80 81 /** 29 82 * State data. 30 83 * … … 36 89 * Constructor. 37 90 * 38 * @param string $file Absolute path. 39 */ 40 public function __construct( string $file ) { 41 $this->file = $file; 91 * @param string $file Absolute path of the state file. 92 * @param string $secret Optional server-only secret key for authenticated encryption. 93 * @param string $run_dir Optional owning private run directory. 94 * @param string $run_handle Optional signed run handle. 95 * @param bool $strict Fail closed on missing/tampered state during load. 96 */ 97 public function __construct( 98 string $file, 99 string $secret = '', 100 string $run_dir = '', 101 string $run_handle = '', 102 bool $strict = false 103 ) { 104 $this->file = $file; 105 $this->secret = $secret; 106 $this->run_dir = $run_dir; 107 $this->run_handle = $run_handle; 108 $this->strict = $strict; 42 109 $this->load(); 43 110 } 44 111 45 112 /** 46 * Load state from disk. 113 * Normalize a filesystem path for cross-platform prefix comparisons. 114 * 115 * @param string $path Raw filesystem path. 116 * @return string Normalized path without trailing slash (except root). 117 */ 118 public static function normalize_path( string $path ): string { 119 $path = trim( $path ); 120 if ( '' === $path ) { 121 return ''; 122 } 123 124 $resolved = @realpath( $path ); 125 if ( is_string( $resolved ) && '' !== $resolved ) { 126 $path = $resolved; 127 } 128 129 $path = str_replace( '\\', '/', $path ); 130 $prefix = ''; 131 132 if ( preg_match( '/^([A-Za-z]:)\/(.*)$/', $path, $m ) ) { 133 $prefix = $m[1] . '/'; 134 $rest = $m[2]; 135 } elseif ( 0 === strpos( $path, '/' ) ) { 136 $prefix = '/'; 137 $rest = ltrim( $path, '/' ); 138 } else { 139 $rest = $path; 140 } 141 142 $segments = array(); 143 foreach ( explode( '/', $rest ) as $part ) { 144 if ( '' === $part || '.' === $part ) { 145 continue; 146 } 147 if ( '..' === $part ) { 148 array_pop( $segments ); 149 continue; 150 } 151 $segments[] = $part; 152 } 153 154 $normalized = $prefix . implode( '/', $segments ); 155 156 return '' === $normalized ? $prefix : $normalized; 157 } 158 159 /** 160 * Check whether a candidate directory is strictly outside the installer 161 * working directory and the web server document root. 162 * 163 * @param string $candidate_dir Candidate storage directory. 164 * @param string $web_dir Installer working directory. 165 * @param string|null $doc_root Web server DOCUMENT_ROOT, if known. 166 * @return bool 167 */ 168 public static function is_outside_webroot( string $candidate_dir, string $web_dir, ?string $doc_root = null ): bool { 169 $candidate = self::normalize_path( $candidate_dir ); 170 if ( '' === $candidate || ! is_dir( $candidate_dir ) ) { 171 return false; 172 } 173 174 $roots = array(); 175 $web = self::normalize_path( $web_dir ); 176 if ( '' !== $web ) { 177 $roots[] = $web; 178 } 179 if ( null !== $doc_root && '' !== trim( $doc_root ) ) { 180 $doc = self::normalize_path( $doc_root ); 181 if ( '' !== $doc ) { 182 $roots[] = $doc; 183 } 184 } 185 186 $case_insensitive = ( '\\' === DIRECTORY_SEPARATOR ) || ( 1 === preg_match( '/^[A-Za-z]:\//', $candidate ) ); 187 $cmp_candidate = $case_insensitive ? strtolower( $candidate ) : $candidate; 188 189 foreach ( $roots as $root ) { 190 $cmp_root = $case_insensitive ? strtolower( $root ) : $root; 191 $cmp_root = rtrim( $cmp_root, '/' ); 192 if ( '' === $cmp_root ) { 193 continue; 194 } 195 196 if ( $cmp_candidate === $cmp_root || 0 === strpos( $cmp_candidate, $cmp_root . '/' ) ) { 197 return false; 198 } 199 } 200 201 return true; 202 } 203 204 /** 205 * Find a writable base directory strictly outside the web document root and 206 * installer working directory where a private `0700` directory can be created. 207 * 208 * @param string $web_dir Installer working directory. 209 * @param string|null $doc_root Web server DOCUMENT_ROOT. 210 * @param array<int, string>|null $candidates Optional explicit candidate list (for testing). 211 * @return string Normalized absolute path of the external base directory. 212 * 213 * @throws \RuntimeException If no secure external storage directory is available. 214 */ 215 public static function find_secure_base_dir( 216 string $web_dir, 217 ?string $doc_root = null, 218 ?array $candidates = null 219 ): string { 220 if ( null === $doc_root && isset( $_SERVER['DOCUMENT_ROOT'] ) ) { 221 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.ValidatedSanitizedInput.MissingUnslash -- Server document root fallback during standalone restore. 222 $doc_root = (string) $_SERVER['DOCUMENT_ROOT']; 223 } 224 225 if ( null === $candidates ) { 226 $candidates = self::default_candidate_dirs(); 227 } 228 229 $checked = array(); 230 foreach ( $candidates as $dir ) { 231 $dir = trim( (string) $dir ); 232 if ( '' === $dir || is_link( $dir ) || ! is_dir( $dir ) ) { 233 continue; 234 } 235 236 $normalized = self::normalize_path( $dir ); 237 if ( '' === $normalized || isset( $checked[ $normalized ] ) ) { 238 continue; 239 } 240 $checked[ $normalized ] = true; 241 242 if ( ! self::is_outside_webroot( $normalized, $web_dir, $doc_root ) ) { 243 continue; 244 } 245 246 $probe_dir = rtrim( $normalized, '/' ) . '/.backupino-probe-' . bin2hex( random_bytes( 8 ) ); 247 if ( ! @mkdir( $probe_dir, 0700, false ) ) { 248 continue; 249 } 250 @chmod( $probe_dir, 0700 ); 251 $ok = ! is_link( $probe_dir ) && is_dir( $probe_dir ) && self::is_outside_webroot( $probe_dir, $web_dir, $doc_root ); 252 @rmdir( $probe_dir ); 253 254 if ( $ok ) { 255 return $normalized; 256 } 257 } 258 259 throw new \RuntimeException( 260 'Secure temporary storage outside the web document root is unavailable. Installation stopped to protect sensitive credentials.' 261 ); 262 } 263 264 /** 265 * Atomically create a brand-new, private `0700` run directory outside the web root 266 * with a cryptographically random name independent of any browser-visible token. 267 * 268 * Rejects pre-existing directories, symlinks, invalid ownership, or unsafe permissions. 269 * 270 * @param string $web_dir Installer working directory. 271 * @param string $state_secret Independent server-only secret (>= 32 chars). 272 * @param string $archive_name Archive basename for binding. 273 * @param string|null $doc_root Web server DOCUMENT_ROOT. 274 * @param array<int, string>|null $candidates Optional explicit candidate list (for testing). 275 * @return self 276 * 277 * @throws \RuntimeException If secure private storage cannot be created or verified. 278 */ 279 public static function create_private_run( 280 string $web_dir, 281 string $state_secret, 282 string $archive_name = '', 283 ?string $doc_root = null, 284 ?array $candidates = null 285 ): self { 286 if ( strlen( trim( $state_secret ) ) < 32 ) { 287 throw new \RuntimeException( 'Installer server-side security secret is missing or invalid.' ); 288 } 289 290 $base_dir = self::find_secure_base_dir( $web_dir, $doc_root, $candidates ); 291 292 for ( $attempt = 0; $attempt < 8; ++$attempt ) { 293 $nonce = bin2hex( random_bytes( 16 ) ); 294 $run_dir = rtrim( $base_dir, '/' ) . '/' . self::RUN_DIR_PREFIX . $nonce; 295 296 // Atomic creation (non-recursive) fails if directory or symlink already exists. 297 if ( ! @mkdir( $run_dir, 0700, false ) ) { 298 continue; 299 } 300 301 @chmod( $run_dir, 0700 ); 302 303 try { 304 self::assert_private_dir_safe( $run_dir, $web_dir, $doc_root ); 305 } catch ( \RuntimeException $e ) { 306 @rmdir( $run_dir ); 307 throw $e; 308 } 309 310 $handle = $nonce . '.' . self::sign_run( $nonce, $web_dir, $archive_name, $state_secret ); 311 $run_secret = self::derive_run_secret( $nonce, $web_dir, $state_secret ); 312 $state_file = $run_dir . '/' . self::STATE_FILENAME; 313 314 $state = new self( $state_file, $run_secret, $run_dir, $handle, false ); 315 if ( ! $state->save() ) { 316 $state->destroy(); 317 throw new \RuntimeException( 'Failed to initialize secure installer state.' ); 318 } 319 320 return $state; 321 } 322 323 throw new \RuntimeException( 324 'Failed to allocate an exclusive private state directory. Installation stopped.' 325 ); 326 } 327 328 /** 329 * Open and verify an existing private run directory using its server-signed handle. 330 * 331 * Fails closed if the handle signature is invalid, the directory or state file is a 332 * symlink, owned by another user, inside webroot, pre-created, missing, or tampered. 333 * 334 * @param string $run_handle Opaque signed handle (`<32-hex>.<64-hex>`). 335 * @param string $web_dir Installer working directory. 336 * @param string $state_secret Independent server-only secret. 337 * @param string $archive_name Archive basename for binding. 338 * @param string|null $doc_root Web server DOCUMENT_ROOT. 339 * @param array<int, string>|null $candidates Optional explicit candidate list (for testing). 340 * @return self 341 * 342 * @throws \RuntimeException On invalid handle, unsafe path/ownership, or tampered state. 343 */ 344 public static function open_private_run( 345 string $run_handle, 346 string $web_dir, 347 string $state_secret, 348 string $archive_name = '', 349 ?string $doc_root = null, 350 ?array $candidates = null 351 ): self { 352 if ( strlen( trim( $state_secret ) ) < 32 ) { 353 throw new \RuntimeException( 'Installer server-side security secret is missing or invalid.' ); 354 } 355 356 if ( 1 !== preg_match( '/^([a-f0-9]{32})\.([a-f0-9]{64})$/', $run_handle, $m ) ) { 357 throw new \RuntimeException( 'Invalid or missing installer session handle.' ); 358 } 359 360 $nonce = $m[1]; 361 $provided_sig = $m[2]; 362 $expected_sig = self::sign_run( $nonce, $web_dir, $archive_name, $state_secret ); 363 364 if ( ! hash_equals( $expected_sig, $provided_sig ) ) { 365 throw new \RuntimeException( 'Installer session verification failed.' ); 366 } 367 368 if ( null === $doc_root && isset( $_SERVER['DOCUMENT_ROOT'] ) ) { 369 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.ValidatedSanitizedInput.MissingUnslash -- Server document root fallback during standalone restore. 370 $doc_root = (string) $_SERVER['DOCUMENT_ROOT']; 371 } 372 373 if ( null === $candidates ) { 374 $candidates = self::default_candidate_dirs(); 375 } 376 377 $run_dir = ''; 378 $checked = array(); 379 foreach ( $candidates as $dir ) { 380 $dir = trim( (string) $dir ); 381 if ( '' === $dir || is_link( $dir ) || ! is_dir( $dir ) ) { 382 continue; 383 } 384 $normalized = self::normalize_path( $dir ); 385 if ( '' === $normalized || isset( $checked[ $normalized ] ) ) { 386 continue; 387 } 388 $checked[ $normalized ] = true; 389 390 $candidate_run = rtrim( $normalized, '/' ) . '/' . self::RUN_DIR_PREFIX . $nonce; 391 if ( file_exists( $candidate_run ) || is_link( $candidate_run ) ) { 392 $run_dir = $candidate_run; 393 break; 394 } 395 } 396 397 if ( '' === $run_dir ) { 398 throw new \RuntimeException( 'Installer session state was not found or has expired.' ); 399 } 400 401 self::assert_private_dir_safe( $run_dir, $web_dir, $doc_root ); 402 403 $state_file = $run_dir . '/' . self::STATE_FILENAME; 404 self::assert_private_file_safe( $state_file, $run_dir ); 405 406 $run_secret = self::derive_run_secret( $nonce, $web_dir, $state_secret ); 407 408 return new self( $state_file, $run_secret, $run_dir, $run_handle, true ); 409 } 410 411 /** 412 * Load state from disk. In strict mode, any missing, malformed, unguarded, or 413 * tampered state fails closed by throwing RuntimeException. 47 414 * 48 415 * @return void 416 * 417 * @throws \RuntimeException In strict mode when state cannot be verified or decrypted. 49 418 */ 50 419 public function load(): void { 420 if ( is_link( $this->file ) ) { 421 $this->data = array(); 422 if ( $this->strict ) { 423 throw new \RuntimeException( 'Installer state file is unsafe (symlink detected).' ); 424 } 425 426 return; 427 } 428 51 429 if ( ! is_readable( $this->file ) ) { 52 430 $this->data = array(); 431 if ( $this->strict ) { 432 throw new \RuntimeException( 'Installer state file is missing or unreadable.' ); 433 } 53 434 54 435 return; 55 436 } 56 437 57 $raw = (string) file_get_contents( $this->file ); 438 $raw = @file_get_contents( $this->file ); 439 if ( ! is_string( $raw ) ) { 440 $this->data = array(); 441 if ( $this->strict ) { 442 throw new \RuntimeException( 'Installer state file could not be read.' ); 443 } 444 445 return; 446 } 447 448 if ( 0 !== strpos( $raw, self::GUARD_PREFIX ) ) { 449 $this->data = array(); 450 if ( $this->strict ) { 451 throw new \RuntimeException( 'Installer state integrity check failed.' ); 452 } 453 } else { 454 $raw = substr( $raw, strlen( self::GUARD_PREFIX ) ); 455 } 456 58 457 $parsed = json_decode( $raw, true ); 59 60 $this->data = is_array( $parsed ) ? $parsed : array(); 61 } 62 63 /** 64 * Persist state atomically with restrictive permissions. 458 if ( ! is_array( $parsed ) ) { 459 $this->data = array(); 460 if ( $this->strict ) { 461 throw new \RuntimeException( 'Installer state is corrupted or tampered.' ); 462 } 463 464 return; 465 } 466 467 if ( '' !== $this->secret ) { 468 $decrypted = $this->decrypt_envelope( $parsed ); 469 if ( ! is_array( $decrypted ) ) { 470 $this->data = array(); 471 if ( $this->strict ) { 472 throw new \RuntimeException( 'Installer state decryption or authentication failed.' ); 473 } 474 475 return; 476 } 477 $this->data = $decrypted; 478 479 return; 480 } 481 482 $this->data = $parsed; 483 } 484 485 /** 486 * Persist state atomically with PHP guard, server-secret authenticated encryption, 487 * and restrictive 0600 permissions inside the private run directory. 65 488 * 66 489 * @return bool 67 490 */ 68 491 public function save(): bool { 69 $encoded = json_encode( $this->data ); 70 71 if ( ! is_string( $encoded ) ) { 492 if ( is_link( $this->file ) ) { 72 493 return false; 73 494 } 74 495 75 $temp = $this->file . '.tmp'; 76 77 if ( false === @file_put_contents( $temp, $encoded, LOCK_EX ) ) { 496 if ( '' !== $this->run_dir && ( is_link( $this->run_dir ) || ! is_dir( $this->run_dir ) ) ) { 78 497 return false; 79 498 } 80 499 500 $plaintext = json_encode( $this->data ); 501 if ( ! is_string( $plaintext ) ) { 502 return false; 503 } 504 505 if ( '' !== $this->secret ) { 506 $envelope = $this->encrypt_envelope( $plaintext ); 507 $encoded = json_encode( $envelope ); 508 if ( ! is_string( $encoded ) ) { 509 return false; 510 } 511 } else { 512 $encoded = $plaintext; 513 } 514 515 $payload = self::GUARD_PREFIX . $encoded; 516 $temp = $this->file . '.tmp.' . bin2hex( random_bytes( 6 ) ); 517 518 $fp = @fopen( $temp, 'xb' ); 519 if ( false === $fp ) { 520 return false; 521 } 522 81 523 @chmod( $temp, 0600 ); 82 83 return @rename( $temp, $this->file ); 524 $written = @fwrite( $fp, $payload ); 525 @fflush( $fp ); 526 @fclose( $fp ); 527 528 if ( false === $written || $written !== strlen( $payload ) ) { 529 @unlink( $temp ); 530 531 return false; 532 } 533 534 if ( ! @rename( $temp, $this->file ) ) { 535 @unlink( $temp ); 536 537 return false; 538 } 539 540 @chmod( $this->file, 0600 ); 541 542 return true; 543 } 544 545 /** 546 * Absolute path of the state file. 547 * 548 * @return string 549 */ 550 public function file(): string { 551 return $this->file; 552 } 553 554 /** 555 * Absolute path of the private per-run directory. 556 * 557 * @return string 558 */ 559 public function run_dir(): string { 560 return $this->run_dir; 561 } 562 563 /** 564 * Opaque signed handle referencing this private run. 565 * 566 * @return string 567 */ 568 public function handle(): string { 569 return $this->run_handle; 84 570 } 85 571 … … 87 573 * Read a value. 88 574 * 89 * @param string $key Key.575 * @param string $key Key. 90 576 * @param mixed $fallback Fallback. 91 577 * @return mixed … … 107 593 108 594 /** 595 * Remove a single key from state. 596 * 597 * @param string $key Key. 598 * @return void 599 */ 600 public function remove( string $key ): void { 601 unset( $this->data[ $key ] ); 602 } 603 604 /** 109 605 * Whether a key exists. 110 606 * … … 117 613 118 614 /** 119 * Delete the state file. 615 * Purge sensitive credential keys from state immediately. 616 * 617 * When `$keep_auth_flag` is true and the session was authenticated with an 618 * installer password, only the minimal non-sensitive authentication flag is 619 * retained so the final cleanup step can still be authorized. Otherwise the 620 * entire private run state and directory are destroyed immediately. 621 * 622 * @param bool $keep_auth_flag Whether to preserve minimal non-sensitive auth status. 623 * @return void 624 */ 625 public function purge_sensitive( bool $keep_auth_flag = false ): void { 626 unset( $this->data['db'], $this->data['admin_account'] ); 627 628 if ( $keep_auth_flag && ! empty( $this->data['authenticated'] ) ) { 629 $this->data = array( 630 'authenticated' => true, 631 'finished' => ! empty( $this->data['finished'] ), 632 ); 633 $this->cleanup_crash_temps(); 634 $this->save(); 635 636 return; 637 } 638 639 $this->destroy(); 640 } 641 642 /** 643 * Delete the state file, any crash-leftover `.tmp.*` files strictly inside this 644 * run's private directory, and remove the private directory itself. 645 * 646 * Never touches files belonging to other runs, shared temp files, or user files. 120 647 * 121 648 * @return void … … 124 651 $this->data = array(); 125 652 653 if ( '' !== $this->run_dir && is_dir( $this->run_dir ) && ! is_link( $this->run_dir ) ) { 654 $this->cleanup_crash_temps(); 655 656 if ( is_file( $this->file ) || is_link( $this->file ) ) { 657 @chmod( $this->file, 0600 ); 658 @unlink( $this->file ); 659 } 660 661 @rmdir( $this->run_dir ); 662 663 return; 664 } 665 126 666 if ( is_file( $this->file ) ) { 667 @chmod( $this->file, 0600 ); 127 668 @unlink( $this->file ); 669 } 670 671 if ( is_file( $this->file . '.tmp' ) ) { 672 @unlink( $this->file . '.tmp' ); 673 } 674 } 675 676 /** 677 * Remove any crash-leftover temporary files (`state.php.tmp*`) strictly scoped 678 * to this run's private directory. 679 * 680 * @return void 681 */ 682 public function cleanup_crash_temps(): void { 683 if ( '' === $this->run_dir || ! is_dir( $this->run_dir ) || is_link( $this->run_dir ) ) { 684 return; 685 } 686 687 $entries = @scandir( $this->run_dir ); 688 if ( ! is_array( $entries ) ) { 689 return; 690 } 691 692 $prefix = self::STATE_FILENAME . '.tmp'; 693 foreach ( $entries as $entry ) { 694 if ( '.' === $entry || '..' === $entry ) { 695 continue; 696 } 697 if ( $entry === $prefix || 1 === preg_match( '/^' . preg_quote( $prefix, '/' ) . '\.[a-f0-9]+$/i', $entry ) ) { 698 $path = rtrim( $this->run_dir, '/' ) . '/' . $entry; 699 if ( is_file( $path ) || is_link( $path ) ) { 700 @chmod( $path, 0600 ); 701 @unlink( $path ); 702 } 703 } 128 704 } 129 705 } … … 137 713 return $this->data; 138 714 } 715 716 /** 717 * Default external candidate directories outside webroot. 718 * 719 * @return array<int, string> 720 */ 721 private static function default_candidate_dirs(): array { 722 $candidates = array(); 723 724 $sys_tmp = sys_get_temp_dir(); 725 if ( is_string( $sys_tmp ) && '' !== trim( $sys_tmp ) ) { 726 $candidates[] = $sys_tmp; 727 } 728 729 $upload_tmp = (string) ini_get( 'upload_tmp_dir' ); 730 if ( '' !== trim( $upload_tmp ) ) { 731 $candidates[] = $upload_tmp; 732 } 733 734 if ( function_exists( 'session_save_path' ) ) { 735 $sess_dir = (string) session_save_path(); 736 if ( '' !== trim( $sess_dir ) ) { 737 if ( false !== strpos( $sess_dir, ';' ) ) { 738 $parts = explode( ';', $sess_dir ); 739 $sess_dir = (string) end( $parts ); 740 } 741 if ( '' !== trim( $sess_dir ) ) { 742 $candidates[] = $sess_dir; 743 } 744 } 745 } 746 747 return $candidates; 748 } 749 750 /** 751 * Verify that a private run directory is real, not a symlink, outside webroot, 752 * owned by the current OS user, and has no group/world access on POSIX systems. 753 * 754 * @param string $dir Candidate private run directory. 755 * @param string $web_dir Installer working directory. 756 * @param string|null $doc_root Web server DOCUMENT_ROOT. 757 * @return void 758 * 759 * @throws \RuntimeException If any safety invariant fails. 760 */ 761 private static function assert_private_dir_safe( string $dir, string $web_dir, ?string $doc_root ): void { 762 if ( is_link( $dir ) || ! is_dir( $dir ) ) { 763 throw new \RuntimeException( 'Secure private state directory is missing or unsafe.' ); 764 } 765 766 if ( ! self::is_outside_webroot( $dir, $web_dir, $doc_root ) ) { 767 throw new \RuntimeException( 'State directory resolved inside web document root. Installation stopped.' ); 768 } 769 770 if ( '\\' !== DIRECTORY_SEPARATOR ) { 771 clearstatcache( true, $dir ); 772 if ( function_exists( 'posix_geteuid' ) && function_exists( 'fileowner' ) ) { 773 $owner = @fileowner( $dir ); 774 if ( false === $owner || $owner !== posix_geteuid() ) { 775 throw new \RuntimeException( 'Private state directory ownership verification failed.' ); 776 } 777 } 778 779 $perms = @fileperms( $dir ); 780 if ( false !== $perms && 0 !== ( $perms & 0077 ) ) { 781 throw new \RuntimeException( 'Private state directory permissions are too permissive.' ); 782 } 783 } 784 } 785 786 /** 787 * Verify that the state file inside a private run directory is a regular file 788 * (not a symlink), lives inside the private directory, and has safe ownership/perms. 789 * 790 * @param string $file Absolute state file path. 791 * @param string $run_dir Expected parent private run directory. 792 * @return void 793 * 794 * @throws \RuntimeException If any safety invariant fails. 795 */ 796 private static function assert_private_file_safe( string $file, string $run_dir ): void { 797 if ( is_link( $file ) || ! is_file( $file ) ) { 798 throw new \RuntimeException( 'Installer state file is missing or unsafe.' ); 799 } 800 801 $norm_dir = rtrim( self::normalize_path( $run_dir ), '/' ); 802 $norm_file = self::normalize_path( $file ); 803 if ( 0 !== strpos( $norm_file, $norm_dir . '/' ) ) { 804 throw new \RuntimeException( 'Installer state file path escaped its private directory.' ); 805 } 806 807 if ( '\\' !== DIRECTORY_SEPARATOR ) { 808 clearstatcache( true, $file ); 809 if ( function_exists( 'posix_geteuid' ) && function_exists( 'fileowner' ) ) { 810 $owner = @fileowner( $file ); 811 if ( false === $owner || $owner !== posix_geteuid() ) { 812 throw new \RuntimeException( 'Installer state file ownership verification failed.' ); 813 } 814 } 815 816 $perms = @fileperms( $file ); 817 if ( false !== $perms && 0 !== ( $perms & 0077 ) ) { 818 throw new \RuntimeException( 'Installer state file permissions are too permissive.' ); 819 } 820 } 821 } 822 823 /** 824 * Compute the server-signed HMAC binding a run nonce to this installer instance. 825 * 826 * @param string $nonce 32-char hex nonce. 827 * @param string $web_dir Installer working directory. 828 * @param string $archive_name Archive basename. 829 * @param string $state_secret Server-only secret. 830 * @return string 64-char hex HMAC-SHA256. 831 */ 832 private static function sign_run( string $nonce, string $web_dir, string $archive_name, string $state_secret ): string { 833 return hash_hmac( 834 'sha256', 835 'backupino-run-handle|' . $nonce . '|' . self::normalize_path( $web_dir ) . '|' . basename( $archive_name ), 836 $state_secret 837 ); 838 } 839 840 /** 841 * Derive the per-run encryption secret from the server-only secret and run nonce. 842 * 843 * @param string $nonce 32-char hex nonce. 844 * @param string $web_dir Installer working directory. 845 * @param string $state_secret Server-only secret. 846 * @return string 847 */ 848 private static function derive_run_secret( string $nonce, string $web_dir, string $state_secret ): string { 849 return hash_hmac( 850 'sha256', 851 'backupino-run-secret|' . $nonce . '|' . self::normalize_path( $web_dir ), 852 $state_secret 853 ); 854 } 855 856 /** 857 * Encrypt a JSON string into an authenticated envelope. 858 * 859 * @param string $plaintext JSON payload. 860 * @return array<string, mixed> 861 */ 862 private function encrypt_envelope( string $plaintext ): array { 863 $enc_key = hash_hmac( 'sha256', 'backupino-state-enc', $this->secret, true ); 864 $mac_key = hash_hmac( 'sha256', 'backupino-state-mac', $this->secret, true ); 865 866 if ( function_exists( 'openssl_encrypt' ) && function_exists( 'openssl_get_cipher_methods' ) ) { 867 $methods = openssl_get_cipher_methods(); 868 869 if ( in_array( 'aes-256-gcm', $methods, true ) ) { 870 $iv = random_bytes( 12 ); 871 $tag = ''; 872 $ct = openssl_encrypt( $plaintext, 'aes-256-gcm', $enc_key, OPENSSL_RAW_DATA, $iv, $tag ); 873 if ( is_string( $ct ) && '' !== $tag ) { 874 return array( 875 'v' => 2, 876 'alg' => 'aes-256-gcm', 877 'iv' => base64_encode( $iv ), 878 'tag' => base64_encode( $tag ), 879 'ct' => base64_encode( $ct ), 880 ); 881 } 882 } 883 884 if ( in_array( 'aes-256-cbc', $methods, true ) ) { 885 $iv = random_bytes( 16 ); 886 $ct = openssl_encrypt( $plaintext, 'aes-256-cbc', $enc_key, OPENSSL_RAW_DATA, $iv ); 887 if ( is_string( $ct ) ) { 888 $mac = hash_hmac( 'sha256', $iv . $ct, $mac_key, true ); 889 890 return array( 891 'v' => 2, 892 'alg' => 'aes-256-cbc-hmac', 893 'iv' => base64_encode( $iv ), 894 'mac' => base64_encode( $mac ), 895 'ct' => base64_encode( $ct ), 896 ); 897 } 898 } 899 } 900 901 // OpenSSL fallback: authenticated stream cipher (still inside 0700 private dir outside webroot + PHP 403 guard). 902 $salt = random_bytes( 16 ); 903 $ct = self::xor_stream( $plaintext, $enc_key, $salt ); 904 $mac = hash_hmac( 'sha256', $salt . $ct, $mac_key, true ); 905 906 return array( 907 'v' => 2, 908 'alg' => 'hmac-stream', 909 'salt' => base64_encode( $salt ), 910 'mac' => base64_encode( $mac ), 911 'ct' => base64_encode( $ct ), 912 ); 913 } 914 915 /** 916 * Decrypt and authenticate a persisted state envelope. 917 * 918 * @param array<string, mixed> $envelope Decoded envelope. 919 * @return array<string, mixed>|null 920 */ 921 private function decrypt_envelope( array $envelope ): ?array { 922 if ( 2 !== (int) ( $envelope['v'] ?? 0 ) || empty( $envelope['alg'] ) || empty( $envelope['ct'] ) ) { 923 return null; 924 } 925 926 $enc_key = hash_hmac( 'sha256', 'backupino-state-enc', $this->secret, true ); 927 $mac_key = hash_hmac( 'sha256', 'backupino-state-mac', $this->secret, true ); 928 $alg = (string) $envelope['alg']; 929 $ct = base64_decode( (string) $envelope['ct'], true ); 930 $plaintext = false; 931 932 if ( ! is_string( $ct ) ) { 933 return null; 934 } 935 936 if ( 'aes-256-gcm' === $alg && function_exists( 'openssl_decrypt' ) ) { 937 $iv = base64_decode( (string) ( $envelope['iv'] ?? '' ), true ); 938 $tag = base64_decode( (string) ( $envelope['tag'] ?? '' ), true ); 939 if ( is_string( $iv ) && is_string( $tag ) ) { 940 $plaintext = openssl_decrypt( $ct, 'aes-256-gcm', $enc_key, OPENSSL_RAW_DATA, $iv, $tag ); 941 } 942 } elseif ( 'aes-256-cbc-hmac' === $alg && function_exists( 'openssl_decrypt' ) ) { 943 $iv = base64_decode( (string) ( $envelope['iv'] ?? '' ), true ); 944 $mac = base64_decode( (string) ( $envelope['mac'] ?? '' ), true ); 945 if ( is_string( $iv ) && is_string( $mac ) ) { 946 $expected = hash_hmac( 'sha256', $iv . $ct, $mac_key, true ); 947 if ( hash_equals( $expected, $mac ) ) { 948 $plaintext = openssl_decrypt( $ct, 'aes-256-cbc', $enc_key, OPENSSL_RAW_DATA, $iv ); 949 } 950 } 951 } elseif ( 'hmac-stream' === $alg ) { 952 $salt = base64_decode( (string) ( $envelope['salt'] ?? '' ), true ); 953 $mac = base64_decode( (string) ( $envelope['mac'] ?? '' ), true ); 954 if ( is_string( $salt ) && is_string( $mac ) ) { 955 $expected = hash_hmac( 'sha256', $salt . $ct, $mac_key, true ); 956 if ( hash_equals( $expected, $mac ) ) { 957 $plaintext = self::xor_stream( $ct, $enc_key, $salt ); 958 } 959 } 960 } 961 962 if ( ! is_string( $plaintext ) ) { 963 return null; 964 } 965 966 $decoded = json_decode( $plaintext, true ); 967 968 return is_array( $decoded ) ? $decoded : null; 969 } 970 971 /** 972 * Deterministic HMAC-SHA256 counter-mode XOR stream for environments without OpenSSL. 973 * 974 * @param string $input Data to encrypt or decrypt. 975 * @param string $key 32-byte key. 976 * @param string $salt 16-byte nonce/salt. 977 * @return string 978 */ 979 private static function xor_stream( string $input, string $key, string $salt ): string { 980 $len = strlen( $input ); 981 $out = ''; 982 $counter = 0; 983 984 for ( $offset = 0; $offset < $len; $offset += 32 ) { 985 $block = hash_hmac( 'sha256', $salt . pack( 'N', $counter ), $key, true ); 986 $chunk = substr( $input, $offset, 32 ); 987 $out .= $chunk ^ substr( $block, 0, strlen( $chunk ) ); 988 ++$counter; 989 } 990 991 return $out; 992 } 139 993 } -
backupino/tags/1.1.0/src/Installer/installer-template.php
r3800274 r3809656 34 34 $error = error_get_last(); 35 35 if ( $error && in_array( $error['type'], array( E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR ), true ) ) { 36 if ( isset( $GLOBALS['backupino_active_state'] ) && $GLOBALS['backupino_active_state'] instanceof State ) { 37 $GLOBALS['backupino_active_state']->purge_sensitive( false ); 38 } 36 39 while ( ob_get_level() > 0 ) { 37 40 @ob_end_clean(); … … 43 46 echo json_encode( array( 44 47 'ok' => false, 45 'error' => ' Fatal Error: ' . $error['message'] . ' in ' . basename( $error['file'] ) . ':' . $error['line'],48 'error' => 'A fatal server error occurred during installation. Temporary credentials have been cleared.', 46 49 ), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ); 47 50 exit; … … 95 98 } 96 99 97 $backupino_state_file = $backupino_dir . '/backupino-install.json';98 100 $backupino_archive_name = isset( $backupino_payload['archive'] ) ? basename( (string) $backupino_payload['archive'] ) : ''; 99 101 $backupino_archive = $backupino_dir . '/' . $backupino_archive_name; 100 102 $backupino_token = isset( $backupino_payload['token'] ) ? (string) $backupino_payload['token'] : ''; 103 $backupino_state_secret = isset( $backupino_payload['state_secret'] ) ? (string) $backupino_payload['state_secret'] : ''; 101 104 $backupino_action = isset( $_REQUEST['action'] ) ? (string) preg_replace( '/[^a-z_]/', '', (string) $_REQUEST['action'] ) : 'index'; 105 $backupino_doc_root = isset( $_SERVER['DOCUMENT_ROOT'] ) ? (string) $_SERVER['DOCUMENT_ROOT'] : null; 106 107 $backupino_state_base = ''; 108 $backupino_state_error = ''; 109 if ( strlen( trim( $backupino_state_secret ) ) < 32 || ( '' !== $backupino_token && hash_equals( $backupino_token, $backupino_state_secret ) ) ) { 110 $backupino_state_error = 'Installer server-side security secret is missing or invalid.'; 111 } else { 112 try { 113 $backupino_state_base = State::find_secure_base_dir( $backupino_dir, $backupino_doc_root ); 114 } catch ( \RuntimeException $e ) { 115 $backupino_state_error = $e->getMessage(); 116 } 117 } 102 118 103 119 // Auto-detect current host and base URL … … 111 127 112 128 if ( 'index' === $backupino_action ) { 113 $backupino_checks = Env::check( $backupino_payload, $backupino_dir, $backupino_archive ); 129 $backupino_checks = Env::check( $backupino_payload, $backupino_dir, $backupino_archive ); 130 $backupino_checks[] = array( 131 'label' => 'Secure state storage', 132 'ok' => '' === $backupino_state_error && '' !== $backupino_state_base, 133 'detail' => '' === $backupino_state_error 134 ? 'Private per-run storage outside web document root' 135 : $backupino_state_error, 136 ); 114 137 $backupino_body = '<div id="app"> 115 138 <section id="step1"> … … 142 165 <span data-i18n="empty_db_lbl">Empty existing database tables before import (Recommended)</span> 143 166 </label> 167 <div class="admin-box"> 168 <label style="display:flex;align-items:center;gap:8px;margin:0;font-weight:600;cursor:pointer;"> 169 <input type="checkbox" id="create_admin" name="create_admin" value="1" style="width:auto;margin:0;"> 170 <span data-i18n="create_admin_opt">Create a new WordPress Administrator account (Optional)</span> 171 </label> 172 <div id="admin-fields" class="hidden" style="margin-top:12px;"> 173 <div class="grid"> 174 <div> 175 <label for="admin_user" data-i18n="admin_user_lbl">Administrator Username</label> 176 <input id="admin_user" name="admin_user" placeholder="admin"> 177 </div> 178 <div> 179 <label for="admin_email" data-i18n="admin_email_lbl">Administrator Email</label> 180 <input id="admin_email" name="admin_email" type="email" placeholder="admin@example.com"> 181 </div> 182 </div> 183 <label for="admin_pass" data-i18n="admin_pass_lbl">Administrator Password</label> 184 <div class="pass-wrap"> 185 <input id="admin_pass" name="admin_pass" type="password" placeholder="Enter secure password"> 186 <button type="button" class="pass-toggle-btn" id="toggle_admin_pass" data-i18n="show_btn">Show</button> 187 </div> 188 </div> 189 </div> 144 190 <p class="err" id="error2"></p> 145 191 <div style="display:flex;gap:10px;align-items:center;margin-top:16px;"> … … 164 210 <h2 style="font-size:16px;margin:0 0 10px;color:#16a34a;" id="done-title" data-i18n="ready_title">✓ Your site is ready</h2> 165 211 <p class="lead" id="done-url" style="font-weight:600;word-break:break-all;"></p> 212 <div id="admin-created-box" class="hidden" style="margin:14px 0;padding:12px 14px;background:#f0fdf4;border:1px solid #bbf7d0;border-radius:8px;font-size:13px;color:#166534;"> 213 <div style="font-weight:700;margin-bottom:4px;" data-i18n="admin_created_title">✓ New Administrator Account Created:</div> 214 <div><span data-i18n="admin_user_lbl">Username</span>: <strong id="admin-created-name"></strong></div> 215 </div> 166 216 <div style="display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:16px;"> 167 217 <button type="button" id="cleanup" data-i18n="cleanup_btn" style="background:#16a34a;margin-top:0;">Delete installer files & Login</button> … … 197 247 @set_time_limit( 180 ); 198 248 199 $backupino_state = new State( $backupino_state_file ); 200 201 // Optional password gate, configured when the package was built. 202 $backupino_password = isset( $backupino_payload['password'] ) ? (string) $backupino_payload['password'] : ''; 203 204 if ( '' !== $backupino_password && ! $backupino_state->get( 'authenticated' ) ) { 205 $backupino_supplied = isset( $_REQUEST['installer_password'] ) ? (string) $_REQUEST['installer_password'] : ''; 206 207 if ( ! hash_equals( $backupino_password, $backupino_supplied ) ) { 249 if ( '' !== $backupino_state_error || '' === $backupino_state_base ) { 250 respond( 251 array( 252 'ok' => false, 253 'error' => '' !== $backupino_state_error 254 ? $backupino_state_error 255 : 'Secure temporary storage outside the web document root is unavailable. Installation stopped to protect sensitive credentials.', 256 ), 257 500 258 ); 259 } 260 261 $backupino_password = isset( $backupino_payload['password'] ) ? (string) $backupino_payload['password'] : ''; 262 $backupino_run_handle = isset( $_POST['run_handle'] ) ? trim( (string) $_POST['run_handle'] ) : ''; 263 if ( '' === $backupino_run_handle && isset( $_COOKIE['backupino_run'] ) ) { 264 $backupino_run_handle = trim( (string) $_COOKIE['backupino_run'] ); 265 } 266 267 $backupino_state = null; 268 $backupino_state_file = ''; 269 270 // Actions that require an already-created private run session fail closed on invalid/tampered state. 271 if ( in_array( $backupino_action, array( 'extract', 'import', 'rewrite', 'config' ), true ) ) { 272 try { 273 $backupino_state = State::open_private_run( 274 $backupino_run_handle, 275 $backupino_dir, 276 $backupino_state_secret, 277 $backupino_archive_name, 278 $backupino_doc_root 279 ); 280 } catch ( \RuntimeException $e ) { 281 respond( array( 'ok' => false, 'error' => sanitize_error_message( $e->getMessage(), array(), '', $backupino_state_secret, $backupino_run_handle ) ), 400 ); 282 } 283 284 $backupino_state_file = $backupino_state->file(); 285 $GLOBALS['backupino_active_state'] = $backupino_state; 286 287 if ( '' !== $backupino_password && ! $backupino_state->get( 'authenticated' ) ) { 208 288 respond( array( 'ok' => false, 'error' => 'Installer password required.' ), 401 ); 209 289 } 210 211 $backupino_state->set( 'authenticated', true ); 212 $backupino_state->save(); 290 } elseif ( in_array( $backupino_action, array( 'abort', 'cleanup' ), true ) && '' !== $backupino_run_handle ) { 291 try { 292 $backupino_state = State::open_private_run( 293 $backupino_run_handle, 294 $backupino_dir, 295 $backupino_state_secret, 296 $backupino_archive_name, 297 $backupino_doc_root 298 ); 299 $backupino_state_file = $backupino_state->file(); 300 $GLOBALS['backupino_active_state'] = $backupino_state; 301 } catch ( \RuntimeException $e ) { 302 $backupino_state = null; 303 } 213 304 } 214 305 … … 216 307 switch ( $backupino_action ) { 217 308 case 'check': 218 $checks = Env::check( $backupino_payload, $backupino_dir, $backupino_archive ); 309 $checks = Env::check( $backupino_payload, $backupino_dir, $backupino_archive ); 310 $checks[] = array( 311 'label' => 'Secure state storage', 312 'ok' => '' === $backupino_state_error && '' !== $backupino_state_base, 313 'detail' => '' === $backupino_state_error 314 ? 'Private per-run storage outside web document root' 315 : $backupino_state_error, 316 ); 219 317 220 318 respond( … … 228 326 229 327 case 'connect': 328 if ( '' !== $backupino_password ) { 329 $backupino_supplied = isset( $_REQUEST['installer_password'] ) ? (string) $_REQUEST['installer_password'] : ''; 330 if ( ! hash_equals( $backupino_password, $backupino_supplied ) ) { 331 respond( array( 'ok' => false, 'error' => 'Installer password required.' ), 401 ); 332 } 333 } 334 230 335 $prefix = isset( $_POST['prefix'] ) && '' !== trim( (string) $_POST['prefix'] ) ? trim( (string) $_POST['prefix'] ) : 'wp_'; 231 336 if ( ! preg_match( '/^[a-zA-Z0-9_]+$/', $prefix ) ) { … … 253 358 } 254 359 360 $create_admin = ! empty( $_POST['create_admin'] ); 361 $admin_account = array(); 362 if ( $create_admin ) { 363 $admin_user = isset( $_POST['admin_user'] ) ? trim( (string) $_POST['admin_user'] ) : ''; 364 $admin_pass = isset( $_POST['admin_pass'] ) ? (string) $_POST['admin_pass'] : ''; 365 $admin_email = isset( $_POST['admin_email'] ) ? trim( (string) $_POST['admin_email'] ) : ''; 366 367 if ( '' === $admin_user || strlen( $admin_user ) > 60 ) { 368 respond( array( 'ok' => false, 'error' => 'Administrator username is required (max 60 characters).' ), 400 ); 369 } 370 if ( '' === $admin_pass ) { 371 respond( array( 'ok' => false, 'error' => 'Administrator password is required.' ), 400 ); 372 } 373 if ( '' === $admin_email || strlen( $admin_email ) > 100 || false === filter_var( $admin_email, FILTER_VALIDATE_EMAIL ) ) { 374 respond( array( 'ok' => false, 'error' => 'A valid administrator email address is required.' ), 400 ); 375 } 376 377 // Hash immediately so plaintext administrator password is never stored in state. 378 $admin_pass_hash = AdminCreator::hash_password( $admin_pass ); 379 unset( $admin_pass ); 380 381 $admin_account = array( 382 'enabled' => true, 383 'username' => $admin_user, 384 'password_hash' => $admin_pass_hash, 385 'email' => $admin_email, 386 ); 387 } 388 255 389 try { 256 390 $connection = ConnectionManager::ensure( $config ); 257 391 } catch ( \RuntimeException $e ) { 258 respond( array( 'ok' => false, 'error' => $e->getMessage() ), 400 );392 respond( array( 'ok' => false, 'error' => sanitize_error_message( $e->getMessage(), $config, '', $backupino_state_secret, $backupino_run_handle ) ), 400 ); 259 393 } 260 394 … … 269 403 } 270 404 405 // Clean up any previous run handle from the same client before creating a fresh private run. 406 if ( '' !== $backupino_run_handle ) { 407 try { 408 $prev_state = State::open_private_run( 409 $backupino_run_handle, 410 $backupino_dir, 411 $backupino_state_secret, 412 $backupino_archive_name, 413 $backupino_doc_root 414 ); 415 $prev_state->destroy(); 416 } catch ( \RuntimeException $e ) { 417 // Ignore stale handle. 418 } 419 } 420 421 try { 422 $backupino_state = State::create_private_run( 423 $backupino_dir, 424 $backupino_state_secret, 425 $backupino_archive_name, 426 $backupino_doc_root 427 ); 428 } catch ( \RuntimeException $e ) { 429 respond( array( 'ok' => false, 'error' => sanitize_error_message( $e->getMessage(), $config, '', $backupino_state_secret ) ), 500 ); 430 } 431 432 $backupino_state_file = $backupino_state->file(); 433 $backupino_run_handle = $backupino_state->handle(); 434 $GLOBALS['backupino_active_state'] = $backupino_state; 435 436 if ( '' !== $backupino_password ) { 437 $backupino_state->set( 'authenticated', true ); 438 } 271 439 $backupino_state->set( 'db', $config ); 272 440 $backupino_state->set( 'tables_found', count( $tables ) ); 273 441 $backupino_state->set( 'new_url', $new_url ); 274 442 $backupino_state->set( 'empty_db', ! empty( $_POST['empty_db'] ) ); 275 $backupino_state->save(); 443 $backupino_state->set( 'admin_account', $admin_account ); 444 if ( ! $backupino_state->save() ) { 445 $backupino_state->destroy(); 446 respond( array( 'ok' => false, 'error' => 'Failed to persist secure installer state.' ), 500 ); 447 } 448 449 if ( ! headers_sent() ) { 450 @setcookie( 451 'backupino_run', 452 $backupino_run_handle, 453 array( 454 'expires' => 0, 455 'path' => '' !== $backupino_subpath ? $backupino_subpath . '/' : '/', 456 'secure' => 'https' === $backupino_scheme, 457 'httponly' => true, 458 'samesite' => 'Strict', 459 ) 460 ); 461 } 276 462 277 463 respond( … … 279 465 'ok' => true, 280 466 'db' => $config['name'], 467 'run_handle' => $backupino_run_handle, 281 468 'message' => sprintf( 'Database connected (%d tables existing).', count( $tables ) ), 282 469 'tables_found' => count( $tables ), … … 287 474 case 'extract': 288 475 if ( ! is_readable( $backupino_archive ) ) { 476 cleanup_sensitive_temp( $backupino_state, $backupino_dir, false ); 289 477 respond( array( 'ok' => false, 'error' => 'Archive file not found: ' . basename( $backupino_archive ) ), 400 ); 290 478 } … … 292 480 $extractor = new Extractor( $backupino_archive, $backupino_dir ); 293 481 if ( ! $extractor->open() ) { 482 cleanup_sensitive_temp( $backupino_state, $backupino_dir, false ); 294 483 respond( array( 'ok' => false, 'error' => $extractor->error() ), 400 ); 295 484 } … … 300 489 301 490 $backupino_state->set( 'extract_offset', $offset ); 302 $backupino_state->save(); 491 if ( ! $backupino_state->save() ) { 492 $extractor->close(); 493 cleanup_sensitive_temp( $backupino_state, $backupino_dir, false ); 494 respond( array( 'ok' => false, 'error' => 'Failed to persist secure installer state.' ), 500 ); 495 } 303 496 304 497 $extractor->close(); … … 354 547 $connection->query( 'SET UNIQUE_CHECKS = 0' ); 355 548 } catch ( \RuntimeException $e ) { 356 respond( array( 'ok' => false, 'error' => $e->getMessage() ), 400 ); 549 cleanup_sensitive_temp( $backupino_state, $backupino_dir, false ); 550 respond( array( 'ok' => false, 'error' => sanitize_error_message( $e->getMessage(), $db, $backupino_state_file, $backupino_state_secret, $backupino_run_handle ) ), 400 ); 357 551 } 358 552 … … 390 584 391 585 if ( ! empty( $result['error'] ) ) { 392 respond( array( 'ok' => false, 'error' => $result['error'] ), 500 ); 586 cleanup_sensitive_temp( $backupino_state, $backupino_dir, false ); 587 respond( array( 'ok' => false, 'error' => sanitize_error_message( (string) $result['error'], $db, $backupino_state_file, $backupino_state_secret, $backupino_run_handle ) ), 500 ); 393 588 } 394 589 … … 453 648 $connection->query( 'SET UNIQUE_CHECKS = 0' ); 454 649 } catch ( \RuntimeException $e ) { 455 respond( array( 'ok' => false, 'error' => $e->getMessage() ), 400 ); 650 cleanup_sensitive_temp( $backupino_state, $backupino_dir, false ); 651 respond( array( 'ok' => false, 'error' => sanitize_error_message( $e->getMessage(), $db, $backupino_state_file, $backupino_state_secret, $backupino_run_handle ) ), 400 ); 456 652 } 457 653 … … 476 672 477 673 case 'config': 478 $db = $backupino_state->get( 'db' ); 674 $admin_created_username = ''; 675 $db = $backupino_state->get( 'db' ); 479 676 480 677 if ( ! is_array( $db ) ) { … … 752 949 // Table might not exist yet, ignore. 753 950 } 951 952 // 5. Optional new WordPress Administrator account creation (INSERT-only; never modifies existing accounts) 953 $admin_account = (array) $backupino_state->get( 'admin_account' ); 954 if ( ! empty( $admin_account['enabled'] ) && ! empty( $admin_account['username'] ) && ! empty( $admin_account['password_hash'] ) ) { 955 $adm_user = trim( (string) $admin_account['username'] ); 956 $adm_pass_hash = (string) $admin_account['password_hash']; 957 $adm_email = trim( (string) ( $admin_account['email'] ?? '' ) ); 958 959 // Remove admin_account from state immediately before/on execution so it never lingers. 960 $backupino_state->remove( 'admin_account' ); 961 $backupino_state->save(); 962 963 $created_admin = AdminCreator::create( $connection, $target_prefix, $adm_user, $adm_email, $adm_pass_hash ); 964 $admin_created_username = $created_admin['username']; 965 } 754 966 } catch ( \RuntimeException $e ) { 755 respond( array( 'ok' => false, 'error' => $e->getMessage() ), 400 ); 967 cleanup_sensitive_temp( $backupino_state, $backupino_dir, false ); 968 respond( array( 'ok' => false, 'error' => sanitize_error_message( $e->getMessage(), $db, $backupino_state_file, $backupino_state_secret, $backupino_run_handle ) ), 400 ); 756 969 } 757 970 … … 776 989 $db['new_url'] = $new_url; 777 990 if ( ! ConfigWriter::write( $backupino_dir . '/wp-config.php', $db, $orig_content ) ) { 991 cleanup_sensitive_temp( $backupino_state, $backupino_dir, false ); 778 992 respond( array( 'ok' => false, 'error' => 'wp-config.php could not be written.' ), 500 ); 779 993 } … … 856 1070 ? rtrim( $new_url, '/' ) . '/' . trim( $detected_login_slug, '/' ) . '/' 857 1071 : rtrim( $new_url, '/' ) . '/wp-login.php'; 858 859 $backupino_state->set( 'finished', true );860 $backupino_state->save();861 1072 862 1073 // Enqueue restore notification in WordPress options so it is dispatched cleanly via WordPress HTTP API on first boot … … 899 1110 } 900 1111 1112 // Purge all sensitive credentials & temporary SQL/config templates immediately upon completion. 1113 $backupino_state->set( 'finished', true ); 1114 cleanup_sensitive_temp( $backupino_state, $backupino_dir, '' !== $backupino_password ); 1115 901 1116 respond( 902 1117 array( 903 'ok' => true, 904 'done' => true, 905 'percent' => 100, 906 'url' => $new_url, 907 'admin' => $admin_login_url, 908 'message' => 'wp-config.php written.', 1118 'ok' => true, 1119 'done' => true, 1120 'percent' => 100, 1121 'url' => $new_url, 1122 'admin' => $admin_login_url, 1123 'admin_created' => $admin_created_username, 1124 'message' => 'wp-config.php written.', 909 1125 ) 910 1126 ); 911 1127 break; 912 1128 1129 case 'abort': 1130 cleanup_sensitive_temp( $backupino_state, $backupino_dir, false ); 1131 respond( array( 'ok' => true, 'aborted' => true ) ); 1132 break; 1133 913 1134 case 'cleanup': 914 $backupino_state->destroy(); 1135 if ( '' !== $backupino_password ) { 1136 $cleanup_auth = ( $backupino_state instanceof State && ! empty( $backupino_state->get( 'authenticated' ) ) ); 1137 if ( ! $cleanup_auth ) { 1138 $backupino_supplied = isset( $_REQUEST['installer_password'] ) ? (string) $_REQUEST['installer_password'] : ''; 1139 if ( ! hash_equals( $backupino_password, $backupino_supplied ) ) { 1140 respond( array( 'ok' => false, 'error' => 'Installer password required.' ), 401 ); 1141 } 1142 } 1143 } 1144 1145 if ( $backupino_state instanceof State ) { 1146 $backupino_state->destroy(); 1147 } 915 1148 916 1149 // Restore preserved destination host php configuration (.user.ini / php.ini) if valid … … 933 1166 } 934 1167 1168 // Delete ONLY exact known Backupino installer artifacts (never unrelated user files or archives). 935 1169 $targets = array( 936 1170 $backupino_dir . '/database.sql', … … 938 1172 $backupino_dir . '/backupino-package.json', 939 1173 $backupino_dir . '/backupino-wp-config.tpl', 940 $backupino_state_file, 941 $backupino_archive, 1174 $backupino_dir . '/backupino-install.json', 942 1175 $backupino_dir . '/wp-config.backupino-orig.php', 943 1176 $backupino_dir . '/.htaccess.backupino-orig', … … 946 1179 ); 947 1180 948 $dir_files = @scandir( $backupino_dir ); 949 if ( is_array( $dir_files ) ) { 950 foreach ( $dir_files as $f ) { 951 if ( '.' === $f || '..' === $f ) { 952 continue; 953 } 954 $fpath = $backupino_dir . '/' . $f; 955 if ( ! is_file( $fpath ) ) { 956 continue; 957 } 958 if ( preg_match( '/\.(zip|sql|ndjson)$/i', $f ) ) { 959 if ( 960 0 === strpos( $f, 'backupino' ) || 961 ( '' !== $backupino_archive_name && $f === $backupino_archive_name ) || 962 preg_match( '/^[a-zA-Z0-9_\.\-]+_\d{8}_\d{6}\.zip$/', $f ) 963 ) { 964 $targets[] = $fpath; 965 } 966 } 967 } 1181 if ( '' !== $backupino_archive_name ) { 1182 $targets[] = $backupino_archive; 968 1183 } 969 1184 970 1185 $targets = array_unique( $targets ); 971 1186 foreach ( $targets as $target ) { 972 if ( is_file( $target ) ) {973 @chmod( $target, 0 777);1187 if ( '' !== $target && is_file( $target ) ) { 1188 @chmod( $target, 0600 ); 974 1189 @unlink( $target ); 975 1190 } … … 994 1209 } 995 1210 } catch ( \Throwable $backupino_err ) { 996 respond( array( 'ok' => false, 'error' => $backupino_err->getMessage() ), 500 ); 1211 $backupino_db_ctx = ( $backupino_state instanceof State && is_array( $backupino_state->get( 'db' ) ) ) 1212 ? (array) $backupino_state->get( 'db' ) 1213 : array(); 1214 cleanup_sensitive_temp( $backupino_state, $backupino_dir, false ); 1215 respond( 1216 array( 1217 'ok' => false, 1218 'error' => sanitize_error_message( $backupino_err->getMessage(), $backupino_db_ctx, $backupino_state_file, $backupino_state_secret, $backupino_run_handle ), 1219 ), 1220 500 1221 ); 1222 } 1223 1224 /** 1225 * Clean up sensitive installer state and temporary extracted files without 1226 * deleting unrelated user files, other runs, or backup archives. 1227 * 1228 * @param State|null $state Active installer state. 1229 * @param string $dir Installer working directory. 1230 * @param bool $keep_auth_flag Preserve minimal non-sensitive auth flag when installer password is active. 1231 * @return void 1232 */ 1233 function cleanup_sensitive_temp( ?State $state, string $dir, bool $keep_auth_flag = false ): void { 1234 if ( $state instanceof State ) { 1235 $state->purge_sensitive( $keep_auth_flag ); 1236 } 1237 1238 $sensitive_temp = array( 1239 $dir . '/database.sql', 1240 $dir . '/backupino-wp-config.tpl', 1241 $dir . '/backupino-install.json', 1242 ); 1243 1244 foreach ( $sensitive_temp as $path ) { 1245 if ( is_file( $path ) ) { 1246 @chmod( $path, 0600 ); 1247 @unlink( $path ); 1248 } 1249 } 1250 } 1251 1252 /** 1253 * Strip sensitive credentials, server secrets, session handles, or private 1254 * filesystem paths from error messages before sending them in HTTP JSON responses. 1255 * 1256 * @param string $message Raw error message. 1257 * @param array<string, mixed> $db_config Database config context. 1258 * @param string $state_file Private state file path. 1259 * @param string $state_secret Server-only state secret. 1260 * @param string $run_handle Signed session handle. 1261 * @return string 1262 */ 1263 function sanitize_error_message( 1264 string $message, 1265 array $db_config = array(), 1266 string $state_file = '', 1267 string $state_secret = '', 1268 string $run_handle = '' 1269 ): string { 1270 $secrets = array(); 1271 1272 if ( ! empty( $db_config['password'] ) && is_string( $db_config['password'] ) ) { 1273 $secrets[] = $db_config['password']; 1274 } 1275 if ( '' !== $state_secret ) { 1276 $secrets[] = $state_secret; 1277 } 1278 if ( '' !== $run_handle ) { 1279 $secrets[] = $run_handle; 1280 } 1281 if ( '' !== $state_file ) { 1282 $secrets[] = $state_file; 1283 $secrets[] = dirname( $state_file ); 1284 $secrets[] = dirname( dirname( $state_file ) ); 1285 } 1286 1287 foreach ( $secrets as $secret ) { 1288 if ( '' !== $secret && '/' !== $secret ) { 1289 $message = str_replace( $secret, '[redacted]', $message ); 1290 } 1291 } 1292 1293 return $message; 997 1294 } 998 1295 -
backupino/tags/1.1.0/src/Support/Fs.php
r3800274 r3809656 49 49 50 50 /** 51 * Drop `.htaccess`, `web.config`, and `index. php` guards into a directory.51 * Drop `.htaccess`, `web.config`, and `index.html` guards into a directory. 52 52 * 53 53 * @param string $dir Absolute directory path. -
backupino/tags/1.1.0/templates/dashboard.php
r3800274 r3809656 57 57 <?php endforeach; ?> 58 58 </ul> 59 <?php if ( \Backupino\Core\Compatibility::is_nginx() ) : ?> 60 <?php $backupino_nginx = \Backupino\Core\Compatibility::nginx_storage_info( $paths ); ?> 61 <p style="margin: 8px 0 6px;"> 62 <strong><?php esc_html_e( 'Nginx Server Configuration Note:', 'backupino' ); ?></strong> 63 <?php esc_html_e( 'Backupino cannot automatically alter or reload Nginx configuration. Direct HTTP access is not blocked until your server administrator applies the server rule.', 'backupino' ); ?> 64 </p> 65 <?php if ( 'exact' === $backupino_nginx['status'] && '' !== $backupino_nginx['rule'] ) : ?> 66 <p style="margin: 0 0 6px;"> 67 <strong><?php esc_html_e( 'Required Nginx server configuration (add inside your server { } block and reload Nginx):', 'backupino' ); ?></strong> 68 </p> 69 <pre class="code" style="margin: 0 0 10px; padding: 10px; background: #fff; border: 1px solid #dcdcde; overflow-x: auto; direction: ltr; text-align: left;"><?php echo esc_html( $backupino_nginx['rule'] ); ?></pre> 70 <?php else : ?> 71 <p class="description" style="margin: 0 0 10px;"> 72 <?php esc_html_e( 'The storage path cannot be resolved to an automatic Nginx location (for example, due to an external CDN, custom domain, or path outside webroot). Please see Backupino -> Settings -> Storage Destination to manually determine the rule for your server.', 'backupino' ); ?> 73 </p> 74 <?php endif; ?> 75 <?php endif; ?> 59 76 </div> 60 77 <?php endif; ?> -
backupino/tags/1.1.0/templates/settings.php
r3800274 r3809656 210 210 </h3> 211 211 <p class="description"> 212 <?php esc_html_e( ' Isolated, protected path used to safely store archive files away from public access:', 'backupino' ); ?>212 <?php esc_html_e( 'Local directory used to store backup archives. Guarded with .htaccess (Apache/LiteSpeed), web.config (IIS), and index.html (directory listing). On Nginx, direct HTTP access is NOT guaranteed to be blocked until a server-level deny rule is configured.', 'backupino' ); ?> 213 213 </p> 214 214 <div class="backupino-path-box"> … … 220 220 </div> 221 221 <p class="backupino-result" id="backupino-storage-result" style="margin-top: 8px;"></p> 222 <?php if ( ! empty( $backupino_snapshot['is_nginx'] ) ) : ?> 223 <div class="notice notice-warning inline" style="margin: 12px 0 0;"> 224 <p> 225 <strong><?php esc_html_e( 'Nginx detected — manual server configuration required:', 'backupino' ); ?></strong> 226 <?php esc_html_e( 'Nginx ignores .htaccess and web.config. Backupino cannot automatically alter or reload Nginx configuration. Direct HTTP downloads of package URLs are not guaranteed to be blocked until your server administrator adds the rule below inside your Nginx server { } block and reloads Nginx.', 'backupino' ); ?> 227 </p> 228 <?php if ( ! empty( $backupino_snapshot['nginx_rule'] ) ) : ?> 229 <pre class="code" style="margin: 6px 0 10px; padding: 10px; background: #fff; border: 1px solid #dcdcde; overflow-x: auto; direction: ltr; text-align: left;"><?php echo esc_html( (string) $backupino_snapshot['nginx_rule'] ); ?></pre> 230 <?php else : ?> 231 <p class="description" style="margin: 6px 0;"> 232 <?php esc_html_e( 'The exact Nginx location block cannot be determined automatically (e.g. external CDN or custom mapping). Please visit Backupino -> Settings -> Storage Destination to view manual configuration guidance.', 'backupino' ); ?> 233 </p> 234 <?php endif; ?> 235 </div> 236 <?php endif; ?> 222 237 </div> 223 238 … … 318 333 </h2> 319 334 <p class="description"> 320 <?php esc_html_e( 'Backup archives a nd standalone installers are stored locally in a secure, protected directory on your server.', 'backupino' ); ?>335 <?php esc_html_e( 'Backup archives are stored locally on your server and served to administrators through Backupino authenticated download endpoints.', 'backupino' ); ?> 321 336 </p> 322 337 … … 324 339 <label class="backupino-label"> 325 340 <span class="backupino-label-text"><?php esc_html_e( 'Primary Destination Driver', 'backupino' ); ?></span> 326 <span class="backupino-tooltip" data-tooltip="<?php esc_attr_e( 'Primary storage destination for completed packages. Local protected storage is used.', 'backupino' ); ?>" tabindex="0">?</span>341 <span class="backupino-tooltip" data-tooltip="<?php esc_attr_e( 'Primary storage destination for completed packages.', 'backupino' ); ?>" tabindex="0">?</span> 327 342 </label> 328 343 <select name="storage.driver" id="backupino-driver"> … … 338 353 <div class="backupino-field-group" style="margin-top: 16px;"> 339 354 <label class="backupino-label"> 340 <span class="backupino-label-text"><?php esc_html_e( ' ProtectedDirectory Path', 'backupino' ); ?></span>355 <span class="backupino-label-text"><?php esc_html_e( 'Storage Directory Path', 'backupino' ); ?></span> 341 356 </label> 342 357 <input type="text" readonly class="large-text code" value="<?php echo esc_attr( $paths->packages() ); ?>"> 343 358 <p class="description"> 344 <?php esc_html_e( ' This location contains an .htaccess file blocking direct HTTP requests and indexing for maximum security.', 'backupino' ); ?>359 <?php esc_html_e( 'Backupino places .htaccess (Apache/LiteSpeed), web.config (IIS), and index.html (hides directory listing only) in this directory. Nginx ignores .htaccess and web.config; direct HTTP access is NOT guaranteed to be blocked on Nginx until you add a server-level deny rule.', 'backupino' ); ?> 345 360 </p> 361 </div> 362 363 <?php if ( ! empty( $backupino_snapshot['is_nginx'] ) ) : ?> 364 <div class="notice notice-warning inline" style="margin: 16px 0 0;"> 365 <p> 366 <strong><?php esc_html_e( 'Nginx Server Detected — Action Required to Block Direct Access:', 'backupino' ); ?></strong> 367 <?php esc_html_e( 'Nginx does not enforce .htaccess or web.config rules, and index.html only conceals directory listings. Action is required by your server administrator to prevent direct HTTP downloads of backup files.', 'backupino' ); ?> 368 </p> 369 </div> 370 <?php endif; ?> 371 372 <!-- Permanent Informational Card for Web Server Protection & Nginx Guidance --> 373 <div class="backupino-card" style="margin-top: 18px; padding: 18px; border: 1px solid var(--backupino-border); border-radius: 10px; background: #fff;"> 374 <h3 style="margin: 0 0 10px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px;"> 375 <span class="dashicons dashicons-shield"></span> 376 <span><?php esc_html_e( 'Web Server Direct Access Protection & Nginx Guidance', 'backupino' ); ?></span> 377 </h3> 378 <p class="description" style="margin: 0 0 10px;"> 379 <?php esc_html_e( 'Backupino automatically creates .htaccess (for Apache/LiteSpeed) and web.config (for Microsoft IIS) files inside the storage directory to block direct HTTP requests. An index.html file is also placed to hide directory browsing, but it cannot prevent direct downloads if an attacker knows or guesses the file name.', 'backupino' ); ?> 380 </p> 381 <p class="description" style="margin: 0 0 12px;"> 382 <strong><?php esc_html_e( 'Nginx & Reverse Proxy Limitations:', 'backupino' ); ?></strong> 383 <?php esc_html_e( 'Nginx completely ignores .htaccess and web.config files. Because reverse proxies or front-end caches may sit in front of Apache or PHP-FPM, automated web server detection is best-effort and cannot be guaranteed in every architecture. Backupino cannot automatically modify or reload Nginx configuration files.', 'backupino' ); ?> 384 </p> 385 <div style="background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px; margin-bottom: 8px;"> 386 <h4 style="margin: 0 0 8px; font-size: 14px; font-weight: 600;"> 387 <?php esc_html_e( 'Server Administrator Nginx Configuration', 'backupino' ); ?> 388 </h4> 389 <p style="margin: 0 0 8px; font-size: 13px;"> 390 <?php esc_html_e( 'Direct HTTP access to backup package URLs is NOT guaranteed to be blocked on Nginx until your server administrator adds the deny rule below inside your Nginx server { } block and reloads Nginx. Merely viewing this rule in the admin panel does not activate it.', 'backupino' ); ?> 391 </p> 392 <?php 393 $backupino_nginx_info = $backupino_snapshot['nginx_storage_info'] ?? \Backupino\Core\Compatibility::nginx_storage_info( $paths ); 394 if ( 'exact' === $backupino_nginx_info['status'] && ! empty( $backupino_nginx_info['rule'] ) ) : 395 ?> 396 <p style="margin: 0 0 6px; font-size: 13px; font-weight: 600;"> 397 <?php esc_html_e( 'Add this directive inside your Nginx server { } block:', 'backupino' ); ?> 398 </p> 399 <pre class="code" style="margin: 0 0 8px; padding: 10px; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; overflow-x: auto; direction: ltr; text-align: left; font-size: 13px;"><?php echo esc_html( (string) $backupino_nginx_info['rule'] ); ?></pre> 400 <?php else : ?> 401 <div style="padding: 10px; background: #fff; border-left: 4px solid #f59e0b; border: 1px solid #cbd5e1; border-radius: 6px; margin: 0 0 8px;"> 402 <p style="margin: 0 0 6px; font-size: 13px; font-weight: 600; color: #b45309;"> 403 <?php esc_html_e( 'Manual Nginx Rule Configuration Required', 'backupino' ); ?> 404 </p> 405 <p class="description" style="margin: 0 0 6px;"> 406 <?php 407 if ( 'cdn' === ( $backupino_nginx_info['reason'] ?? '' ) ) { 408 esc_html_e( 'Your WordPress uploads directory uses an external CDN or separate domain. The exact public Nginx location cannot be determined automatically. Your server administrator must manually create an Nginx location block matching your origin server URL mapping.', 'backupino' ); 409 } else { 410 esc_html_e( 'The backup storage directory is located outside standard web root or uses a custom path mapping. Your server administrator must manually configure an Nginx rule denying direct access based on your web server configuration.', 'backupino' ); 411 } 412 ?> 413 </p> 414 <p class="description" style="margin: 0;"> 415 <?php 416 /* translators: %s: Filesystem path of the storage directory. */ 417 printf( esc_html__( 'Target filesystem path: %s', 'backupino' ), '<code>' . esc_html( $paths->packages() ) . '</code>' ); 418 ?> 419 </p> 420 </div> 421 <?php endif; ?> 422 <p class="description" style="margin: 0;"> 423 <?php esc_html_e( 'After adding the rule, test with `nginx -t` and reload Nginx. Authorized downloads through Backupino admin or the permanent download link continue to work normally through PHP.', 'backupino' ); ?> 424 </p> 425 </div> 346 426 </div> 347 427 </div> -
backupino/tags/1.1.0/uninstall.php
r3800274 r3809656 16 16 // phpcs:disable WordPress.WP.AlternativeFunctions.file_system_operations_chmod -- Recursive uninstall permissions handling. 17 17 18 /** 19 * Recursively remove a directory and all its contents. 20 * 21 * @param string $dir Target directory. 22 * @return void 23 */ 24 function backupino_remove_directory( string $dir ): void { 25 if ( ! is_dir( $dir ) ) { 26 return; 18 if ( ! function_exists( 'backupino_remove_directory' ) ) { 19 /** 20 * Recursively remove a directory and all its contents. 21 * 22 * Defensively handles symbolic links: if the target directory itself is a symlink, 23 * only the symlink is removed without traversing, altering permissions, or deleting 24 * the destination target. During traversal, symlinks (to files or directories) are 25 * identified before directory checks and unlinked directly without following them. 26 * 27 * @param string $dir Target directory. 28 * @return void 29 */ 30 function backupino_remove_directory( string $dir ): void { 31 $target = rtrim( $dir, '/\\' ); 32 if ( '' === $target ) { 33 return; 34 } 35 36 // 1. If the root target path is a symbolic link, remove only the link itself. 37 // Never traverse, chmod, or remove the destination directory. 38 if ( is_link( $target ) ) { 39 if ( ! @unlink( $target ) ) { // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 40 @rmdir( $target ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 41 } 42 return; 43 } 44 45 if ( ! is_dir( $target ) ) { 46 return; 47 } 48 49 // Ensure symlinks are never followed during traversal (SKIP_DOTS only, no FOLLOW_SYMLINKS). 50 $flags = FilesystemIterator::SKIP_DOTS; 51 52 try { 53 $dir_iterator = new RecursiveDirectoryIterator( $target, $flags ); 54 $items = new RecursiveIteratorIterator( $dir_iterator, RecursiveIteratorIterator::CHILD_FIRST ); 55 56 foreach ( $items as $item ) { 57 $path = $item->getPathname(); 58 59 // 2. Identify symlinks BEFORE checking if directory. 60 // If entry is a symlink (to a file or directory), unlink only the link itself. 61 if ( $item->isLink() || is_link( $path ) ) { 62 if ( ! @unlink( $path ) ) { // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 63 @rmdir( $path ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 64 } 65 continue; 66 } 67 68 if ( $item->isDir() ) { 69 @chmod( $path, 0777 ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 70 @rmdir( $path ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 71 } else { 72 @chmod( $path, 0777 ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 73 @unlink( $path ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 74 } 75 } 76 } catch ( UnexpectedValueException $e ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch 77 // Fail-safe if directory cannot be opened. 78 } 79 80 @chmod( $target, 0777 ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 81 @rmdir( $target ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 27 82 } 28 29 $items = new RecursiveIteratorIterator(30 new RecursiveDirectoryIterator( $dir, FilesystemIterator::SKIP_DOTS ),31 RecursiveIteratorIterator::CHILD_FIRST32 );33 34 foreach ( $items as $item ) {35 if ( $item->isDir() ) {36 @chmod( $item->getPathname(), 0777 ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged37 @rmdir( $item->getPathname() ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged38 } else {39 @chmod( $item->getPathname(), 0777 ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged40 @unlink( $item->getPathname() ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged41 }42 }43 44 @chmod( $dir, 0777 ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged45 @rmdir( $dir ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged46 83 } 47 84 48 /** 49 * Remove every trace of the plugin for the current site. 50 * 51 * @return void 52 */ 53 function backupino_uninstall_site(): void { 54 global $wpdb; 85 if ( ! function_exists( 'backupino_uninstall_site' ) ) { 86 /** 87 * Remove every trace of the plugin for the current site. 88 * 89 * @return void 90 */ 91 function backupino_uninstall_site(): void { 92 global $wpdb; 55 93 56 // Drop custom database tables57 // phpcs:ignore WordPress.DB.DirectDatabaseQuery58 $wpdb->query( 'DROP TABLE IF EXISTS `' . $wpdb->prefix . 'backupino_jobs`' );94 // Drop custom database tables 95 // phpcs:ignore WordPress.DB.DirectDatabaseQuery 96 $wpdb->query( 'DROP TABLE IF EXISTS `' . $wpdb->prefix . 'backupino_jobs`' ); 59 97 60 // Delete all stored options61 delete_option( 'backupino_settings' );62 delete_option( 'backupino_schema_version' );63 delete_option( 'backupino_schedule_state' );64 delete_option( 'backupino_installed_at' );65 delete_option( 'backupino_download_key' );66 delete_option( 'backupino_notify_queue' );67 delete_option( 'backupino_migration_notice' );98 // Delete all stored options 99 delete_option( 'backupino_settings' ); 100 delete_option( 'backupino_schema_version' ); 101 delete_option( 'backupino_schedule_state' ); 102 delete_option( 'backupino_installed_at' ); 103 delete_option( 'backupino_download_key' ); 104 delete_option( 'backupino_notify_queue' ); 105 delete_option( 'backupino_migration_notice' ); 68 106 69 // Clear scheduled cron events 70 wp_clear_scheduled_hook( 'backupino_run_jobs' ); 71 wp_clear_scheduled_hook( 'backupino_scheduled_backup' ); 107 // Clear scheduled cron events (current and legacy hooks) 108 $backupino_cron_hooks = array( 109 'backupino_run_jobs', 110 'backupino_scheduled_backup', 111 'backupino_cron_worker', 112 'backupino_cron_scheduler', 113 'backupino_cron_queue', 114 'backupino_cron_retention', 115 ); 116 foreach ( $backupino_cron_hooks as $backupino_hook ) { 117 wp_clear_scheduled_hook( $backupino_hook ); 118 } 72 119 73 // Remove storage directories in uploads and legacy wp-content/backupino74 $backupino_uploads = wp_upload_dir( null, false );75 if ( ! empty( $backupino_uploads['basedir'] ) ) {76 $backupino_primary_dir = rtrim( (string) $backupino_uploads['basedir'], '/' ) . '/backupino';77 backupino_remove_directory( $backupino_primary_dir );78 }120 // Remove storage directories in uploads and legacy wp-content/backupino 121 $backupino_uploads = wp_upload_dir( null, false ); 122 if ( ! empty( $backupino_uploads['basedir'] ) ) { 123 $backupino_primary_dir = rtrim( (string) $backupino_uploads['basedir'], '/' ) . '/backupino'; 124 backupino_remove_directory( $backupino_primary_dir ); 125 } 79 126 80 $backupino_content_dir = defined( 'WP_CONTENT_DIR' ) ? (string) WP_CONTENT_DIR : ( (string) ABSPATH . 'wp-content' ); 81 $backupino_legacy_dir = rtrim( $backupino_content_dir, '/' ) . '/backupino'; 82 if ( is_dir( $backupino_legacy_dir ) ) { 83 backupino_remove_directory( $backupino_legacy_dir ); 127 $backupino_content_dir = defined( 'WP_CONTENT_DIR' ) ? (string) WP_CONTENT_DIR : ( (string) ABSPATH . 'wp-content' ); 128 $backupino_legacy_dir = rtrim( $backupino_content_dir, '/' ) . '/backupino'; 129 if ( is_dir( $backupino_legacy_dir ) || is_link( $backupino_legacy_dir ) ) { 130 backupino_remove_directory( $backupino_legacy_dir ); 131 } 84 132 } 85 133 } 86 134 87 135 if ( is_multisite() ) { 88 $backupino_sites = get_sites( array( 'fields' => 'ids' ) ); 136 $backupino_sites = get_sites( 137 array( 138 'fields' => 'ids', 139 'number' => 0, 140 ) 141 ); 89 142 90 143 foreach ( $backupino_sites as $backupino_site_id ) { -
backupino/trunk/assets/css/installer.css
r3800274 r3809656 253 253 font-size: 12.5px; 254 254 } 255 .admin-box { 256 background: #f8fafc; 257 border: 1px solid var(--line); 258 border-radius: 8px; 259 padding: 12px 14px; 260 margin-top: 14px; 261 } 262 .pass-wrap { 263 position: relative; 264 display: flex; 265 align-items: center; 266 } 267 .pass-wrap input { 268 padding-inline-end: 65px; 269 } 270 .pass-toggle-btn { 271 position: absolute; 272 inset-inline-end: 6px; 273 top: 50%; 274 transform: translateY(-50%); 275 margin: 0; 276 padding: 4px 10px; 277 font-size: 11px; 278 background: #e2e8f0; 279 color: #334155; 280 border-radius: 4px; 281 border: 0; 282 cursor: pointer; 283 } 284 .pass-toggle-btn:hover { 285 background: #cbd5e1; 286 } -
backupino/trunk/assets/js/installer.js
r3800274 r3809656 37 37 open_admin: "Open wp-login.php →", 38 38 empty_db_lbl: "Empty existing database tables before import (Recommended)", 39 create_admin_opt: "Create a new WordPress Administrator account (Optional)", 40 admin_user_lbl: "Administrator Username", 41 admin_email_lbl: "Administrator Email", 42 admin_pass_lbl: "Administrator Password", 43 admin_created_title: "✓ New Administrator Account Created:", 44 show_btn: "Show", 45 hide_btn: "Hide", 39 46 ext_files: "Extracting files", 40 47 imp_db: "Importing database", … … 74 81 open_admin: "ورود مستقیم به wp-login.php ←", 75 82 empty_db_lbl: "پاکسازی و حذف جداول موجود در دیتابیس قبل از درونریزی (پیشنهادی)", 83 create_admin_opt: "ایجاد حساب کاربری مدیر کل جدید در وردپرس (اختیاری)", 84 admin_user_lbl: "نام کاربری مدیر", 85 admin_email_lbl: "ایمیل مدیر", 86 admin_pass_lbl: "رمز عبور مدیر", 87 admin_created_title: "✓ حساب کاربری مدیر کل جدید با موفقیت ایجاد شد:", 88 show_btn: "نمایش", 89 hide_btn: "مخفی", 76 90 ext_files: "در حال استخراج فایلها", 77 91 imp_db: "در حال درونریزی دیتابیس", … … 153 167 var title = document.getElementById("progress-title"); 154 168 var busy = false; 169 var completed = false; 170 var runHandle = ""; 171 172 function sendAbort(useBeacon) { 173 var token = getToken(); 174 if (!token) { return; } 175 var fields = { action: "abort", token: token }; 176 if (runHandle) { 177 fields.run_handle = runHandle; 178 } 179 var body = new URLSearchParams(fields); 180 runHandle = ""; 181 if (useBeacon && typeof navigator !== "undefined" && typeof navigator.sendBeacon === "function") { 182 try { 183 navigator.sendBeacon(window.location.pathname, body); 184 return; 185 } catch (e) {} 186 } 187 try { 188 fetch(window.location.pathname, { 189 method: "POST", 190 body: body, 191 credentials: "same-origin", 192 keepalive: true, 193 headers: { "Content-Type": "application/x-www-form-urlencoded" } 194 }).catch(function () {}); 195 } catch (e) {} 196 } 197 198 window.addEventListener("pagehide", function () { 199 if (busy && !completed) { 200 sendAbort(true); 201 } 202 }); 155 203 156 204 function api(action, data) { 157 var params = Object.assign({ action: action, token: getToken() }, data || {}); 205 var base = { action: action, token: getToken() }; 206 if (runHandle) { 207 base.run_handle = runHandle; 208 } 209 var params = Object.assign(base, data || {}); 158 210 var body = new URLSearchParams(params); 159 211 return fetch(window.location.pathname, { … … 187 239 188 240 function fail(message, field) { 189 var el = document.getElementById(field || "error3"); 241 var targetField = field || "error3"; 242 var el = document.getElementById(targetField); 190 243 if (el) { 191 244 el.textContent = message; … … 199 252 if (bar) { 200 253 bar.style.background = "#dc2626"; 254 } 255 if (targetField === "error3" && !completed) { 256 sendAbort(false); 201 257 } 202 258 busy = false; … … 278 334 prefix: getVal("prefix"), 279 335 new_url: getVal("new_url"), 280 empty_db: getChecked("empty_db") 336 empty_db: getChecked("empty_db"), 337 create_admin: getChecked("create_admin"), 338 admin_user: getVal("admin_user"), 339 admin_email: getVal("admin_email"), 340 admin_pass: getVal("admin_pass") 281 341 }; 282 342 … … 288 348 return; 289 349 } 350 if (res.run_handle) { 351 runHandle = String(res.run_handle); 352 } 353 var dbPassEl = document.getElementById("db_pass"); 354 if (dbPassEl) { dbPassEl.value = ""; } 355 var adminPassEl = document.getElementById("admin_pass"); 356 if (adminPassEl) { adminPassEl.value = ""; } 290 357 show("step3"); 291 358 updateStepNav(3); … … 305 372 api("config").then(function (final) { 306 373 if (!final.ok) { fail(final.error || "Configuration failed."); return; } 374 completed = true; 375 busy = false; 307 376 show("step4"); 308 377 var siteUrl = final.url || ""; … … 317 386 var doneUrlEl = document.getElementById("done-url"); 318 387 if (doneUrlEl) { doneUrlEl.textContent = siteUrl; } 319 }); 388 if (final.admin_created) { 389 var adminBox = document.getElementById("admin-created-box"); 390 var adminName = document.getElementById("admin-created-name"); 391 if (adminBox && adminName) { 392 adminName.textContent = final.admin_created; 393 adminBox.classList.remove("hidden"); 394 } 395 } 396 }).catch(function (err) { fail(String(err)); }); 320 397 }); 321 398 }); … … 334 411 api("cleanup").then(function (res) { 335 412 if (!res.ok) { fail(res.error || "Cleanup failed.", "error4"); btn.disabled = false; return; } 413 runHandle = ""; 336 414 btn.textContent = (I18N[currentLang] && I18N[currentLang].cleaned) ? I18N[currentLang].cleaned : "Installer files deleted."; 337 415 window.setTimeout(function () { … … 344 422 }); 345 423 } 424 var createAdminCb = document.getElementById("create_admin"); 425 var adminFields = document.getElementById("admin-fields"); 426 if (createAdminCb && adminFields) { 427 createAdminCb.addEventListener("change", function () { 428 if (createAdminCb.checked) { 429 adminFields.classList.remove("hidden"); 430 } else { 431 adminFields.classList.add("hidden"); 432 } 433 }); 434 } 435 436 var togglePassBtn = document.getElementById("toggle_admin_pass"); 437 var adminPassInput = document.getElementById("admin_pass"); 438 if (togglePassBtn && adminPassInput) { 439 togglePassBtn.addEventListener("click", function () { 440 if (adminPassInput.type === "password") { 441 adminPassInput.type = "text"; 442 togglePassBtn.textContent = (I18N[currentLang] && I18N[currentLang].hide_btn) ? I18N[currentLang].hide_btn : "Hide"; 443 } else { 444 adminPassInput.type = "password"; 445 togglePassBtn.textContent = (I18N[currentLang] && I18N[currentLang].show_btn) ? I18N[currentLang].show_btn : "Show"; 446 } 447 }); 448 } 346 449 })(); -
backupino/trunk/backupino.php
r3800363 r3809656 4 4 * Plugin URI: https://github.com/Backupino/documents 5 5 * Description: Fast, resumable WordPress backups, cloning and migration with a self-contained installer. 6 * Version: 1. 0.56 * Version: 1.1.0 7 7 * Requires at least: 6.0 8 8 * Requires PHP: 7.4 … … 19 19 defined( 'ABSPATH' ) || exit; 20 20 21 define( 'BACKUPINO_VERSION', '1. 0.5' );21 define( 'BACKUPINO_VERSION', '1.1.0' ); 22 22 define( 'BACKUPINO_FILE', __FILE__ ); 23 23 define( 'BACKUPINO_DIR', plugin_dir_path( __FILE__ ) ); -
backupino/trunk/languages/backupino.pot
r3800363 r3809656 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Backupino 1. 0.5\n"5 "Project-Id-Version: Backupino 1.1.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/backupino\n" 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"8 "Language-Team: LANGUAGE <LL@li.org>\n"7 "Last-Translator: Backupino Team <support@backupino.com>\n" 8 "Language-Team: English <support@backupino.com>\n" 9 9 "MIME-Version: 1.0\n" 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2026-11-1 3T12:22:16+00:00\n"12 "POT-Creation-Date: 2026-11-18T13:11:27+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2.12.0\n"14 "X-Generator: Backupino i18n build tool\n" 15 15 "X-Domain: backupino\n" 16 16 17 #. Plugin Name of the plugin 18 #. Author of the plugin 19 #: backupino.php 20 #: src/Admin/Admin.php:48 21 #: templates/dashboard.php:34 22 #: templates/settings.php:64 17 #: free/src/Backup/Stages/ScanStage.php:86 18 msgid "%1$s files found (%2$s)." 19 msgstr "" 20 21 #: free/src/Backup/Stages/DatabaseStage.php:99 22 msgid "%1$s rows from %2$s tables (%3$s)." 23 msgstr "" 24 25 #: free/backupino.php:1 26 msgid "%d message is waiting to be resent on the next scheduled run." 27 msgstr "" 28 29 #: free/src/Notify/Notifier.php:241 30 msgid "%s messenger is not enabled or not fully configured." 31 msgstr "" 32 33 #: free/templates/settings.php:681 34 msgid "100% privacy-compliant: zero tracking, zero telemetry, strictly optional notifications." 35 msgstr "" 36 37 #: free/backupino.php:1 38 msgid "A new version of Backupino is available (%s)." 39 msgstr "" 40 41 #: free/backupino.php:1 42 msgid "A valid administrator email address is required." 43 msgstr "" 44 45 #: free/backupino.php:1 46 msgid "API token provided by Telegram @BotFather or Bale Bot platform." 47 msgstr "" 48 49 #: free/templates/dashboard.php:305 50 msgid "Actions" 51 msgstr "" 52 53 #: free/templates/settings.php:199 54 msgid "Active" 55 msgstr "" 56 57 #: free/templates/settings.php:397 58 msgid "Add this directive inside your Nginx server { } block:" 59 msgstr "" 60 61 #: free/templates/settings.php:576 62 msgid "Admin Login URL" 63 msgstr "" 64 65 #: free/backupino.php:1 66 msgid "Administrator Email" 67 msgstr "" 68 69 #: free/backupino.php:1 70 msgid "Administrator Password" 71 msgstr "" 72 73 #: free/backupino.php:1 74 msgid "Administrator Username" 75 msgstr "" 76 77 #: free/backupino.php:1 78 msgid "Administrator password is required." 79 msgstr "" 80 81 #: free/backupino.php:1 82 msgid "Administrator username is required." 83 msgstr "" 84 85 #: free/templates/settings.php:423 86 msgid "After adding the rule, test with `nginx -t` and reload Nginx. Authorized downloads through Backupino admin or the permanent download link continue to work normally through PHP." 87 msgstr "" 88 89 #: free/backupino.php:1 90 msgid "Archive" 91 msgstr "" 92 93 #: free/templates/settings.php:20 94 #: free/templates/settings.php:289 95 msgid "Archive & Exclusions" 96 msgstr "" 97 98 #: free/src/Installer/Env.php:77 99 msgid "Archive checksum" 100 msgstr "" 101 102 #: free/src/Installer/Env.php:70 103 msgid "Archive file" 104 msgstr "" 105 106 #: free/src/Installer/Env.php:50 107 msgid "Archive support" 108 msgstr "" 109 110 #: free/src/Backup/Stages/FilesStage.php:40 111 msgid "Archiving files" 112 msgstr "" 113 114 #: free/templates/settings.php:609 115 msgid "Automatic recurring backups trigger via WordPress cron. In Persian locale, monthly schedules automatically align with the start of the Jalali month." 116 msgstr "" 117 118 #: free/templates/settings.php:540 119 #: free/templates/settings.php:572 120 msgid "Available tags:" 121 msgstr "" 122 123 #: free/backupino.php:1 124 msgid "Back to backups" 125 msgstr "" 126 127 #: free/templates/settings.php:543 128 msgid "Backup Contents" 129 msgstr "" 130 131 #: free/templates/settings.php:545 132 msgid "Backup Date" 133 msgstr "" 134 135 #: free/templates/dashboard.php:409 136 msgid "Backup Details & Log" 137 msgstr "" 138 139 #: free/src/Admin/Admin.php:116 140 msgid "Backup Job" 141 msgstr "" 142 143 #: free/templates/settings.php:526 144 msgid "Backup Message Template" 145 msgstr "" 146 147 #: free/templates/settings.php:544 148 msgid "Backup Size" 149 msgstr "" 150 151 #: free/templates/settings.php:209 152 msgid "Backup Storage Destination" 153 msgstr "" 154 155 #: free/backupino.php:1 156 msgid "Backup archives and standalone installers are stored locally in a secure, protected directory on your server." 157 msgstr "" 158 159 #: free/templates/settings.php:335 160 msgid "Backup archives are stored locally on your server and served to administrators through Backupino authenticated download endpoints." 161 msgstr "" 162 163 #: free/src/Admin/Admin.php:118 164 msgid "Backup cancelled." 165 msgstr "" 166 167 #: free/templates/dashboard.php:218 168 msgid "Backup in Progress" 169 msgstr "" 170 171 #: free/src/Admin/Admin.php:48 172 #: free/templates/dashboard.php:34 173 #: free/templates/settings.php:64 23 174 msgid "Backupino" 24 175 msgstr "" 25 176 26 #. Plugin URI of the plugin 27 #: backupino.php 28 msgid "https://github.com/Backupino/documents" 29 msgstr "" 30 31 #. Description of the plugin 32 #: backupino.php 33 msgid "Fast, resumable WordPress backups, cloning and migration with a self-contained installer." 34 msgstr "" 35 36 #. Author URI of the plugin 37 #: backupino.php 38 msgid "https://profiles.wordpress.org/backupino/" 39 msgstr "" 40 41 #: src/Admin/Admin.php:47 177 #: free/backupino.php:1 178 msgid "Backupino - Free WordPress Backup & Migration" 179 msgstr "" 180 181 #: free/src/Admin/Admin.php:47 42 182 msgid "Backupino - WordPress Backup & Migration" 43 183 msgstr "" 44 184 45 #: src/Admin/Admin.php:58 46 #: src/Admin/Admin.php:59 47 #: templates/dashboard.php:43 48 #: templates/settings.php:73 185 #: free/templates/dashboard.php:40 186 #: free/templates/settings.php:70 187 msgid "Backupino Navigation" 188 msgstr "" 189 190 #: free/backupino.php:1 191 msgid "Backupino Verified Package" 192 msgstr "" 193 194 #: free/templates/settings.php:379 195 msgid "Backupino automatically creates .htaccess (for Apache/LiteSpeed) and web.config (for Microsoft IIS) files inside the storage directory to block direct HTTP requests. An index.html file is also placed to hide directory browsing, but it cannot prevent direct downloads if an attacker knows or guesses the file name." 196 msgstr "" 197 198 #: free/backupino.php:1 199 msgid "Backupino can announce every finished backup, with the permanent download link, in Telegram or Bale. The bot belongs to you: create one with @BotFather, then paste its token and your chat id here." 200 msgstr "" 201 202 #: free/templates/settings.php:437 203 msgid "Backupino can announce every finished backup, with the permanent download link, in Telegram or Bale. You can enable either or both messengers simultaneously." 204 msgstr "" 205 206 #: free/templates/dashboard.php:63 207 msgid "Backupino cannot automatically alter or reload Nginx configuration. Direct HTTP access is not blocked until your server administrator applies the server rule." 208 msgstr "" 209 210 #: free/src/Plugin.php:190 211 msgid "Backupino cannot run on this server:" 212 msgstr "" 213 214 #: free/backupino.php:1 215 msgid "Backupino is up to date. You are running the latest version (%s)." 216 msgstr "" 217 218 #: free/templates/settings.php:359 219 msgid "Backupino places .htaccess (Apache/LiteSpeed), web.config (IIS), and index.html (hides directory listing only) in this directory. Nginx ignores .htaccess and web.config; direct HTTP access is NOT guaranteed to be blocked on Nginx until you add a server-level deny rule." 220 msgstr "" 221 222 #: free/src/Core/Compatibility.php:49 223 msgid "Backupino requires PHP %1$s or newer. This server runs PHP %2$s." 224 msgstr "" 225 226 #: free/backupino.php:1 227 msgid "Backupino settings" 228 msgstr "" 229 230 #: free/src/Admin/Admin.php:185 231 msgid "Backupino — Site Migration Completed!" 232 msgstr "" 233 234 #: free/backupino.php:1 235 msgid "Backupino — backup finished: %s" 236 msgstr "" 237 238 #: free/backupino.php:1 239 msgid "Backupino — test message from %s" 240 msgstr "" 241 242 #: free/src/Core/Activator.php:45 243 #: free/src/Cron/Scheduler.php:62 244 msgid "Backupino: every minute" 245 msgstr "" 246 247 #: free/src/Admin/Admin.php:58 248 #: free/src/Admin/Admin.php:59 249 #: free/templates/dashboard.php:43 250 #: free/templates/settings.php:73 49 251 msgid "Backups" 50 252 msgstr "" 51 253 52 #: src/Admin/Admin.php:67 53 #: src/Admin/Admin.php:68 54 #: src/Admin/Admin.php:160 55 #: templates/dashboard.php:47 56 #: templates/settings.php:77 254 #: free/src/Notify/ChannelFactory.php:37 255 msgid "Bale" 256 msgstr "" 257 258 #: free/templates/settings.php:496 259 msgid "Bale Bot Token" 260 msgstr "" 261 262 #: free/templates/settings.php:505 263 msgid "Bale Chat ID" 264 msgstr "" 265 266 #: free/templates/settings.php:486 267 msgid "Bale Notification" 268 msgstr "" 269 270 #: free/templates/settings.php:506 271 msgid "Bale numeric chat or channel ID." 272 msgstr "" 273 274 #: free/templates/settings.php:319 275 msgid "Batch size for slicing file packing per tick. Default 1000 files ensures fast backup on modern systems." 276 msgstr "" 277 278 #: free/backupino.php:1 279 msgid "Batch size for slicing file packing per tick. Default 250 files is balanced for shared hosting." 280 msgstr "" 281 282 #: free/templates/dashboard.php:195 283 msgid "Before updating plugins" 284 msgstr "" 285 286 #: free/templates/settings.php:28 287 #: free/templates/settings.php:434 288 msgid "Bot Notifications" 289 msgstr "" 290 291 #: free/backupino.php:1 292 msgid "Bot token" 293 msgstr "" 294 295 #: free/templates/settings.php:497 296 msgid "Bot token obtained from Bale @BotFather." 297 msgstr "" 298 299 #: free/templates/settings.php:456 300 msgid "Bot token obtained from Telegram @BotFather." 301 msgstr "" 302 303 #: free/templates/dashboard.php:224 304 msgid "Cancel" 305 msgstr "" 306 307 #: free/templates/dashboard.php:222 308 msgid "Cancel backup job" 309 msgstr "" 310 311 #: free/src/Admin/Admin.php:117 312 msgid "Cancel the current backup job?" 313 msgstr "" 314 315 #: free/src/Jobs/JobStatus.php:62 316 msgid "Cancelled" 317 msgstr "" 318 319 #: free/src/Jobs/JobRunner.php:308 320 msgid "Cancelled by the user." 321 msgstr "" 322 323 #: free/templates/dashboard.php:233 324 msgid "Cataloging" 325 msgstr "" 326 327 #: free/backupino.php:1 328 msgid "Chat id" 329 msgstr "" 330 331 #: free/backupino.php:1 332 msgid "Check GitHub releases for the latest version and updates." 333 msgstr "" 334 335 #: free/backupino.php:1 336 msgid "Check for updates" 337 msgstr "" 338 339 #: free/backupino.php:1 340 msgid "Checking for updates…" 341 msgstr "" 342 343 #: free/templates/dashboard.php:335 344 msgid "Click to view log and details" 345 msgstr "" 346 347 #: free/templates/dashboard.php:411 348 #: free/templates/dashboard.php:459 349 msgid "Close" 350 msgstr "" 351 352 #: free/templates/settings.php:156 353 msgid "Compatible" 354 msgstr "" 355 356 #: free/src/Jobs/JobStatus.php:58 357 msgid "Completed" 358 msgstr "" 359 360 #: free/templates/settings.php:649 361 msgid "Configure preset credentials for the standalone migration installer generated with each backup." 362 msgstr "" 363 364 #: free/templates/settings.php:292 365 msgid "Configure which files, folders, or sizes should be skipped during backup creation to save disk space and maximize speed." 366 msgstr "" 367 368 #: free/backupino.php:1 369 msgid "Contents: %s" 370 msgstr "" 371 372 #: free/templates/dashboard.php:99 373 msgid "Copy link" 374 msgstr "" 375 376 #: free/src/Backup/Stages/DatabaseStage.php:40 377 msgid "Copying the database" 378 msgstr "" 379 380 #: free/src/Backup/ZipArchiveWriter.php:109 381 msgid "Could not add file to archive: %s" 382 msgstr "" 383 384 #: free/backupino.php:1 385 msgid "Could not check for updates. Please try again later." 386 msgstr "" 387 388 #: free/src/Admin/RestController.php:237 389 msgid "Could not create backup job in database." 390 msgstr "" 391 392 #: free/src/Backup/ZipArchiveWriter.php:73 393 msgid "Could not open the archive (error %d)." 394 msgstr "" 395 396 #: free/src/Storage/LocalStorage.php:97 397 msgid "Could not read the package file." 398 msgstr "" 399 400 #: free/src/Storage/LocalStorage.php:104 401 msgid "Could not write the package file." 402 msgstr "" 403 404 #: free/templates/dashboard.php:165 405 msgid "Create a backup" 406 msgstr "" 407 408 #: free/backupino.php:1 409 msgid "Create a new WordPress Administrator account (Optional)" 410 msgstr "" 411 412 #: free/templates/dashboard.php:201 413 msgid "Create backup" 414 msgstr "" 415 416 #: free/templates/dashboard.php:300 417 msgid "Created" 418 msgstr "" 419 420 #: free/src/Download/PublicDownload.php:289 421 msgid "Created Date" 422 msgstr "" 423 424 #: free/templates/settings.php:691 425 msgid "Current Version:" 426 msgstr "" 427 428 #: free/templates/dashboard.php:237 429 msgid "Database" 430 msgstr "" 431 432 #: free/templates/settings.php:189 433 msgid "Database Driver" 434 msgstr "" 435 436 #: free/src/Backup/Stages/DatabaseStage.php:61 437 msgid "Database dump disabled." 438 msgstr "" 439 440 #: free/templates/dashboard.php:424 441 msgid "Date" 442 msgstr "" 443 444 #: free/backupino.php:1 445 msgid "Date: %s" 446 msgstr "" 447 448 #: free/templates/settings.php:663 449 msgid "Default new URL (optional)" 450 msgstr "" 451 452 #: free/templates/dashboard.php:390 453 msgid "Delete" 454 msgstr "" 455 456 #: free/backupino.php:1 457 msgid "Delete backup" 458 msgstr "" 459 460 #: free/templates/dashboard.php:389 461 msgid "Delete backup package" 462 msgstr "" 463 464 #: free/src/Admin/Admin.php:112 465 msgid "Delete this package permanently?" 466 msgstr "" 467 468 #: free/backupino.php:1 469 msgid "Description of the plugin" 470 msgstr "" 471 472 #: free/templates/dashboard.php:115 473 msgid "Destination" 474 msgstr "" 475 476 #: free/backupino.php:1 477 msgid "Diagnostic information about active server extensions and write permissions." 478 msgstr "" 479 480 #: free/templates/settings.php:390 481 msgid "Direct HTTP access to backup package URLs is NOT guaranteed to be blocked on Nginx until your server administrator adds the deny rule below inside your Nginx server { } block and reloads Nginx. Merely viewing this rule in the admin panel does not activate it." 482 msgstr "" 483 484 #: free/templates/dashboard.php:89 485 msgid "Direct link that always serves the newest completed backup. Requires administrator login before download." 486 msgstr "" 487 488 #: free/backupino.php:1 489 msgid "Disabled" 490 msgstr "" 491 492 #: free/backupino.php:1 493 msgid "Download" 494 msgstr "" 495 496 #: free/backupino.php:1 497 msgid "Download (sign in as an administrator):" 498 msgstr "" 499 500 #: free/templates/dashboard.php:367 501 msgid "Download Archive" 502 msgstr "" 503 504 #: free/templates/dashboard.php:366 505 #: free/templates/dashboard.php:440 506 msgid "Download Archive (.zip)" 507 msgstr "" 508 509 #: free/src/Download/PublicDownload.php:297 510 msgid "Download Archive + Installer (Both)" 511 msgstr "" 512 513 #: free/templates/dashboard.php:382 514 msgid "Download Archive and Installer simultaneously" 515 msgstr "" 516 517 #: free/src/Download/PublicDownload.php:301 518 msgid "Download Backup Archive (.zip)" 519 msgstr "" 520 521 #: free/src/Download/PublicDownload.php:267 522 #: free/src/Download/PublicDownload.php:276 523 msgid "Download Backup Package" 524 msgstr "" 525 526 #: free/templates/dashboard.php:383 527 msgid "Download Both" 528 msgstr "" 529 530 #: free/templates/dashboard.php:374 531 msgid "Download Installer" 532 msgstr "" 533 534 #: free/templates/dashboard.php:443 535 msgid "Download Installer (.php)" 536 msgstr "" 537 538 #: free/src/Download/PublicDownload.php:305 539 #: free/templates/dashboard.php:373 540 msgid "Download Installer (installer.php)" 541 msgstr "" 542 543 #: free/templates/settings.php:546 544 msgid "Download Link" 545 msgstr "" 546 547 #: free/backupino.php:1 548 msgid "Download ZIP" 549 msgstr "" 550 551 #: free/templates/dashboard.php:186 552 msgid "Dumps all WordPress database tables into pure standard SQL without relying on mysqldump." 553 msgstr "" 554 555 #: free/templates/dashboard.php:153 556 msgid "Each backup includes installer.php alongside the archive zip. You can copy both files to an empty domain or localhost and run installer.php in your browser to restore the entire website in 3 steps without pre-installing WordPress." 557 msgstr "" 558 559 #: free/templates/settings.php:490 560 msgid "Enable Bale" 561 msgstr "" 562 563 #: free/templates/settings.php:449 564 msgid "Enable Telegram" 565 msgstr "" 566 567 #: free/templates/settings.php:181 568 msgid "Enabled" 569 msgstr "" 570 571 #: free/templates/settings.php:615 572 msgid "Enables recurring background backup jobs using WordPress built-in WP-Cron scheduler." 573 msgstr "" 574 575 #: free/templates/settings.php:201 576 msgid "Encrypted" 577 msgstr "" 578 579 #: free/templates/settings.php:111 580 msgid "Environment" 581 msgstr "" 582 583 #: free/templates/dashboard.php:169 584 msgid "Everything is packed into one archive plus a standalone installer that rebuilds the site on any empty server." 585 msgstr "" 586 587 #: free/templates/settings.php:302 588 msgid "Examples: wp-content/uploads/2022/, *.mp4, node_modules/. Cache and backup folders are always skipped automatically." 589 msgstr "" 590 591 #: free/backupino.php:1 592 msgid "Examples: wp-content/uploads/2022/, *.mp4, node_modules/. Cache and backup folders are always skipped." 593 msgstr "" 594 595 #: free/templates/settings.php:297 596 msgid "Excluded paths and patterns (one per line)" 597 msgstr "" 598 599 #: free/src/Storage/LocalStorage.php:75 600 msgid "Executable files cannot be stored in backup storage." 601 msgstr "" 602 603 #: free/templates/dashboard.php:450 604 msgid "Execution Log" 605 msgstr "" 606 607 #: free/templates/settings.php:171 608 msgid "Execution Timeout" 609 msgstr "" 610 611 #: free/src/Jobs/JobStatus.php:60 612 msgid "Failed" 613 msgstr "" 614 615 #: free/src/Download/PublicDownload.php:285 616 msgid "File Size" 617 msgstr "" 618 619 #: free/src/Backup/Stages/FilesStage.php:77 620 msgid "File archiving disabled." 621 msgstr "" 622 623 #: free/src/Backup/ZipArchiveWriter.php:99 624 msgid "File is not readable: %s" 625 msgstr "" 626 627 #: free/templates/dashboard.php:241 628 msgid "Files" 629 msgstr "" 630 631 #: free/templates/settings.php:310 632 msgid "Files exceeding this size threshold will be skipped to keep backups fast and reliable. Enter 0 for no limit." 633 msgstr "" 634 635 #: free/templates/settings.php:318 636 msgid "Files packed per request" 637 msgstr "" 638 639 #: free/src/Backup/Stages/FinalizeStage.php:43 640 msgid "Finalizing the package" 641 msgstr "" 642 643 #: free/templates/settings.php:298 644 msgid "Folders or file patterns that will be excluded from the backup archive (e.g. wp-content/cache/, *.mp4)." 645 msgstr "" 646 647 #: free/backupino.php:1 648 msgid "Free" 649 msgstr "" 650 651 #: free/src/Installer/Env.php:90 652 msgid "Free disk space" 653 msgstr "" 654 655 #: free/templates/settings.php:621 656 msgid "Frequency" 657 msgstr "" 658 659 #: free/templates/settings.php:549 660 #: free/templates/settings.php:580 661 msgid "HTML formatting tags such as <b>bold</b> and <a href=\"...\">links</a> are supported." 662 msgstr "" 663 664 #: free/backupino.php:1 665 msgid "Hide" 666 msgstr "" 667 668 #: free/src/Download/PublicDownload.php:310 669 msgid "How to restore or migrate:" 670 msgstr "" 671 672 #: free/backupino.php:1 673 msgid "In Free edition, monthly execution triggers on the 1st of each Persian/Gregorian month based on site language." 674 msgstr "" 675 676 #: free/templates/settings.php:199 677 msgid "Inactive" 678 msgstr "" 679 680 #: free/templates/dashboard.php:185 681 msgid "Include database" 682 msgstr "" 683 684 #: free/templates/dashboard.php:180 685 msgid "Include files" 686 msgstr "" 687 688 #: free/templates/dashboard.php:181 689 msgid "Includes WordPress core files, active themes, plugins, and uploads media library." 690 msgstr "" 691 692 #: free/templates/dashboard.php:262 693 msgid "Initializing backup job…" 694 msgstr "" 695 696 #: free/templates/dashboard.php:245 697 msgid "Installer" 698 msgstr "" 699 700 #: free/src/Download/PublicDownload.php:140 701 msgid "Installer file not found." 702 msgstr "" 703 704 #: free/templates/settings.php:655 705 msgid "Installer password (optional)" 706 msgstr "" 707 708 #: free/src/Admin/DownloadHandler.php:56 709 msgid "Invalid file name." 710 msgstr "" 711 712 #: free/backupino.php:1 713 msgid "Isolated, protected path used to safely store archive files away from public access:" 714 msgstr "" 715 716 #: free/templates/dashboard.php:173 717 msgid "JavaScript is required to build backups." 718 msgstr "" 719 720 #: free/templates/settings.php:633 721 msgid "Keep at most (backups)" 722 msgstr "" 723 724 #: free/templates/dashboard.php:192 725 msgid "Label (optional)" 726 msgstr "" 727 728 #: free/src/Admin/Admin.php:114 729 msgid "Link copied to the clipboard." 730 msgstr "" 731 732 #: free/templates/dashboard.php:274 733 msgid "Live Activity Feed" 734 msgstr "" 735 736 #: free/templates/settings.php:145 737 msgid "Live diagnostic health report of active server extensions, filesystem permissions, and system stability." 738 msgstr "" 739 740 #: free/templates/dashboard.php:453 741 msgid "Loading logs…" 742 msgstr "" 743 744 #: free/backupino.php:1 745 msgid "Loading…" 746 msgstr "" 747 748 #: free/templates/settings.php:212 749 msgid "Local directory used to store backup archives. Guarded with .htaccess (Apache/LiteSpeed), web.config (IIS), and index.html (directory listing). On Nginx, direct HTTP access is NOT guaranteed to be blocked until a server-level deny rule is configured." 750 msgstr "" 751 752 #: free/backupino.php:1 753 msgid "Local folder: %s" 754 msgstr "" 755 756 #: free/templates/settings.php:403 757 msgid "Manual Nginx Rule Configuration Required" 758 msgstr "" 759 760 #: free/templates/settings.php:634 761 msgid "Maximum number of recent backups to keep on disk. Older packages are automatically pruned to save space." 762 msgstr "" 763 764 #: free/templates/dashboard.php:123 765 #: free/templates/settings.php:120 766 #: free/templates/settings.php:162 767 msgid "Memory Limit" 768 msgstr "" 769 770 #: free/templates/dashboard.php:428 771 msgid "Message" 772 msgstr "" 773 774 #: free/templates/settings.php:529 775 msgid "Message template sent to messengers when a backup finishes." 776 msgstr "" 777 778 #: free/templates/settings.php:561 779 msgid "Message template sent to messengers when the site is restored using the installer." 780 msgstr "" 781 782 #: free/backupino.php:1 783 msgid "Messenger" 784 msgstr "" 785 786 #: free/backupino.php:1 787 msgid "Messenger Platform" 788 msgstr "" 789 790 #: free/templates/settings.php:626 791 msgid "Monthly (first day of the month)" 792 msgstr "" 793 794 #: free/templates/settings.php:622 795 msgid "Monthly execution triggers on the 1st of each Persian/Gregorian month based on site language." 796 msgstr "" 797 798 #: free/src/Installer/Env.php:56 799 msgid "MySQL driver" 800 msgstr "" 801 802 #: free/src/Core/Compatibility.php:66 803 msgid "Neither the Zip extension nor PclZip is available, so archives cannot be created." 804 msgstr "" 805 806 #: free/backupino.php:1 807 msgid "New Administrator Account Created:" 808 msgstr "" 809 810 #: free/templates/settings.php:575 811 msgid "New Site URL" 812 msgstr "" 813 814 #: free/templates/settings.php:382 815 msgid "Nginx & Reverse Proxy Limitations:" 816 msgstr "" 817 818 #: free/templates/dashboard.php:62 819 msgid "Nginx Server Configuration Note:" 820 msgstr "" 821 822 #: free/templates/settings.php:366 823 msgid "Nginx Server Detected — Action Required to Block Direct Access:" 824 msgstr "" 825 826 #: free/templates/settings.php:383 827 msgid "Nginx completely ignores .htaccess and web.config files. Because reverse proxies or front-end caches may sit in front of Apache or PHP-FPM, automated web server detection is best-effort and cannot be guaranteed in every architecture. Backupino cannot automatically modify or reload Nginx configuration files." 828 msgstr "" 829 830 #: free/templates/settings.php:225 831 msgid "Nginx detected — manual server configuration required:" 832 msgstr "" 833 834 #: free/templates/settings.php:367 835 msgid "Nginx does not enforce .htaccess or web.config rules, and index.html only conceals directory listings. Action is required by your server administrator to prevent direct HTTP downloads of backup files." 836 msgstr "" 837 838 #: free/templates/settings.php:226 839 msgid "Nginx ignores .htaccess and web.config. Backupino cannot automatically alter or reload Nginx configuration. Direct HTTP downloads of package URLs are not guaranteed to be blocked until your server administrator adds the rule below inside your Nginx server { } block and reloads Nginx." 840 msgstr "" 841 842 #: free/src/Core/Compatibility.php:108 843 msgid "Nginx web server detected: Nginx ignores .htaccess and web.config files, and index.html only hides directory listing. Direct HTTP access to backup files is NOT guaranteed to be blocked until your server administrator adds the server-level Nginx deny rule in Backupino -> Settings -> Storage Destination and reloads Nginx. Backupino cannot automatically alter or reload Nginx configuration." 844 msgstr "" 845 846 #: free/templates/dashboard.php:312 847 msgid "No backups yet." 848 msgstr "" 849 850 #: free/src/Notify/Notifier.php:251 851 msgid "No messenger is configured." 852 msgstr "" 853 854 #: free/templates/settings.php:266 855 msgid "No recent log entries found." 856 msgstr "" 857 858 #: free/src/Installer/Env.php:92 859 msgid "Not restricted / host managed" 860 msgstr "" 861 862 #: free/backupino.php:1 863 msgid "Notifications" 864 msgstr "" 865 866 #: free/backupino.php:1 867 msgid "Notifications are working. Backups will be announced here." 868 msgstr "" 869 870 #: free/backupino.php:1 871 msgid "Numeric chat or channel ID where notifications should be posted." 872 msgstr "" 873 874 #: free/templates/settings.php:165 875 #: free/templates/settings.php:174 876 msgid "OK" 877 msgstr "" 878 879 #: free/src/Cron/Scheduler.php:69 880 msgid "Once monthly (first day of the month)" 881 msgstr "" 882 883 #: free/backupino.php:1 884 msgid "Once weekly" 885 msgstr "" 886 887 #: free/src/Download/PublicDownload.php:313 888 msgid "Open installer.php in your web browser and follow the on-screen steps." 889 msgstr "" 890 891 #: free/templates/settings.php:198 892 msgid "OpenSSL" 893 msgstr "" 894 895 #: free/src/Core/Compatibility.php:100 896 msgid "OpenSSL extension is missing: secure HTTPS communications will be unavailable." 897 msgstr "" 898 899 #: free/backupino.php:1 900 msgid "OpenSSL is missing: S3 uploads that require HTTPS signatures and encrypted packages will be unavailable." 901 msgstr "" 902 903 #: free/templates/dashboard.php:193 904 msgid "Optional note to identify why this backup was created (e.g. before updating WooCommerce)." 905 msgstr "" 906 907 #: free/templates/dashboard.php:119 908 #: free/templates/settings.php:116 909 #: free/templates/settings.php:153 910 msgid "PHP Version" 911 msgstr "" 912 913 #: free/src/Installer/Env.php:40 914 msgid "PHP extension: %s" 915 msgstr "" 916 917 #: free/src/Core/Compatibility.php:84 918 msgid "PHP memory limit is %s. Backups will run in small chunks, but 128M or more is recommended." 919 msgstr "" 920 921 #: free/src/Installer/Env.php:33 922 msgid "PHP version" 923 msgstr "" 924 925 #: free/templates/dashboard.php:435 926 msgid "Package" 927 msgstr "" 928 929 #: free/src/Backup/Stages/FinalizeStage.php:130 930 msgid "Package %1$s is ready (%2$s)." 931 msgstr "" 932 933 #: free/src/Download/PublicDownload.php:281 934 msgid "Package Name" 935 msgstr "" 936 937 #: free/templates/dashboard.php:303 938 msgid "Package name" 939 msgstr "" 940 941 #: free/src/Storage/LocalStorage.php:119 942 msgid "Package not found." 943 msgstr "" 944 945 #: free/backupino.php:1 946 msgid "Packages are stored on: %s" 947 msgstr "" 948 949 #: free/templates/dashboard.php:249 950 msgid "Packaging" 951 msgstr "" 952 953 #: free/src/Backup/Stages/FilesStage.php:155 954 msgid "Packed %1$s of %2$s files (%3$s skipped, %4$s)." 955 msgstr "" 956 957 #: free/templates/settings.php:656 958 msgid "Password protecting installer.php when accessed via browser during migration or restoration." 959 msgstr "" 960 961 #: free/templates/settings.php:181 962 msgid "PclZip fallback" 963 msgstr "" 964 965 #: free/templates/dashboard.php:88 966 msgid "Permanent download link" 967 msgstr "" 968 969 #: free/backupino.php:1 970 msgid "Plugin Name of the plugin" 971 msgstr "" 972 973 #: free/templates/settings.php:692 974 msgid "Plugin updates are delivered securely through the official WordPress repository." 975 msgstr "" 976 977 #: free/templates/settings.php:664 978 msgid "Preset target URL for search & replace when migrating to a known new domain." 979 msgstr "" 980 981 #: free/templates/settings.php:340 982 msgid "Primary Destination Driver" 983 msgstr "" 984 985 #: free/templates/settings.php:341 986 msgid "Primary storage destination for completed packages." 987 msgstr "" 988 989 #: free/backupino.php:1 990 msgid "Primary storage destination for completed packages. In the Free edition, local protected storage is used." 991 msgstr "" 992 993 #: free/templates/dashboard.php:302 994 #: free/templates/dashboard.php:420 995 msgid "Progress" 996 msgstr "" 997 998 #: free/templates/settings.php:126 999 msgid "Protected" 1000 msgstr "" 1001 1002 #: free/backupino.php:1 1003 msgid "Protected Directory Path" 1004 msgstr "" 1005 1006 #: free/src/Jobs/JobStatus.php:54 1007 msgid "Queued" 1008 msgstr "" 1009 1010 #: free/backupino.php:1 1011 msgid "Quick Navigation" 1012 msgstr "" 1013 1014 #: free/templates/dashboard.php:275 1015 msgid "RUNNING" 1016 msgstr "" 1017 1018 #: free/templates/settings.php:183 1019 msgid "Ready" 1020 msgstr "" 1021 1022 #: free/templates/dashboard.php:278 1023 msgid "Ready to start backup..." 1024 msgstr "" 1025 1026 #: free/templates/settings.php:680 1027 msgid "Receive critical security notices, product updates, and roadmap announcements (opt-in)." 1028 msgstr "" 1029 1030 #: free/templates/dashboard.php:294 1031 msgid "Recent backups" 1032 msgstr "" 1033 1034 #: free/templates/settings.php:32 1035 #: free/templates/settings.php:606 1036 msgid "Recurring Schedule" 1037 msgstr "" 1038 1039 #: free/templates/settings.php:248 1040 msgid "Refresh" 1041 msgstr "" 1042 1043 #: free/templates/dashboard.php:67 1044 msgid "Required Nginx server configuration (add inside your server { } block and reload Nginx):" 1045 msgstr "" 1046 1047 #: free/templates/settings.php:577 1048 msgid "Restoration Date" 1049 msgstr "" 1050 1051 #: free/templates/settings.php:558 1052 msgid "Restoration Message Template" 1053 msgstr "" 1054 1055 #: free/templates/settings.php:218 1056 msgid "Run Storage Write Test" 1057 msgstr "" 1058 1059 #: free/templates/settings.php:614 1060 msgid "Run automatic backups" 1061 msgstr "" 1062 1063 #: free/src/Jobs/JobStatus.php:56 1064 msgid "Running" 1065 msgstr "" 1066 1067 #: free/templates/settings.php:703 1068 msgid "Save settings" 1069 msgstr "" 1070 1071 #: free/src/Backup/Stages/ScanStage.php:39 1072 msgid "Scanning files" 1073 msgstr "" 1074 1075 #: free/backupino.php:1 1076 msgid "Schedule" 1077 msgstr "" 1078 1079 #: free/src/Cron/Scheduler.php:115 1080 msgid "Scheduled backup" 1081 msgstr "" 1082 1083 #: free/src/Backup/Stages/FinalizeStage.php:78 1084 msgid "Sealing the archive…" 1085 msgstr "" 1086 1087 #: free/backupino.php:1 1088 msgid "Select which messaging platform to send backup completion or failure alerts to." 1089 msgstr "" 1090 1091 #: free/backupino.php:1 1092 msgid "Send test message" 1093 msgstr "" 1094 1095 #: free/templates/settings.php:387 1096 msgid "Server Administrator Nginx Configuration" 1097 msgstr "" 1098 1099 #: free/src/Admin/Admin.php:67 1100 #: free/src/Admin/Admin.php:68 1101 #: free/src/Admin/Admin.php:160 1102 #: free/templates/dashboard.php:47 1103 #: free/templates/settings.php:77 57 1104 msgid "Settings" 58 1105 msgstr "" 59 1106 60 #: src/Admin/Admin.php:109 1107 #: free/templates/settings.php:90 1108 msgid "Settings Navigation" 1109 msgstr "" 1110 1111 #: free/src/Admin/Admin.php:113 1112 msgid "Settings saved." 1113 msgstr "" 1114 1115 #: free/backupino.php:1 1116 msgid "Show" 1117 msgstr "" 1118 1119 #: free/templates/settings.php:542 1120 #: free/templates/settings.php:574 1121 msgid "Site Name" 1122 msgstr "" 1123 1124 #: free/templates/dashboard.php:304 1125 #: free/templates/dashboard.php:436 1126 msgid "Size" 1127 msgstr "" 1128 1129 #: free/backupino.php:1 1130 msgid "Size: %s" 1131 msgstr "" 1132 1133 #: free/templates/settings.php:309 1134 msgid "Skip files larger than (MB, 0 = no limit)" 1135 msgstr "" 1136 1137 #: free/src/Installer/Extractor.php:136 1138 msgid "Skipped unsafe entry: %s" 1139 msgstr "" 1140 1141 #: free/templates/settings.php:36 1142 #: free/templates/settings.php:646 1143 msgid "Standalone Installer" 1144 msgstr "" 1145 1146 #: free/templates/dashboard.php:149 1147 msgid "Standalone Restore" 1148 msgstr "" 1149 1150 #: free/src/Admin/Admin.php:109 61 1151 msgid "Starting…" 62 1152 msgstr "" 63 1153 64 #: src/Admin/Admin.php:110 1154 #: free/templates/dashboard.php:301 1155 #: free/templates/dashboard.php:416 1156 msgid "Status" 1157 msgstr "" 1158 1159 #: free/backupino.php:1 1160 msgid "Storage" 1161 msgstr "" 1162 1163 #: free/templates/dashboard.php:110 1164 msgid "Storage & Environment" 1165 msgstr "" 1166 1167 #: free/templates/settings.php:24 1168 #: free/templates/settings.php:332 1169 msgid "Storage Destination" 1170 msgstr "" 1171 1172 #: free/templates/settings.php:355 1173 msgid "Storage Directory Path" 1174 msgstr "" 1175 1176 #: free/templates/settings.php:124 1177 msgid "Storage Status" 1178 msgstr "" 1179 1180 #: free/templates/dashboard.php:133 1181 msgid "Storage folder:" 1182 msgstr "" 1183 1184 #: free/src/Admin/RestController.php:455 1185 msgid "Storage is writable." 1186 msgstr "" 1187 1188 #: free/templates/settings.php:192 1189 msgid "Streaming" 1190 msgstr "" 1191 1192 #: free/templates/settings.php:244 1193 msgid "System & Activity Log Stream" 1194 msgstr "" 1195 1196 #: free/templates/settings.php:258 1197 msgid "System Activity Log (Last 100 entries)" 1198 msgstr "" 1199 1200 #: free/templates/settings.php:40 1201 msgid "System Status" 1202 msgstr "" 1203 1204 #: free/templates/settings.php:141 1205 msgid "System Status & Diagnostics" 1206 msgstr "" 1207 1208 #: free/backupino.php:1 1209 msgid "System status" 1210 msgstr "" 1211 1212 #: free/templates/settings.php:417 1213 msgid "Target filesystem path: %s" 1214 msgstr "" 1215 1216 #: free/src/Notify/ChannelFactory.php:36 1217 msgid "Telegram" 1218 msgstr "" 1219 1220 #: free/templates/settings.php:455 1221 msgid "Telegram Bot Token" 1222 msgstr "" 1223 1224 #: free/templates/settings.php:464 1225 msgid "Telegram Chat ID" 1226 msgstr "" 1227 1228 #: free/templates/settings.php:445 1229 msgid "Telegram Notification" 1230 msgstr "" 1231 1232 #: free/templates/settings.php:465 1233 msgid "Telegram numeric chat or channel ID." 1234 msgstr "" 1235 1236 #: free/templates/settings.php:516 1237 msgid "Test Bale" 1238 msgstr "" 1239 1240 #: free/templates/settings.php:475 1241 msgid "Test Telegram" 1242 msgstr "" 1243 1244 #: free/src/Admin/Admin.php:115 1245 msgid "Test message sent." 1246 msgstr "" 1247 1248 #: free/templates/dashboard.php:139 1249 msgid "Test storage" 1250 msgstr "" 1251 1252 #: free/src/Core/Compatibility.php:59 1253 msgid "The PHP extension \"%s\" is required but not loaded." 1254 msgstr "" 1255 1256 #: free/src/Backup/Stages/DatabaseStage.php:77 1257 msgid "The SQL dump file could not be opened." 1258 msgstr "" 1259 1260 #: free/src/Installer/Extractor.php:74 1261 msgid "The Zip extension is not available on this server." 1262 msgstr "" 1263 1264 #: free/src/Backup/ZipArchiveWriter.php:60 1265 msgid "The Zip extension is not available." 1266 msgstr "" 1267 1268 #: free/src/Installer/Extractor.php:88 1269 msgid "The archive cannot be opened. Is it complete?" 1270 msgstr "" 1271 1272 #: free/src/Backup/ZipArchiveWriter.php:182 1273 msgid "The archive could not be finalized (%s)." 1274 msgstr "" 1275 1276 #: free/src/Backup/ZipArchiveWriter.php:182 1277 msgid "The archive could not be finalized." 1278 msgstr "" 1279 1280 #: free/src/Backup/Stages/FinalizeStage.php:85 1281 msgid "The archive could not be hashed." 1282 msgstr "" 1283 1284 #: free/src/Installer/Extractor.php:80 1285 msgid "The archive file is missing." 1286 msgstr "" 1287 1288 #: free/src/Backup/ZipArchiveWriter.php:89 1289 #: free/src/Backup/ZipArchiveWriter.php:132 1290 msgid "The archive is not open." 1291 msgstr "" 1292 1293 #: free/templates/dashboard.php:285 1294 msgid "The backup process is running in the background. Please keep this browser window open until the operation finishes completely." 1295 msgstr "" 1296 1297 #: free/templates/settings.php:410 1298 msgid "The backup storage directory is located outside standard web root or uses a custom path mapping. Your server administrator must manually configure an Nginx rule denying direct access based on your web server configuration." 1299 msgstr "" 1300 1301 #: free/src/Notify/BotApi.php:191 1302 msgid "The bot token or chat id is missing." 1303 msgstr "" 1304 1305 #: free/src/Installer/ConnectionManager.php:74 1306 msgid "The database could not be created: %s" 1307 msgstr "" 1308 1309 #: free/templates/settings.php:232 1310 msgid "The exact Nginx location block cannot be determined automatically (e.g. external CDN or custom mapping). Please visit Backupino -> Settings -> Storage Destination to view manual configuration guidance." 1311 msgstr "" 1312 1313 #: free/backupino.php:1 1314 msgid "The installer file could not be generated." 1315 msgstr "" 1316 1317 #: free/src/Admin/Admin.php:111 1318 msgid "The job failed." 1319 msgstr "" 1320 1321 #: free/src/Notify/BotApi.php:251 1322 msgid "The messenger answered with HTTP %d." 1323 msgstr "" 1324 1325 #: free/src/Notify/BotApi.php:259 1326 msgid "The messenger rejected the message." 1327 msgstr "" 1328 1329 #: free/src/Backup/Stages/FinalizeStage.php:99 1330 msgid "The package metadata could not be generated." 1331 msgstr "" 1332 1333 #: free/src/Support/Fs.php:281 1334 msgid "The requested file does not exist." 1335 msgstr "" 1336 1337 #: free/templates/dashboard.php:72 1338 msgid "The storage path cannot be resolved to an automatic Nginx location (for example, due to an external CDN, custom domain, or path outside webroot). Please see Backupino -> Settings -> Storage Destination to manually determine the rule for your server." 1339 msgstr "" 1340 1341 #: free/src/Download/PublicDownload.php:101 1342 msgid "There is no backup ready to download yet." 1343 msgstr "" 1344 1345 #: free/src/Notify/BotApi.php:197 1346 msgid "There is nothing to send." 1347 msgstr "" 1348 1349 #: free/src/Download/PublicDownload.php:93 1350 msgid "This download link is not valid." 1351 msgstr "" 1352 1353 #: free/templates/dashboard.php:93 1354 msgid "This link always points at the newest backup. It never expires, but the visitor must be signed in as an administrator before the download starts." 1355 msgstr "" 1356 1357 #: free/backupino.php:1 1358 msgid "This location contains an .htaccess file blocking direct HTTP requests and indexing for maximum security." 1359 msgstr "" 1360 1361 #: free/src/Admin/DownloadHandler.php:77 1362 #: free/src/Admin/DownloadHandler.php:81 1363 msgid "This package no longer exists on the server." 1364 msgstr "" 1365 1366 #: free/src/Storage/LocalStorage.php:55 1367 msgid "This server" 1368 msgstr "" 1369 1370 #: free/templates/dashboard.php:127 1371 msgid "Time Limit" 1372 msgstr "" 1373 1374 #: free/src/Download/PublicDownload.php:65 1375 msgid "Too Many Requests" 1376 msgstr "" 1377 1378 #: free/src/Download/PublicDownload.php:64 1379 msgid "Too many failed download attempts. Please try again in 10 minutes." 1380 msgstr "" 1381 1382 #: free/src/Jobs/JobRunner.php:172 1383 msgid "Unknown pipeline stage." 1384 msgstr "" 1385 1386 #: free/backupino.php:1 1387 msgid "Update Now" 1388 msgstr "" 1389 1390 #: free/backupino.php:1 1391 msgid "Updates & Community" 1392 msgstr "" 1393 1394 #: free/templates/settings.php:44 1395 #: free/templates/settings.php:676 1396 msgid "Updates & Privacy" 1397 msgstr "" 1398 1399 #: free/src/Download/PublicDownload.php:312 1400 msgid "Upload both the .zip archive and installer.php into an empty directory on your destination server." 1401 msgstr "" 1402 1403 #: free/src/Backup/Stages/FinalizeStage.php:260 1404 msgid "Upload failed: %s" 1405 msgstr "" 1406 1407 #: free/src/Download/PublicDownload.php:274 1408 msgid "Verified Backup Package" 1409 msgstr "" 1410 1411 #: free/backupino.php:1 1412 msgid "View Release Notes" 1413 msgstr "" 1414 1415 #: free/templates/settings.php:684 1416 msgid "We respect your privacy. No telemetry or personal data is collected or sent without your explicit consent." 1417 msgstr "" 1418 1419 #: free/templates/settings.php:376 1420 msgid "Web Server Direct Access Protection & Nginx Guidance" 1421 msgstr "" 1422 1423 #: free/src/Admin/Admin.php:110 65 1424 msgid "Working…" 66 1425 msgstr "" 67 1426 68 #: src/Admin/Admin.php:111 69 msgid "The job failed." 70 msgstr "" 71 72 #: src/Admin/Admin.php:112 73 msgid "Delete this package permanently?" 74 msgstr "" 75 76 #: src/Admin/Admin.php:113 77 msgid "Settings saved." 78 msgstr "" 79 80 #: src/Admin/Admin.php:114 81 msgid "Link copied to the clipboard." 82 msgstr "" 83 84 #: src/Admin/Admin.php:115 85 msgid "Test message sent." 86 msgstr "" 87 88 #: src/Admin/Admin.php:116 89 msgid "Backup Job" 90 msgstr "" 91 92 #: src/Admin/Admin.php:117 93 msgid "Cancel the current backup job?" 94 msgstr "" 95 96 #: src/Admin/Admin.php:118 97 msgid "Backup cancelled." 98 msgstr "" 99 100 #: src/Admin/Admin.php:131 101 #: src/Admin/Admin.php:144 1427 #: free/templates/settings.php:126 1428 msgid "Writable" 1429 msgstr "" 1430 1431 #: free/src/Installer/Env.php:62 1432 msgid "Writable directory" 1433 msgstr "" 1434 1435 #: free/src/Admin/DownloadHandler.php:50 1436 msgid "You are not allowed to download backups." 1437 msgstr "" 1438 1439 #: free/src/Admin/Admin.php:131 1440 #: free/src/Admin/Admin.php:144 102 1441 msgid "You are not allowed to manage backups." 103 1442 msgstr "" 104 1443 105 #: src/Admin/Admin.php:185 106 msgid "Backupino — Site Migration Completed!" 107 msgstr "" 108 109 #: src/Admin/Admin.php:187 1444 #: free/backupino.php:1 1445 msgid "You do not have permission to check for updates." 1446 msgstr "" 1447 1448 #: free/templates/settings.php:408 1449 msgid "Your WordPress uploads directory uses an external CDN or separate domain. The exact public Nginx location cannot be determined automatically. Your server administrator must manually create an Nginx location block matching your origin server URL mapping." 1450 msgstr "" 1451 1452 #: free/src/Admin/Admin.php:187 110 1453 msgid "Your website has been successfully restored and migrated to this location. Installer files and temporary data have been cleaned up." 111 1454 msgstr "" 112 1455 113 #: src/Admin/DownloadHandler.php:50 114 msgid "You are not allowed to download backups." 115 msgstr "" 116 117 #: src/Admin/DownloadHandler.php:56 118 msgid "Invalid file name." 119 msgstr "" 120 121 #: src/Admin/DownloadHandler.php:77 122 #: src/Admin/DownloadHandler.php:81 123 msgid "This package no longer exists on the server." 124 msgstr "" 125 126 #: src/Admin/RestController.php:237 127 msgid "Could not create backup job in database." 128 msgstr "" 129 130 #: src/Admin/RestController.php:455 131 msgid "Storage is writable." 132 msgstr "" 133 134 #: src/Backup/Stages/DatabaseStage.php:40 135 msgid "Copying the database" 136 msgstr "" 137 138 #: src/Backup/Stages/DatabaseStage.php:61 139 msgid "Database dump disabled." 140 msgstr "" 141 142 #: src/Backup/Stages/DatabaseStage.php:77 143 msgid "The SQL dump file could not be opened." 144 msgstr "" 145 146 #. translators: 1: number of rows, 2: number of tables, 3: dumped size. 147 #: src/Backup/Stages/DatabaseStage.php:99 148 #, php-format 149 msgid "%1$s rows from %2$s tables (%3$s)." 150 msgstr "" 151 152 #: src/Backup/Stages/FilesStage.php:40 153 msgid "Archiving files" 154 msgstr "" 155 156 #: src/Backup/Stages/FilesStage.php:77 157 msgid "File archiving disabled." 158 msgstr "" 159 160 #. translators: 1: packed files, 2: total files, 3: skipped files, 4: archive size. 161 #: src/Backup/Stages/FilesStage.php:155 162 #, php-format 163 msgid "Packed %1$s of %2$s files (%3$s skipped, %4$s)." 164 msgstr "" 165 166 #: src/Backup/Stages/FinalizeStage.php:43 167 msgid "Finalizing the package" 168 msgstr "" 169 170 #: src/Backup/Stages/FinalizeStage.php:78 171 msgid "Sealing the archive…" 172 msgstr "" 173 174 #: src/Backup/Stages/FinalizeStage.php:85 175 msgid "The archive could not be hashed." 176 msgstr "" 177 178 #: src/Backup/Stages/FinalizeStage.php:99 179 msgid "The package metadata could not be generated." 180 msgstr "" 181 182 #. translators: 1: package name, 2: package size. 183 #: src/Backup/Stages/FinalizeStage.php:130 184 #, php-format 185 msgid "Package %1$s is ready (%2$s)." 186 msgstr "" 187 188 #. translators: %s: storage error. 189 #: src/Backup/Stages/FinalizeStage.php:260 190 #, php-format 191 msgid "Upload failed: %s" 192 msgstr "" 193 194 #: src/Backup/Stages/ScanStage.php:39 195 msgid "Scanning files" 196 msgstr "" 197 198 #. translators: 1: number of files, 2: total size. 199 #: src/Backup/Stages/ScanStage.php:86 200 #, php-format 201 msgid "%1$s files found (%2$s)." 202 msgstr "" 203 204 #: src/Backup/ZipArchiveWriter.php:60 205 msgid "The Zip extension is not available." 206 msgstr "" 207 208 #. translators: %d: ZipArchive error code. 209 #: src/Backup/ZipArchiveWriter.php:73 210 #, php-format 211 msgid "Could not open the archive (error %d)." 212 msgstr "" 213 214 #: src/Backup/ZipArchiveWriter.php:89 215 #: src/Backup/ZipArchiveWriter.php:132 216 msgid "The archive is not open." 217 msgstr "" 218 219 #. translators: %s: file path. 220 #: src/Backup/ZipArchiveWriter.php:99 221 #, php-format 222 msgid "File is not readable: %s" 223 msgstr "" 224 225 #. translators: %s: file path. 226 #: src/Backup/ZipArchiveWriter.php:109 227 #, php-format 228 msgid "Could not add file to archive: %s" 229 msgstr "" 230 231 #. translators: %s: status description. 232 #: src/Backup/ZipArchiveWriter.php:182 233 #, php-format 234 msgid "The archive could not be finalized (%s)." 235 msgstr "" 236 237 #. translators: %s: status description. 238 #: src/Backup/ZipArchiveWriter.php:182 239 msgid "The archive could not be finalized." 240 msgstr "" 241 242 #: src/Core/Activator.php:45 243 #: src/Cron/Scheduler.php:62 244 msgid "Backupino: every minute" 245 msgstr "" 246 247 #. translators: 1: required PHP version, 2: current PHP version. 248 #: src/Core/Compatibility.php:49 249 #, php-format 250 msgid "Backupino requires PHP %1$s or newer. This server runs PHP %2$s." 251 msgstr "" 252 253 #. translators: %s: PHP extension name. 254 #: src/Core/Compatibility.php:59 255 #, php-format 256 msgid "The PHP extension \"%s\" is required but not loaded." 257 msgstr "" 258 259 #: src/Core/Compatibility.php:66 260 msgid "Neither the Zip extension nor PclZip is available, so archives cannot be created." 261 msgstr "" 262 263 #. translators: %s: current memory limit. 264 #: src/Core/Compatibility.php:84 265 #, php-format 266 msgid "PHP memory limit is %s. Backups will run in small chunks, but 128M or more is recommended." 267 msgstr "" 268 269 #. translators: %d: seconds. 270 #: src/Core/Compatibility.php:94 271 #, php-format 1456 #: free/templates/settings.php:180 1457 msgid "ZipArchive" 1458 msgstr "" 1459 1460 #: free/src/Installer/Env.php:52 1461 msgid "ZipArchive available" 1462 msgstr "" 1463 1464 #: free/src/Installer/Env.php:52 1465 msgid "ZipArchive missing" 1466 msgstr "" 1467 1468 #: free/src/Notify/Notifier.php:185 1469 msgid "database only" 1470 msgstr "" 1471 1472 #: free/src/Notify/Notifier.php:183 1473 msgid "files and database" 1474 msgstr "" 1475 1476 #: free/src/Notify/Notifier.php:187 1477 msgid "files only" 1478 msgstr "" 1479 1480 #: free/src/Installer/Env.php:42 1481 msgid "loaded" 1482 msgstr "" 1483 1484 #: free/src/Core/Compatibility.php:94 272 1485 msgid "max_execution_time is %d seconds. Long steps will be split automatically." 273 1486 msgstr "" 274 1487 275 #: src/Core/Compatibility.php:100 276 msgid "OpenSSL extension is missing: secure HTTPS communications will be unavailable." 277 msgstr "" 278 279 #: src/Core/Compatibility.php:104 1488 #: free/src/Core/Compatibility.php:104 280 1489 msgid "mbstring is missing: multibyte site titles may be truncated on URL replacement." 281 1490 msgstr "" 282 1491 283 #: src/Cron/Scheduler.php:69 284 msgid "Once monthly (first day of the month)" 285 msgstr "" 286 287 #: src/Cron/Scheduler.php:115 288 msgid "Scheduled backup" 289 msgstr "" 290 291 #: src/Download/PublicDownload.php:64 292 msgid "Too many failed download attempts. Please try again in 10 minutes." 293 msgstr "" 294 295 #: src/Download/PublicDownload.php:65 296 msgid "Too Many Requests" 297 msgstr "" 298 299 #: src/Download/PublicDownload.php:93 300 msgid "This download link is not valid." 301 msgstr "" 302 303 #: src/Download/PublicDownload.php:101 304 msgid "There is no backup ready to download yet." 305 msgstr "" 306 307 #: src/Download/PublicDownload.php:140 308 msgid "Installer file not found." 309 msgstr "" 310 311 #: src/Download/PublicDownload.php:267 312 #: src/Download/PublicDownload.php:276 313 msgid "Download Backup Package" 314 msgstr "" 315 316 #: src/Download/PublicDownload.php:274 317 msgid "Verified Backup Package" 318 msgstr "" 319 320 #: src/Download/PublicDownload.php:281 321 msgid "Package Name" 322 msgstr "" 323 324 #: src/Download/PublicDownload.php:285 325 msgid "File Size" 326 msgstr "" 327 328 #: src/Download/PublicDownload.php:289 329 msgid "Created Date" 330 msgstr "" 331 332 #: src/Download/PublicDownload.php:297 333 msgid "Download Archive + Installer (Both)" 334 msgstr "" 335 336 #: src/Download/PublicDownload.php:301 337 msgid "Download Backup Archive (.zip)" 338 msgstr "" 339 340 #: src/Download/PublicDownload.php:305 341 #: templates/dashboard.php:356 342 msgid "Download Installer (installer.php)" 343 msgstr "" 344 345 #: src/Download/PublicDownload.php:310 346 msgid "How to restore or migrate:" 347 msgstr "" 348 349 #: src/Download/PublicDownload.php:312 350 msgid "Upload both the .zip archive and installer.php into an empty directory on your destination server." 351 msgstr "" 352 353 #: src/Download/PublicDownload.php:313 354 msgid "Open installer.php in your web browser and follow the on-screen steps." 355 msgstr "" 356 357 #. translators: %s: driver error. 358 #: src/Installer/ConnectionManager.php:74 359 #, php-format 360 msgid "The database could not be created: %s" 361 msgstr "" 362 363 #: src/Installer/Env.php:33 364 msgid "PHP version" 365 msgstr "" 366 367 #. translators: %s: extension name. 368 #: src/Installer/Env.php:40 369 #, php-format 370 msgid "PHP extension: %s" 371 msgstr "" 372 373 #: src/Installer/Env.php:42 374 msgid "loaded" 375 msgstr "" 376 377 #: src/Installer/Env.php:42 1492 #: free/src/Installer/Env.php:42 378 1493 msgid "missing" 379 1494 msgstr "" 380 1495 381 #: src/Installer/Env.php:50 382 msgid "Archive support" 383 msgstr "" 384 385 #: src/Installer/Env.php:52 386 msgid "ZipArchive available" 387 msgstr "" 388 389 #: src/Installer/Env.php:52 390 msgid "ZipArchive missing" 391 msgstr "" 392 393 #: src/Installer/Env.php:56 394 msgid "MySQL driver" 395 msgstr "" 396 397 #: src/Installer/Env.php:58 1496 #: free/src/Installer/Env.php:92 1497 msgid "needed" 1498 msgstr "" 1499 1500 #: free/backupino.php:1 1501 msgid "none" 1502 msgstr "" 1503 1504 #: free/src/Installer/Env.php:72 1505 msgid "not found: %s" 1506 msgstr "" 1507 1508 #: free/src/Installer/Env.php:58 398 1509 msgid "pdo_mysql missing" 399 1510 msgstr "" 400 1511 401 #: src/Installer/Env.php:62 402 msgid "Writable directory" 403 msgstr "" 404 405 #: src/Installer/Env.php:70 406 msgid "Archive file" 407 msgstr "" 408 409 #. translators: %s: file name. 410 #: src/Installer/Env.php:72 411 #, php-format 412 msgid "not found: %s" 413 msgstr "" 414 415 #: src/Installer/Env.php:77 416 msgid "Archive checksum" 417 msgstr "" 418 419 #: src/Installer/Env.php:79 1512 #: free/backupino.php:1 1513 msgid "unknown" 1514 msgstr "" 1515 1516 #: free/src/Installer/Env.php:79 420 1517 msgid "verified against the package manifest" 421 1518 msgstr "" 422 1519 423 #: src/Installer/Env.php:90424 msgid "Free disk space"425 msgstr ""426 427 #: src/Installer/Env.php:92428 msgid "Not restricted / host managed"429 msgstr ""430 431 #: src/Installer/Env.php:92432 msgid "needed"433 msgstr ""434 435 #: src/Installer/Extractor.php:74436 msgid "The Zip extension is not available on this server."437 msgstr ""438 439 #: src/Installer/Extractor.php:80440 msgid "The archive file is missing."441 msgstr ""442 443 #: src/Installer/Extractor.php:88444 msgid "The archive cannot be opened. Is it complete?"445 msgstr ""446 447 #. translators: %s: archive entry name.448 #: src/Installer/Extractor.php:136449 #, php-format450 msgid "Skipped unsafe entry: %s"451 msgstr ""452 453 #: src/Jobs/JobRunner.php:172454 msgid "Unknown pipeline stage."455 msgstr ""456 457 #: src/Jobs/JobRunner.php:308458 msgid "Cancelled by the user."459 msgstr ""460 461 #: src/Jobs/JobStatus.php:54462 msgid "Queued"463 msgstr ""464 465 #: src/Jobs/JobStatus.php:56466 msgid "Running"467 msgstr ""468 469 #: src/Jobs/JobStatus.php:58470 msgid "Completed"471 msgstr ""472 473 #: src/Jobs/JobStatus.php:60474 msgid "Failed"475 msgstr ""476 477 #: src/Jobs/JobStatus.php:62478 msgid "Cancelled"479 msgstr ""480 481 #: src/Notify/BotApi.php:191482 msgid "The bot token or chat id is missing."483 msgstr ""484 485 #: src/Notify/BotApi.php:197486 msgid "There is nothing to send."487 msgstr ""488 489 #. translators: %d: HTTP status code.490 #: src/Notify/BotApi.php:251491 #, php-format492 msgid "The messenger answered with HTTP %d."493 msgstr ""494 495 #: src/Notify/BotApi.php:259496 msgid "The messenger rejected the message."497 msgstr ""498 499 #: src/Notify/ChannelFactory.php:36500 msgid "Telegram"501 msgstr ""502 503 #: src/Notify/ChannelFactory.php:37504 msgid "Bale"505 msgstr ""506 507 #: src/Notify/Notifier.php:183508 msgid "files and database"509 msgstr ""510 511 #: src/Notify/Notifier.php:185512 msgid "database only"513 msgstr ""514 515 #: src/Notify/Notifier.php:187516 msgid "files only"517 msgstr ""518 519 #. translators: %s: messenger service name.520 #: src/Notify/Notifier.php:241521 #, php-format522 msgid "%s messenger is not enabled or not fully configured."523 msgstr ""524 525 #: src/Notify/Notifier.php:251526 msgid "No messenger is configured."527 msgstr ""528 529 #: src/Plugin.php:190530 msgid "Backupino cannot run on this server:"531 msgstr ""532 533 #: src/Storage/LocalStorage.php:55534 msgid "This server"535 msgstr ""536 537 #: src/Storage/LocalStorage.php:75538 msgid "Executable files cannot be stored in backup storage."539 msgstr ""540 541 #: src/Storage/LocalStorage.php:97542 msgid "Could not read the package file."543 msgstr ""544 545 #: src/Storage/LocalStorage.php:104546 msgid "Could not write the package file."547 msgstr ""548 549 #: src/Storage/LocalStorage.php:119550 msgid "Package not found."551 msgstr ""552 553 #: src/Support/Fs.php:281554 msgid "The requested file does not exist."555 msgstr ""556 557 #: templates/dashboard.php:40558 #: templates/settings.php:70559 msgid "Backupino Navigation"560 msgstr ""561 562 #: templates/dashboard.php:71563 msgid "Permanent download link"564 msgstr ""565 566 #: templates/dashboard.php:72567 msgid "Direct link that always serves the newest completed backup. Requires administrator login before download."568 msgstr ""569 570 #: templates/dashboard.php:76571 msgid "This link always points at the newest backup. It never expires, but the visitor must be signed in as an administrator before the download starts."572 msgstr ""573 574 #: templates/dashboard.php:82575 msgid "Copy link"576 msgstr ""577 578 #: templates/dashboard.php:93579 msgid "Storage & Environment"580 msgstr ""581 582 #: templates/dashboard.php:98583 msgid "Destination"584 msgstr ""585 586 #: templates/dashboard.php:102587 #: templates/settings.php:116588 #: templates/settings.php:153589 msgid "PHP Version"590 msgstr ""591 592 #: templates/dashboard.php:106593 #: templates/settings.php:120594 #: templates/settings.php:162595 msgid "Memory Limit"596 msgstr ""597 598 #: templates/dashboard.php:110599 msgid "Time Limit"600 msgstr ""601 602 #: templates/dashboard.php:116603 msgid "Storage folder:"604 msgstr ""605 606 #: templates/dashboard.php:122607 msgid "Test storage"608 msgstr ""609 610 #: templates/dashboard.php:132611 msgid "Standalone Restore"612 msgstr ""613 614 #: templates/dashboard.php:136615 msgid "Each backup includes installer.php alongside the archive zip. You can copy both files to an empty domain or localhost and run installer.php in your browser to restore the entire website in 3 steps without pre-installing WordPress."616 msgstr ""617 618 #: templates/dashboard.php:148619 msgid "Create a backup"620 msgstr ""621 622 #: templates/dashboard.php:152623 msgid "Everything is packed into one archive plus a standalone installer that rebuilds the site on any empty server."624 msgstr ""625 626 #: templates/dashboard.php:156627 msgid "JavaScript is required to build backups."628 msgstr ""629 630 #: templates/dashboard.php:163631 msgid "Include files"632 msgstr ""633 634 #: templates/dashboard.php:164635 msgid "Includes WordPress core files, active themes, plugins, and uploads media library."636 msgstr ""637 638 #: templates/dashboard.php:168639 msgid "Include database"640 msgstr ""641 642 #: templates/dashboard.php:169643 msgid "Dumps all WordPress database tables into pure standard SQL without relying on mysqldump."644 msgstr ""645 646 #: templates/dashboard.php:175647 msgid "Label (optional)"648 msgstr ""649 650 #: templates/dashboard.php:176651 msgid "Optional note to identify why this backup was created (e.g. before updating WooCommerce)."652 msgstr ""653 654 #: templates/dashboard.php:178655 msgid "Before updating plugins"656 msgstr ""657 658 #: templates/dashboard.php:184659 msgid "Create backup"660 msgstr ""661 662 #: templates/dashboard.php:201663 msgid "Backup in Progress"664 msgstr ""665 666 #: templates/dashboard.php:205667 msgid "Cancel backup job"668 msgstr ""669 670 #: templates/dashboard.php:207671 msgid "Cancel"672 msgstr ""673 674 #: templates/dashboard.php:216675 msgid "Cataloging"676 msgstr ""677 678 #: templates/dashboard.php:220679 msgid "Database"680 msgstr ""681 682 #: templates/dashboard.php:224683 msgid "Files"684 msgstr ""685 686 #: templates/dashboard.php:228687 msgid "Installer"688 msgstr ""689 690 #: templates/dashboard.php:232691 msgid "Packaging"692 msgstr ""693 694 #: templates/dashboard.php:245695 msgid "Initializing backup job…"696 msgstr ""697 698 #: templates/dashboard.php:257699 msgid "Live Activity Feed"700 msgstr ""701 702 #: templates/dashboard.php:258703 msgid "RUNNING"704 msgstr ""705 706 #: templates/dashboard.php:261707 msgid "Ready to start backup..."708 msgstr ""709 710 #: templates/dashboard.php:268711 msgid "The backup process is running in the background. Please keep this browser window open until the operation finishes completely."712 msgstr ""713 714 #: templates/dashboard.php:277715 msgid "Recent backups"716 msgstr ""717 718 #: templates/dashboard.php:283719 msgid "Created"720 msgstr ""721 722 #: templates/dashboard.php:284723 #: templates/dashboard.php:399724 msgid "Status"725 msgstr ""726 727 #: templates/dashboard.php:285728 #: templates/dashboard.php:403729 msgid "Progress"730 msgstr ""731 732 #: templates/dashboard.php:286733 msgid "Package name"734 msgstr ""735 736 #: templates/dashboard.php:287737 #: templates/dashboard.php:419738 msgid "Size"739 msgstr ""740 741 #: templates/dashboard.php:288742 msgid "Actions"743 msgstr ""744 745 #: templates/dashboard.php:295746 msgid "No backups yet."747 msgstr ""748 749 #: templates/dashboard.php:318750 msgid "Click to view log and details"751 msgstr ""752 753 #: templates/dashboard.php:349754 #: templates/dashboard.php:423755 msgid "Download Archive (.zip)"756 msgstr ""757 758 #: templates/dashboard.php:350759 msgid "Download Archive"760 msgstr ""761 762 #: templates/dashboard.php:357763 msgid "Download Installer"764 msgstr ""765 766 #: templates/dashboard.php:365767 msgid "Download Archive and Installer simultaneously"768 msgstr ""769 770 #: templates/dashboard.php:366771 msgid "Download Both"772 msgstr ""773 774 #: templates/dashboard.php:372775 msgid "Delete backup package"776 msgstr ""777 778 #: templates/dashboard.php:373779 msgid "Delete"780 msgstr ""781 782 #: templates/dashboard.php:392783 msgid "Backup Details & Log"784 msgstr ""785 786 #: templates/dashboard.php:394787 #: templates/dashboard.php:442788 msgid "Close"789 msgstr ""790 791 #: templates/dashboard.php:407792 msgid "Date"793 msgstr ""794 795 #: templates/dashboard.php:411796 msgid "Message"797 msgstr ""798 799 #: templates/dashboard.php:418800 msgid "Package"801 msgstr ""802 803 #: templates/dashboard.php:426804 msgid "Download Installer (.php)"805 msgstr ""806 807 #: templates/dashboard.php:433808 msgid "Execution Log"809 msgstr ""810 811 #: templates/dashboard.php:436812 msgid "Loading logs…"813 msgstr ""814 815 #: templates/settings.php:20816 #: templates/settings.php:274817 msgid "Archive & Exclusions"818 msgstr ""819 820 #: templates/settings.php:24821 #: templates/settings.php:317822 msgid "Storage Destination"823 msgstr ""824 825 #: templates/settings.php:28826 #: templates/settings.php:354827 msgid "Bot Notifications"828 msgstr ""829 830 #: templates/settings.php:32831 #: templates/settings.php:526832 msgid "Recurring Schedule"833 msgstr ""834 835 #: templates/settings.php:36836 #: templates/settings.php:566837 msgid "Standalone Installer"838 msgstr ""839 840 #: templates/settings.php:40841 msgid "System Status"842 msgstr ""843 844 #: templates/settings.php:44845 #: templates/settings.php:596846 msgid "Updates & Privacy"847 msgstr ""848 849 #: templates/settings.php:90850 msgid "Settings Navigation"851 msgstr ""852 853 #: templates/settings.php:111854 msgid "Environment"855 msgstr ""856 857 #: templates/settings.php:124858 msgid "Storage Status"859 msgstr ""860 861 #: templates/settings.php:126862 msgid "Writable"863 msgstr ""864 865 #: templates/settings.php:126866 msgid "Protected"867 msgstr ""868 869 #: templates/settings.php:141870 msgid "System Status & Diagnostics"871 msgstr ""872 873 #: templates/settings.php:145874 msgid "Live diagnostic health report of active server extensions, filesystem permissions, and system stability."875 msgstr ""876 877 #: templates/settings.php:156878 msgid "Compatible"879 msgstr ""880 881 #: templates/settings.php:165882 #: templates/settings.php:174883 msgid "OK"884 msgstr ""885 886 #: templates/settings.php:171887 msgid "Execution Timeout"888 msgstr ""889 890 #: templates/settings.php:180891 msgid "ZipArchive"892 msgstr ""893 894 #: templates/settings.php:181895 msgid "Enabled"896 msgstr ""897 898 #: templates/settings.php:181899 msgid "PclZip fallback"900 msgstr ""901 902 #: templates/settings.php:183903 msgid "Ready"904 msgstr ""905 906 #: templates/settings.php:189907 msgid "Database Driver"908 msgstr ""909 910 #: templates/settings.php:192911 msgid "Streaming"912 msgstr ""913 914 #: templates/settings.php:198915 msgid "OpenSSL"916 msgstr ""917 918 #: templates/settings.php:199919 msgid "Active"920 msgstr ""921 922 #: templates/settings.php:199923 msgid "Inactive"924 msgstr ""925 926 #: templates/settings.php:201927 msgid "Encrypted"928 msgstr ""929 930 #: templates/settings.php:209931 msgid "Backup Storage Destination"932 msgstr ""933 934 #: templates/settings.php:212935 msgid "Isolated, protected path used to safely store archive files away from public access:"936 msgstr ""937 938 #: templates/settings.php:218939 msgid "Run Storage Write Test"940 msgstr ""941 942 #: templates/settings.php:229943 msgid "System & Activity Log Stream"944 msgstr ""945 946 #: templates/settings.php:233947 msgid "Refresh"948 msgstr ""949 950 #: templates/settings.php:243951 msgid "System Activity Log (Last 100 entries)"952 msgstr ""953 954 #: templates/settings.php:251955 msgid "No recent log entries found."956 msgstr ""957 958 #: templates/settings.php:277959 msgid "Configure which files, folders, or sizes should be skipped during backup creation to save disk space and maximize speed."960 msgstr ""961 962 #: templates/settings.php:282963 msgid "Excluded paths and patterns (one per line)"964 msgstr ""965 966 #: templates/settings.php:283967 msgid "Folders or file patterns that will be excluded from the backup archive (e.g. wp-content/cache/, *.mp4)."968 msgstr ""969 970 #: templates/settings.php:287971 msgid "Examples: wp-content/uploads/2022/, *.mp4, node_modules/. Cache and backup folders are always skipped automatically."972 msgstr ""973 974 #: templates/settings.php:294975 msgid "Skip files larger than (MB, 0 = no limit)"976 msgstr ""977 978 #: templates/settings.php:295979 msgid "Files exceeding this size threshold will be skipped to keep backups fast and reliable. Enter 0 for no limit."980 msgstr ""981 982 #: templates/settings.php:303983 msgid "Files packed per request"984 msgstr ""985 986 #: templates/settings.php:304987 msgid "Batch size for slicing file packing per tick. Default 1000 files ensures fast backup on modern systems."988 msgstr ""989 990 #: templates/settings.php:320991 msgid "Backup archives and standalone installers are stored locally in a secure, protected directory on your server."992 msgstr ""993 994 #: templates/settings.php:325995 msgid "Primary Destination Driver"996 msgstr ""997 998 #: templates/settings.php:326999 msgid "Primary storage destination for completed packages. Local protected storage is used."1000 msgstr ""1001 1002 #: templates/settings.php:3401003 msgid "Protected Directory Path"1004 msgstr ""1005 1006 #: templates/settings.php:3441007 msgid "This location contains an .htaccess file blocking direct HTTP requests and indexing for maximum security."1008 msgstr ""1009 1010 #: templates/settings.php:3571011 msgid "Backupino can announce every finished backup, with the permanent download link, in Telegram or Bale. You can enable either or both messengers simultaneously."1012 msgstr ""1013 1014 #: templates/settings.php:3651015 msgid "Telegram Notification"1016 msgstr ""1017 1018 #: templates/settings.php:3691019 msgid "Enable Telegram"1020 msgstr ""1021 1022 #: templates/settings.php:3751023 msgid "Telegram Bot Token"1024 msgstr ""1025 1026 #: templates/settings.php:3761027 msgid "Bot token obtained from Telegram @BotFather."1028 msgstr ""1029 1030 #: templates/settings.php:3841031 msgid "Telegram Chat ID"1032 msgstr ""1033 1034 #: templates/settings.php:3851035 msgid "Telegram numeric chat or channel ID."1036 msgstr ""1037 1038 #: templates/settings.php:3951039 msgid "Test Telegram"1040 msgstr ""1041 1042 #: templates/settings.php:4061043 msgid "Bale Notification"1044 msgstr ""1045 1046 #: templates/settings.php:4101047 msgid "Enable Bale"1048 msgstr ""1049 1050 #: templates/settings.php:4161051 msgid "Bale Bot Token"1052 msgstr ""1053 1054 #: templates/settings.php:4171055 msgid "Bot token obtained from Bale @BotFather."1056 msgstr ""1057 1058 #: templates/settings.php:4251059 msgid "Bale Chat ID"1060 msgstr ""1061 1062 #: templates/settings.php:4261063 msgid "Bale numeric chat or channel ID."1064 msgstr ""1065 1066 #: templates/settings.php:4361067 msgid "Test Bale"1068 msgstr ""1069 1070 #: templates/settings.php:4461071 msgid "Backup Message Template"1072 msgstr ""1073 1074 #: templates/settings.php:4491075 msgid "Message template sent to messengers when a backup finishes."1076 msgstr ""1077 1078 #: templates/settings.php:4601079 #: templates/settings.php:4921080 msgid "Available tags:"1081 msgstr ""1082 1083 #: templates/settings.php:4621084 #: templates/settings.php:4941085 msgid "Site Name"1086 msgstr ""1087 1088 #: templates/settings.php:4631089 msgid "Backup Contents"1090 msgstr ""1091 1092 #: templates/settings.php:4641093 msgid "Backup Size"1094 msgstr ""1095 1096 #: templates/settings.php:4651097 msgid "Backup Date"1098 msgstr ""1099 1100 #: templates/settings.php:4661101 msgid "Download Link"1102 msgstr ""1103 1104 #: templates/settings.php:4691105 #: templates/settings.php:5001106 msgid "HTML formatting tags such as <b>bold</b> and <a href=\"...\">links</a> are supported."1107 msgstr ""1108 1109 #: templates/settings.php:4781110 msgid "Restoration Message Template"1111 msgstr ""1112 1113 #: templates/settings.php:4811114 msgid "Message template sent to messengers when the site is restored using the installer."1115 msgstr ""1116 1117 #: templates/settings.php:4951118 msgid "New Site URL"1119 msgstr ""1120 1121 #: templates/settings.php:4961122 msgid "Admin Login URL"1123 msgstr ""1124 1125 #: templates/settings.php:4971126 msgid "Restoration Date"1127 msgstr ""1128 1129 #. translators: %d: number of queued messages.1130 #: templates/settings.php:5121131 #, php-format1132 msgid "%d message is waiting to be resent on the next scheduled run."1133 msgid_plural "%d messages are waiting to be resent on the next scheduled run."1134 msgstr[0] ""1135 msgstr[1] ""1136 1137 #: templates/settings.php:5291138 msgid "Automatic recurring backups trigger via WordPress cron. In Persian locale, monthly schedules automatically align with the start of the Jalali month."1139 msgstr ""1140 1141 #: templates/settings.php:5341142 msgid "Run automatic backups"1143 msgstr ""1144 1145 #: templates/settings.php:5351146 msgid "Enables recurring background backup jobs using WordPress built-in WP-Cron scheduler."1147 msgstr ""1148 1149 #: templates/settings.php:5411150 msgid "Frequency"1151 msgstr ""1152 1153 #: templates/settings.php:5421154 msgid "Monthly execution triggers on the 1st of each Persian/Gregorian month based on site language."1155 msgstr ""1156 1157 #: templates/settings.php:5461158 msgid "Monthly (first day of the month)"1159 msgstr ""1160 1161 #: templates/settings.php:5531162 msgid "Keep at most (backups)"1163 msgstr ""1164 1165 #: templates/settings.php:5541166 msgid "Maximum number of recent backups to keep on disk. Older packages are automatically pruned to save space."1167 msgstr ""1168 1169 #: templates/settings.php:5691170 msgid "Configure preset credentials for the standalone migration installer generated with each backup."1171 msgstr ""1172 1173 #: templates/settings.php:5751174 msgid "Installer password (optional)"1175 msgstr ""1176 1177 #: templates/settings.php:5761178 msgid "Password protecting installer.php when accessed via browser during migration or restoration."1179 msgstr ""1180 1181 #: templates/settings.php:5831182 msgid "Default new URL (optional)"1183 msgstr ""1184 1185 #: templates/settings.php:5841186 msgid "Preset target URL for search & replace when migrating to a known new domain."1187 msgstr ""1188 1189 #: templates/settings.php:6001190 msgid "Receive critical security notices, product updates, and roadmap announcements (opt-in)."1191 msgstr ""1192 1193 #: templates/settings.php:6011194 msgid "100% privacy-compliant: zero tracking, zero telemetry, strictly optional notifications."1195 msgstr ""1196 1197 #: templates/settings.php:6041198 msgid "We respect your privacy. No telemetry or personal data is collected or sent without your explicit consent."1199 msgstr ""1200 1201 #: templates/settings.php:6111202 msgid "Current Version:"1203 msgstr ""1204 1205 #: templates/settings.php:6121206 msgid "Plugin updates are delivered securely through the official WordPress repository."1207 msgstr ""1208 1209 #: templates/settings.php:6231210 msgid "Save settings"1211 msgstr "" -
backupino/trunk/readme.txt
r3800361 r3809656 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1. 0.57 Stable tag: 1.1.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 76 76 77 77 = Where are backup packages stored? = 78 Packages are stored locally in `/wp-content/backupino/packages/` (outside of the public uploads directory for enhanced security and isolation). The directory is secured with `.htaccess`, `web.config`, and empty `index.php` guards to prevent direct public file browsing and execution. 78 Packages are stored locally in `backupino/packages/` inside your site's configured WordPress uploads directory (`basedir` returned by `wp_upload_dir()`, which is typically under `wp-content/uploads/backupino/packages/` on default installations, though the full path may vary on sites with a custom uploads directory). If `wp_upload_dir()` does not return a `basedir`, Backupino falls back to `backupino/packages/` inside `WP_CONTENT_DIR`. 79 80 Backupino writes `.htaccess` (for Apache/LiteSpeed), `web.config` (for IIS), and `index.html` (which only prevents directory listing) inside its storage directories. **Important for Nginx:** Nginx ignores `.htaccess` and `web.config`, and `index.html` does not block direct requests to a known package URL. On Nginx (or Nginx reverse proxies serving static files), direct HTTP access to backup files is **not guaranteed to be blocked** until you add a server-level deny rule inside your Nginx `server { }` block (adjusting the path if your uploads directory is customized) and reload Nginx: 81 82 `location ^~ /wp-content/uploads/backupino/ { deny all; return 403; }` 83 84 Authorized downloads through Backupino's WordPress admin screen and permanent download link are streamed via PHP and continue working normally with this rule enabled. 79 85 80 86 = Does the permanent download link ever expire? = … … 101 107 == Upgrade Notice == 102 108 109 = 1.1.0 = 110 Feature and enhancement release. Adds optional WordPress administrator account creation during standalone restore, restores animated plugin icon, hands off translations to GlotPress, and updates translation catalog. 111 103 112 = 1.0.5 = 104 113 Bundled full Persian (fa_IR) localization, static PNG/SVG directory icons, and clean .distignore distribution packaging. 105 114 106 115 = 1.0.4 = 107 Security , compliance, and platform hardening release addressing WordPress.org directory requirements.116 Security and compliance update. Eliminates unconsented public attributions, replaces error_reporting and raw cURL with WordPress-standard mechanisms, replaces mysqli with PDO prepared statements, quarantines web server configs, and heals table prefix casing. 108 117 109 118 = 1.0.3 = … … 120 129 121 130 == Changelog == 131 132 = 1.1.0 = 133 * Feature: Added optional new WordPress Administrator account creation during restoration in the standalone installer with secure password hashing and capability assignment. 134 * UI: Restored SMIL animated SVG plugin icon for enhanced branding while maintaining crisp high-resolution display. 135 * i18n: Removed bundled local Persian .po/.mo translation files in favor of official WordPress.org GlotPress language packs (translate.wordpress.org). 136 * i18n: Updated backupino.pot catalog with all newly introduced installer strings. 122 137 123 138 = 1.0.5 = -
backupino/trunk/src/Backup/InstallerBuilder.php
r3800274 r3809656 40 40 'UrlRewrite.php', 41 41 'ConfigWriter.php', 42 'AdminCreator.php', 42 43 'View.php', 43 44 ); … … 113 114 114 115 $template = (string) file_get_contents( $template_path ); // phpcs:ignore WordPress.WP.AlternativeFunctions 116 117 // Ensure an independent server-only secret for state encryption and session signing 118 // that is never derived from or equal to the browser-facing CSRF token. 119 $existing_secret = isset( $payload['state_secret'] ) ? (string) $payload['state_secret'] : ''; 120 $public_token = isset( $payload['token'] ) ? (string) $payload['token'] : ''; 121 if ( strlen( $existing_secret ) < 32 || ( '' !== $public_token && hash_equals( $public_token, $existing_secret ) ) ) { 122 $payload['state_secret'] = bin2hex( random_bytes( 32 ) ); 123 } 115 124 116 125 $json = function_exists( 'wp_json_encode' ) ? wp_json_encode( $payload ) : json_encode( $payload ); … … 178 187 179 188 $defaults = array( 180 'version' => defined( 'BACKUPINO_VERSION' ) ? BACKUPINO_VERSION : '1. 0.4',189 'version' => defined( 'BACKUPINO_VERSION' ) ? BACKUPINO_VERSION : '1.1.0', 181 190 'name' => $name, 182 191 'token' => \Backupino\Support\Str::random( 16 ), -
backupino/trunk/src/Backup/Stages/FinalizeStage.php
r3800274 r3809656 176 176 $meta = array( 177 177 'generator' => 'Backupino', 178 'version' => defined( 'BACKUPINO_VERSION' ) ? BACKUPINO_VERSION : '1. 0.0',178 'version' => defined( 'BACKUPINO_VERSION' ) ? BACKUPINO_VERSION : '1.1.0', 179 179 'created' => $context->clock()->now_mysql(), 180 180 'site_url' => home_url(), … … 207 207 208 208 $payload = array( 209 'version' => defined( 'BACKUPINO_VERSION' ) ? BACKUPINO_VERSION : '1. 0.4',209 'version' => defined( 'BACKUPINO_VERSION' ) ? BACKUPINO_VERSION : '1.1.0', 210 210 'name' => $name, 211 211 'token' => Str::random( 16 ), -
backupino/trunk/src/Core/Compatibility.php
r3800274 r3809656 105 105 } 106 106 107 if ( self::is_nginx() ) { 108 $warnings[] = __( 'Nginx web server detected: Nginx ignores .htaccess and web.config files, and index.html only hides directory listing. Direct HTTP access to backup files is NOT guaranteed to be blocked until your server administrator adds the server-level Nginx deny rule in Backupino -> Settings -> Storage Destination and reloads Nginx. Backupino cannot automatically alter or reload Nginx configuration.', 'backupino' ); 109 } 110 107 111 return $warnings; 112 } 113 114 /** 115 * Detect whether the current request is served behind Nginx (best-effort). 116 * 117 * Note: Detection is purely informational and best-effort. Reverse proxies 118 * or caching servers sitting in front of Apache or PHP-FPM might not advertise 119 * Nginx in SERVER_SOFTWARE. User-controlled request headers (such as HTTP_X_*) 120 * are intentionally NOT trusted for security reasons. 121 * 122 * @param string|null $server_software Optional SERVER_SOFTWARE override for testing. 123 * @return bool 124 */ 125 public static function is_nginx( ?string $server_software = null ): bool { 126 if ( null === $server_software ) { 127 if ( isset( $GLOBALS['is_nginx'] ) && true === $GLOBALS['is_nginx'] ) { 128 return true; 129 } 130 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.ValidatedSanitizedInput.MissingUnslash -- Read-only server banner check. 131 $server_software = isset( $_SERVER['SERVER_SOFTWARE'] ) ? (string) wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) : ''; 132 } 133 134 return false !== stripos( $server_software, 'nginx' ); 135 } 136 137 /** 138 * Extract canonical origin components (scheme, host, effective port) from an absolute URL. 139 * 140 * Returns null if the URL is relative, protocol-relative, invalid, or has an unsupported scheme. 141 * 142 * @param string $url URL to parse. 143 * @return array{scheme: string, host: string, port: int}|null 144 */ 145 public static function extract_origin( string $url ): ?array { 146 $trimmed = trim( $url ); 147 if ( '' === $trimmed || 0 === strpos( $trimmed, '//' ) ) { 148 return null; 149 } 150 151 $parts = wp_parse_url( $trimmed ); 152 if ( false === $parts || ! is_array( $parts ) ) { 153 return null; 154 } 155 156 $scheme = isset( $parts['scheme'] ) ? strtolower( (string) $parts['scheme'] ) : ''; 157 $host = isset( $parts['host'] ) ? strtolower( (string) $parts['host'] ) : ''; 158 159 if ( '' === $scheme || '' === $host || ! in_array( $scheme, array( 'http', 'https' ), true ) ) { 160 return null; 161 } 162 163 if ( isset( $parts['port'] ) ) { 164 if ( ! is_int( $parts['port'] ) && ! ctype_digit( (string) $parts['port'] ) ) { 165 return null; 166 } 167 $port = (int) $parts['port']; 168 if ( $port < 1 || $port > 65535 ) { 169 return null; 170 } 171 } else { 172 $port = 'https' === $scheme ? 443 : 80; 173 } 174 175 return array( 176 'scheme' => $scheme, 177 'host' => $host, 178 'port' => $port, 179 ); 180 } 181 182 /** 183 * Detailed inspection of Nginx storage protection and location block generation. 184 * 185 * Only generates a concrete `location ^~` directive when the storage web path can be 186 * reliably and safely determined relative to ABSPATH or the site/home URL (same-origin). 187 * If uploads point to an external CDN, a different host, or an indeterminate path, 188 * status is set to 'manual' to prevent displaying inaccurate or misleading Nginx rules. 189 * 190 * Output paths are strictly sanitized to prevent directive injection, newlines, and traversal. 191 * 192 * @param Paths $paths Storage layout. 193 * @return array{status: string, rule: string, web_path: string, fs_path: string, reason: string} 194 */ 195 public static function nginx_storage_info( Paths $paths ): array { 196 $base = rtrim( str_replace( '\\', '/', $paths->base() ), '/' ); 197 $root = rtrim( str_replace( '\\', '/', $paths->root() ), '/' ); 198 $fs_path = $paths->packages(); 199 200 $uploads_baseurl = ''; 201 $uploads_basedir = ''; 202 if ( function_exists( 'wp_upload_dir' ) ) { 203 $uploads = wp_upload_dir( null, false ); 204 $uploads_baseurl = isset( $uploads['baseurl'] ) ? (string) $uploads['baseurl'] : ''; 205 $uploads_basedir = isset( $uploads['basedir'] ) ? rtrim( str_replace( '\\', '/', (string) $uploads['basedir'] ), '/' ) : ''; 206 } 207 208 $candidate_path = ''; 209 210 // 1. Primary resolution: If base is inside wp_upload_dir basedir, map through baseurl. 211 $is_inside_uploads = '' !== $uploads_basedir && ( $base === $uploads_basedir || 0 === strpos( $base, $uploads_basedir . '/' ) ); 212 if ( $is_inside_uploads ) { 213 $trimmed_baseurl = trim( $uploads_baseurl ); 214 if ( '' === $trimmed_baseurl ) { 215 return array( 216 'status' => 'manual', 217 'rule' => '', 218 'web_path' => '', 219 'fs_path' => $fs_path, 220 'reason' => 'invalid_baseurl', 221 ); 222 } 223 224 // Reject protocol-relative URLs (e.g. //cdn.example.org/uploads). 225 if ( 0 === strpos( $trimmed_baseurl, '//' ) ) { 226 return array( 227 'status' => 'manual', 228 'rule' => '', 229 'web_path' => '', 230 'fs_path' => $fs_path, 231 'reason' => 'protocol_relative', 232 ); 233 } 234 235 $parsed_baseurl = wp_parse_url( $trimmed_baseurl ); 236 if ( false === $parsed_baseurl || ! is_array( $parsed_baseurl ) ) { 237 return array( 238 'status' => 'manual', 239 'rule' => '', 240 'web_path' => '', 241 'fs_path' => $fs_path, 242 'reason' => 'malformed_baseurl', 243 ); 244 } 245 246 // Reject unexpected query, fragment, or user credentials in baseurl. 247 if ( isset( $parsed_baseurl['query'] ) || isset( $parsed_baseurl['fragment'] ) || isset( $parsed_baseurl['user'] ) || isset( $parsed_baseurl['pass'] ) ) { 248 return array( 249 'status' => 'manual', 250 'rule' => '', 251 'web_path' => '', 252 'fs_path' => $fs_path, 253 'reason' => 'unexpected_url_components', 254 ); 255 } 256 257 $upload_path = isset( $parsed_baseurl['path'] ) ? (string) $parsed_baseurl['path'] : ''; 258 $is_absolute = isset( $parsed_baseurl['scheme'] ) || isset( $parsed_baseurl['host'] ); 259 260 if ( $is_absolute ) { 261 $upload_origin = self::extract_origin( $trimmed_baseurl ); 262 if ( null === $upload_origin ) { 263 return array( 264 'status' => 'manual', 265 'rule' => '', 266 'web_path' => '', 267 'fs_path' => $fs_path, 268 'reason' => 'invalid_origin', 269 ); 270 } 271 272 // Resolve expected site origins from home_url() and site_url(). 273 $home_url = function_exists( 'home_url' ) ? (string) home_url() : ''; 274 $site_url = function_exists( 'site_url' ) ? (string) site_url() : ''; 275 $home_origin = '' !== $home_url ? self::extract_origin( $home_url ) : null; 276 $site_origin = '' !== $site_url ? self::extract_origin( $site_url ) : null; 277 278 // Fail closed if neither home_url nor site_url provides a valid origin to verify against. 279 if ( null === $home_origin && null === $site_origin ) { 280 return array( 281 'status' => 'manual', 282 'rule' => '', 283 'web_path' => '', 284 'fs_path' => $fs_path, 285 'reason' => 'missing_expected_origin', 286 ); 287 } 288 289 // Check exact same-origin match (scheme, hostname, effective port). 290 $matches_home = null !== $home_origin && 291 $upload_origin['scheme'] === $home_origin['scheme'] && 292 $upload_origin['host'] === $home_origin['host'] && 293 $upload_origin['port'] === $home_origin['port']; 294 295 $matches_site = null !== $site_origin && 296 $upload_origin['scheme'] === $site_origin['scheme'] && 297 $upload_origin['host'] === $site_origin['host'] && 298 $upload_origin['port'] === $site_origin['port']; 299 300 if ( ! $matches_home && ! $matches_site ) { 301 return array( 302 'status' => 'manual', 303 'rule' => '', 304 'web_path' => '', 305 'fs_path' => $fs_path, 306 'reason' => 'origin_mismatch', 307 ); 308 } 309 } else { 310 // Relative URL: must start strictly with '/' and not contain scheme markers or traversal. 311 if ( '' === $upload_path || 0 !== strpos( $upload_path, '/' ) ) { 312 return array( 313 'status' => 'manual', 314 'rule' => '', 315 'web_path' => '', 316 'fs_path' => $fs_path, 317 'reason' => 'invalid_relative_path', 318 ); 319 } 320 } 321 322 if ( '' === trim( $upload_path ) ) { 323 return array( 324 'status' => 'manual', 325 'rule' => '', 326 'web_path' => '', 327 'fs_path' => $fs_path, 328 'reason' => 'invalid_path', 329 ); 330 } 331 332 $rel_to_upload = substr( $base, strlen( $uploads_basedir ) ); 333 $candidate_path = rtrim( $upload_path, '/' ) . '/' . ltrim( $rel_to_upload, '/' ); 334 } elseif ( '' !== $root && ( $base === $root || 0 === strpos( $base, $root . '/' ) ) ) { 335 // 2. Fallback resolution: If base is directly inside ABSPATH / root. 336 $rel_to_root = substr( $base, strlen( $root ) ); 337 $site_ref = function_exists( 'site_url' ) && '' !== (string) site_url() 338 ? (string) site_url() 339 : ( function_exists( 'home_url' ) ? (string) home_url() : '' ); 340 $site_path = (string) wp_parse_url( $site_ref, PHP_URL_PATH ); 341 $site_path = '/' . trim( $site_path, '/' ); 342 343 if ( '/' !== $site_path && '' !== $site_path && 0 !== strpos( $rel_to_root, $site_path . '/' ) ) { 344 $candidate_path = rtrim( $site_path, '/' ) . '/' . ltrim( $rel_to_root, '/' ); 345 } else { 346 $candidate_path = '/' . ltrim( $rel_to_root, '/' ); 347 } 348 } 349 350 // If candidate path cannot be determined or resolved relative to webroot, require manual configuration. 351 if ( '' === $candidate_path ) { 352 return array( 353 'status' => 'manual', 354 'rule' => '', 355 'web_path' => '', 356 'fs_path' => $fs_path, 357 'reason' => 'outside_root', 358 ); 359 } 360 361 // 3. Strict security validation: reject control characters, newlines, NUL bytes, directive injection, and traversal. 362 if ( false !== strpos( $candidate_path, "\n" ) || 363 false !== strpos( $candidate_path, "\r" ) || 364 false !== strpos( $candidate_path, "\0" ) || 365 false !== strpos( $candidate_path, ';' ) || 366 false !== strpos( $candidate_path, '{' ) || 367 false !== strpos( $candidate_path, '}' ) ) { 368 return array( 369 'status' => 'manual', 370 'rule' => '', 371 'web_path' => '', 372 'fs_path' => $fs_path, 373 'reason' => 'unsafe_chars', 374 ); 375 } 376 377 // Reject any path segment containing '.' or '..' traversal, or empty segments. 378 $segments = explode( '/', trim( $candidate_path, '/' ) ); 379 foreach ( $segments as $seg ) { 380 if ( '' === $seg || '.' === $seg || '..' === $seg ) { 381 return array( 382 'status' => 'manual', 383 'rule' => '', 384 'web_path' => '', 385 'fs_path' => $fs_path, 386 'reason' => 'traversal', 387 ); 388 } 389 } 390 391 // Strictly validate characters: Never mutate or strip characters silently. 392 // If the candidate path contains any characters outside [A-Za-z0-9/_.-] (such as %20, spaces, etc.), 393 // refuse to generate a misleading rule and fail closed to manual status. 394 if ( 1 !== preg_match( '#^[A-Za-z0-9/_.\-]+$#', $candidate_path ) ) { 395 return array( 396 'status' => 'manual', 397 'rule' => '', 398 'web_path' => '', 399 'fs_path' => $fs_path, 400 'reason' => 'disallowed_chars', 401 ); 402 } 403 404 $trimmed = trim( $candidate_path, '/' ); 405 406 // Prevent matching the entire document root or invalid short paths. 407 if ( '' === $trimmed || strlen( $trimmed ) < 2 ) { 408 return array( 409 'status' => 'manual', 410 'rule' => '', 411 'web_path' => '', 412 'fs_path' => $fs_path, 413 'reason' => 'root_path', 414 ); 415 } 416 417 $web_path = '/' . $trimmed . '/'; 418 $rule = "location ^~ {$web_path} {\n deny all;\n return 403;\n}"; 419 420 return array( 421 'status' => 'exact', 422 'rule' => $rule, 423 'web_path' => $web_path, 424 'fs_path' => $fs_path, 425 'reason' => 'ok', 426 ); 427 } 428 429 /** 430 * Build an Nginx server-block location rule denying direct HTTP access to the 431 * Backupino storage directory. Uses `^~` so static-file regex rules cannot bypass it. 432 * 433 * Returns empty string if the web path cannot be reliably determined (e.g. external CDN or custom mapping). 434 * 435 * @param Paths $paths Storage layout. 436 * @return string 437 */ 438 public static function nginx_storage_rule( Paths $paths ): string { 439 $info = self::nginx_storage_info( $paths ); 440 return $info['rule']; 108 441 } 109 442 … … 115 448 */ 116 449 public static function snapshot( Paths $paths ): array { 450 $nginx_info = self::nginx_storage_info( $paths ); 451 117 452 return array( 118 'php_version' => PHP_VERSION, 119 'wp_version' => function_exists( 'get_bloginfo' ) ? get_bloginfo( 'version' ) : '', 120 'memory_limit' => (string) ini_get( 'memory_limit' ), 121 'max_execution' => (int) ini_get( 'max_execution_time' ), 122 'post_max_size' => (string) ini_get( 'post_max_size' ), 123 'disk_free' => Fs::free_space( $paths->base() ), 124 'zip' => class_exists( 'ZipArchive' ), 125 'openssl' => extension_loaded( 'openssl' ), 126 'curl' => extension_loaded( 'curl' ), 127 'suhosin' => extension_loaded( 'suhosin' ), 128 'storage_writable' => Fs::is_writable_dir( $paths->base() ), 129 'storage_path' => $paths->base(), 130 'blocking' => self::blocking_issues(), 131 'warnings' => self::warnings(), 453 'php_version' => PHP_VERSION, 454 'wp_version' => function_exists( 'get_bloginfo' ) ? get_bloginfo( 'version' ) : '', 455 'memory_limit' => (string) ini_get( 'memory_limit' ), 456 'max_execution' => (int) ini_get( 'max_execution_time' ), 457 'post_max_size' => (string) ini_get( 'post_max_size' ), 458 'disk_free' => Fs::free_space( $paths->base() ), 459 'zip' => class_exists( 'ZipArchive' ), 460 'openssl' => extension_loaded( 'openssl' ), 461 'curl' => extension_loaded( 'curl' ), 462 'suhosin' => extension_loaded( 'suhosin' ), 463 'is_nginx' => self::is_nginx(), 464 'nginx_rule' => $nginx_info['rule'], 465 'nginx_storage_info' => $nginx_info, 466 'storage_writable' => Fs::is_writable_dir( $paths->base() ), 467 'storage_path' => $paths->base(), 468 'blocking' => self::blocking_issues(), 469 'warnings' => self::warnings(), 132 470 ); 133 471 } -
backupino/trunk/src/Core/Paths.php
r3800274 r3809656 23 23 24 24 /** 25 * Storage root (`wp-content/backupino` by default). 25 * Storage root (`backupino` under the configured WordPress uploads `basedir`, 26 * or `WP_CONTENT_DIR/backupino` if `basedir` is unavailable). 26 27 * 27 28 * @var string … … 50 51 * Build from the current WordPress environment. 51 52 * 52 * Uses wp-content/backupino outside of public uploads for enhanced security and isolation, 53 * with automatic fallback to uploads directory if wp-content is not writable. 53 * Resolves the storage root to `<basedir>/backupino` using `wp_upload_dir()` 54 * whenever a non-empty `basedir` is returned, falling back to 55 * `WP_CONTENT_DIR . '/backupino'` (or `ABSPATH . 'wp-content/backupino'`) 56 * when `wp_upload_dir()` is unavailable or returns an empty `basedir`. 54 57 * 55 58 * @return self -
backupino/trunk/src/Download/PublicDownload.php
r3800274 r3809656 249 249 : plugins_url( 'assets/js/public-download.js', dirname( dirname( __DIR__ ) ) . '/backupino.php' ); 250 250 251 wp_register_style( 'backupino-public-download', $css_url, array(), defined( 'BACKUPINO_VERSION' ) ? BACKUPINO_VERSION : '1. 0.4' );251 wp_register_style( 'backupino-public-download', $css_url, array(), defined( 'BACKUPINO_VERSION' ) ? BACKUPINO_VERSION : '1.1.0' ); 252 252 $inline_css = ':root { ' . $css_vars . ' } ' . $custom_styles; 253 253 wp_add_inline_style( 'backupino-public-download', $inline_css ); 254 254 wp_enqueue_style( 'backupino-public-download' ); 255 255 256 wp_register_script( 'backupino-public-download', $js_url, array(), defined( 'BACKUPINO_VERSION' ) ? BACKUPINO_VERSION : '1. 0.4', true );256 wp_register_script( 'backupino-public-download', $js_url, array(), defined( 'BACKUPINO_VERSION' ) ? BACKUPINO_VERSION : '1.1.0', true ); 257 257 wp_enqueue_script( 'backupino-public-download' ); 258 258 -
backupino/trunk/src/Installer/State.php
r3800274 r3809656 13 13 14 14 // phpcs:disable WordPress.WP.AlternativeFunctions -- Standalone installer running outside WordPress environment. 15 // phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Offline standalone installer exceptions. 15 16 16 17 /** 17 * Stores wizard progress between AJAX requests. 18 * Stores wizard progress between AJAX requests inside a per-run private `0700` 19 * directory strictly outside the web document root, wrapped in an executable 20 * PHP 403 guard and authenticated encryption using a server-only secret. 18 21 */ 19 22 final class State { 20 23 21 24 /** 25 * Executable PHP guard prepended to every state file so direct HTTP access 26 * fails closed even on misconfigured web servers (Apache, Nginx, IIS). 27 * 28 * @var string 29 */ 30 public const GUARD_PREFIX = "<?php http_response_code( 403 ); exit; ?>\n"; 31 32 /** 33 * Prefix for per-run private state directories. 34 * 35 * @var string 36 */ 37 public const RUN_DIR_PREFIX = 'backupino-run-'; 38 39 /** 40 * Filename of the state file inside a private run directory. 41 * 42 * @var string 43 */ 44 public const STATE_FILENAME = 'state.php'; 45 46 /** 22 47 * Absolute path of the state file. 23 48 * … … 27 52 28 53 /** 54 * Absolute path of the private per-run directory (when managed as a private run). 55 * 56 * @var string 57 */ 58 private $run_dir; 59 60 /** 61 * Opaque signed run handle (nonce.hmac) referencing the private run directory. 62 * 63 * @var string 64 */ 65 private $run_handle; 66 67 /** 68 * Server-only secret key used for authenticated encryption at rest. 69 * 70 * @var string 71 */ 72 private $secret; 73 74 /** 75 * When true, corrupted, tampered, or undecryptable state fails closed by throwing. 76 * 77 * @var bool 78 */ 79 private $strict; 80 81 /** 29 82 * State data. 30 83 * … … 36 89 * Constructor. 37 90 * 38 * @param string $file Absolute path. 39 */ 40 public function __construct( string $file ) { 41 $this->file = $file; 91 * @param string $file Absolute path of the state file. 92 * @param string $secret Optional server-only secret key for authenticated encryption. 93 * @param string $run_dir Optional owning private run directory. 94 * @param string $run_handle Optional signed run handle. 95 * @param bool $strict Fail closed on missing/tampered state during load. 96 */ 97 public function __construct( 98 string $file, 99 string $secret = '', 100 string $run_dir = '', 101 string $run_handle = '', 102 bool $strict = false 103 ) { 104 $this->file = $file; 105 $this->secret = $secret; 106 $this->run_dir = $run_dir; 107 $this->run_handle = $run_handle; 108 $this->strict = $strict; 42 109 $this->load(); 43 110 } 44 111 45 112 /** 46 * Load state from disk. 113 * Normalize a filesystem path for cross-platform prefix comparisons. 114 * 115 * @param string $path Raw filesystem path. 116 * @return string Normalized path without trailing slash (except root). 117 */ 118 public static function normalize_path( string $path ): string { 119 $path = trim( $path ); 120 if ( '' === $path ) { 121 return ''; 122 } 123 124 $resolved = @realpath( $path ); 125 if ( is_string( $resolved ) && '' !== $resolved ) { 126 $path = $resolved; 127 } 128 129 $path = str_replace( '\\', '/', $path ); 130 $prefix = ''; 131 132 if ( preg_match( '/^([A-Za-z]:)\/(.*)$/', $path, $m ) ) { 133 $prefix = $m[1] . '/'; 134 $rest = $m[2]; 135 } elseif ( 0 === strpos( $path, '/' ) ) { 136 $prefix = '/'; 137 $rest = ltrim( $path, '/' ); 138 } else { 139 $rest = $path; 140 } 141 142 $segments = array(); 143 foreach ( explode( '/', $rest ) as $part ) { 144 if ( '' === $part || '.' === $part ) { 145 continue; 146 } 147 if ( '..' === $part ) { 148 array_pop( $segments ); 149 continue; 150 } 151 $segments[] = $part; 152 } 153 154 $normalized = $prefix . implode( '/', $segments ); 155 156 return '' === $normalized ? $prefix : $normalized; 157 } 158 159 /** 160 * Check whether a candidate directory is strictly outside the installer 161 * working directory and the web server document root. 162 * 163 * @param string $candidate_dir Candidate storage directory. 164 * @param string $web_dir Installer working directory. 165 * @param string|null $doc_root Web server DOCUMENT_ROOT, if known. 166 * @return bool 167 */ 168 public static function is_outside_webroot( string $candidate_dir, string $web_dir, ?string $doc_root = null ): bool { 169 $candidate = self::normalize_path( $candidate_dir ); 170 if ( '' === $candidate || ! is_dir( $candidate_dir ) ) { 171 return false; 172 } 173 174 $roots = array(); 175 $web = self::normalize_path( $web_dir ); 176 if ( '' !== $web ) { 177 $roots[] = $web; 178 } 179 if ( null !== $doc_root && '' !== trim( $doc_root ) ) { 180 $doc = self::normalize_path( $doc_root ); 181 if ( '' !== $doc ) { 182 $roots[] = $doc; 183 } 184 } 185 186 $case_insensitive = ( '\\' === DIRECTORY_SEPARATOR ) || ( 1 === preg_match( '/^[A-Za-z]:\//', $candidate ) ); 187 $cmp_candidate = $case_insensitive ? strtolower( $candidate ) : $candidate; 188 189 foreach ( $roots as $root ) { 190 $cmp_root = $case_insensitive ? strtolower( $root ) : $root; 191 $cmp_root = rtrim( $cmp_root, '/' ); 192 if ( '' === $cmp_root ) { 193 continue; 194 } 195 196 if ( $cmp_candidate === $cmp_root || 0 === strpos( $cmp_candidate, $cmp_root . '/' ) ) { 197 return false; 198 } 199 } 200 201 return true; 202 } 203 204 /** 205 * Find a writable base directory strictly outside the web document root and 206 * installer working directory where a private `0700` directory can be created. 207 * 208 * @param string $web_dir Installer working directory. 209 * @param string|null $doc_root Web server DOCUMENT_ROOT. 210 * @param array<int, string>|null $candidates Optional explicit candidate list (for testing). 211 * @return string Normalized absolute path of the external base directory. 212 * 213 * @throws \RuntimeException If no secure external storage directory is available. 214 */ 215 public static function find_secure_base_dir( 216 string $web_dir, 217 ?string $doc_root = null, 218 ?array $candidates = null 219 ): string { 220 if ( null === $doc_root && isset( $_SERVER['DOCUMENT_ROOT'] ) ) { 221 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.ValidatedSanitizedInput.MissingUnslash -- Server document root fallback during standalone restore. 222 $doc_root = (string) $_SERVER['DOCUMENT_ROOT']; 223 } 224 225 if ( null === $candidates ) { 226 $candidates = self::default_candidate_dirs(); 227 } 228 229 $checked = array(); 230 foreach ( $candidates as $dir ) { 231 $dir = trim( (string) $dir ); 232 if ( '' === $dir || is_link( $dir ) || ! is_dir( $dir ) ) { 233 continue; 234 } 235 236 $normalized = self::normalize_path( $dir ); 237 if ( '' === $normalized || isset( $checked[ $normalized ] ) ) { 238 continue; 239 } 240 $checked[ $normalized ] = true; 241 242 if ( ! self::is_outside_webroot( $normalized, $web_dir, $doc_root ) ) { 243 continue; 244 } 245 246 $probe_dir = rtrim( $normalized, '/' ) . '/.backupino-probe-' . bin2hex( random_bytes( 8 ) ); 247 if ( ! @mkdir( $probe_dir, 0700, false ) ) { 248 continue; 249 } 250 @chmod( $probe_dir, 0700 ); 251 $ok = ! is_link( $probe_dir ) && is_dir( $probe_dir ) && self::is_outside_webroot( $probe_dir, $web_dir, $doc_root ); 252 @rmdir( $probe_dir ); 253 254 if ( $ok ) { 255 return $normalized; 256 } 257 } 258 259 throw new \RuntimeException( 260 'Secure temporary storage outside the web document root is unavailable. Installation stopped to protect sensitive credentials.' 261 ); 262 } 263 264 /** 265 * Atomically create a brand-new, private `0700` run directory outside the web root 266 * with a cryptographically random name independent of any browser-visible token. 267 * 268 * Rejects pre-existing directories, symlinks, invalid ownership, or unsafe permissions. 269 * 270 * @param string $web_dir Installer working directory. 271 * @param string $state_secret Independent server-only secret (>= 32 chars). 272 * @param string $archive_name Archive basename for binding. 273 * @param string|null $doc_root Web server DOCUMENT_ROOT. 274 * @param array<int, string>|null $candidates Optional explicit candidate list (for testing). 275 * @return self 276 * 277 * @throws \RuntimeException If secure private storage cannot be created or verified. 278 */ 279 public static function create_private_run( 280 string $web_dir, 281 string $state_secret, 282 string $archive_name = '', 283 ?string $doc_root = null, 284 ?array $candidates = null 285 ): self { 286 if ( strlen( trim( $state_secret ) ) < 32 ) { 287 throw new \RuntimeException( 'Installer server-side security secret is missing or invalid.' ); 288 } 289 290 $base_dir = self::find_secure_base_dir( $web_dir, $doc_root, $candidates ); 291 292 for ( $attempt = 0; $attempt < 8; ++$attempt ) { 293 $nonce = bin2hex( random_bytes( 16 ) ); 294 $run_dir = rtrim( $base_dir, '/' ) . '/' . self::RUN_DIR_PREFIX . $nonce; 295 296 // Atomic creation (non-recursive) fails if directory or symlink already exists. 297 if ( ! @mkdir( $run_dir, 0700, false ) ) { 298 continue; 299 } 300 301 @chmod( $run_dir, 0700 ); 302 303 try { 304 self::assert_private_dir_safe( $run_dir, $web_dir, $doc_root ); 305 } catch ( \RuntimeException $e ) { 306 @rmdir( $run_dir ); 307 throw $e; 308 } 309 310 $handle = $nonce . '.' . self::sign_run( $nonce, $web_dir, $archive_name, $state_secret ); 311 $run_secret = self::derive_run_secret( $nonce, $web_dir, $state_secret ); 312 $state_file = $run_dir . '/' . self::STATE_FILENAME; 313 314 $state = new self( $state_file, $run_secret, $run_dir, $handle, false ); 315 if ( ! $state->save() ) { 316 $state->destroy(); 317 throw new \RuntimeException( 'Failed to initialize secure installer state.' ); 318 } 319 320 return $state; 321 } 322 323 throw new \RuntimeException( 324 'Failed to allocate an exclusive private state directory. Installation stopped.' 325 ); 326 } 327 328 /** 329 * Open and verify an existing private run directory using its server-signed handle. 330 * 331 * Fails closed if the handle signature is invalid, the directory or state file is a 332 * symlink, owned by another user, inside webroot, pre-created, missing, or tampered. 333 * 334 * @param string $run_handle Opaque signed handle (`<32-hex>.<64-hex>`). 335 * @param string $web_dir Installer working directory. 336 * @param string $state_secret Independent server-only secret. 337 * @param string $archive_name Archive basename for binding. 338 * @param string|null $doc_root Web server DOCUMENT_ROOT. 339 * @param array<int, string>|null $candidates Optional explicit candidate list (for testing). 340 * @return self 341 * 342 * @throws \RuntimeException On invalid handle, unsafe path/ownership, or tampered state. 343 */ 344 public static function open_private_run( 345 string $run_handle, 346 string $web_dir, 347 string $state_secret, 348 string $archive_name = '', 349 ?string $doc_root = null, 350 ?array $candidates = null 351 ): self { 352 if ( strlen( trim( $state_secret ) ) < 32 ) { 353 throw new \RuntimeException( 'Installer server-side security secret is missing or invalid.' ); 354 } 355 356 if ( 1 !== preg_match( '/^([a-f0-9]{32})\.([a-f0-9]{64})$/', $run_handle, $m ) ) { 357 throw new \RuntimeException( 'Invalid or missing installer session handle.' ); 358 } 359 360 $nonce = $m[1]; 361 $provided_sig = $m[2]; 362 $expected_sig = self::sign_run( $nonce, $web_dir, $archive_name, $state_secret ); 363 364 if ( ! hash_equals( $expected_sig, $provided_sig ) ) { 365 throw new \RuntimeException( 'Installer session verification failed.' ); 366 } 367 368 if ( null === $doc_root && isset( $_SERVER['DOCUMENT_ROOT'] ) ) { 369 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.ValidatedSanitizedInput.MissingUnslash -- Server document root fallback during standalone restore. 370 $doc_root = (string) $_SERVER['DOCUMENT_ROOT']; 371 } 372 373 if ( null === $candidates ) { 374 $candidates = self::default_candidate_dirs(); 375 } 376 377 $run_dir = ''; 378 $checked = array(); 379 foreach ( $candidates as $dir ) { 380 $dir = trim( (string) $dir ); 381 if ( '' === $dir || is_link( $dir ) || ! is_dir( $dir ) ) { 382 continue; 383 } 384 $normalized = self::normalize_path( $dir ); 385 if ( '' === $normalized || isset( $checked[ $normalized ] ) ) { 386 continue; 387 } 388 $checked[ $normalized ] = true; 389 390 $candidate_run = rtrim( $normalized, '/' ) . '/' . self::RUN_DIR_PREFIX . $nonce; 391 if ( file_exists( $candidate_run ) || is_link( $candidate_run ) ) { 392 $run_dir = $candidate_run; 393 break; 394 } 395 } 396 397 if ( '' === $run_dir ) { 398 throw new \RuntimeException( 'Installer session state was not found or has expired.' ); 399 } 400 401 self::assert_private_dir_safe( $run_dir, $web_dir, $doc_root ); 402 403 $state_file = $run_dir . '/' . self::STATE_FILENAME; 404 self::assert_private_file_safe( $state_file, $run_dir ); 405 406 $run_secret = self::derive_run_secret( $nonce, $web_dir, $state_secret ); 407 408 return new self( $state_file, $run_secret, $run_dir, $run_handle, true ); 409 } 410 411 /** 412 * Load state from disk. In strict mode, any missing, malformed, unguarded, or 413 * tampered state fails closed by throwing RuntimeException. 47 414 * 48 415 * @return void 416 * 417 * @throws \RuntimeException In strict mode when state cannot be verified or decrypted. 49 418 */ 50 419 public function load(): void { 420 if ( is_link( $this->file ) ) { 421 $this->data = array(); 422 if ( $this->strict ) { 423 throw new \RuntimeException( 'Installer state file is unsafe (symlink detected).' ); 424 } 425 426 return; 427 } 428 51 429 if ( ! is_readable( $this->file ) ) { 52 430 $this->data = array(); 431 if ( $this->strict ) { 432 throw new \RuntimeException( 'Installer state file is missing or unreadable.' ); 433 } 53 434 54 435 return; 55 436 } 56 437 57 $raw = (string) file_get_contents( $this->file ); 438 $raw = @file_get_contents( $this->file ); 439 if ( ! is_string( $raw ) ) { 440 $this->data = array(); 441 if ( $this->strict ) { 442 throw new \RuntimeException( 'Installer state file could not be read.' ); 443 } 444 445 return; 446 } 447 448 if ( 0 !== strpos( $raw, self::GUARD_PREFIX ) ) { 449 $this->data = array(); 450 if ( $this->strict ) { 451 throw new \RuntimeException( 'Installer state integrity check failed.' ); 452 } 453 } else { 454 $raw = substr( $raw, strlen( self::GUARD_PREFIX ) ); 455 } 456 58 457 $parsed = json_decode( $raw, true ); 59 60 $this->data = is_array( $parsed ) ? $parsed : array(); 61 } 62 63 /** 64 * Persist state atomically with restrictive permissions. 458 if ( ! is_array( $parsed ) ) { 459 $this->data = array(); 460 if ( $this->strict ) { 461 throw new \RuntimeException( 'Installer state is corrupted or tampered.' ); 462 } 463 464 return; 465 } 466 467 if ( '' !== $this->secret ) { 468 $decrypted = $this->decrypt_envelope( $parsed ); 469 if ( ! is_array( $decrypted ) ) { 470 $this->data = array(); 471 if ( $this->strict ) { 472 throw new \RuntimeException( 'Installer state decryption or authentication failed.' ); 473 } 474 475 return; 476 } 477 $this->data = $decrypted; 478 479 return; 480 } 481 482 $this->data = $parsed; 483 } 484 485 /** 486 * Persist state atomically with PHP guard, server-secret authenticated encryption, 487 * and restrictive 0600 permissions inside the private run directory. 65 488 * 66 489 * @return bool 67 490 */ 68 491 public function save(): bool { 69 $encoded = json_encode( $this->data ); 70 71 if ( ! is_string( $encoded ) ) { 492 if ( is_link( $this->file ) ) { 72 493 return false; 73 494 } 74 495 75 $temp = $this->file . '.tmp'; 76 77 if ( false === @file_put_contents( $temp, $encoded, LOCK_EX ) ) { 496 if ( '' !== $this->run_dir && ( is_link( $this->run_dir ) || ! is_dir( $this->run_dir ) ) ) { 78 497 return false; 79 498 } 80 499 500 $plaintext = json_encode( $this->data ); 501 if ( ! is_string( $plaintext ) ) { 502 return false; 503 } 504 505 if ( '' !== $this->secret ) { 506 $envelope = $this->encrypt_envelope( $plaintext ); 507 $encoded = json_encode( $envelope ); 508 if ( ! is_string( $encoded ) ) { 509 return false; 510 } 511 } else { 512 $encoded = $plaintext; 513 } 514 515 $payload = self::GUARD_PREFIX . $encoded; 516 $temp = $this->file . '.tmp.' . bin2hex( random_bytes( 6 ) ); 517 518 $fp = @fopen( $temp, 'xb' ); 519 if ( false === $fp ) { 520 return false; 521 } 522 81 523 @chmod( $temp, 0600 ); 82 83 return @rename( $temp, $this->file ); 524 $written = @fwrite( $fp, $payload ); 525 @fflush( $fp ); 526 @fclose( $fp ); 527 528 if ( false === $written || $written !== strlen( $payload ) ) { 529 @unlink( $temp ); 530 531 return false; 532 } 533 534 if ( ! @rename( $temp, $this->file ) ) { 535 @unlink( $temp ); 536 537 return false; 538 } 539 540 @chmod( $this->file, 0600 ); 541 542 return true; 543 } 544 545 /** 546 * Absolute path of the state file. 547 * 548 * @return string 549 */ 550 public function file(): string { 551 return $this->file; 552 } 553 554 /** 555 * Absolute path of the private per-run directory. 556 * 557 * @return string 558 */ 559 public function run_dir(): string { 560 return $this->run_dir; 561 } 562 563 /** 564 * Opaque signed handle referencing this private run. 565 * 566 * @return string 567 */ 568 public function handle(): string { 569 return $this->run_handle; 84 570 } 85 571 … … 87 573 * Read a value. 88 574 * 89 * @param string $key Key.575 * @param string $key Key. 90 576 * @param mixed $fallback Fallback. 91 577 * @return mixed … … 107 593 108 594 /** 595 * Remove a single key from state. 596 * 597 * @param string $key Key. 598 * @return void 599 */ 600 public function remove( string $key ): void { 601 unset( $this->data[ $key ] ); 602 } 603 604 /** 109 605 * Whether a key exists. 110 606 * … … 117 613 118 614 /** 119 * Delete the state file. 615 * Purge sensitive credential keys from state immediately. 616 * 617 * When `$keep_auth_flag` is true and the session was authenticated with an 618 * installer password, only the minimal non-sensitive authentication flag is 619 * retained so the final cleanup step can still be authorized. Otherwise the 620 * entire private run state and directory are destroyed immediately. 621 * 622 * @param bool $keep_auth_flag Whether to preserve minimal non-sensitive auth status. 623 * @return void 624 */ 625 public function purge_sensitive( bool $keep_auth_flag = false ): void { 626 unset( $this->data['db'], $this->data['admin_account'] ); 627 628 if ( $keep_auth_flag && ! empty( $this->data['authenticated'] ) ) { 629 $this->data = array( 630 'authenticated' => true, 631 'finished' => ! empty( $this->data['finished'] ), 632 ); 633 $this->cleanup_crash_temps(); 634 $this->save(); 635 636 return; 637 } 638 639 $this->destroy(); 640 } 641 642 /** 643 * Delete the state file, any crash-leftover `.tmp.*` files strictly inside this 644 * run's private directory, and remove the private directory itself. 645 * 646 * Never touches files belonging to other runs, shared temp files, or user files. 120 647 * 121 648 * @return void … … 124 651 $this->data = array(); 125 652 653 if ( '' !== $this->run_dir && is_dir( $this->run_dir ) && ! is_link( $this->run_dir ) ) { 654 $this->cleanup_crash_temps(); 655 656 if ( is_file( $this->file ) || is_link( $this->file ) ) { 657 @chmod( $this->file, 0600 ); 658 @unlink( $this->file ); 659 } 660 661 @rmdir( $this->run_dir ); 662 663 return; 664 } 665 126 666 if ( is_file( $this->file ) ) { 667 @chmod( $this->file, 0600 ); 127 668 @unlink( $this->file ); 669 } 670 671 if ( is_file( $this->file . '.tmp' ) ) { 672 @unlink( $this->file . '.tmp' ); 673 } 674 } 675 676 /** 677 * Remove any crash-leftover temporary files (`state.php.tmp*`) strictly scoped 678 * to this run's private directory. 679 * 680 * @return void 681 */ 682 public function cleanup_crash_temps(): void { 683 if ( '' === $this->run_dir || ! is_dir( $this->run_dir ) || is_link( $this->run_dir ) ) { 684 return; 685 } 686 687 $entries = @scandir( $this->run_dir ); 688 if ( ! is_array( $entries ) ) { 689 return; 690 } 691 692 $prefix = self::STATE_FILENAME . '.tmp'; 693 foreach ( $entries as $entry ) { 694 if ( '.' === $entry || '..' === $entry ) { 695 continue; 696 } 697 if ( $entry === $prefix || 1 === preg_match( '/^' . preg_quote( $prefix, '/' ) . '\.[a-f0-9]+$/i', $entry ) ) { 698 $path = rtrim( $this->run_dir, '/' ) . '/' . $entry; 699 if ( is_file( $path ) || is_link( $path ) ) { 700 @chmod( $path, 0600 ); 701 @unlink( $path ); 702 } 703 } 128 704 } 129 705 } … … 137 713 return $this->data; 138 714 } 715 716 /** 717 * Default external candidate directories outside webroot. 718 * 719 * @return array<int, string> 720 */ 721 private static function default_candidate_dirs(): array { 722 $candidates = array(); 723 724 $sys_tmp = sys_get_temp_dir(); 725 if ( is_string( $sys_tmp ) && '' !== trim( $sys_tmp ) ) { 726 $candidates[] = $sys_tmp; 727 } 728 729 $upload_tmp = (string) ini_get( 'upload_tmp_dir' ); 730 if ( '' !== trim( $upload_tmp ) ) { 731 $candidates[] = $upload_tmp; 732 } 733 734 if ( function_exists( 'session_save_path' ) ) { 735 $sess_dir = (string) session_save_path(); 736 if ( '' !== trim( $sess_dir ) ) { 737 if ( false !== strpos( $sess_dir, ';' ) ) { 738 $parts = explode( ';', $sess_dir ); 739 $sess_dir = (string) end( $parts ); 740 } 741 if ( '' !== trim( $sess_dir ) ) { 742 $candidates[] = $sess_dir; 743 } 744 } 745 } 746 747 return $candidates; 748 } 749 750 /** 751 * Verify that a private run directory is real, not a symlink, outside webroot, 752 * owned by the current OS user, and has no group/world access on POSIX systems. 753 * 754 * @param string $dir Candidate private run directory. 755 * @param string $web_dir Installer working directory. 756 * @param string|null $doc_root Web server DOCUMENT_ROOT. 757 * @return void 758 * 759 * @throws \RuntimeException If any safety invariant fails. 760 */ 761 private static function assert_private_dir_safe( string $dir, string $web_dir, ?string $doc_root ): void { 762 if ( is_link( $dir ) || ! is_dir( $dir ) ) { 763 throw new \RuntimeException( 'Secure private state directory is missing or unsafe.' ); 764 } 765 766 if ( ! self::is_outside_webroot( $dir, $web_dir, $doc_root ) ) { 767 throw new \RuntimeException( 'State directory resolved inside web document root. Installation stopped.' ); 768 } 769 770 if ( '\\' !== DIRECTORY_SEPARATOR ) { 771 clearstatcache( true, $dir ); 772 if ( function_exists( 'posix_geteuid' ) && function_exists( 'fileowner' ) ) { 773 $owner = @fileowner( $dir ); 774 if ( false === $owner || $owner !== posix_geteuid() ) { 775 throw new \RuntimeException( 'Private state directory ownership verification failed.' ); 776 } 777 } 778 779 $perms = @fileperms( $dir ); 780 if ( false !== $perms && 0 !== ( $perms & 0077 ) ) { 781 throw new \RuntimeException( 'Private state directory permissions are too permissive.' ); 782 } 783 } 784 } 785 786 /** 787 * Verify that the state file inside a private run directory is a regular file 788 * (not a symlink), lives inside the private directory, and has safe ownership/perms. 789 * 790 * @param string $file Absolute state file path. 791 * @param string $run_dir Expected parent private run directory. 792 * @return void 793 * 794 * @throws \RuntimeException If any safety invariant fails. 795 */ 796 private static function assert_private_file_safe( string $file, string $run_dir ): void { 797 if ( is_link( $file ) || ! is_file( $file ) ) { 798 throw new \RuntimeException( 'Installer state file is missing or unsafe.' ); 799 } 800 801 $norm_dir = rtrim( self::normalize_path( $run_dir ), '/' ); 802 $norm_file = self::normalize_path( $file ); 803 if ( 0 !== strpos( $norm_file, $norm_dir . '/' ) ) { 804 throw new \RuntimeException( 'Installer state file path escaped its private directory.' ); 805 } 806 807 if ( '\\' !== DIRECTORY_SEPARATOR ) { 808 clearstatcache( true, $file ); 809 if ( function_exists( 'posix_geteuid' ) && function_exists( 'fileowner' ) ) { 810 $owner = @fileowner( $file ); 811 if ( false === $owner || $owner !== posix_geteuid() ) { 812 throw new \RuntimeException( 'Installer state file ownership verification failed.' ); 813 } 814 } 815 816 $perms = @fileperms( $file ); 817 if ( false !== $perms && 0 !== ( $perms & 0077 ) ) { 818 throw new \RuntimeException( 'Installer state file permissions are too permissive.' ); 819 } 820 } 821 } 822 823 /** 824 * Compute the server-signed HMAC binding a run nonce to this installer instance. 825 * 826 * @param string $nonce 32-char hex nonce. 827 * @param string $web_dir Installer working directory. 828 * @param string $archive_name Archive basename. 829 * @param string $state_secret Server-only secret. 830 * @return string 64-char hex HMAC-SHA256. 831 */ 832 private static function sign_run( string $nonce, string $web_dir, string $archive_name, string $state_secret ): string { 833 return hash_hmac( 834 'sha256', 835 'backupino-run-handle|' . $nonce . '|' . self::normalize_path( $web_dir ) . '|' . basename( $archive_name ), 836 $state_secret 837 ); 838 } 839 840 /** 841 * Derive the per-run encryption secret from the server-only secret and run nonce. 842 * 843 * @param string $nonce 32-char hex nonce. 844 * @param string $web_dir Installer working directory. 845 * @param string $state_secret Server-only secret. 846 * @return string 847 */ 848 private static function derive_run_secret( string $nonce, string $web_dir, string $state_secret ): string { 849 return hash_hmac( 850 'sha256', 851 'backupino-run-secret|' . $nonce . '|' . self::normalize_path( $web_dir ), 852 $state_secret 853 ); 854 } 855 856 /** 857 * Encrypt a JSON string into an authenticated envelope. 858 * 859 * @param string $plaintext JSON payload. 860 * @return array<string, mixed> 861 */ 862 private function encrypt_envelope( string $plaintext ): array { 863 $enc_key = hash_hmac( 'sha256', 'backupino-state-enc', $this->secret, true ); 864 $mac_key = hash_hmac( 'sha256', 'backupino-state-mac', $this->secret, true ); 865 866 if ( function_exists( 'openssl_encrypt' ) && function_exists( 'openssl_get_cipher_methods' ) ) { 867 $methods = openssl_get_cipher_methods(); 868 869 if ( in_array( 'aes-256-gcm', $methods, true ) ) { 870 $iv = random_bytes( 12 ); 871 $tag = ''; 872 $ct = openssl_encrypt( $plaintext, 'aes-256-gcm', $enc_key, OPENSSL_RAW_DATA, $iv, $tag ); 873 if ( is_string( $ct ) && '' !== $tag ) { 874 return array( 875 'v' => 2, 876 'alg' => 'aes-256-gcm', 877 'iv' => base64_encode( $iv ), 878 'tag' => base64_encode( $tag ), 879 'ct' => base64_encode( $ct ), 880 ); 881 } 882 } 883 884 if ( in_array( 'aes-256-cbc', $methods, true ) ) { 885 $iv = random_bytes( 16 ); 886 $ct = openssl_encrypt( $plaintext, 'aes-256-cbc', $enc_key, OPENSSL_RAW_DATA, $iv ); 887 if ( is_string( $ct ) ) { 888 $mac = hash_hmac( 'sha256', $iv . $ct, $mac_key, true ); 889 890 return array( 891 'v' => 2, 892 'alg' => 'aes-256-cbc-hmac', 893 'iv' => base64_encode( $iv ), 894 'mac' => base64_encode( $mac ), 895 'ct' => base64_encode( $ct ), 896 ); 897 } 898 } 899 } 900 901 // OpenSSL fallback: authenticated stream cipher (still inside 0700 private dir outside webroot + PHP 403 guard). 902 $salt = random_bytes( 16 ); 903 $ct = self::xor_stream( $plaintext, $enc_key, $salt ); 904 $mac = hash_hmac( 'sha256', $salt . $ct, $mac_key, true ); 905 906 return array( 907 'v' => 2, 908 'alg' => 'hmac-stream', 909 'salt' => base64_encode( $salt ), 910 'mac' => base64_encode( $mac ), 911 'ct' => base64_encode( $ct ), 912 ); 913 } 914 915 /** 916 * Decrypt and authenticate a persisted state envelope. 917 * 918 * @param array<string, mixed> $envelope Decoded envelope. 919 * @return array<string, mixed>|null 920 */ 921 private function decrypt_envelope( array $envelope ): ?array { 922 if ( 2 !== (int) ( $envelope['v'] ?? 0 ) || empty( $envelope['alg'] ) || empty( $envelope['ct'] ) ) { 923 return null; 924 } 925 926 $enc_key = hash_hmac( 'sha256', 'backupino-state-enc', $this->secret, true ); 927 $mac_key = hash_hmac( 'sha256', 'backupino-state-mac', $this->secret, true ); 928 $alg = (string) $envelope['alg']; 929 $ct = base64_decode( (string) $envelope['ct'], true ); 930 $plaintext = false; 931 932 if ( ! is_string( $ct ) ) { 933 return null; 934 } 935 936 if ( 'aes-256-gcm' === $alg && function_exists( 'openssl_decrypt' ) ) { 937 $iv = base64_decode( (string) ( $envelope['iv'] ?? '' ), true ); 938 $tag = base64_decode( (string) ( $envelope['tag'] ?? '' ), true ); 939 if ( is_string( $iv ) && is_string( $tag ) ) { 940 $plaintext = openssl_decrypt( $ct, 'aes-256-gcm', $enc_key, OPENSSL_RAW_DATA, $iv, $tag ); 941 } 942 } elseif ( 'aes-256-cbc-hmac' === $alg && function_exists( 'openssl_decrypt' ) ) { 943 $iv = base64_decode( (string) ( $envelope['iv'] ?? '' ), true ); 944 $mac = base64_decode( (string) ( $envelope['mac'] ?? '' ), true ); 945 if ( is_string( $iv ) && is_string( $mac ) ) { 946 $expected = hash_hmac( 'sha256', $iv . $ct, $mac_key, true ); 947 if ( hash_equals( $expected, $mac ) ) { 948 $plaintext = openssl_decrypt( $ct, 'aes-256-cbc', $enc_key, OPENSSL_RAW_DATA, $iv ); 949 } 950 } 951 } elseif ( 'hmac-stream' === $alg ) { 952 $salt = base64_decode( (string) ( $envelope['salt'] ?? '' ), true ); 953 $mac = base64_decode( (string) ( $envelope['mac'] ?? '' ), true ); 954 if ( is_string( $salt ) && is_string( $mac ) ) { 955 $expected = hash_hmac( 'sha256', $salt . $ct, $mac_key, true ); 956 if ( hash_equals( $expected, $mac ) ) { 957 $plaintext = self::xor_stream( $ct, $enc_key, $salt ); 958 } 959 } 960 } 961 962 if ( ! is_string( $plaintext ) ) { 963 return null; 964 } 965 966 $decoded = json_decode( $plaintext, true ); 967 968 return is_array( $decoded ) ? $decoded : null; 969 } 970 971 /** 972 * Deterministic HMAC-SHA256 counter-mode XOR stream for environments without OpenSSL. 973 * 974 * @param string $input Data to encrypt or decrypt. 975 * @param string $key 32-byte key. 976 * @param string $salt 16-byte nonce/salt. 977 * @return string 978 */ 979 private static function xor_stream( string $input, string $key, string $salt ): string { 980 $len = strlen( $input ); 981 $out = ''; 982 $counter = 0; 983 984 for ( $offset = 0; $offset < $len; $offset += 32 ) { 985 $block = hash_hmac( 'sha256', $salt . pack( 'N', $counter ), $key, true ); 986 $chunk = substr( $input, $offset, 32 ); 987 $out .= $chunk ^ substr( $block, 0, strlen( $chunk ) ); 988 ++$counter; 989 } 990 991 return $out; 992 } 139 993 } -
backupino/trunk/src/Installer/installer-template.php
r3800274 r3809656 34 34 $error = error_get_last(); 35 35 if ( $error && in_array( $error['type'], array( E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR ), true ) ) { 36 if ( isset( $GLOBALS['backupino_active_state'] ) && $GLOBALS['backupino_active_state'] instanceof State ) { 37 $GLOBALS['backupino_active_state']->purge_sensitive( false ); 38 } 36 39 while ( ob_get_level() > 0 ) { 37 40 @ob_end_clean(); … … 43 46 echo json_encode( array( 44 47 'ok' => false, 45 'error' => ' Fatal Error: ' . $error['message'] . ' in ' . basename( $error['file'] ) . ':' . $error['line'],48 'error' => 'A fatal server error occurred during installation. Temporary credentials have been cleared.', 46 49 ), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ); 47 50 exit; … … 95 98 } 96 99 97 $backupino_state_file = $backupino_dir . '/backupino-install.json';98 100 $backupino_archive_name = isset( $backupino_payload['archive'] ) ? basename( (string) $backupino_payload['archive'] ) : ''; 99 101 $backupino_archive = $backupino_dir . '/' . $backupino_archive_name; 100 102 $backupino_token = isset( $backupino_payload['token'] ) ? (string) $backupino_payload['token'] : ''; 103 $backupino_state_secret = isset( $backupino_payload['state_secret'] ) ? (string) $backupino_payload['state_secret'] : ''; 101 104 $backupino_action = isset( $_REQUEST['action'] ) ? (string) preg_replace( '/[^a-z_]/', '', (string) $_REQUEST['action'] ) : 'index'; 105 $backupino_doc_root = isset( $_SERVER['DOCUMENT_ROOT'] ) ? (string) $_SERVER['DOCUMENT_ROOT'] : null; 106 107 $backupino_state_base = ''; 108 $backupino_state_error = ''; 109 if ( strlen( trim( $backupino_state_secret ) ) < 32 || ( '' !== $backupino_token && hash_equals( $backupino_token, $backupino_state_secret ) ) ) { 110 $backupino_state_error = 'Installer server-side security secret is missing or invalid.'; 111 } else { 112 try { 113 $backupino_state_base = State::find_secure_base_dir( $backupino_dir, $backupino_doc_root ); 114 } catch ( \RuntimeException $e ) { 115 $backupino_state_error = $e->getMessage(); 116 } 117 } 102 118 103 119 // Auto-detect current host and base URL … … 111 127 112 128 if ( 'index' === $backupino_action ) { 113 $backupino_checks = Env::check( $backupino_payload, $backupino_dir, $backupino_archive ); 129 $backupino_checks = Env::check( $backupino_payload, $backupino_dir, $backupino_archive ); 130 $backupino_checks[] = array( 131 'label' => 'Secure state storage', 132 'ok' => '' === $backupino_state_error && '' !== $backupino_state_base, 133 'detail' => '' === $backupino_state_error 134 ? 'Private per-run storage outside web document root' 135 : $backupino_state_error, 136 ); 114 137 $backupino_body = '<div id="app"> 115 138 <section id="step1"> … … 142 165 <span data-i18n="empty_db_lbl">Empty existing database tables before import (Recommended)</span> 143 166 </label> 167 <div class="admin-box"> 168 <label style="display:flex;align-items:center;gap:8px;margin:0;font-weight:600;cursor:pointer;"> 169 <input type="checkbox" id="create_admin" name="create_admin" value="1" style="width:auto;margin:0;"> 170 <span data-i18n="create_admin_opt">Create a new WordPress Administrator account (Optional)</span> 171 </label> 172 <div id="admin-fields" class="hidden" style="margin-top:12px;"> 173 <div class="grid"> 174 <div> 175 <label for="admin_user" data-i18n="admin_user_lbl">Administrator Username</label> 176 <input id="admin_user" name="admin_user" placeholder="admin"> 177 </div> 178 <div> 179 <label for="admin_email" data-i18n="admin_email_lbl">Administrator Email</label> 180 <input id="admin_email" name="admin_email" type="email" placeholder="admin@example.com"> 181 </div> 182 </div> 183 <label for="admin_pass" data-i18n="admin_pass_lbl">Administrator Password</label> 184 <div class="pass-wrap"> 185 <input id="admin_pass" name="admin_pass" type="password" placeholder="Enter secure password"> 186 <button type="button" class="pass-toggle-btn" id="toggle_admin_pass" data-i18n="show_btn">Show</button> 187 </div> 188 </div> 189 </div> 144 190 <p class="err" id="error2"></p> 145 191 <div style="display:flex;gap:10px;align-items:center;margin-top:16px;"> … … 164 210 <h2 style="font-size:16px;margin:0 0 10px;color:#16a34a;" id="done-title" data-i18n="ready_title">✓ Your site is ready</h2> 165 211 <p class="lead" id="done-url" style="font-weight:600;word-break:break-all;"></p> 212 <div id="admin-created-box" class="hidden" style="margin:14px 0;padding:12px 14px;background:#f0fdf4;border:1px solid #bbf7d0;border-radius:8px;font-size:13px;color:#166534;"> 213 <div style="font-weight:700;margin-bottom:4px;" data-i18n="admin_created_title">✓ New Administrator Account Created:</div> 214 <div><span data-i18n="admin_user_lbl">Username</span>: <strong id="admin-created-name"></strong></div> 215 </div> 166 216 <div style="display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:16px;"> 167 217 <button type="button" id="cleanup" data-i18n="cleanup_btn" style="background:#16a34a;margin-top:0;">Delete installer files & Login</button> … … 197 247 @set_time_limit( 180 ); 198 248 199 $backupino_state = new State( $backupino_state_file ); 200 201 // Optional password gate, configured when the package was built. 202 $backupino_password = isset( $backupino_payload['password'] ) ? (string) $backupino_payload['password'] : ''; 203 204 if ( '' !== $backupino_password && ! $backupino_state->get( 'authenticated' ) ) { 205 $backupino_supplied = isset( $_REQUEST['installer_password'] ) ? (string) $_REQUEST['installer_password'] : ''; 206 207 if ( ! hash_equals( $backupino_password, $backupino_supplied ) ) { 249 if ( '' !== $backupino_state_error || '' === $backupino_state_base ) { 250 respond( 251 array( 252 'ok' => false, 253 'error' => '' !== $backupino_state_error 254 ? $backupino_state_error 255 : 'Secure temporary storage outside the web document root is unavailable. Installation stopped to protect sensitive credentials.', 256 ), 257 500 258 ); 259 } 260 261 $backupino_password = isset( $backupino_payload['password'] ) ? (string) $backupino_payload['password'] : ''; 262 $backupino_run_handle = isset( $_POST['run_handle'] ) ? trim( (string) $_POST['run_handle'] ) : ''; 263 if ( '' === $backupino_run_handle && isset( $_COOKIE['backupino_run'] ) ) { 264 $backupino_run_handle = trim( (string) $_COOKIE['backupino_run'] ); 265 } 266 267 $backupino_state = null; 268 $backupino_state_file = ''; 269 270 // Actions that require an already-created private run session fail closed on invalid/tampered state. 271 if ( in_array( $backupino_action, array( 'extract', 'import', 'rewrite', 'config' ), true ) ) { 272 try { 273 $backupino_state = State::open_private_run( 274 $backupino_run_handle, 275 $backupino_dir, 276 $backupino_state_secret, 277 $backupino_archive_name, 278 $backupino_doc_root 279 ); 280 } catch ( \RuntimeException $e ) { 281 respond( array( 'ok' => false, 'error' => sanitize_error_message( $e->getMessage(), array(), '', $backupino_state_secret, $backupino_run_handle ) ), 400 ); 282 } 283 284 $backupino_state_file = $backupino_state->file(); 285 $GLOBALS['backupino_active_state'] = $backupino_state; 286 287 if ( '' !== $backupino_password && ! $backupino_state->get( 'authenticated' ) ) { 208 288 respond( array( 'ok' => false, 'error' => 'Installer password required.' ), 401 ); 209 289 } 210 211 $backupino_state->set( 'authenticated', true ); 212 $backupino_state->save(); 290 } elseif ( in_array( $backupino_action, array( 'abort', 'cleanup' ), true ) && '' !== $backupino_run_handle ) { 291 try { 292 $backupino_state = State::open_private_run( 293 $backupino_run_handle, 294 $backupino_dir, 295 $backupino_state_secret, 296 $backupino_archive_name, 297 $backupino_doc_root 298 ); 299 $backupino_state_file = $backupino_state->file(); 300 $GLOBALS['backupino_active_state'] = $backupino_state; 301 } catch ( \RuntimeException $e ) { 302 $backupino_state = null; 303 } 213 304 } 214 305 … … 216 307 switch ( $backupino_action ) { 217 308 case 'check': 218 $checks = Env::check( $backupino_payload, $backupino_dir, $backupino_archive ); 309 $checks = Env::check( $backupino_payload, $backupino_dir, $backupino_archive ); 310 $checks[] = array( 311 'label' => 'Secure state storage', 312 'ok' => '' === $backupino_state_error && '' !== $backupino_state_base, 313 'detail' => '' === $backupino_state_error 314 ? 'Private per-run storage outside web document root' 315 : $backupino_state_error, 316 ); 219 317 220 318 respond( … … 228 326 229 327 case 'connect': 328 if ( '' !== $backupino_password ) { 329 $backupino_supplied = isset( $_REQUEST['installer_password'] ) ? (string) $_REQUEST['installer_password'] : ''; 330 if ( ! hash_equals( $backupino_password, $backupino_supplied ) ) { 331 respond( array( 'ok' => false, 'error' => 'Installer password required.' ), 401 ); 332 } 333 } 334 230 335 $prefix = isset( $_POST['prefix'] ) && '' !== trim( (string) $_POST['prefix'] ) ? trim( (string) $_POST['prefix'] ) : 'wp_'; 231 336 if ( ! preg_match( '/^[a-zA-Z0-9_]+$/', $prefix ) ) { … … 253 358 } 254 359 360 $create_admin = ! empty( $_POST['create_admin'] ); 361 $admin_account = array(); 362 if ( $create_admin ) { 363 $admin_user = isset( $_POST['admin_user'] ) ? trim( (string) $_POST['admin_user'] ) : ''; 364 $admin_pass = isset( $_POST['admin_pass'] ) ? (string) $_POST['admin_pass'] : ''; 365 $admin_email = isset( $_POST['admin_email'] ) ? trim( (string) $_POST['admin_email'] ) : ''; 366 367 if ( '' === $admin_user || strlen( $admin_user ) > 60 ) { 368 respond( array( 'ok' => false, 'error' => 'Administrator username is required (max 60 characters).' ), 400 ); 369 } 370 if ( '' === $admin_pass ) { 371 respond( array( 'ok' => false, 'error' => 'Administrator password is required.' ), 400 ); 372 } 373 if ( '' === $admin_email || strlen( $admin_email ) > 100 || false === filter_var( $admin_email, FILTER_VALIDATE_EMAIL ) ) { 374 respond( array( 'ok' => false, 'error' => 'A valid administrator email address is required.' ), 400 ); 375 } 376 377 // Hash immediately so plaintext administrator password is never stored in state. 378 $admin_pass_hash = AdminCreator::hash_password( $admin_pass ); 379 unset( $admin_pass ); 380 381 $admin_account = array( 382 'enabled' => true, 383 'username' => $admin_user, 384 'password_hash' => $admin_pass_hash, 385 'email' => $admin_email, 386 ); 387 } 388 255 389 try { 256 390 $connection = ConnectionManager::ensure( $config ); 257 391 } catch ( \RuntimeException $e ) { 258 respond( array( 'ok' => false, 'error' => $e->getMessage() ), 400 );392 respond( array( 'ok' => false, 'error' => sanitize_error_message( $e->getMessage(), $config, '', $backupino_state_secret, $backupino_run_handle ) ), 400 ); 259 393 } 260 394 … … 269 403 } 270 404 405 // Clean up any previous run handle from the same client before creating a fresh private run. 406 if ( '' !== $backupino_run_handle ) { 407 try { 408 $prev_state = State::open_private_run( 409 $backupino_run_handle, 410 $backupino_dir, 411 $backupino_state_secret, 412 $backupino_archive_name, 413 $backupino_doc_root 414 ); 415 $prev_state->destroy(); 416 } catch ( \RuntimeException $e ) { 417 // Ignore stale handle. 418 } 419 } 420 421 try { 422 $backupino_state = State::create_private_run( 423 $backupino_dir, 424 $backupino_state_secret, 425 $backupino_archive_name, 426 $backupino_doc_root 427 ); 428 } catch ( \RuntimeException $e ) { 429 respond( array( 'ok' => false, 'error' => sanitize_error_message( $e->getMessage(), $config, '', $backupino_state_secret ) ), 500 ); 430 } 431 432 $backupino_state_file = $backupino_state->file(); 433 $backupino_run_handle = $backupino_state->handle(); 434 $GLOBALS['backupino_active_state'] = $backupino_state; 435 436 if ( '' !== $backupino_password ) { 437 $backupino_state->set( 'authenticated', true ); 438 } 271 439 $backupino_state->set( 'db', $config ); 272 440 $backupino_state->set( 'tables_found', count( $tables ) ); 273 441 $backupino_state->set( 'new_url', $new_url ); 274 442 $backupino_state->set( 'empty_db', ! empty( $_POST['empty_db'] ) ); 275 $backupino_state->save(); 443 $backupino_state->set( 'admin_account', $admin_account ); 444 if ( ! $backupino_state->save() ) { 445 $backupino_state->destroy(); 446 respond( array( 'ok' => false, 'error' => 'Failed to persist secure installer state.' ), 500 ); 447 } 448 449 if ( ! headers_sent() ) { 450 @setcookie( 451 'backupino_run', 452 $backupino_run_handle, 453 array( 454 'expires' => 0, 455 'path' => '' !== $backupino_subpath ? $backupino_subpath . '/' : '/', 456 'secure' => 'https' === $backupino_scheme, 457 'httponly' => true, 458 'samesite' => 'Strict', 459 ) 460 ); 461 } 276 462 277 463 respond( … … 279 465 'ok' => true, 280 466 'db' => $config['name'], 467 'run_handle' => $backupino_run_handle, 281 468 'message' => sprintf( 'Database connected (%d tables existing).', count( $tables ) ), 282 469 'tables_found' => count( $tables ), … … 287 474 case 'extract': 288 475 if ( ! is_readable( $backupino_archive ) ) { 476 cleanup_sensitive_temp( $backupino_state, $backupino_dir, false ); 289 477 respond( array( 'ok' => false, 'error' => 'Archive file not found: ' . basename( $backupino_archive ) ), 400 ); 290 478 } … … 292 480 $extractor = new Extractor( $backupino_archive, $backupino_dir ); 293 481 if ( ! $extractor->open() ) { 482 cleanup_sensitive_temp( $backupino_state, $backupino_dir, false ); 294 483 respond( array( 'ok' => false, 'error' => $extractor->error() ), 400 ); 295 484 } … … 300 489 301 490 $backupino_state->set( 'extract_offset', $offset ); 302 $backupino_state->save(); 491 if ( ! $backupino_state->save() ) { 492 $extractor->close(); 493 cleanup_sensitive_temp( $backupino_state, $backupino_dir, false ); 494 respond( array( 'ok' => false, 'error' => 'Failed to persist secure installer state.' ), 500 ); 495 } 303 496 304 497 $extractor->close(); … … 354 547 $connection->query( 'SET UNIQUE_CHECKS = 0' ); 355 548 } catch ( \RuntimeException $e ) { 356 respond( array( 'ok' => false, 'error' => $e->getMessage() ), 400 ); 549 cleanup_sensitive_temp( $backupino_state, $backupino_dir, false ); 550 respond( array( 'ok' => false, 'error' => sanitize_error_message( $e->getMessage(), $db, $backupino_state_file, $backupino_state_secret, $backupino_run_handle ) ), 400 ); 357 551 } 358 552 … … 390 584 391 585 if ( ! empty( $result['error'] ) ) { 392 respond( array( 'ok' => false, 'error' => $result['error'] ), 500 ); 586 cleanup_sensitive_temp( $backupino_state, $backupino_dir, false ); 587 respond( array( 'ok' => false, 'error' => sanitize_error_message( (string) $result['error'], $db, $backupino_state_file, $backupino_state_secret, $backupino_run_handle ) ), 500 ); 393 588 } 394 589 … … 453 648 $connection->query( 'SET UNIQUE_CHECKS = 0' ); 454 649 } catch ( \RuntimeException $e ) { 455 respond( array( 'ok' => false, 'error' => $e->getMessage() ), 400 ); 650 cleanup_sensitive_temp( $backupino_state, $backupino_dir, false ); 651 respond( array( 'ok' => false, 'error' => sanitize_error_message( $e->getMessage(), $db, $backupino_state_file, $backupino_state_secret, $backupino_run_handle ) ), 400 ); 456 652 } 457 653 … … 476 672 477 673 case 'config': 478 $db = $backupino_state->get( 'db' ); 674 $admin_created_username = ''; 675 $db = $backupino_state->get( 'db' ); 479 676 480 677 if ( ! is_array( $db ) ) { … … 752 949 // Table might not exist yet, ignore. 753 950 } 951 952 // 5. Optional new WordPress Administrator account creation (INSERT-only; never modifies existing accounts) 953 $admin_account = (array) $backupino_state->get( 'admin_account' ); 954 if ( ! empty( $admin_account['enabled'] ) && ! empty( $admin_account['username'] ) && ! empty( $admin_account['password_hash'] ) ) { 955 $adm_user = trim( (string) $admin_account['username'] ); 956 $adm_pass_hash = (string) $admin_account['password_hash']; 957 $adm_email = trim( (string) ( $admin_account['email'] ?? '' ) ); 958 959 // Remove admin_account from state immediately before/on execution so it never lingers. 960 $backupino_state->remove( 'admin_account' ); 961 $backupino_state->save(); 962 963 $created_admin = AdminCreator::create( $connection, $target_prefix, $adm_user, $adm_email, $adm_pass_hash ); 964 $admin_created_username = $created_admin['username']; 965 } 754 966 } catch ( \RuntimeException $e ) { 755 respond( array( 'ok' => false, 'error' => $e->getMessage() ), 400 ); 967 cleanup_sensitive_temp( $backupino_state, $backupino_dir, false ); 968 respond( array( 'ok' => false, 'error' => sanitize_error_message( $e->getMessage(), $db, $backupino_state_file, $backupino_state_secret, $backupino_run_handle ) ), 400 ); 756 969 } 757 970 … … 776 989 $db['new_url'] = $new_url; 777 990 if ( ! ConfigWriter::write( $backupino_dir . '/wp-config.php', $db, $orig_content ) ) { 991 cleanup_sensitive_temp( $backupino_state, $backupino_dir, false ); 778 992 respond( array( 'ok' => false, 'error' => 'wp-config.php could not be written.' ), 500 ); 779 993 } … … 856 1070 ? rtrim( $new_url, '/' ) . '/' . trim( $detected_login_slug, '/' ) . '/' 857 1071 : rtrim( $new_url, '/' ) . '/wp-login.php'; 858 859 $backupino_state->set( 'finished', true );860 $backupino_state->save();861 1072 862 1073 // Enqueue restore notification in WordPress options so it is dispatched cleanly via WordPress HTTP API on first boot … … 899 1110 } 900 1111 1112 // Purge all sensitive credentials & temporary SQL/config templates immediately upon completion. 1113 $backupino_state->set( 'finished', true ); 1114 cleanup_sensitive_temp( $backupino_state, $backupino_dir, '' !== $backupino_password ); 1115 901 1116 respond( 902 1117 array( 903 'ok' => true, 904 'done' => true, 905 'percent' => 100, 906 'url' => $new_url, 907 'admin' => $admin_login_url, 908 'message' => 'wp-config.php written.', 1118 'ok' => true, 1119 'done' => true, 1120 'percent' => 100, 1121 'url' => $new_url, 1122 'admin' => $admin_login_url, 1123 'admin_created' => $admin_created_username, 1124 'message' => 'wp-config.php written.', 909 1125 ) 910 1126 ); 911 1127 break; 912 1128 1129 case 'abort': 1130 cleanup_sensitive_temp( $backupino_state, $backupino_dir, false ); 1131 respond( array( 'ok' => true, 'aborted' => true ) ); 1132 break; 1133 913 1134 case 'cleanup': 914 $backupino_state->destroy(); 1135 if ( '' !== $backupino_password ) { 1136 $cleanup_auth = ( $backupino_state instanceof State && ! empty( $backupino_state->get( 'authenticated' ) ) ); 1137 if ( ! $cleanup_auth ) { 1138 $backupino_supplied = isset( $_REQUEST['installer_password'] ) ? (string) $_REQUEST['installer_password'] : ''; 1139 if ( ! hash_equals( $backupino_password, $backupino_supplied ) ) { 1140 respond( array( 'ok' => false, 'error' => 'Installer password required.' ), 401 ); 1141 } 1142 } 1143 } 1144 1145 if ( $backupino_state instanceof State ) { 1146 $backupino_state->destroy(); 1147 } 915 1148 916 1149 // Restore preserved destination host php configuration (.user.ini / php.ini) if valid … … 933 1166 } 934 1167 1168 // Delete ONLY exact known Backupino installer artifacts (never unrelated user files or archives). 935 1169 $targets = array( 936 1170 $backupino_dir . '/database.sql', … … 938 1172 $backupino_dir . '/backupino-package.json', 939 1173 $backupino_dir . '/backupino-wp-config.tpl', 940 $backupino_state_file, 941 $backupino_archive, 1174 $backupino_dir . '/backupino-install.json', 942 1175 $backupino_dir . '/wp-config.backupino-orig.php', 943 1176 $backupino_dir . '/.htaccess.backupino-orig', … … 946 1179 ); 947 1180 948 $dir_files = @scandir( $backupino_dir ); 949 if ( is_array( $dir_files ) ) { 950 foreach ( $dir_files as $f ) { 951 if ( '.' === $f || '..' === $f ) { 952 continue; 953 } 954 $fpath = $backupino_dir . '/' . $f; 955 if ( ! is_file( $fpath ) ) { 956 continue; 957 } 958 if ( preg_match( '/\.(zip|sql|ndjson)$/i', $f ) ) { 959 if ( 960 0 === strpos( $f, 'backupino' ) || 961 ( '' !== $backupino_archive_name && $f === $backupino_archive_name ) || 962 preg_match( '/^[a-zA-Z0-9_\.\-]+_\d{8}_\d{6}\.zip$/', $f ) 963 ) { 964 $targets[] = $fpath; 965 } 966 } 967 } 1181 if ( '' !== $backupino_archive_name ) { 1182 $targets[] = $backupino_archive; 968 1183 } 969 1184 970 1185 $targets = array_unique( $targets ); 971 1186 foreach ( $targets as $target ) { 972 if ( is_file( $target ) ) {973 @chmod( $target, 0 777);1187 if ( '' !== $target && is_file( $target ) ) { 1188 @chmod( $target, 0600 ); 974 1189 @unlink( $target ); 975 1190 } … … 994 1209 } 995 1210 } catch ( \Throwable $backupino_err ) { 996 respond( array( 'ok' => false, 'error' => $backupino_err->getMessage() ), 500 ); 1211 $backupino_db_ctx = ( $backupino_state instanceof State && is_array( $backupino_state->get( 'db' ) ) ) 1212 ? (array) $backupino_state->get( 'db' ) 1213 : array(); 1214 cleanup_sensitive_temp( $backupino_state, $backupino_dir, false ); 1215 respond( 1216 array( 1217 'ok' => false, 1218 'error' => sanitize_error_message( $backupino_err->getMessage(), $backupino_db_ctx, $backupino_state_file, $backupino_state_secret, $backupino_run_handle ), 1219 ), 1220 500 1221 ); 1222 } 1223 1224 /** 1225 * Clean up sensitive installer state and temporary extracted files without 1226 * deleting unrelated user files, other runs, or backup archives. 1227 * 1228 * @param State|null $state Active installer state. 1229 * @param string $dir Installer working directory. 1230 * @param bool $keep_auth_flag Preserve minimal non-sensitive auth flag when installer password is active. 1231 * @return void 1232 */ 1233 function cleanup_sensitive_temp( ?State $state, string $dir, bool $keep_auth_flag = false ): void { 1234 if ( $state instanceof State ) { 1235 $state->purge_sensitive( $keep_auth_flag ); 1236 } 1237 1238 $sensitive_temp = array( 1239 $dir . '/database.sql', 1240 $dir . '/backupino-wp-config.tpl', 1241 $dir . '/backupino-install.json', 1242 ); 1243 1244 foreach ( $sensitive_temp as $path ) { 1245 if ( is_file( $path ) ) { 1246 @chmod( $path, 0600 ); 1247 @unlink( $path ); 1248 } 1249 } 1250 } 1251 1252 /** 1253 * Strip sensitive credentials, server secrets, session handles, or private 1254 * filesystem paths from error messages before sending them in HTTP JSON responses. 1255 * 1256 * @param string $message Raw error message. 1257 * @param array<string, mixed> $db_config Database config context. 1258 * @param string $state_file Private state file path. 1259 * @param string $state_secret Server-only state secret. 1260 * @param string $run_handle Signed session handle. 1261 * @return string 1262 */ 1263 function sanitize_error_message( 1264 string $message, 1265 array $db_config = array(), 1266 string $state_file = '', 1267 string $state_secret = '', 1268 string $run_handle = '' 1269 ): string { 1270 $secrets = array(); 1271 1272 if ( ! empty( $db_config['password'] ) && is_string( $db_config['password'] ) ) { 1273 $secrets[] = $db_config['password']; 1274 } 1275 if ( '' !== $state_secret ) { 1276 $secrets[] = $state_secret; 1277 } 1278 if ( '' !== $run_handle ) { 1279 $secrets[] = $run_handle; 1280 } 1281 if ( '' !== $state_file ) { 1282 $secrets[] = $state_file; 1283 $secrets[] = dirname( $state_file ); 1284 $secrets[] = dirname( dirname( $state_file ) ); 1285 } 1286 1287 foreach ( $secrets as $secret ) { 1288 if ( '' !== $secret && '/' !== $secret ) { 1289 $message = str_replace( $secret, '[redacted]', $message ); 1290 } 1291 } 1292 1293 return $message; 997 1294 } 998 1295 -
backupino/trunk/src/Support/Fs.php
r3800274 r3809656 49 49 50 50 /** 51 * Drop `.htaccess`, `web.config`, and `index. php` guards into a directory.51 * Drop `.htaccess`, `web.config`, and `index.html` guards into a directory. 52 52 * 53 53 * @param string $dir Absolute directory path. -
backupino/trunk/templates/dashboard.php
r3800274 r3809656 57 57 <?php endforeach; ?> 58 58 </ul> 59 <?php if ( \Backupino\Core\Compatibility::is_nginx() ) : ?> 60 <?php $backupino_nginx = \Backupino\Core\Compatibility::nginx_storage_info( $paths ); ?> 61 <p style="margin: 8px 0 6px;"> 62 <strong><?php esc_html_e( 'Nginx Server Configuration Note:', 'backupino' ); ?></strong> 63 <?php esc_html_e( 'Backupino cannot automatically alter or reload Nginx configuration. Direct HTTP access is not blocked until your server administrator applies the server rule.', 'backupino' ); ?> 64 </p> 65 <?php if ( 'exact' === $backupino_nginx['status'] && '' !== $backupino_nginx['rule'] ) : ?> 66 <p style="margin: 0 0 6px;"> 67 <strong><?php esc_html_e( 'Required Nginx server configuration (add inside your server { } block and reload Nginx):', 'backupino' ); ?></strong> 68 </p> 69 <pre class="code" style="margin: 0 0 10px; padding: 10px; background: #fff; border: 1px solid #dcdcde; overflow-x: auto; direction: ltr; text-align: left;"><?php echo esc_html( $backupino_nginx['rule'] ); ?></pre> 70 <?php else : ?> 71 <p class="description" style="margin: 0 0 10px;"> 72 <?php esc_html_e( 'The storage path cannot be resolved to an automatic Nginx location (for example, due to an external CDN, custom domain, or path outside webroot). Please see Backupino -> Settings -> Storage Destination to manually determine the rule for your server.', 'backupino' ); ?> 73 </p> 74 <?php endif; ?> 75 <?php endif; ?> 59 76 </div> 60 77 <?php endif; ?> -
backupino/trunk/templates/settings.php
r3800274 r3809656 210 210 </h3> 211 211 <p class="description"> 212 <?php esc_html_e( ' Isolated, protected path used to safely store archive files away from public access:', 'backupino' ); ?>212 <?php esc_html_e( 'Local directory used to store backup archives. Guarded with .htaccess (Apache/LiteSpeed), web.config (IIS), and index.html (directory listing). On Nginx, direct HTTP access is NOT guaranteed to be blocked until a server-level deny rule is configured.', 'backupino' ); ?> 213 213 </p> 214 214 <div class="backupino-path-box"> … … 220 220 </div> 221 221 <p class="backupino-result" id="backupino-storage-result" style="margin-top: 8px;"></p> 222 <?php if ( ! empty( $backupino_snapshot['is_nginx'] ) ) : ?> 223 <div class="notice notice-warning inline" style="margin: 12px 0 0;"> 224 <p> 225 <strong><?php esc_html_e( 'Nginx detected — manual server configuration required:', 'backupino' ); ?></strong> 226 <?php esc_html_e( 'Nginx ignores .htaccess and web.config. Backupino cannot automatically alter or reload Nginx configuration. Direct HTTP downloads of package URLs are not guaranteed to be blocked until your server administrator adds the rule below inside your Nginx server { } block and reloads Nginx.', 'backupino' ); ?> 227 </p> 228 <?php if ( ! empty( $backupino_snapshot['nginx_rule'] ) ) : ?> 229 <pre class="code" style="margin: 6px 0 10px; padding: 10px; background: #fff; border: 1px solid #dcdcde; overflow-x: auto; direction: ltr; text-align: left;"><?php echo esc_html( (string) $backupino_snapshot['nginx_rule'] ); ?></pre> 230 <?php else : ?> 231 <p class="description" style="margin: 6px 0;"> 232 <?php esc_html_e( 'The exact Nginx location block cannot be determined automatically (e.g. external CDN or custom mapping). Please visit Backupino -> Settings -> Storage Destination to view manual configuration guidance.', 'backupino' ); ?> 233 </p> 234 <?php endif; ?> 235 </div> 236 <?php endif; ?> 222 237 </div> 223 238 … … 318 333 </h2> 319 334 <p class="description"> 320 <?php esc_html_e( 'Backup archives a nd standalone installers are stored locally in a secure, protected directory on your server.', 'backupino' ); ?>335 <?php esc_html_e( 'Backup archives are stored locally on your server and served to administrators through Backupino authenticated download endpoints.', 'backupino' ); ?> 321 336 </p> 322 337 … … 324 339 <label class="backupino-label"> 325 340 <span class="backupino-label-text"><?php esc_html_e( 'Primary Destination Driver', 'backupino' ); ?></span> 326 <span class="backupino-tooltip" data-tooltip="<?php esc_attr_e( 'Primary storage destination for completed packages. Local protected storage is used.', 'backupino' ); ?>" tabindex="0">?</span>341 <span class="backupino-tooltip" data-tooltip="<?php esc_attr_e( 'Primary storage destination for completed packages.', 'backupino' ); ?>" tabindex="0">?</span> 327 342 </label> 328 343 <select name="storage.driver" id="backupino-driver"> … … 338 353 <div class="backupino-field-group" style="margin-top: 16px;"> 339 354 <label class="backupino-label"> 340 <span class="backupino-label-text"><?php esc_html_e( ' ProtectedDirectory Path', 'backupino' ); ?></span>355 <span class="backupino-label-text"><?php esc_html_e( 'Storage Directory Path', 'backupino' ); ?></span> 341 356 </label> 342 357 <input type="text" readonly class="large-text code" value="<?php echo esc_attr( $paths->packages() ); ?>"> 343 358 <p class="description"> 344 <?php esc_html_e( ' This location contains an .htaccess file blocking direct HTTP requests and indexing for maximum security.', 'backupino' ); ?>359 <?php esc_html_e( 'Backupino places .htaccess (Apache/LiteSpeed), web.config (IIS), and index.html (hides directory listing only) in this directory. Nginx ignores .htaccess and web.config; direct HTTP access is NOT guaranteed to be blocked on Nginx until you add a server-level deny rule.', 'backupino' ); ?> 345 360 </p> 361 </div> 362 363 <?php if ( ! empty( $backupino_snapshot['is_nginx'] ) ) : ?> 364 <div class="notice notice-warning inline" style="margin: 16px 0 0;"> 365 <p> 366 <strong><?php esc_html_e( 'Nginx Server Detected — Action Required to Block Direct Access:', 'backupino' ); ?></strong> 367 <?php esc_html_e( 'Nginx does not enforce .htaccess or web.config rules, and index.html only conceals directory listings. Action is required by your server administrator to prevent direct HTTP downloads of backup files.', 'backupino' ); ?> 368 </p> 369 </div> 370 <?php endif; ?> 371 372 <!-- Permanent Informational Card for Web Server Protection & Nginx Guidance --> 373 <div class="backupino-card" style="margin-top: 18px; padding: 18px; border: 1px solid var(--backupino-border); border-radius: 10px; background: #fff;"> 374 <h3 style="margin: 0 0 10px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px;"> 375 <span class="dashicons dashicons-shield"></span> 376 <span><?php esc_html_e( 'Web Server Direct Access Protection & Nginx Guidance', 'backupino' ); ?></span> 377 </h3> 378 <p class="description" style="margin: 0 0 10px;"> 379 <?php esc_html_e( 'Backupino automatically creates .htaccess (for Apache/LiteSpeed) and web.config (for Microsoft IIS) files inside the storage directory to block direct HTTP requests. An index.html file is also placed to hide directory browsing, but it cannot prevent direct downloads if an attacker knows or guesses the file name.', 'backupino' ); ?> 380 </p> 381 <p class="description" style="margin: 0 0 12px;"> 382 <strong><?php esc_html_e( 'Nginx & Reverse Proxy Limitations:', 'backupino' ); ?></strong> 383 <?php esc_html_e( 'Nginx completely ignores .htaccess and web.config files. Because reverse proxies or front-end caches may sit in front of Apache or PHP-FPM, automated web server detection is best-effort and cannot be guaranteed in every architecture. Backupino cannot automatically modify or reload Nginx configuration files.', 'backupino' ); ?> 384 </p> 385 <div style="background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px; margin-bottom: 8px;"> 386 <h4 style="margin: 0 0 8px; font-size: 14px; font-weight: 600;"> 387 <?php esc_html_e( 'Server Administrator Nginx Configuration', 'backupino' ); ?> 388 </h4> 389 <p style="margin: 0 0 8px; font-size: 13px;"> 390 <?php esc_html_e( 'Direct HTTP access to backup package URLs is NOT guaranteed to be blocked on Nginx until your server administrator adds the deny rule below inside your Nginx server { } block and reloads Nginx. Merely viewing this rule in the admin panel does not activate it.', 'backupino' ); ?> 391 </p> 392 <?php 393 $backupino_nginx_info = $backupino_snapshot['nginx_storage_info'] ?? \Backupino\Core\Compatibility::nginx_storage_info( $paths ); 394 if ( 'exact' === $backupino_nginx_info['status'] && ! empty( $backupino_nginx_info['rule'] ) ) : 395 ?> 396 <p style="margin: 0 0 6px; font-size: 13px; font-weight: 600;"> 397 <?php esc_html_e( 'Add this directive inside your Nginx server { } block:', 'backupino' ); ?> 398 </p> 399 <pre class="code" style="margin: 0 0 8px; padding: 10px; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; overflow-x: auto; direction: ltr; text-align: left; font-size: 13px;"><?php echo esc_html( (string) $backupino_nginx_info['rule'] ); ?></pre> 400 <?php else : ?> 401 <div style="padding: 10px; background: #fff; border-left: 4px solid #f59e0b; border: 1px solid #cbd5e1; border-radius: 6px; margin: 0 0 8px;"> 402 <p style="margin: 0 0 6px; font-size: 13px; font-weight: 600; color: #b45309;"> 403 <?php esc_html_e( 'Manual Nginx Rule Configuration Required', 'backupino' ); ?> 404 </p> 405 <p class="description" style="margin: 0 0 6px;"> 406 <?php 407 if ( 'cdn' === ( $backupino_nginx_info['reason'] ?? '' ) ) { 408 esc_html_e( 'Your WordPress uploads directory uses an external CDN or separate domain. The exact public Nginx location cannot be determined automatically. Your server administrator must manually create an Nginx location block matching your origin server URL mapping.', 'backupino' ); 409 } else { 410 esc_html_e( 'The backup storage directory is located outside standard web root or uses a custom path mapping. Your server administrator must manually configure an Nginx rule denying direct access based on your web server configuration.', 'backupino' ); 411 } 412 ?> 413 </p> 414 <p class="description" style="margin: 0;"> 415 <?php 416 /* translators: %s: Filesystem path of the storage directory. */ 417 printf( esc_html__( 'Target filesystem path: %s', 'backupino' ), '<code>' . esc_html( $paths->packages() ) . '</code>' ); 418 ?> 419 </p> 420 </div> 421 <?php endif; ?> 422 <p class="description" style="margin: 0;"> 423 <?php esc_html_e( 'After adding the rule, test with `nginx -t` and reload Nginx. Authorized downloads through Backupino admin or the permanent download link continue to work normally through PHP.', 'backupino' ); ?> 424 </p> 425 </div> 346 426 </div> 347 427 </div> -
backupino/trunk/uninstall.php
r3800274 r3809656 16 16 // phpcs:disable WordPress.WP.AlternativeFunctions.file_system_operations_chmod -- Recursive uninstall permissions handling. 17 17 18 /** 19 * Recursively remove a directory and all its contents. 20 * 21 * @param string $dir Target directory. 22 * @return void 23 */ 24 function backupino_remove_directory( string $dir ): void { 25 if ( ! is_dir( $dir ) ) { 26 return; 18 if ( ! function_exists( 'backupino_remove_directory' ) ) { 19 /** 20 * Recursively remove a directory and all its contents. 21 * 22 * Defensively handles symbolic links: if the target directory itself is a symlink, 23 * only the symlink is removed without traversing, altering permissions, or deleting 24 * the destination target. During traversal, symlinks (to files or directories) are 25 * identified before directory checks and unlinked directly without following them. 26 * 27 * @param string $dir Target directory. 28 * @return void 29 */ 30 function backupino_remove_directory( string $dir ): void { 31 $target = rtrim( $dir, '/\\' ); 32 if ( '' === $target ) { 33 return; 34 } 35 36 // 1. If the root target path is a symbolic link, remove only the link itself. 37 // Never traverse, chmod, or remove the destination directory. 38 if ( is_link( $target ) ) { 39 if ( ! @unlink( $target ) ) { // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 40 @rmdir( $target ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 41 } 42 return; 43 } 44 45 if ( ! is_dir( $target ) ) { 46 return; 47 } 48 49 // Ensure symlinks are never followed during traversal (SKIP_DOTS only, no FOLLOW_SYMLINKS). 50 $flags = FilesystemIterator::SKIP_DOTS; 51 52 try { 53 $dir_iterator = new RecursiveDirectoryIterator( $target, $flags ); 54 $items = new RecursiveIteratorIterator( $dir_iterator, RecursiveIteratorIterator::CHILD_FIRST ); 55 56 foreach ( $items as $item ) { 57 $path = $item->getPathname(); 58 59 // 2. Identify symlinks BEFORE checking if directory. 60 // If entry is a symlink (to a file or directory), unlink only the link itself. 61 if ( $item->isLink() || is_link( $path ) ) { 62 if ( ! @unlink( $path ) ) { // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 63 @rmdir( $path ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 64 } 65 continue; 66 } 67 68 if ( $item->isDir() ) { 69 @chmod( $path, 0777 ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 70 @rmdir( $path ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 71 } else { 72 @chmod( $path, 0777 ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 73 @unlink( $path ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 74 } 75 } 76 } catch ( UnexpectedValueException $e ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch 77 // Fail-safe if directory cannot be opened. 78 } 79 80 @chmod( $target, 0777 ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 81 @rmdir( $target ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 27 82 } 28 29 $items = new RecursiveIteratorIterator(30 new RecursiveDirectoryIterator( $dir, FilesystemIterator::SKIP_DOTS ),31 RecursiveIteratorIterator::CHILD_FIRST32 );33 34 foreach ( $items as $item ) {35 if ( $item->isDir() ) {36 @chmod( $item->getPathname(), 0777 ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged37 @rmdir( $item->getPathname() ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged38 } else {39 @chmod( $item->getPathname(), 0777 ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged40 @unlink( $item->getPathname() ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged41 }42 }43 44 @chmod( $dir, 0777 ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged45 @rmdir( $dir ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged46 83 } 47 84 48 /** 49 * Remove every trace of the plugin for the current site. 50 * 51 * @return void 52 */ 53 function backupino_uninstall_site(): void { 54 global $wpdb; 85 if ( ! function_exists( 'backupino_uninstall_site' ) ) { 86 /** 87 * Remove every trace of the plugin for the current site. 88 * 89 * @return void 90 */ 91 function backupino_uninstall_site(): void { 92 global $wpdb; 55 93 56 // Drop custom database tables57 // phpcs:ignore WordPress.DB.DirectDatabaseQuery58 $wpdb->query( 'DROP TABLE IF EXISTS `' . $wpdb->prefix . 'backupino_jobs`' );94 // Drop custom database tables 95 // phpcs:ignore WordPress.DB.DirectDatabaseQuery 96 $wpdb->query( 'DROP TABLE IF EXISTS `' . $wpdb->prefix . 'backupino_jobs`' ); 59 97 60 // Delete all stored options61 delete_option( 'backupino_settings' );62 delete_option( 'backupino_schema_version' );63 delete_option( 'backupino_schedule_state' );64 delete_option( 'backupino_installed_at' );65 delete_option( 'backupino_download_key' );66 delete_option( 'backupino_notify_queue' );67 delete_option( 'backupino_migration_notice' );98 // Delete all stored options 99 delete_option( 'backupino_settings' ); 100 delete_option( 'backupino_schema_version' ); 101 delete_option( 'backupino_schedule_state' ); 102 delete_option( 'backupino_installed_at' ); 103 delete_option( 'backupino_download_key' ); 104 delete_option( 'backupino_notify_queue' ); 105 delete_option( 'backupino_migration_notice' ); 68 106 69 // Clear scheduled cron events 70 wp_clear_scheduled_hook( 'backupino_run_jobs' ); 71 wp_clear_scheduled_hook( 'backupino_scheduled_backup' ); 107 // Clear scheduled cron events (current and legacy hooks) 108 $backupino_cron_hooks = array( 109 'backupino_run_jobs', 110 'backupino_scheduled_backup', 111 'backupino_cron_worker', 112 'backupino_cron_scheduler', 113 'backupino_cron_queue', 114 'backupino_cron_retention', 115 ); 116 foreach ( $backupino_cron_hooks as $backupino_hook ) { 117 wp_clear_scheduled_hook( $backupino_hook ); 118 } 72 119 73 // Remove storage directories in uploads and legacy wp-content/backupino74 $backupino_uploads = wp_upload_dir( null, false );75 if ( ! empty( $backupino_uploads['basedir'] ) ) {76 $backupino_primary_dir = rtrim( (string) $backupino_uploads['basedir'], '/' ) . '/backupino';77 backupino_remove_directory( $backupino_primary_dir );78 }120 // Remove storage directories in uploads and legacy wp-content/backupino 121 $backupino_uploads = wp_upload_dir( null, false ); 122 if ( ! empty( $backupino_uploads['basedir'] ) ) { 123 $backupino_primary_dir = rtrim( (string) $backupino_uploads['basedir'], '/' ) . '/backupino'; 124 backupino_remove_directory( $backupino_primary_dir ); 125 } 79 126 80 $backupino_content_dir = defined( 'WP_CONTENT_DIR' ) ? (string) WP_CONTENT_DIR : ( (string) ABSPATH . 'wp-content' ); 81 $backupino_legacy_dir = rtrim( $backupino_content_dir, '/' ) . '/backupino'; 82 if ( is_dir( $backupino_legacy_dir ) ) { 83 backupino_remove_directory( $backupino_legacy_dir ); 127 $backupino_content_dir = defined( 'WP_CONTENT_DIR' ) ? (string) WP_CONTENT_DIR : ( (string) ABSPATH . 'wp-content' ); 128 $backupino_legacy_dir = rtrim( $backupino_content_dir, '/' ) . '/backupino'; 129 if ( is_dir( $backupino_legacy_dir ) || is_link( $backupino_legacy_dir ) ) { 130 backupino_remove_directory( $backupino_legacy_dir ); 131 } 84 132 } 85 133 } 86 134 87 135 if ( is_multisite() ) { 88 $backupino_sites = get_sites( array( 'fields' => 'ids' ) ); 136 $backupino_sites = get_sites( 137 array( 138 'fields' => 'ids', 139 'number' => 0, 140 ) 141 ); 89 142 90 143 foreach ( $backupino_sites as $backupino_site_id ) {
Note:
See TracChangeset
for help on using the changeset viewer.