diff --git a/feca_mailshots_plugin/feca_mailshots_plugin.php b/feca_mailshots_plugin/feca_mailshots_plugin.php index 115e1f3..5630078 100644 --- a/feca_mailshots_plugin/feca_mailshots_plugin.php +++ b/feca_mailshots_plugin/feca_mailshots_plugin.php @@ -3,7 +3,7 @@ * Plugin Name: FECA Mailshots * Plugin URI: https://fenedge.co.uk/ * Description: FECA mailshots plugin. - * Version: 1.1.8 + * Version: 1.1.10 * Requires at least: 6.0 * Requires PHP: 7.4 * Author: FECA diff --git a/feca_mailshots_plugin/src/Admin/AdminRequestHelpers.php b/feca_mailshots_plugin/src/Admin/AdminRequestHelpers.php index 944b7e9..12a827b 100644 --- a/feca_mailshots_plugin/src/Admin/AdminRequestHelpers.php +++ b/feca_mailshots_plugin/src/Admin/AdminRequestHelpers.php @@ -55,6 +55,9 @@ trait AdminRequestHelpers . '.feca-mailshots-admin .feca-form .form-table th,.feca-mailshots-admin .feca-form .form-table td{padding-top:12px;padding-bottom:12px;}' . '.feca-mailshots-admin .feca-form .form-table th{width:220px;}' . '.feca-mailshots-admin .feca-form .description{margin-top:var(--feca-space-1);}' + . '.feca-mailshots-admin .feca-password-control{display:flex;align-items:center;gap:8px;max-width:34rem;}' + . '.feca-mailshots-admin .feca-password-control .regular-text{flex:1;min-width:220px;margin:0;}' + . '.feca-mailshots-admin .feca-password-toggle{min-width:74px;text-align:center;}' . '.feca-mailshots-admin .feca-inline-form{display:inline;}' . '.feca-mailshots-admin .feca-hidden{display:none;}' . '.feca-mailshots-admin .feca-meta-line{margin:4px 0 var(--feca-space-3) 0;color:#6b7280;font-size:12px;}' diff --git a/feca_mailshots_plugin/src/Admin/ProfileAdminPage.php b/feca_mailshots_plugin/src/Admin/ProfileAdminPage.php index ea543ba..a0ef4c3 100644 --- a/feca_mailshots_plugin/src/Admin/ProfileAdminPage.php +++ b/feca_mailshots_plugin/src/Admin/ProfileAdminPage.php @@ -46,16 +46,39 @@ final class ProfileAdminPage } $uid = $this->wp->currentUserId(); - $saved = $uid > 0 ? ($this->repo()->findByUserId($uid) ?? []) : []; + $saved = []; + $loadError = ''; + if ($uid > 0) { + try { + $saved = $this->repo()->findByUserId($uid) ?? []; + } catch (\Throwable $e) { + $loadError = 'Unable to load stored profile credentials: ' . $e->getMessage(); + } + } $status = $this->wp->requestParam('saved', '') === '1' ? 'Profile credentials saved.' : ''; $test = $uid > 0 ? $this->testResult($uid) : null; $action = htmlspecialchars($this->wp->adminUrl('admin-post.php')); + $missingPasswords = $loadError === '' ? $this->missingPasswordLabels($saved) : []; echo '
' . htmlspecialchars($hint) . '
'; } echo '