diff --git a/source/packages/com_mokosuitebackup/src/Extension/MokoSuiteBackupComponent.php b/source/packages/com_mokosuitebackup/src/Extension/MokoSuiteBackupComponent.php index 63329386..d9f4e012 100644 --- a/source/packages/com_mokosuitebackup/src/Extension/MokoSuiteBackupComponent.php +++ b/source/packages/com_mokosuitebackup/src/Extension/MokoSuiteBackupComponent.php @@ -45,7 +45,7 @@ class MokoSuiteBackupComponent extends MVCComponent . ' .main-nav a[href*="com_mokosuitebackup"][href*="view=backups"] .sidebar-item-title::before { content: "\f1c0"; }' . ' .main-nav a[href*="com_mokosuitebackup"][href*="view=profiles"] .sidebar-item-title::before { content: "\f013"; }' ); - } catch (\RuntimeException $e) { + } catch (\Exception $e) { error_log('MokoSuiteBackup: boot() CSS injection failed: ' . $e->getMessage()); } } diff --git a/source/script.php b/source/script.php index f4728626..bfbbe1cf 100644 --- a/source/script.php +++ b/source/script.php @@ -103,6 +103,11 @@ class Pkg_MokoSuiteBackupInstallerScript } } catch (\Exception $e) { error_log('MokoSuiteBackup: Could not save download key: ' . $e->getMessage()); + Factory::getApplication()->enqueueMessage( + 'MokoSuiteBackup could not preserve your download/license key before the update. ' + . 'Please verify your license key is still configured in System → Update Sites after this update completes.', + 'warning' + ); } } @@ -213,7 +218,14 @@ class Pkg_MokoSuiteBackupInstallerScript $htaccess = $backupDir . '/.htaccess'; if (!file_exists($htaccess)) { - file_put_contents($htaccess, "Order Deny,Allow\nDeny from all\n"); + if (file_put_contents($htaccess, "Order Deny,Allow\nDeny from all\n") === false) { + error_log('MokoSuiteBackup: Failed to write .htaccess to ' . $backupDir); + Factory::getApplication()->enqueueMessage( + 'MokoSuiteBackup created the backup directory but could not write an .htaccess file to protect it. ' + . 'Please manually create ' . htmlspecialchars($htaccess) . ' with "Deny from all" to prevent direct web access.', + 'warning' + ); + } } $indexHtml = $backupDir . '/index.html'; @@ -262,6 +274,11 @@ class Pkg_MokoSuiteBackupInstallerScript } } catch (\Exception $e) { error_log('MokoSuiteBackup: migrateDefaultBackupDir() failed: ' . $e->getMessage()); + Factory::getApplication()->enqueueMessage( + 'MokoSuiteBackup could not automatically migrate backup directory settings in your profiles. ' + . 'Please review your backup profiles and ensure the backup directory is set correctly.', + 'warning' + ); } } @@ -322,6 +339,11 @@ class Pkg_MokoSuiteBackupInstallerScript $db->insertObject('#__scheduler_tasks', $task); } catch (\Exception $e) { error_log('MokoSuiteBackup: createDefaultScheduledTask() failed: ' . $e->getMessage()); + Factory::getApplication()->enqueueMessage( + 'MokoSuiteBackup could not create the default scheduled backup task. ' + . 'Please create a scheduled task manually in System → Scheduled Tasks to enable automated backups.', + 'warning' + ); } }