Wholesale rename to avoid clashes with generic 'site healthcheck' plugin names on a target site: - Plugin Name: 'Site Healthcheck' → 'ATT Site Healthcheck' - Main file: site-healthcheck.php → att-site-healthcheck.php - Plugin folder: site-healthcheck → att-site-healthcheck - Admin menu slug: site-healthcheck → att-site-healthcheck - Settings slug: site-healthcheck-settings → att-site-healthcheck-settings - PHP class prefix: WPH_ → ATT_HC_ - Function prefix: wph_ → att_hc_ - Option / transient: wph_* → att_hc_* - Action/filter: wph_* → att_hc_* - CSS class prefix: wph- → att-hc- - Constants: WPH_GITEA_* → ATT_HC_GITEA_* - Class file names: class-wph-*.php → class-att-hc-*.php - Dev folder: ~/dev/wp-healthcheck → ~/dev/att-site-healthcheck Existing in-progress sessions on installs that had the old wph_session option will not migrate — they were intended for dev use only and the user has confirmed this is OK for the rename window. Smoke-tested on testsite: classes load, 14 steps discovered, save/load round-trip works, admin page renders with new att-hc- CSS classes. Recovery plugin detection unchanged — that lives in wp-site-recovery and continues to be detected by Name + Author header.
70 lines
3.1 KiB
PHP
70 lines
3.1 KiB
PHP
<?php
|
|
if (!defined('ABSPATH')) exit;
|
|
|
|
return new class extends ATT_HC_Step {
|
|
public function id(): string { return 'wrap_up'; }
|
|
public function title(): string { return 'Step 12 — Wrap Up and Document'; }
|
|
public function sub_items(): array {
|
|
return [
|
|
'Log everything done in the client record: versions before and after, any issues found, any fixes applied, anything flagged for follow-up',
|
|
'Note the date, time taken, and technician',
|
|
'If using ManageWP or WP Umbrella, generate the client report and review it before sending — make sure it accurately reflects what was done',
|
|
'Send the client report or file it according to your process',
|
|
'If anything was flagged that needs a separate quote or client decision, send that communication now rather than leaving it',
|
|
];
|
|
}
|
|
|
|
public function autocheck(array $session_state): array {
|
|
// Roll up all 'bad' and 'warn' findings from other steps into a wrap-up summary.
|
|
$bad = [];
|
|
$warn = [];
|
|
$blocked = [];
|
|
foreach (ATT_HC_Steps::instance()->all() as $sid => $s) {
|
|
if ($sid === 'wrap_up') continue;
|
|
// Pull stored autocheck results from session data (we get session_state passed in).
|
|
$stored = $session_state['autocheck'][$sid] ?? null;
|
|
if ($stored && !empty($stored['findings'])) {
|
|
foreach ($stored['findings'] as $finding) {
|
|
$label = $s->title() . ' → ' . $finding['label'];
|
|
if ($finding['level'] === 'bad') $bad[] = $label . ' (' . $finding['value'] . ')';
|
|
if ($finding['level'] === 'warn') $warn[] = $label . ' (' . $finding['value'] . ')';
|
|
}
|
|
}
|
|
$step_state = $session_state['steps'][$sid] ?? null;
|
|
if (is_array($step_state) && ($step_state['status'] ?? '') === 'blocked') {
|
|
$blocked[] = $s->title();
|
|
}
|
|
}
|
|
$f = [];
|
|
$f[] = $this->finding(
|
|
'bad_count',
|
|
count($bad) > 0 ? 'bad' : 'ok',
|
|
'Critical findings',
|
|
(string) count($bad),
|
|
$bad ? implode(' · ', array_slice($bad, 0, 6)) . (count($bad) > 6 ? ' …' : '') : 'No bad-level findings across steps.'
|
|
);
|
|
$f[] = $this->finding(
|
|
'warn_count',
|
|
count($warn) > 0 ? 'warn' : 'ok',
|
|
'Warnings',
|
|
(string) count($warn),
|
|
$warn ? implode(' · ', array_slice($warn, 0, 8)) . (count($warn) > 8 ? ' …' : '') : ''
|
|
);
|
|
$f[] = $this->finding(
|
|
'blocked_steps',
|
|
count($blocked) > 0 ? 'bad' : 'ok',
|
|
'Blocked steps',
|
|
(string) count($blocked),
|
|
$blocked ? implode(', ', $blocked) : ''
|
|
);
|
|
$f[] = $this->finding(
|
|
'tip_copy',
|
|
'info',
|
|
'Tip',
|
|
'paste this into the client record',
|
|
'Click Copy to clipboard on the finish screen — the full Markdown report is also downloadable.'
|
|
);
|
|
return $f;
|
|
}
|
|
};
|